diff options
author | piernov <piernov@piernov.org> | 2011-08-14 12:57:34 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2011-08-14 12:57:34 +0200 |
commit | fc1f8bf54d8499e4decf46d87d53dcd5d82eeb93 (patch) | |
tree | 3714121ebba4dd83322afee0a3efd5e3c9126c31 | |
parent | 19358fb602b866f6284eafe57da83889289eec0a (diff) | |
download | gnome3-fc1f8bf54d8499e4decf46d87d53dcd5d82eeb93.tar.gz gnome3-fc1f8bf54d8499e4decf46d87d53dcd5d82eeb93.tar.bz2 gnome3-fc1f8bf54d8499e4decf46d87d53dcd5d82eeb93.tar.xz gnome3-fc1f8bf54d8499e4decf46d87d53dcd5d82eeb93.zip |
gnome-control-center 3.1.4-2 correction port
-rw-r--r-- | gnome-control-center/.md5sum.i686 | 1 | ||||
-rw-r--r-- | gnome-control-center/.md5sum.x86_64 | 1 | ||||
-rw-r--r-- | gnome-control-center/Pkgfile | 15 | ||||
-rw-r--r-- | gnome-control-center/gnome-menus3-new-api.patch | 370 |
4 files changed, 382 insertions, 5 deletions
diff --git a/gnome-control-center/.md5sum.i686 b/gnome-control-center/.md5sum.i686 index 68eb018..ef3b737 100644 --- a/gnome-control-center/.md5sum.i686 +++ b/gnome-control-center/.md5sum.i686 @@ -1 +1,2 @@ 72a8c52a6141a79a663e53482d8cae25 gnome-control-center-3.1.4.tar.xz +a006bb5571627b596c49740617f96168 gnome-menus3-new-api.patch diff --git a/gnome-control-center/.md5sum.x86_64 b/gnome-control-center/.md5sum.x86_64 index 68eb018..ef3b737 100644 --- a/gnome-control-center/.md5sum.x86_64 +++ b/gnome-control-center/.md5sum.x86_64 @@ -1 +1,2 @@ 72a8c52a6141a79a663e53482d8cae25 gnome-control-center-3.1.4.tar.xz +a006bb5571627b596c49740617f96168 gnome-menus3-new-api.patch diff --git a/gnome-control-center/Pkgfile b/gnome-control-center/Pkgfile index 30de0b3..09ca6f8 100644 --- a/gnome-control-center/Pkgfile +++ b/gnome-control-center/Pkgfile @@ -2,20 +2,25 @@ # URL: http://www.gnome.org/ # Maintainer: NuTyX GNOME team # Packager: thierryn1 at hispeed dot ch -# Depends on: gnome-desktop, gnome-menus, gst-plugins-base, libcanberra, libgnomekbd, gnome-panel, metacity, nautilus, hal, gnome-settings-daemon, polkit-gnome, webkit, cheese, network-manager-applet -# Run on: gnome-desktop,gnome-menus,gst-plugins-base,libcanberra,libgnomekbd,gnome-panel,metacity,nautilus,hal,gnome-settings-daemon,polkit-gnome,webkit,cheese,network-manager-applet +# Depends on: gnome-desktop, gnome-menus, gst-plugins-base, libcanberra, libgnomekbd, gnome-panel, metacity, nautilus, hal, gnome-settings-daemon, polkit-gnome, webkit, cheese, network-manager-applet, libpulse, mesa-demos +# Run on: gnome-desktop,gnome-menus,gst-plugins-base,libcanberra,libgnomekbd,gnome-panel,metacity,nautilus,hal,gnome-settings-daemon,polkit-gnome,webkit,cheese,network-manager-applet,libpulse,mesa-demos name=gnome-control-center version=3.1.4 -release=1 -source=(http://download.gnome.org/sources/$name/${version%.*}/$name-$version.tar.xz) +release=2 +source=(http://download.gnome.org/sources/$name/${version%.*}/$name-$version.tar.xz + gnome-menus3-new-api.patch) build() { cd $name-$version + patch -p1 < ../gnome-menus3-new-api.patch + autoreconf -i ./configure --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var/lib \ - --libexecdir=/usr/bin + --libexecdir=/usr/bin \ + --with-cheese \ + --with-x make make DESTDIR=$PKG install rm -rf $PKG/usr/share/sounds/ diff --git a/gnome-control-center/gnome-menus3-new-api.patch b/gnome-control-center/gnome-menus3-new-api.patch new file mode 100644 index 0000000..0cae3f2 --- /dev/null +++ b/gnome-control-center/gnome-menus3-new-api.patch @@ -0,0 +1,370 @@ +diff --git a/configure.ac b/configure.ac +index 5bb94b1..48fd12c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -89,7 +89,7 @@ COMMON_MODULES="gtk+-3.0 >= $GTK_REQUIRED_VERSION + PKG_CHECK_MODULES(LIBGNOME_CONTROL_CENTER, $COMMON_MODULES gconf-2.0) + PKG_CHECK_MODULES(LIBLANGUAGE, $COMMON_MODULES gnome-desktop-3.0) + PKG_CHECK_MODULES(LIBSHORTCUTS, $COMMON_MODULES x11) +-PKG_CHECK_MODULES(SHELL, $COMMON_MODULES libgnome-menu gio-unix-2.0) ++PKG_CHECK_MODULES(SHELL, $COMMON_MODULES libgnome-menu-3.0 gio-unix-2.0) + PKG_CHECK_MODULES(BACKGROUND_PANEL, $COMMON_MODULES libxml-2.0 gnome-desktop-3.0 + gdk-pixbuf-2.0 >= $GDKPIXBUF_REQUIRED_VERSION) + PKG_CHECK_MODULES(DATETIME_PANEL, $COMMON_MODULES dbus-glib-1 +diff --git a/shell/cc-shell-model.c b/shell/cc-shell-model.c +index 8f63801..c4ae28f 100644 +--- a/shell/cc-shell-model.c ++++ b/shell/cc-shell-model.c +@@ -30,43 +30,37 @@ + G_DEFINE_TYPE (CcShellModel, cc_shell_model, GTK_TYPE_LIST_STORE) + + static GdkPixbuf * +-load_pixbuf_for_string (const char *icon) ++load_pixbuf_for_gicon (GIcon *icon) + { + GtkIconTheme *theme; ++ GtkIconInfo *icon_info; + GdkPixbuf *pixbuf; + GError *err = NULL; +- char *icon2 = NULL; + + if (icon == NULL) + return NULL; + + theme = gtk_icon_theme_get_default (); + +- /* find the icon */ +- if (*icon == '/') ++ icon_info = gtk_icon_theme_lookup_by_gicon (theme, icon, ++ 32, GTK_ICON_LOOKUP_FORCE_SIZE); ++ if (icon_info) + { +- pixbuf = gdk_pixbuf_new_from_file_at_scale (icon, 32, 32, TRUE, &err); +- } +- else +- { +- if (g_str_has_suffix (icon, ".png")) +- icon2 = g_strndup (icon, strlen (icon) - strlen (".png")); ++ pixbuf = gtk_icon_info_load_icon (icon_info, &err); ++ if (err) ++ { ++ g_warning ("Could not load icon '%s': %s", ++ gtk_icon_info_get_filename (icon_info), err->message); ++ g_error_free (err); ++ } + +- pixbuf = gtk_icon_theme_load_icon (theme, +- icon2 ? icon2 : icon, 32, +- GTK_ICON_LOOKUP_FORCE_SIZE, +- &err); ++ gtk_icon_info_free (icon_info); + } +- +- if (err) ++ else + { +- g_warning ("Could not load icon '%s': %s", icon2 ? icon2 : icon, +- err->message); +- g_error_free (err); ++ g_warning ("Could not find icon"); + } + +- g_free (icon2); +- + return pixbuf; + } + +@@ -83,13 +77,13 @@ icon_theme_changed (GtkIconTheme *theme, + while (cont) + { + GdkPixbuf *pixbuf; +- char *icon; ++ GIcon *icon; + + gtk_tree_model_get (model, &iter, +- COL_ICON_NAME, &icon, ++ COL_GICON, &icon, + -1); +- pixbuf = load_pixbuf_for_string (icon); +- g_free (icon); ++ pixbuf = load_pixbuf_for_gicon (icon); ++ g_object_unref (icon); + gtk_list_store_set (GTK_LIST_STORE (model), &iter, + COL_PIXBUF, pixbuf, + -1); +@@ -107,7 +101,7 @@ static void + cc_shell_model_init (CcShellModel *self) + { + GType types[] = {G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, +- GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRV}; ++ GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_ICON, G_TYPE_STRV}; + + gtk_list_store_set_column_types (GTK_LIST_STORE (self), + N_COLS, types); +@@ -160,10 +154,11 @@ cc_shell_model_add_item (CcShellModel *model, + const gchar *category_name, + GMenuTreeEntry *item) + { +- const gchar *icon = gmenu_tree_entry_get_icon (item); +- const gchar *name = gmenu_tree_entry_get_name (item); ++ GAppInfo *appinfo = G_APP_INFO (gmenu_tree_entry_get_app_info (item)); ++ GIcon *icon = g_app_info_get_icon (appinfo); ++ const gchar *name = g_app_info_get_name (appinfo); + const gchar *desktop = gmenu_tree_entry_get_desktop_file_path (item); +- const gchar *comment = gmenu_tree_entry_get_comment (item); ++ const gchar *comment = g_app_info_get_description (appinfo); + gchar *id; + GdkPixbuf *pixbuf = NULL; + gchar *search_target; +@@ -202,7 +197,7 @@ cc_shell_model_add_item (CcShellModel *model, + g_key_file_free (key_file); + key_file = NULL; + +- pixbuf = load_pixbuf_for_string (icon); ++ pixbuf = load_pixbuf_for_gicon (icon); + + search_target = g_strconcat (name, " - ", comment, NULL); + +@@ -213,7 +208,7 @@ cc_shell_model_add_item (CcShellModel *model, + COL_PIXBUF, pixbuf, + COL_CATEGORY, category_name, + COL_SEARCH_TARGET, search_target, +- COL_ICON_NAME, icon, ++ COL_GICON, icon, + COL_KEYWORDS, keywords, + -1); + +diff --git a/shell/cc-shell-model.h b/shell/cc-shell-model.h +index 6208e43..97ac160 100644 +--- a/shell/cc-shell-model.h ++++ b/shell/cc-shell-model.h +@@ -61,7 +61,7 @@ enum + COL_PIXBUF, + COL_CATEGORY, + COL_SEARCH_TARGET, +- COL_ICON_NAME, ++ COL_GICON, + COL_KEYWORDS, + + N_COLS +diff --git a/shell/gnome-control-center.c b/shell/gnome-control-center.c +index a771282..3725a63 100644 +--- a/shell/gnome-control-center.c ++++ b/shell/gnome-control-center.c +@@ -84,12 +84,34 @@ struct _GnomeControlCenterPrivate + #define FIXED_WIDTH 675 + + ++static const gchar * ++get_icon_name_from_g_icon (GIcon *gicon) ++{ ++ const gchar * const *names; ++ GtkIconTheme *icon_theme; ++ int i; ++ ++ if (!G_IS_THEMED_ICON (gicon)) ++ return NULL; ++ ++ names = g_themed_icon_get_names (G_THEMED_ICON (gicon)); ++ icon_theme = gtk_icon_theme_get_default (); ++ ++ for (i = 0; names[i] != NULL; i++) ++ { ++ if (gtk_icon_theme_has_icon (icon_theme, names[i])) ++ return names[i]; ++ } ++ ++ return NULL; ++} ++ + static void + activate_panel (GnomeControlCenter *shell, + const gchar *id, + const gchar *desktop_file, + const gchar *name, +- const gchar *icon_name) ++ GIcon *gicon) + { + GnomeControlCenterPrivate *priv = shell->priv; + GType panel_type = G_TYPE_INVALID; +@@ -126,6 +148,7 @@ activate_panel (GnomeControlCenter *shell, + GtkWidget *box; + gint i; + int nat_height; ++ const gchar *icon_name; + + /* create the panel plugin */ + panel = g_object_new (panel_type, "shell", shell, NULL); +@@ -146,6 +169,7 @@ activate_panel (GnomeControlCenter *shell, + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), i); + + /* set the title of the window */ ++ icon_name = get_icon_name_from_g_icon (gicon); + gtk_window_set_title (GTK_WINDOW (priv->window), name); + gtk_window_set_default_icon_name (icon_name); + gtk_window_set_icon_name (GTK_WINDOW (priv->window), icon_name); +@@ -627,43 +651,57 @@ maybe_add_category_view (GnomeControlCenter *shell, + static void + reload_menu (GnomeControlCenter *shell) + { +- GSList *list, *l; ++ GError *error; + GMenuTreeDirectory *d; ++ GMenuTreeIter *iter; ++ GMenuTreeItemType next_type; ++ ++ error = NULL; ++ if (!gmenu_tree_load_sync (shell->priv->menu_tree, &error)) ++ { ++ g_warning ("Could not load control center menu: %s", error->message); ++ g_clear_error (&error); ++ return; ++ } ++ + + d = gmenu_tree_get_root_directory (shell->priv->menu_tree); +- list = gmenu_tree_directory_get_contents (d); ++ iter = gmenu_tree_directory_iter (d); + +- for (l = list; l; l = l->next) ++ while ((next_type = gmenu_tree_iter_next (iter)) != GMENU_TREE_ITEM_INVALID) + { +- GMenuTreeItemType type; +- type = gmenu_tree_item_get_type (l->data); +- +- if (type == GMENU_TREE_ITEM_DIRECTORY) ++ if (next_type == GMENU_TREE_ITEM_DIRECTORY) + { +- GSList *contents, *f; ++ GMenuTreeDirectory *subdir; + const gchar *dir_name; ++ GMenuTreeIter *sub_iter; ++ GMenuTreeItemType sub_next_type; + +- contents = gmenu_tree_directory_get_contents (l->data); +- dir_name = gmenu_tree_directory_get_name (l->data); ++ subdir = gmenu_tree_iter_get_directory (iter); ++ dir_name = gmenu_tree_directory_get_name (subdir); + + maybe_add_category_view (shell, dir_name); + + /* add the items from this category to the model */ +- for (f = contents; f; f = f->next) ++ sub_iter = gmenu_tree_directory_iter (subdir); ++ while ((sub_next_type = gmenu_tree_iter_next (sub_iter)) != GMENU_TREE_ITEM_INVALID) + { +- if (gmenu_tree_item_get_type (f->data) == GMENU_TREE_ITEM_ENTRY) ++ if (sub_next_type == GMENU_TREE_ITEM_ENTRY) + { ++ GMenuTreeEntry *item = gmenu_tree_iter_get_entry (sub_iter); + cc_shell_model_add_item (CC_SHELL_MODEL (shell->priv->store), + dir_name, +- f->data); ++ item); ++ gmenu_tree_item_unref (item); + } + } + +- g_slist_free (contents); ++ gmenu_tree_iter_unref (sub_iter); ++ gmenu_tree_item_unref (subdir); + } + } + +- g_slist_free (list); ++ gmenu_tree_iter_unref (iter); + } + + static void +@@ -685,17 +723,11 @@ setup_model (GnomeControlCenter *shell) + + priv->store = (GtkListStore *) cc_shell_model_new (); + priv->category_views = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); +- priv->menu_tree = gmenu_tree_lookup (MENUDIR "/gnomecc.menu", 0); +- +- if (priv->menu_tree == NULL) +- { +- g_warning ("Could not find control center menu"); +- return; +- } ++ priv->menu_tree = gmenu_tree_new_for_path (MENUDIR "/gnomecc.menu", 0); + + reload_menu (shell); + +- gmenu_tree_add_monitor (priv->menu_tree, (GMenuTreeChangedFunc)on_menu_changed, shell); ++ g_signal_connect (priv->menu_tree, "changed", G_CALLBACK (on_menu_changed), shell); + } + + static void +@@ -759,7 +791,8 @@ _shell_set_active_panel_from_id (CcShell *shell, + GtkTreeIter iter; + gboolean iter_valid; + gchar *name = NULL; +- gchar *desktop, *icon_name; ++ gchar *desktop; ++ GIcon *gicon; + GnomeControlCenterPrivate *priv = GNOME_CONTROL_CENTER (shell)->priv; + + +@@ -774,7 +807,7 @@ _shell_set_active_panel_from_id (CcShell *shell, + gtk_tree_model_get (GTK_TREE_MODEL (priv->store), &iter, + COL_NAME, &name, + COL_DESKTOP_FILE, &desktop, +- COL_ICON_NAME, &icon_name, ++ COL_GICON, &gicon, + COL_ID, &id, + -1); + +@@ -788,7 +821,8 @@ _shell_set_active_panel_from_id (CcShell *shell, + g_free (id); + g_free (name); + g_free (desktop); +- g_free (icon_name); ++ if (gicon) ++ g_object_unref (gicon); + + name = NULL; + id = NULL; +@@ -808,11 +842,12 @@ _shell_set_active_panel_from_id (CcShell *shell, + gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), CAPPLET_PAGE); + + activate_panel (GNOME_CONTROL_CENTER (shell), start_id, desktop, name, +- icon_name); ++ gicon); + + g_free (name); + g_free (desktop); +- g_free (icon_name); ++ if (gicon) ++ g_object_unref (gicon); + + return TRUE; + } +@@ -915,8 +950,9 @@ gnome_control_center_finalize (GObject *object) + + if (priv->menu_tree) + { +- gmenu_tree_remove_monitor (priv->menu_tree, (GMenuTreeChangedFunc)on_menu_changed, object); +- gmenu_tree_unref (priv->menu_tree); ++ g_signal_handlers_disconnect_by_func (priv->menu_tree, ++ G_CALLBACK (on_menu_changed), object); ++ g_object_unref (priv->menu_tree); + } + + if (priv->category_views) +diff --git a/shell/cc-shell-model.c b/shell/cc-shell-model.c +index c4ae28f..dd916f8 100644 +--- a/shell/cc-shell-model.c ++++ b/shell/cc-shell-model.c +@@ -199,7 +199,10 @@ cc_shell_model_add_item (CcShellModel *model, + + pixbuf = load_pixbuf_for_gicon (icon); + +- search_target = g_strconcat (name, " - ", comment, NULL); ++ if (comment && comment[0]) ++ search_target = g_strconcat (name, " - ", comment, NULL); ++ else ++ search_target = g_strdup (name); + + gtk_list_store_insert_with_values (GTK_LIST_STORE (model), NULL, 0, + COL_NAME, name,
\ No newline at end of file |