From 728339f536ca03cde003d5c9320a8c3a4b627cae Mon Sep 17 00:00:00 2001 From: Andre Miranda Date: Sat, 2 Jun 2018 13:27:55 -0300 Subject: [PATCH] Drop thunar-stock --- po/POTFILES.in | 1 - thunar/Makefile.am | 2 - thunar/main.c | 4 -- thunar/thunar-launcher.c | 3 +- thunar/thunar-shortcuts-pane.c | 3 +- thunar/thunar-shortcuts-view.c | 3 +- thunar/thunar-standard-view.c | 3 +- thunar/thunar-stock.c | 98 ---------------------------------- thunar/thunar-stock.h | 35 ------------ thunar/thunar-trash-action.c | 8 ++- thunar/thunar-tree-view.c | 1 - thunar/thunar-window.c | 5 +- 12 files changed, 9 insertions(+), 157 deletions(-) delete mode 100644 thunar/thunar-stock.c delete mode 100644 thunar/thunar-stock.h diff --git a/po/POTFILES.in b/po/POTFILES.in index 01b151c43..1317d3285 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -72,7 +72,6 @@ thunar/thunar-simple-job.c thunar/thunar-size-label.c thunar/thunar-standard-view.c thunar/thunar-statusbar.c -thunar/thunar-stock.c thunar/thunar-templates-action.c thunar/thunar-thumbnail-cache.c thunar/thunar-thumbnailer.c diff --git a/thunar/Makefile.am b/thunar/Makefile.am index 1ae0d3e34..e27c95e59 100644 --- a/thunar/Makefile.am +++ b/thunar/Makefile.am @@ -194,8 +194,6 @@ thunar_SOURCES = \ thunar-standard-view.h \ thunar-statusbar.c \ thunar-statusbar.h \ - thunar-stock.c \ - thunar-stock.h \ thunar-templates-action.c \ thunar-templates-action.h \ thunar-thumbnail-cache.c \ diff --git a/thunar/main.c b/thunar/main.c index 7e1d94129..7483750cc 100644 --- a/thunar/main.c +++ b/thunar/main.c @@ -40,7 +40,6 @@ #include #include #include -#include #include @@ -152,9 +151,6 @@ main (int argc, char **argv) /* register additional transformation functions */ thunar_g_initialize_transformations (); - /* initialize the thunar stock items/icons */ - thunar_stock_init (); - /* acquire a reference on the global application */ application = thunar_application_get (); diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c index 8fed3edf1..c8963350f 100644 --- a/thunar/thunar-launcher.c +++ b/thunar/thunar-launcher.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -181,7 +180,7 @@ static const GtkActionEntry action_entries[] = { "open-with-other", NULL, N_ ("Open With Other _Application..."), NULL, N_ ("Choose another application with which to open the selected file"), G_CALLBACK (thunar_launcher_action_open_with_other), }, { "open-with-menu", NULL, N_ ("Open With"), NULL, NULL, NULL, }, { "open-with-other-in-menu", NULL, N_ ("Open With Other _Application..."), NULL, N_ ("Choose another application with which to open the selected file"), G_CALLBACK (thunar_launcher_action_open_with_other), }, - { "sendto-desktop", THUNAR_STOCK_DESKTOP, "", NULL, NULL, G_CALLBACK (thunar_launcher_action_sendto_desktop), }, + { "sendto-desktop", "user-desktop", "", NULL, NULL, G_CALLBACK (thunar_launcher_action_sendto_desktop), }, }; static GQuark thunar_launcher_handler_quark; diff --git a/thunar/thunar-shortcuts-pane.c b/thunar/thunar-shortcuts-pane.c index 873a0fca8..98b5d6eb1 100644 --- a/thunar/thunar-shortcuts-pane.c +++ b/thunar/thunar-shortcuts-pane.c @@ -28,7 +28,6 @@ #include #include #include -#include @@ -95,7 +94,7 @@ struct _ThunarShortcutsPane static const GtkActionEntry action_entries[] = { - { "sendto-shortcuts", THUNAR_STOCK_SHORTCUTS, "", NULL, NULL, G_CALLBACK (thunar_shortcuts_pane_action_shortcuts_add), }, + { "sendto-shortcuts", "stock_thunar-shortcuts", "", NULL, NULL, G_CALLBACK (thunar_shortcuts_pane_action_shortcuts_add), }, }; diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index e7ef4949e..c570a41a8 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -46,7 +46,6 @@ #include #include #include -#include @@ -1184,7 +1183,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - image = gtk_image_new_from_stock (THUNAR_STOCK_SHORTCUTS, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name ("stock_thunar-shortcuts", GTK_ICON_SIZE_MENU); G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 3a9c5fa85..46d871550 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -408,7 +407,7 @@ static const GtkActionEntry action_entries[] = { "cut", "edit-cut", N_ ("Cu_t"), "X", NULL, G_CALLBACK (thunar_standard_view_action_cut), }, { "copy", "edit-copy", N_ ("_Copy"), "C", NULL, G_CALLBACK (thunar_standard_view_action_copy), }, { "paste", "edit-paste", N_ ("_Paste"), "V", N_ ("Move or copy files previously selected by a Cut or Copy command"), G_CALLBACK (thunar_standard_view_action_paste), }, - { "move-to-trash", THUNAR_STOCK_TRASH_FULL, N_ ("Mo_ve to Trash"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_move_to_trash), }, + { "move-to-trash", "user-trash", N_ ("Mo_ve to Trash"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_move_to_trash), }, { "delete", "edit-delete", N_ ("_Delete"), NULL, NULL, G_CALLBACK (thunar_standard_view_action_delete), }, { "paste-into-folder", "edit-paste", N_ ("Paste Into Folder"), NULL, N_ ("Move or copy files previously selected by a Cut or Copy command into the selected folder"), G_CALLBACK (thunar_standard_view_action_paste_into_folder), }, { "select-all-files", NULL, N_ ("Select _all Files"), NULL, N_ ("Select all files in this window"), G_CALLBACK (thunar_standard_view_action_select_all_files), }, diff --git a/thunar/thunar-stock.c b/thunar/thunar-stock.c deleted file mode 100644 index a4a12ac6a..000000000 --- a/thunar/thunar-stock.c +++ /dev/null @@ -1,98 +0,0 @@ -/* vi:set et ai sw=2 sts=2 ts=2: */ -/*- - * Copyright (c) 2006 Benedikt Meurer . - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef HAVE_MEMORY_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - -#include - -#include - - - -typedef struct -{ - const gchar *name; - const gchar *icon; -} ThunarStockIcon; - - - -/* keep in sync with thunar-stock.h */ -static const ThunarStockIcon thunar_stock_icons[] = -{ - { THUNAR_STOCK_DESKTOP, "user-desktop" }, - { THUNAR_STOCK_SHORTCUTS, "stock_thunar-shortcuts" }, - { THUNAR_STOCK_TEMPLATES, "text-x-generic-template" }, - { THUNAR_STOCK_TRASH_EMPTY, "user-trash", }, - { THUNAR_STOCK_TRASH_FULL, "user-trash-full" }, -}; - - - -/** - * thunar_stock_init: - * - * Initializes the stock icons used by the Thunar - * file manager. - **/ -void -thunar_stock_init (void) -{ - GtkIconFactory *icon_factory; - GtkIconSource *icon_source; - GtkIconSet *icon_set; - guint n; - - /* allocate a new icon factory for the thunar stock icons */ - icon_factory = gtk_icon_factory_new (); - - /* allocate an icon source */ - icon_source = gtk_icon_source_new (); - - /* register our stock icons */ - for (n = 0; n < G_N_ELEMENTS (thunar_stock_icons); ++n) - { - /* setup the icon set */ - icon_set = gtk_icon_set_new (); - gtk_icon_source_set_icon_name (icon_source, thunar_stock_icons[n].icon); - gtk_icon_set_add_source (icon_set, icon_source); - gtk_icon_factory_add (icon_factory, thunar_stock_icons[n].name, icon_set); - gtk_icon_set_unref (icon_set); - } - - /* register our icon factory as default */ - gtk_icon_factory_add_default (icon_factory); - - /* cleanup */ - g_object_unref (G_OBJECT (icon_factory)); - gtk_icon_source_free (icon_source); -} - - - - diff --git a/thunar/thunar-stock.h b/thunar/thunar-stock.h deleted file mode 100644 index ce578a491..000000000 --- a/thunar/thunar-stock.h +++ /dev/null @@ -1,35 +0,0 @@ -/* vi:set et ai sw=2 sts=2 ts=2: */ -/*- - * Copyright (c) 2006 Benedikt Meurer . - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __THUNAR_STOCK_H__ -#define __THUNAR_STOCK_H__ - -G_BEGIN_DECLS; - -#define THUNAR_STOCK_DESKTOP "thunar-desktop" /* see ThunarLauncher */ -#define THUNAR_STOCK_SHORTCUTS "thunar-shortcuts" /* see ThunarShortcutsPane */ -#define THUNAR_STOCK_TEMPLATES "thunar-templates" /* see ThunarWindow */ -#define THUNAR_STOCK_TRASH_EMPTY "thunar-trash" /* see ThunarTrashAction */ -#define THUNAR_STOCK_TRASH_FULL "thunar-trash-full" /* see ThunarTrashAction */ - -void thunar_stock_init (void); - -G_END_DECLS; - -#endif /* !__THUNAR_STOCK_H__ */ diff --git a/thunar/thunar-trash-action.c b/thunar/thunar-trash-action.c index 791e479e2..2e79f8f61 100644 --- a/thunar/thunar-trash-action.c +++ b/thunar/thunar-trash-action.c @@ -23,7 +23,6 @@ #endif #include -#include #include #include #include @@ -148,9 +147,9 @@ thunar_trash_action_changed (ThunarTrashAction *trash_action, /* adjust the stock icon appropriately */ if (thunar_file_get_item_count (trash_bin) > 0) - g_object_set (G_OBJECT (trash_action), "stock-id", THUNAR_STOCK_TRASH_FULL, NULL); + g_object_set (G_OBJECT (trash_action), "icon-name", "user-trash-full", NULL); else - g_object_set (G_OBJECT (trash_action), "stock-id", THUNAR_STOCK_TRASH_EMPTY, NULL); + g_object_set (G_OBJECT (trash_action), "icon-name", "user-trash", NULL); } @@ -169,7 +168,6 @@ thunar_trash_action_new (void) return g_object_new (THUNAR_TYPE_TRASH_ACTION, "name", "open-trash", "tooltip", _("Display the contents of the trash can"), - "stock-id", THUNAR_STOCK_TRASH_FULL, + "icon-name", "user-trash-full", NULL); } - diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 81ebdf9ce..4c238ca5e 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 9ec3bcd37..3ad80de12 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -368,10 +367,10 @@ static GtkActionEntry action_entries[] = { "go-menu", NULL, N_ ("_Go"), NULL, }, { "open-parent", "go-up-symbolic", N_ ("Open _Parent"), "Up", N_ ("Open the parent folder"), G_CALLBACK (thunar_window_action_go_up), }, { "open-home", "go-home-symbolic", N_ ("_Home"), "Home", N_ ("Go to the home folder"), G_CALLBACK (thunar_window_action_open_home), }, - { "open-desktop", THUNAR_STOCK_DESKTOP, N_ ("Desktop"), NULL, N_ ("Go to the desktop folder"), G_CALLBACK (thunar_window_action_open_desktop), }, + { "open-desktop", "user-desktop", N_ ("Desktop"), NULL, N_ ("Go to the desktop folder"), G_CALLBACK (thunar_window_action_open_desktop), }, { "open-file-system", "drive-harddisk", N_ ("File System"), NULL, N_ ("Browse the file system"), G_CALLBACK (thunar_window_action_open_file_system), }, { "open-network", "network-workgroup", N_("B_rowse Network"), NULL, N_ ("Browse local network connections"), G_CALLBACK (thunar_window_action_open_network), }, - { "open-templates", THUNAR_STOCK_TEMPLATES, N_("T_emplates"), NULL, N_ ("Go to the templates folder"), G_CALLBACK (thunar_window_action_open_templates), }, + { "open-templates", "text-x-generic-template", N_("T_emplates"), NULL, N_ ("Go to the templates folder"), G_CALLBACK (thunar_window_action_open_templates), }, { "open-location", NULL, N_ ("_Open Location..."), "L", N_ ("Specify a location to open"), G_CALLBACK (thunar_window_action_open_location), }, { "help-menu", NULL, N_ ("_Help"), NULL, }, { "contents", "help-browser", N_ ("_Contents"), "F1", N_ ("Display Thunar user manual"), G_CALLBACK (thunar_window_action_contents), },