Skip to content
Permalink
Browse files

avoid deprecated GtkStock

  • Loading branch information...
sc0w authored and raveit65 committed Feb 7, 2018
1 parent b5651bb commit 2e9c1a1d447ddc1c54b94d1dcc6b99437b7f601f
Showing with 110 additions and 110 deletions.
  1. +2 −2 src/actions.c
  2. +2 −2 src/dlg-add-files.c
  3. +4 −4 src/dlg-add-folder.c
  4. +6 −6 src/dlg-batch-add.c
  5. +6 −6 src/dlg-extract.c
  6. +25 −25 src/fr-window.c
  7. +13 −13 src/gtk-utils.c
  8. +1 −1 src/gtk-utils.h
  9. +51 −51 src/ui.h
@@ -382,8 +382,8 @@ activate_action_open (GtkAction *action,
file_sel = gtk_file_chooser_dialog_new (_("Open"),
GTK_WINDOW (window),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-open", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (file_sel), GTK_RESPONSE_OK);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_sel), FALSE);
@@ -152,9 +152,9 @@ add_files_cb (GtkWidget *widget,
gtk_file_chooser_dialog_new (_("Add Files"),
GTK_WINDOW (data->window),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
FR_STOCK_ADD_FILES, GTK_RESPONSE_OK,
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
"gtk-help", GTK_RESPONSE_HELP,
NULL);

gtk_window_set_default_size (GTK_WINDOW (data->dialog), 530, 450);
@@ -223,9 +223,9 @@ add_folder_cb (GtkWidget *widget,
gtk_file_chooser_dialog_new (_("Add a Folder"),
GTK_WINDOW (data->window),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
FR_STOCK_ADD_FOLDER, GTK_RESPONSE_OK,
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
"gtk-help", GTK_RESPONSE_HELP,
NULL);

gtk_window_set_default_size (GTK_WINDOW (data->dialog), 530, 510);
@@ -878,8 +878,8 @@ save_options_cb (GtkWidget *w,
_("_Options Name:"),
(data->last_options != NULL) ? data->last_options : "",
1024,
GTK_STOCK_CANCEL,
GTK_STOCK_SAVE);
"gtk-cancel",
"gtk-save");
if (opt_filename == NULL)
return;

@@ -228,10 +228,10 @@ add_clicked_cb (GtkWidget *widget,

d = _gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("dialog")),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
msg,
NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("Create _Folder"), GTK_RESPONSE_YES,
NULL);

@@ -267,10 +267,10 @@ add_clicked_cb (GtkWidget *widget,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_DIALOG_WARNING,
"dialog-warning",
_("Archive not created"),
NULL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
gtk_dialog_run (GTK_DIALOG (d));
@@ -315,10 +315,10 @@ add_clicked_cb (GtkWidget *widget,

d = _gtk_message_dialog_new (GTK_WINDOW (GET_WIDGET ("dialog")),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
_("The archive is already present. Do you want to overwrite it?"),
NULL,
GTK_STOCK_NO, GTK_RESPONSE_NO,
"gtk-no", GTK_RESPONSE_NO,
_("_Overwrite"), GTK_RESPONSE_YES,
NULL);

@@ -106,10 +106,10 @@ extract_cb (GtkWidget *w,

d = _gtk_message_dialog_new (GTK_WINDOW (data->dialog),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
msg,
NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("Create _Folder"), GTK_RESPONSE_YES,
NULL);

@@ -146,10 +146,10 @@ extract_cb (GtkWidget *w,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_DIALOG_WARNING,
"dialog-warning",
_("Extraction not performed"),
NULL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
gtk_dialog_run (GTK_DIALOG (d));
@@ -423,9 +423,9 @@ dlg_extract__common (FrWindow *window,
gtk_file_chooser_dialog_new (_("Extract"),
GTK_WINDOW (data->window),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
FR_STOCK_EXTRACT, GTK_RESPONSE_OK,
GTK_STOCK_HELP, GTK_RESPONSE_HELP,
"gtk-help", GTK_RESPONSE_HELP,
NULL);

gtk_window_set_default_size (GTK_WINDOW (file_sel), 530, 510);
@@ -2525,12 +2525,12 @@ create_the_progress_dialog (FrWindow *window)
NULL,
NULL);

window->priv->pd_quit_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), GTK_STOCK_QUIT, DIALOG_RESPONSE_QUIT);
window->priv->pd_quit_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), "gtk-quit", DIALOG_RESPONSE_QUIT);
window->priv->pd_open_archive_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), _("_Open the Archive"), DIALOG_RESPONSE_OPEN_ARCHIVE);
window->priv->pd_open_destination_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), _("_Show the Files"), DIALOG_RESPONSE_OPEN_DESTINATION_FOLDER);
window->priv->pd_open_destination_and_quit_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), _("Show the _Files and Quit"), DIALOG_RESPONSE_OPEN_DESTINATION_FOLDER_AND_QUIT);
window->priv->pd_close_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
window->priv->pd_cancel_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
window->priv->pd_close_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), "gtk-close", GTK_RESPONSE_CLOSE);
window->priv->pd_cancel_button = gtk_dialog_add_button (GTK_DIALOG (window->priv->progress_dialog), "gtk-cancel", GTK_RESPONSE_CANCEL);

d = GTK_DIALOG (window->priv->progress_dialog);
gtk_window_set_resizable (GTK_WINDOW (d), TRUE);
@@ -4135,12 +4135,12 @@ fr_window_drag_data_received (GtkWidget *widget,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
_("Do you want to add this file to the current archive or open it as a new archive?"),
NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_ADD, 0,
GTK_STOCK_OPEN, 1,
"gtk-cancel", GTK_RESPONSE_CANCEL,
"gtk-add", 0,
"gtk-open", 1,
NULL);

gtk_dialog_set_default_response (GTK_DIALOG (d), 2);
@@ -4165,10 +4165,10 @@ fr_window_drag_data_received (GtkWidget *widget,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
_("Do you want to create a new archive with these files?"),
NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("Create _Archive"), GTK_RESPONSE_YES,
NULL);

@@ -5871,7 +5871,7 @@ fr_window_construct (FrWindow *window)
/* Translators: this is the label for the "open recent file" sub-menu. */
"label", _("Open _Recent"),
"tooltip", _("Open a recently used archive"),
"stock-id", GTK_STOCK_OPEN,
"stock-id", "gtk-open",
NULL);
fr_window_init_recent_chooser (window, GTK_RECENT_CHOOSER (action));
gtk_action_group_add_action (actions, action);
@@ -5883,7 +5883,7 @@ fr_window_construct (FrWindow *window)
"name", "OpenRecent_Toolbar",
"label", _("Open"),
"tooltip", _("Open a recently used archive"),
"stock-id", GTK_STOCK_OPEN,
"stock-id", "gtk-open",
"is-important", TRUE,
NULL);
fr_window_init_recent_chooser (window, GTK_RECENT_CHOOSER (action));
@@ -6813,10 +6813,10 @@ _fr_window_ask_overwrite_dialog (OverwriteData *odata)
details = g_strdup_printf (_("Another file with the same name already exists in \"%s\"."), parent_name);
d = _gtk_message_dialog_new (GTK_WINDOW (odata->window),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
msg,
details,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("Replace _All"), _FR_RESPONSE_OVERWRITE_YES_ALL,
_("_Skip"), _FR_RESPONSE_OVERWRITE_NO,
_("_Replace"), _FR_RESPONSE_OVERWRITE_YES,
@@ -6858,10 +6858,10 @@ _fr_window_ask_overwrite_dialog (OverwriteData *odata)

d = _gtk_message_dialog_new (GTK_WINDOW (odata->window),
0,
GTK_STOCK_DIALOG_WARNING,
"dialog-warning",
_("Extraction not performed"),
NULL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
fr_window_show_error_dialog (odata->window, d, GTK_WINDOW (odata->window), _("Extraction not performed"));
@@ -6923,10 +6923,10 @@ fr_window_archive_extract (FrWindow *window,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
msg,
NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
"gtk-cancel", GTK_RESPONSE_CANCEL,
_("Create _Folder"), GTK_RESPONSE_YES,
NULL);

@@ -6966,10 +6966,10 @@ fr_window_archive_extract (FrWindow *window,

d = _gtk_message_dialog_new (GTK_WINDOW (window),
0,
GTK_STOCK_DIALOG_WARNING,
"dialog-warning",
_("Extraction not performed"),
NULL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (d), GTK_RESPONSE_OK);
fr_window_show_error_dialog (window, d, GTK_WINDOW (window), _("Extraction not performed"));
@@ -7354,7 +7354,7 @@ fr_window_view_last_output (FrWindow *window,
dialog = gtk_dialog_new_with_buttons (title,
GTK_WINDOW (window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
"gtk-close", GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
@@ -7776,7 +7776,7 @@ fr_window_rename_selection (FrWindow *window,
(renaming_dir ? _("_New folder name:") : _("_New file name:")),
utf8_old_name,
1024,
GTK_STOCK_CANCEL,
"gtk-cancel",
_("_Rename"));
g_free (utf8_old_name);

@@ -7812,10 +7812,10 @@ fr_window_rename_selection (FrWindow *window,

dlg = _gtk_message_dialog_new (GTK_WINDOW (window),
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_QUESTION,
"dialog-question",
(renaming_dir ? _("Could not rename the folder") : _("Could not rename the file")),
reason,
GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
"gtk-close", GTK_RESPONSE_OK,
NULL);
gtk_dialog_run (GTK_DIALOG (dlg));
gtk_widget_destroy (dlg);
@@ -8217,8 +8217,8 @@ fr_window_paste_selection (FrWindow *window,
_("_Destination folder:"),
utf8_old_path,
1024,
GTK_STOCK_CANCEL,
GTK_STOCK_PASTE);
"gtk-cancel",
"gtk-paste");
g_free (utf8_old_path);
if (utf8_path == NULL)
return;
@@ -54,7 +54,7 @@ _gtk_count_selected (GtkTreeSelection *selection)
GtkWidget*
_gtk_message_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
const char *stock_id,
const char *icon_name,
const char *message,
const char *secondary_message,
const gchar *first_button_text,
@@ -72,15 +72,15 @@ _gtk_message_dialog_new (GtkWindow *parent,

g_return_val_if_fail ((message != NULL) || (secondary_message != NULL), NULL);

if (stock_id == NULL)
stock_id = GTK_STOCK_DIALOG_INFO;
if (icon_name == NULL)
icon_name = "dialog-information";

dialog = gtk_dialog_new_with_buttons ("", parent, flags, NULL, NULL);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));

/* Add label and image */

image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_DIALOG);
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_DIALOG);
gtk_widget_set_valign (image, GTK_ALIGN_START);

label = gtk_label_new ("");
@@ -244,12 +244,12 @@ _gtk_request_dialog_run (GtkWindow *parent,

/* Add buttons */

button = create_button (GTK_STOCK_CANCEL, no_button_text);
button = create_button ("gtk-cancel", no_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
button,
GTK_RESPONSE_CANCEL);

button = create_button (GTK_STOCK_OK, yes_button_text);
button = create_button ("gtk-ok", yes_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
button,
GTK_RESPONSE_YES);
@@ -316,14 +316,14 @@ _gtk_yesno_dialog_new (GtkWindow *parent,

/* Add buttons */

button = create_button (GTK_STOCK_CANCEL, no_button_text);
button = create_button ("gtk-cancel", no_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (d),
button,
GTK_RESPONSE_CANCEL);

/**/

button = create_button (GTK_STOCK_OK, yes_button_text);
button = create_button ("gtk-ok", yes_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (d),
button,
GTK_RESPONSE_YES);
@@ -364,7 +364,7 @@ _gtk_error_dialog_new (GtkWindow *parent,
dialog = gtk_dialog_new_with_buttons ("",
parent,
flags,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
@@ -494,10 +494,10 @@ _gtk_error_dialog_run (GtkWindow *parent,

d = _gtk_message_dialog_new (parent,
GTK_DIALOG_MODAL,
GTK_STOCK_DIALOG_ERROR,
"dialog-error",
main_message,
message,
GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
"gtk-close", GTK_RESPONSE_CANCEL,
NULL);
g_free (message);

@@ -736,10 +736,10 @@ show_help_dialog (GtkWindow *parent,

dialog = _gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_DIALOG_ERROR,
"dialog-error",
_("Could not display help"),
error->message,
GTK_STOCK_OK, GTK_RESPONSE_OK,
"gtk-ok", GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);

@@ -30,7 +30,7 @@
int _gtk_count_selected (GtkTreeSelection *selection);
GtkWidget* _gtk_message_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
const char *stock_id,
const char *icon_name,
const char *message,
const char *secondary_message,
const char *first_button_text,
Oops, something went wrong.

0 comments on commit 2e9c1a1

Please sign in to comment.
You can’t perform that action at this time.