From 1cbdb4442b82a58576f16b664e647755ff964037 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 2 Apr 2020 17:38:15 +0200 Subject: Remove fr-stock.c and fr-stock.h --- src/Makefile.am | 2 -- src/dlg-batch-add.c | 3 -- src/dlg-extract.c | 1 - src/fr-init.c | 3 -- src/fr-stock.c | 81 ----------------------------------------------- src/fr-stock.h | 33 ------------------- src/fr-window.c | 1 - src/ui.h | 15 ++++----- src/ui/batch-add-files.ui | 17 +++++++--- 9 files changed, 19 insertions(+), 137 deletions(-) delete mode 100644 src/fr-stock.c delete mode 100644 src/fr-stock.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 2f14c1d..52773ec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -127,8 +127,6 @@ COMMON_SOURCES = \ fr-init.h \ fr-list-model.c \ fr-list-model.h \ - fr-stock.c \ - fr-stock.h \ fr-proc-error.c \ fr-proc-error.h \ fr-process.c \ diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c index 7e416e6..4d7a3ca 100644 --- a/src/dlg-batch-add.c +++ b/src/dlg-batch-add.c @@ -29,7 +29,6 @@ #include "dlg-batch-add.h" #include "file-utils.h" #include "fr-init.h" -#include "fr-stock.h" #include "fr-window.h" #include "gtk-utils.h" #include "glib-utils.h" @@ -497,8 +496,6 @@ dlg_batch_add_files (FrWindow *window, gtk_size_group_add_widget (size_group, GET_WIDGET ("a_location_label")); gtk_size_group_add_widget (size_group, GET_WIDGET ("a_password_label")); - gtk_button_set_use_stock (GTK_BUTTON (GET_WIDGET ("a_add_button")), TRUE); - gtk_button_set_label (GTK_BUTTON (GET_WIDGET ("a_add_button")), FR_STOCK_CREATE_ARCHIVE); gtk_expander_set_expanded (GTK_EXPANDER (GET_WIDGET ("a_other_options_expander")), FALSE /*g_settings_get_boolean (data->settings, PREF_BATCH_ADD_OTHER_OPTIONS)*/); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (GET_WIDGET ("a_encrypt_header_checkbutton")), g_settings_get_boolean (data->settings_general, PREF_GENERAL_ENCRYPT_HEADER)); gtk_spin_button_set_value (GTK_SPIN_BUTTON (GET_WIDGET ("a_volume_spinbutton")), g_settings_get_int (data->settings, PREF_BATCH_ADD_VOLUME_SIZE) / MEGABYTE); diff --git a/src/dlg-extract.c b/src/dlg-extract.c index 5eda7dc..836cc09 100644 --- a/src/dlg-extract.c +++ b/src/dlg-extract.c @@ -25,7 +25,6 @@ #include #include #include "file-utils.h" -#include "fr-stock.h" #include "fr-init.h" #include "gtk-utils.h" #include "fr-window.h" diff --git a/src/fr-init.c b/src/fr-init.c index fa5d026..850df07 100644 --- a/src/fr-init.c +++ b/src/fr-init.c @@ -50,7 +50,6 @@ #include "fr-command-lrzip.h" #include "fr-init.h" #include "fr-process.h" -#include "fr-stock.h" #include "fr-window.h" #include "typedefs.h" #include "preferences.h" @@ -654,8 +653,6 @@ initialize_data (void) migrate_options_directory (); register_commands (); compute_supported_archive_types (); - - fr_stock_init (); } diff --git a/src/fr-stock.c b/src/fr-stock.c deleted file mode 100644 index e292b04..0000000 --- a/src/fr-stock.c +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Engrampa - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include "fr-stock.h" - - -static gboolean stock_initialized = FALSE; - -static const struct { - const char *stock_id; - const char *icon; -} stock_icons [] = { - { FR_STOCK_CREATE_ARCHIVE, "add-files-to-archive" }, - { FR_STOCK_ADD_FILES, "add-files-to-archive" }, - { FR_STOCK_ADD_FOLDER, "add-folder-to-archive" }, - { FR_STOCK_EXTRACT, "extract-archive" } -}; - -static const GtkStockItem stock_items [] = { - { FR_STOCK_CREATE_ARCHIVE, N_("C_reate"), 0, 0, GETTEXT_PACKAGE }, - { FR_STOCK_ADD_FILES, N_("_Add"), 0, 0, GETTEXT_PACKAGE }, - { FR_STOCK_ADD_FOLDER, N_("_Add"), 0, 0, GETTEXT_PACKAGE }, - { FR_STOCK_EXTRACT, N_("_Extract"), 0, 0, GETTEXT_PACKAGE } -}; - -void -fr_stock_init (void) -{ - GtkIconFactory *factory; - GtkIconSource *source; - size_t i; - - if (stock_initialized) - return; - stock_initialized = TRUE; - - gtk_stock_add_static (stock_items, G_N_ELEMENTS (stock_items)); - - factory = gtk_icon_factory_new (); - gtk_icon_factory_add_default (factory); - - source = gtk_icon_source_new (); - - for (i = 0; i < G_N_ELEMENTS (stock_icons); i++) { - GtkIconSet *set; - - gtk_icon_source_set_icon_name (source, stock_icons [i].icon); - - set = gtk_icon_set_new (); - gtk_icon_set_add_source (set, source); - - gtk_icon_factory_add (factory, stock_icons [i].stock_id, set); - gtk_icon_set_unref (set); - } - - gtk_icon_source_free (source); - - g_object_unref (factory); -} diff --git a/src/fr-stock.h b/src/fr-stock.h deleted file mode 100644 index 69bde49..0000000 --- a/src/fr-stock.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Engrampa - * - * Copyright (C) 2003 Free Software Foundation, Inc. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef FR_STOCK_H -#define FR_STOCK_H - -#define FR_STOCK_CREATE_ARCHIVE "create-archive" -#define FR_STOCK_ADD_FILES "add-files-to-archive" -#define FR_STOCK_ADD_FOLDER "add-folder-to-archive" -#define FR_STOCK_EXTRACT "extract-archive" - -void fr_stock_init (void); - -#endif /* FR_STOCK_H */ diff --git a/src/fr-window.c b/src/fr-window.c index d44711d..540c502 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -43,7 +43,6 @@ #include "fr-list-model.h" #include "fr-archive.h" #include "fr-error.h" -#include "fr-stock.h" #include "fr-window.h" #include "file-data.h" #include "file-utils.h" diff --git a/src/ui.h b/src/ui.h index a288468..2841b76 100644 --- a/src/ui.h +++ b/src/ui.h @@ -25,7 +25,6 @@ #include "actions.h" -#include "fr-stock.h" static GtkActionEntry action_entries[] = { @@ -39,19 +38,19 @@ static GtkActionEntry action_entries[] = { N_("_About"), NULL, N_("Information about the program"), G_CALLBACK (activate_action_about) }, - { "AddFiles", FR_STOCK_ADD_FILES, + { "AddFiles", "add-files-to-archive", N_("_Add Files…"), NULL, N_("Add files to the archive"), G_CALLBACK (activate_action_add_files) }, - { "AddFiles_Toolbar", FR_STOCK_ADD_FILES, + { "AddFiles_Toolbar", "add-files-to-archive", N_("Add Files"), NULL, N_("Add files to the archive"), G_CALLBACK (activate_action_add_files) }, - { "AddFolder", FR_STOCK_ADD_FOLDER, + { "AddFolder", "add-folder-to-archive", N_("Add a _Folder…"), NULL, N_("Add a folder to the archive"), G_CALLBACK (activate_action_add_folder) }, - { "AddFolder_Toolbar", FR_STOCK_ADD_FOLDER, + { "AddFolder_Toolbar", "add-folder-to-archive", N_("Add Folder"), NULL, N_("Add a folder to the archive"), G_CALLBACK (activate_action_add_folder) }, @@ -110,15 +109,15 @@ static GtkActionEntry action_entries[] = { N_("Dese_lect All"), "A", N_("Deselect all files"), G_CALLBACK (activate_action_deselect_all) }, - { "Extract", FR_STOCK_EXTRACT, + { "Extract", "extract-archive", N_("_Extract…"), "E", N_("Extract files from the archive"), G_CALLBACK (activate_action_extract) }, - { "ExtractFolderFromSidebar", FR_STOCK_EXTRACT, + { "ExtractFolderFromSidebar", "extract-archive", N_("_Extract…"), NULL, N_("Extract files from the archive"), G_CALLBACK (activate_action_extract_folder_from_sidebar) }, - { "Extract_Toolbar", FR_STOCK_EXTRACT, + { "Extract_Toolbar", "extract-archive", N_("Extract"), NULL, N_("Extract files from the archive"), G_CALLBACK (activate_action_extract) }, diff --git a/src/ui/batch-add-files.ui b/src/ui/batch-add-files.ui index f3ae2f9..476cb0c 100644 --- a/src/ui/batch-add-files.ui +++ b/src/ui/batch-add-files.ui @@ -1,7 +1,12 @@ - + - + + + True + False + add-files-to-archive + 0.10000000000000001 9999999999 @@ -16,6 +21,9 @@ False center normal + + + True @@ -43,16 +51,15 @@ + C_reate True True True True True False + image1 True - - - False -- cgit v1.2.1