Commit 0f177a40 authored by Jim Krehl's avatar Jim Krehl
Browse files

svn path=/branches/version-2/; revision=155



svn path=/branches/version-2/; revision=155
parent 2f473e87
2007-01-30 Scott Reeves <sreeves@novell.com>
* application-browser/src/application-browser.c
* control-center/src/control-center.c
* libslab/application-tile.c
* libslab/application-tile.h
* libslab/app-shell.c
* libslab/app-shell.h:
Fix for BNC#185957 - inconsistent GenericName display
2007-01-25 Scott Reeves <sreeves@novell.com>
* control-center/src/control-center.c: - stop CC common tasks from
launching twic
......
......@@ -83,8 +83,8 @@ main (int argc, char *argv[])
NewAppConfig *config = g_new0 (NewAppConfig, 1);
config->max_items = get_slab_gconf_int (NEW_APPS_MAX_ITEMS);
config->name = _("New Applications");
AppShellData *app_data = appshelldata_new (
"applications.menu", config, APPLICATION_BROWSER_PREFIX, GTK_ICON_SIZE_DND, FALSE);
AppShellData *app_data = appshelldata_new ("applications.menu", config,
APPLICATION_BROWSER_PREFIX, GTK_ICON_SIZE_DND, TRUE, FALSE);
generate_categories (app_data);
layout_shell (app_data, _("Filter"), _("Groups"), _("Application Actions"), NULL, NULL);
......
AC_INIT([gnome-main-menu], [0.9.1], [])
AC_INIT([gnome-main-menu], [0.9.2], [])
AC_CONFIG_SRCDIR([.])
AC_CONFIG_HEADERS([config.h])
......
......@@ -152,8 +152,8 @@ main (int argc, char *argv[])
exit (1);
}
app_data = appshelldata_new (
"preferences.menu", NULL, CONTROL_CENTER_PREFIX, GTK_ICON_SIZE_DIALOG, TRUE);
app_data = appshelldata_new ("preferences.menu", NULL, CONTROL_CENTER_PREFIX,
GTK_ICON_SIZE_DIALOG, FALSE, TRUE);
generate_categories (app_data);
actions = get_actions_list ();
......
......@@ -821,7 +821,7 @@ gmenu_tree_changed_callback (GMenuTree * old_tree, gpointer user_data)
AppShellData *
appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps, const gchar * gconf_keys_prefix,
GtkIconSize icon_size, gboolean exit_on_close)
GtkIconSize icon_size, gboolean show_tile_generic_name, gboolean exit_on_close)
{
AppShellData *app_data = g_new0 (AppShellData, 1);
app_data->gconf_prefix = gconf_keys_prefix;
......@@ -829,6 +829,7 @@ appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps, const gchar
app_data->menu_name = menu_name;
app_data->icon_size = icon_size;
app_data->stop_incremental_relayout = TRUE;
app_data->show_tile_generic_name = show_tile_generic_name;
app_data->exit_on_close = exit_on_close;
return app_data;
}
......@@ -1215,7 +1216,7 @@ insert_launcher_into_category (CategoryData * cat_data, GnomeDesktopItem * deskt
launcher =
application_tile_new_full (gnome_desktop_item_get_location (desktop_item),
app_data->icon_size);
app_data->icon_size, app_data->show_tile_generic_name);
gtk_widget_set_size_request (launcher, SIZING_TILE_WIDTH, -1);
filepath =
......
......@@ -93,6 +93,7 @@ typedef struct _AppShellData
GtkWidget *filtered_out_everything_widget;
GtkLabel *filtered_out_everything_widget_label;
gboolean show_tile_generic_name;
gboolean exit_on_close;
} AppShellData;
......@@ -122,7 +123,8 @@ void generate_categories (AppShellData * app_data);
/* If new_apps is NULL then the new applications category is not created */
AppShellData *appshelldata_new (const gchar * menu_name, NewAppConfig * new_apps,
const gchar * gconf_keys_prefix, GtkIconSize icon_size, gboolean exit_on_close);
const gchar * gconf_keys_prefix, GtkIconSize icon_size,
gboolean show_tile_generic_name, gboolean exit_on_close);
void layout_shell (AppShellData * app_data, const gchar * filter_title, const gchar * groups_title,
const gchar * actions_title, GSList * actions,
......
......@@ -84,6 +84,7 @@ typedef struct {
gboolean image_is_broken;
GtkIconSize image_size;
gboolean show_generic_name;
gboolean is_in_user_list;
StartupStatus startup_status;
......@@ -127,11 +128,12 @@ application_tile_class_init (ApplicationTileClass *app_tile_class)
GtkWidget *
application_tile_new (const gchar *desktop_item_id)
{
return application_tile_new_full (desktop_item_id, GTK_ICON_SIZE_DND);
return application_tile_new_full (desktop_item_id, GTK_ICON_SIZE_DND, TRUE);
}
GtkWidget *
application_tile_new_full (const gchar *desktop_item_id, GtkIconSize image_size)
application_tile_new_full (const gchar *desktop_item_id,
GtkIconSize image_size, gboolean show_generic_name)
{
ApplicationTile *this;
ApplicationTilePrivate *priv;
......@@ -154,6 +156,7 @@ application_tile_new_full (const gchar *desktop_item_id, GtkIconSize image_size)
priv->image_size = image_size;
priv->desktop_item = desktop_item;
priv->show_generic_name = show_generic_name;
application_tile_setup (this);
......@@ -280,7 +283,7 @@ application_tile_setup (ApplicationTile *this)
atk_object_set_description (accessible, desc);
header = create_header (name);
if (desc) /*if no GenericName then just show and center the Name */
if (desc && priv->show_generic_name) /*if no GenericName then just show and center the Name */
subheader = create_subheader (desc);
else
subheader = NULL;
......
......@@ -56,7 +56,8 @@ typedef struct
GType application_tile_get_type (void);
GtkWidget *application_tile_new (const gchar * desktop_item_id);
GtkWidget *application_tile_new_full (const gchar * desktop_item_id, GtkIconSize icon_size);
GtkWidget *application_tile_new_full (const gchar * desktop_item_id,
GtkIconSize icon_size, gboolean show_generic_name);
GnomeDesktopItem *application_tile_get_desktop_item (ApplicationTile * tile);
......
......@@ -34,6 +34,7 @@
# define libslab_bookmark_file_get_app_info g_bookmark_file_get_app_info
# define libslab_bookmark_file_get_groups g_bookmark_file_get_groups
# define libslab_bookmark_file_add_group g_bookmark_file_add_group
# define libslab_bookmark_file_move_item g_bookmark_file_move_item
#else
# include "eggbookmarkfile.h"
......@@ -61,6 +62,7 @@
# define libslab_bookmark_file_get_app_info egg_bookmark_file_get_app_info
# define libslab_bookmark_file_get_groups egg_bookmark_file_get_groups
# define libslab_bookmark_file_add_group egg_bookmark_file_add_group
# define libslab_bookmark_file_move_item egg_bookmark_file_move_item
#endif
G_BEGIN_DECLS
......
......@@ -3,7 +3,7 @@
xmlns:bookmark="http://www.freedesktop.org/standards/desktop-bookmarks"
xmlns:mime="http://www.freedesktop.org/standards/shared-mime-info"
>
<bookmark href="file:///home/jimmyk" added="2007-01-25T23:17:19Z" modified="2007-01-25T23:17:19Z" visited="2007-01-25T23:17:19Z">
<bookmark href="HOME" added="2007-01-25T23:17:19Z" modified="2007-01-25T23:17:19Z" visited="2007-01-25T23:17:19Z">
<title>Home Dir</title>
<info>
<metadata owner="http://freedesktop.org">
......@@ -14,7 +14,8 @@
</metadata>
</info>
</bookmark>
<bookmark href="file:///home/jimmyk/Desktop" added="2007-01-25T23:17:19Z" modified="2007-01-25T23:17:19Z" visited="2007-01-25T23:17:19Z">
<bookmark href="DESKTOP" added="2007-01-25T23:17:19Z" modified="2007-01-25T23:17:19Z" visited="2007-01-25T23:17:19Z">
<title>Desktop</title>
<info>
<metadata owner="http://freedesktop.org">
<mime:mime-type type="inode/directory"/>
......
......@@ -70,6 +70,8 @@ migrate_system_gconf_to_bookmark_file ()
LibSlabBookmarkFile *bm_file;
gchar **uris;
gchar *path;
GnomeDesktopItem *ditem;
......@@ -96,8 +98,44 @@ migrate_system_gconf_to_bookmark_file ()
need_migration = ! get_main_menu_user_data_file_path (& bookmark_path, SYSTEM_BOOKMARK_FILENAME, TRUE);
if (! need_migration)
if (! need_migration) {
bm_file = libslab_bookmark_file_new ();
libslab_bookmark_file_load_from_file (bm_file, bookmark_path, & error);
if (error) {
libslab_handle_g_error (
& error, "%s: can't read system item store path [%s]\n",
G_STRFUNC, bookmark_path);
}
else {
uris = libslab_bookmark_file_get_uris (bm_file, NULL);
for (i = 0; uris && uris [i]; ++i) {
if (g_str_has_suffix (uris [i], "yelp.desktop"))
libslab_bookmark_file_set_title (bm_file, uris [i], _("Help"));
else if (g_str_has_suffix (uris [i], "gnome-session-logout.desktop"))
libslab_bookmark_file_set_title (bm_file, uris [i], _("Logout"));
else if (g_str_has_suffix (uris [i], "gnome-session-shutdown.desktop"))
libslab_bookmark_file_set_title (bm_file, uris [i], _("Shutdown"));
else
/* do nothing */ ;
}
libslab_bookmark_file_to_file (bm_file, bookmark_path, & error);
if (error)
libslab_handle_g_error (
& error, "%s: can't write system item store [%s]\n",
G_STRFUNC, bookmark_path);
g_strfreev (uris);
}
libslab_bookmark_file_free (bm_file);
goto exit;
}
gconf_system_list = (GList *) libslab_get_gconf_value (SYSTEM_ITEM_GCONF_KEY);
......@@ -429,13 +467,21 @@ migrate_user_docs_to_user_bookmark_file ()
void
migrate_user_dirs_to_user_bookmark_file ()
{
LibSlabBookmarkFile *bm_file;
gchar *bookmark_path;
gchar *bookmark_path_cp_dest;
gchar *contents;
gchar **uris;
gchar *uri_new;
gchar *path;
GError *error = NULL;
gint i;
if (! get_main_menu_user_data_file_path (& bookmark_path, DIRS_BOOKMARK_FILENAME, TRUE)) {
g_free (bookmark_path);
......@@ -458,7 +504,49 @@ migrate_user_dirs_to_user_bookmark_file ()
G_STRFUNC, bookmark_path_cp_dest);
g_free (contents);
g_free (bookmark_path_cp_dest);
g_free (bookmark_path);
bookmark_path = bookmark_path_cp_dest;
bm_file = libslab_bookmark_file_new ();
libslab_bookmark_file_load_from_file (bm_file, bookmark_path, & error);
if (error) {
libslab_handle_g_error (
& error, "%s: can't read user dirs store path [%s]\n",
G_STRFUNC, bookmark_path);
}
else {
uris = libslab_bookmark_file_get_uris (bm_file, NULL);
for (i = 0; uris && uris [i]; ++i) {
if (! strcmp (uris [i], "HOME"))
uri_new = g_filename_to_uri (g_get_home_dir (), NULL, NULL);
else if (! strcmp (uris [i], "DESKTOP")) {
path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
uri_new = g_filename_to_uri (path, NULL, NULL);
g_free (path);
}
else
uri_new = NULL;
if (uri_new)
libslab_bookmark_file_move_item (bm_file, uris [i], uri_new, NULL);
g_free (uri_new);
}
libslab_bookmark_file_to_file (bm_file, bookmark_path, & error);
if (error)
libslab_handle_g_error (
& error, "%s: can't write user dirs store [%s]\n",
G_STRFUNC, bookmark_path);
g_strfreev (uris);
}
libslab_bookmark_file_free (bm_file);
}
g_free (bookmark_path);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment