1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

chore: fix deprecation warnings of GTK_STOCK_ use. (#1370)

* chore: fix deprecation warnings of GTK_STOCK_ use.

This is just a tiny step towards getting all of the GTK code up-to-date,
but GTK_STOCK warnings are the lowest-hanging fruit of the warnings, so
let's fix them.
This commit is contained in:
Charles Kerr 2020-07-27 12:49:45 -05:00 committed by GitHub
parent 10fc016239
commit 073ae6c206
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 118 additions and 72 deletions

View file

@ -81,36 +81,37 @@ static GtkActionEntry entries[] =
{ "queue-menu", NULL, N_("_Queue"), NULL, NULL, NULL },
{ "edit-menu", NULL, N_("_Edit"), NULL, NULL, NULL },
{ "help-menu", NULL, N_("_Help"), NULL, NULL, NULL },
{ "copy-magnet-link-to-clipboard", GTK_STOCK_COPY, N_("Copy _Magnet Link to Clipboard"), "", NULL, G_CALLBACK(action_cb) },
{ "open-torrent-from-url", GTK_STOCK_OPEN, N_("Open _URL…"), "<control>U", N_("Open URL…"), G_CALLBACK(action_cb) },
{ "open-torrent-toolbar", GTK_STOCK_OPEN, NULL, NULL, N_("Open a torrent"), G_CALLBACK(action_cb) },
{ "open-torrent-menu", GTK_STOCK_OPEN, NULL, NULL, N_("Open a torrent"), G_CALLBACK(action_cb) },
{ "torrent-start", GTK_STOCK_MEDIA_PLAY, N_("_Start"), "<control>S", N_("Start torrent"), G_CALLBACK(action_cb) },
{ "torrent-start-now", GTK_STOCK_MEDIA_PLAY, N_("Start _Now"), "<shift><control>S", N_("Start torrent now"),
{ "copy-magnet-link-to-clipboard", "edit-copy", N_("Copy _Magnet Link to Clipboard"), "", NULL, G_CALLBACK(action_cb) },
{ "open-torrent-from-url", "document-open", N_("Open _URL…"), "<control>U", N_("Open URL…"), G_CALLBACK(action_cb) },
{ "open-torrent-toolbar", "document-open", N_("_Open"), NULL, N_("Open a torrent"), G_CALLBACK(action_cb) },
{ "open-torrent-menu", "document-open", N_("_Open"), NULL, N_("Open a torrent"), G_CALLBACK(action_cb) },
{ "torrent-start", "media-playback-start", N_("_Start"), "<control>S", N_("Start torrent"), G_CALLBACK(action_cb) },
{ "torrent-start-now", "media-playback-start", N_("Start _Now"), "<shift><control>S", N_("Start torrent now"),
G_CALLBACK(action_cb) },
{ "show-stats", NULL, N_("_Statistics"), NULL, NULL, G_CALLBACK(action_cb) },
{ "donate", NULL, N_("_Donate"), NULL, NULL, G_CALLBACK(action_cb) },
{ "torrent-verify", NULL, N_("_Verify Local Data"), "<control>V", NULL, G_CALLBACK(action_cb) },
{ "torrent-stop", GTK_STOCK_MEDIA_PAUSE, N_("_Pause"), "<control>P", N_("Pause torrent"), G_CALLBACK(action_cb) },
{ "pause-all-torrents", GTK_STOCK_MEDIA_PAUSE, N_("_Pause All"), NULL, N_("Pause all torrents"), G_CALLBACK(action_cb) },
{ "start-all-torrents", GTK_STOCK_MEDIA_PLAY, N_("_Start All"), NULL, N_("Start all torrents"), G_CALLBACK(action_cb) },
{ "torrent-stop", "media-playback-pause", N_("_Pause"), "<control>P", N_("Pause torrent"), G_CALLBACK(action_cb) },
{ "pause-all-torrents", "media-playback-pause", N_("_Pause All"), NULL, N_("Pause all torrents"), G_CALLBACK(action_cb) },
{ "start-all-torrents", "media-playback-start", N_("_Start All"), NULL, N_("Start all torrents"), G_CALLBACK(action_cb) },
{ "relocate-torrent", NULL, N_("Set _Location…"), NULL, NULL, G_CALLBACK(action_cb) },
{ "remove-torrent", GTK_STOCK_REMOVE, NULL, "Delete", N_("Remove torrent"), G_CALLBACK(action_cb) },
{ "delete-torrent", GTK_STOCK_DELETE, N_("_Delete Files and Remove"), "<shift>Delete", NULL, G_CALLBACK(action_cb) },
{ "new-torrent", GTK_STOCK_NEW, N_("_New…"), NULL, N_("Create a torrent"), G_CALLBACK(action_cb) },
{ "quit", GTK_STOCK_QUIT, N_("_Quit"), NULL, NULL, G_CALLBACK(action_cb) },
{ "select-all", GTK_STOCK_SELECT_ALL, N_("Select _All"), "<control>A", NULL, G_CALLBACK(action_cb) },
{ "remove-torrent", "list-remove", NULL, "Delete", N_("Remove torrent"), G_CALLBACK(action_cb) },
{ "delete-torrent", "edit-delete", N_("_Delete Files and Remove"), "<shift>Delete", NULL, G_CALLBACK(action_cb) },
{ "new-torrent", "document-new", N_("_New…"), NULL, N_("Create a torrent"), G_CALLBACK(action_cb) },
{ "quit", "application-exit", N_("_Quit"), NULL, NULL, G_CALLBACK(action_cb) },
{ "select-all", "edit-select-all", N_("Select _All"), "<control>A", NULL, G_CALLBACK(action_cb) },
{ "deselect-all", NULL, N_("Dese_lect All"), "<shift><control>A", NULL, G_CALLBACK(action_cb) },
{ "edit-preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, G_CALLBACK(action_cb) },
{ "show-torrent-properties", GTK_STOCK_PROPERTIES, NULL, "<alt>Return", N_("Torrent properties"), G_CALLBACK(action_cb) },
{ "open-torrent-folder", GTK_STOCK_OPEN, N_("Open Fold_er"), "<control>E", NULL, G_CALLBACK(action_cb) },
{ "show-about-dialog", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK(action_cb) },
{ "help", GTK_STOCK_HELP, N_("_Contents"), "F1", NULL, G_CALLBACK(action_cb) },
{ "torrent-reannounce", GTK_STOCK_NETWORK, N_("Ask Tracker for _More Peers"), NULL, NULL, G_CALLBACK(action_cb) },
{ "queue-move-top", GTK_STOCK_GOTO_TOP, N_("Move to _Top"), NULL, NULL, G_CALLBACK(action_cb) },
{ "queue-move-up", GTK_STOCK_GO_UP, N_("Move _Up"), "<control>Up", NULL, G_CALLBACK(action_cb) },
{ "queue-move-down", GTK_STOCK_GO_DOWN, N_("Move _Down"), "<control>Down", NULL, G_CALLBACK(action_cb) },
{ "queue-move-bottom", GTK_STOCK_GOTO_BOTTOM, N_("Move to _Bottom"), NULL, NULL, G_CALLBACK(action_cb) },
{ "edit-preferences", "preferences-system", N_("_Preferences"), NULL, NULL, G_CALLBACK(action_cb) },
{ "show-torrent-properties", "document-properties", N_("_Properties"), "<alt>Return", N_("Torrent properties"), G_CALLBACK(
action_cb) },
{ "open-torrent-folder", "document-open", N_("Open Fold_er"), "<control>E", NULL, G_CALLBACK(action_cb) },
{ "show-about-dialog", "help-about", N_("_About"), NULL, NULL, G_CALLBACK(action_cb) },
{ "help", "help-browser", N_("_Contents"), "F1", NULL, G_CALLBACK(action_cb) },
{ "torrent-reannounce", "network-workgroup", N_("Ask Tracker for _More Peers"), NULL, NULL, G_CALLBACK(action_cb) },
{ "queue-move-top", "go-top", N_("Move to _Top"), NULL, NULL, G_CALLBACK(action_cb) },
{ "queue-move-up", "go-up", N_("Move _Up"), "<control>Up", NULL, G_CALLBACK(action_cb) },
{ "queue-move-down", "go-down", N_("Move _Down"), "<control>Down", NULL, G_CALLBACK(action_cb) },
{ "queue-move-bottom", "go-bottom", N_("Move to _Bottom"), NULL, NULL, G_CALLBACK(action_cb) },
{ "present-main-window", NULL, N_("Present Main Window"), NULL, NULL, G_CALLBACK(action_cb) }
};

View file

@ -2601,8 +2601,10 @@ static void on_edit_trackers(GtkButton* button, gpointer data)
g_string_truncate(gstr, 0);
g_string_append_printf(gstr, _("%s - Edit Trackers"), tr_torrentName(tor));
d = gtk_dialog_new_with_buttons(gstr->str, win, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
d = gtk_dialog_new_with_buttons(gstr->str, win, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
g_signal_connect(d, "response", G_CALLBACK(on_edit_trackers_response), data);
row = 0;
@ -2711,8 +2713,10 @@ static void on_tracker_list_add_button_clicked(GtkButton* button UNUSED, gpointe
g_string_truncate(gstr, 0);
g_string_append_printf(gstr, _("%s - Add Tracker"), tr_torrentName(tor));
w = gtk_dialog_new_with_buttons(gstr->str, GTK_WINDOW(di->dialog), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, NULL);
w = gtk_dialog_new_with_buttons(gstr->str, GTK_WINDOW(di->dialog), GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Add"), GTK_RESPONSE_ACCEPT,
NULL);
g_signal_connect(w, "response", G_CALLBACK(on_add_tracker_response), gdi);
row = 0;
@ -2837,7 +2841,6 @@ static GtkWidget* tracker_page_new(struct DetailsImpl* di)
gtk_box_pack_start(GTK_BOX(v), w, FALSE, FALSE, 0);
w = gtk_button_new_with_mnemonic(_("_Edit"));
gtk_button_set_image(GTK_BUTTON(w), gtk_image_new_from_icon_name(GTK_STOCK_EDIT, GTK_ICON_SIZE_BUTTON));
g_signal_connect(w, "clicked", G_CALLBACK(on_edit_trackers), di);
di->edit_trackers_button = w;
gtk_box_pack_start(GTK_BOX(v), w, FALSE, FALSE, 0);
@ -2899,7 +2902,6 @@ static gboolean periodic_refresh(gpointer data)
static void on_details_window_size_allocated(GtkWidget* gtk_window, GtkAllocation* alloc UNUSED, gpointer gdata UNUSED)
{
GdkWindow* gdk_window = gtk_widget_get_window(gtk_window);
int w, h;
gtk_window_get_size(GTK_WINDOW(gtk_window), &w, &h);
gtr_pref_int_set(TR_KEY_details_window_width, w);
@ -2940,7 +2942,9 @@ GtkWidget* gtr_torrent_details_dialog_new(GtkWindow* parent, TrCore* core)
/* create the dialog */
di->core = core;
di->gstr = g_string_new(NULL);
d = gtk_dialog_new_with_buttons(NULL, parent, 0, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
d = gtk_dialog_new_with_buttons(NULL, parent, 0,
_("_Close"), GTK_RESPONSE_CLOSE,
NULL);
di->dialog = d;
gtk_window_set_role(GTK_WINDOW(d), "tr-info");

View file

@ -151,8 +151,10 @@ void gtr_confirm_remove(GtkWindow* parent, TrCore* core, GSList* torrent_ids, gb
gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(d), "%s", secondary_text->str);
}
gtk_dialog_add_buttons(GTK_DIALOG(d), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
delete_files ? GTK_STOCK_DELETE : GTK_STOCK_REMOVE, GTK_RESPONSE_ACCEPT, NULL);
gtk_dialog_add_buttons(GTK_DIALOG(d),
_("_Cancel"), GTK_RESPONSE_CANCEL,
delete_files ? _("_Delete") : _("_Remove"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(d), GTK_RESPONSE_CANCEL);
g_signal_connect(d, "response", G_CALLBACK(on_remove_dialog_response), dd);
gtk_widget_show_all(d);

View file

@ -468,7 +468,7 @@ enum
ACTIVITY_FILTER_COL_NAME,
ACTIVITY_FILTER_COL_COUNT,
ACTIVITY_FILTER_COL_TYPE,
ACTIVITY_FILTER_COL_STOCK_ID,
ACTIVITY_FILTER_COL_ICON_NAME,
ACTIVITY_FILTER_N_COLS
};
@ -576,19 +576,19 @@ static GtkTreeModel* activity_filter_model_new(GtkTreeModel* tmodel)
int type;
char const* context;
char const* name;
char const* stock_id;
char const* icon_name;
}
types[] =
{
{ ACTIVITY_FILTER_ALL, NULL, N_("All"), NULL },
{ ACTIVITY_FILTER_SEPARATOR, NULL, NULL, NULL },
{ ACTIVITY_FILTER_ACTIVE, NULL, N_("Active"), GTK_STOCK_EXECUTE },
{ ACTIVITY_FILTER_DOWNLOADING, "Verb", NC_("Verb", "Downloading"), GTK_STOCK_GO_DOWN },
{ ACTIVITY_FILTER_SEEDING, "Verb", NC_("Verb", "Seeding"), GTK_STOCK_GO_UP },
{ ACTIVITY_FILTER_PAUSED, NULL, N_("Paused"), GTK_STOCK_MEDIA_PAUSE },
{ ACTIVITY_FILTER_FINISHED, NULL, N_("Finished"), NULL },
{ ACTIVITY_FILTER_VERIFYING, "Verb", NC_("Verb", "Verifying"), GTK_STOCK_REFRESH },
{ ACTIVITY_FILTER_ERROR, NULL, N_("Error"), GTK_STOCK_DIALOG_ERROR }
{ ACTIVITY_FILTER_ACTIVE, NULL, N_("Active"), "system-run" },
{ ACTIVITY_FILTER_DOWNLOADING, "Verb", NC_("Verb", "Downloading"), "network-receive" },
{ ACTIVITY_FILTER_SEEDING, "Verb", NC_("Verb", "Seeding"), "network-transmit" },
{ ACTIVITY_FILTER_PAUSED, NULL, N_("Paused"), "media-playback-pause" },
{ ACTIVITY_FILTER_FINISHED, NULL, N_("Finished"), "media-playback-stop" },
{ ACTIVITY_FILTER_VERIFYING, "Verb", NC_("Verb", "Verifying"), "view-refresh" },
{ ACTIVITY_FILTER_ERROR, NULL, N_("Error"), "dialog-error" }
};
GtkListStore* store = gtk_list_store_new(ACTIVITY_FILTER_N_COLS,
@ -603,7 +603,7 @@ static GtkTreeModel* activity_filter_model_new(GtkTreeModel* tmodel)
gtk_list_store_insert_with_values(store, NULL, -1,
ACTIVITY_FILTER_COL_NAME, name,
ACTIVITY_FILTER_COL_TYPE, types[i].type,
ACTIVITY_FILTER_COL_STOCK_ID, types[i].stock_id,
ACTIVITY_FILTER_COL_ICON_NAME, types[i].icon_name,
-1);
}
@ -674,7 +674,9 @@ static GtkWidget* activity_combo_box_new(GtkTreeModel* tmodel)
r = gtk_cell_renderer_pixbuf_new();
gtk_cell_layout_pack_start(c_cell_layout, r, FALSE);
gtk_cell_layout_set_attributes(c_cell_layout, r, "stock-id", ACTIVITY_FILTER_COL_STOCK_ID, NULL);
gtk_cell_layout_set_attributes(c_cell_layout, r,
"icon-name", ACTIVITY_FILTER_COL_ICON_NAME,
NULL);
gtk_cell_layout_set_cell_data_func(c_cell_layout, r, render_activity_pixbuf_func, NULL, NULL);
r = gtk_cell_renderer_text_new();
@ -976,7 +978,7 @@ GtkWidget* gtr_filter_bar_new(tr_session* session, GtkTreeModel* tmodel, GtkTree
/* add the entry field */
s = gtk_entry_new();
gtk_entry_set_icon_from_stock(GTK_ENTRY(s), GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
gtk_entry_set_icon_from_icon_name(GTK_ENTRY(s), GTK_ENTRY_ICON_SECONDARY, "edit-clear");
g_signal_connect(s, "icon-release", G_CALLBACK(entry_clear), NULL);
gtk_box_pack_start(h_box, s, TRUE, TRUE, 0);

View file

@ -745,7 +745,7 @@ static void app_setup(GtkWindow* wind, struct cbdata* cbdata)
GtkWidget* w = gtk_message_dialog_new(GTK_WINDOW(wind), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_OTHER,
GTK_BUTTONS_NONE, "%s", _("Transmission is a file sharing program. When you run a torrent, its data will be "
"made available to others by means of upload. Any content you share is your sole responsibility."));
gtk_dialog_add_button(GTK_DIALOG(w), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT);
gtk_dialog_add_button(GTK_DIALOG(w), _("_Cancel"), GTK_RESPONSE_REJECT);
gtk_dialog_add_button(GTK_DIALOG(w), _("I _Agree"), GTK_RESPONSE_ACCEPT);
gtk_dialog_set_default_response(GTK_DIALOG(w), GTK_RESPONSE_ACCEPT);
@ -973,7 +973,7 @@ static void on_app_exit(gpointer vdata)
NULL);
gtk_container_add(GTK_CONTAINER(c), p);
w = gtk_image_new_from_icon_name(GTK_STOCK_NETWORK, GTK_ICON_SIZE_DIALOG);
w = gtk_image_new_from_icon_name("network-workgroup", GTK_ICON_SIZE_DIALOG);
gtk_grid_attach(GTK_GRID(p), w, 0, 0, 1, 2);
w = gtk_label_new(NULL);

View file

@ -181,7 +181,10 @@ static void makeProgressDialog(GtkWidget* parent, MakeMetaUI* ui)
GtkWidget* fr;
d = gtk_dialog_new_with_buttons(_("New Torrent"), GTK_WINDOW(parent), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT, NULL);
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Close"), GTK_RESPONSE_CLOSE,
_("_Add"), GTK_RESPONSE_ACCEPT,
NULL);
ui->progress_dialog = d;
g_signal_connect(d, "response", G_CALLBACK(onProgressDialogResponse), ui);
@ -431,8 +434,10 @@ GtkWidget* gtr_torrent_creation_dialog_new(GtkWindow* parent, TrCore* core)
ui->core = core;
d = gtk_dialog_new_with_buttons(_("New Torrent"), parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE, GTK_STOCK_NEW, GTK_RESPONSE_ACCEPT, NULL);
d = gtk_dialog_new_with_buttons(_("New Torrent"), parent, GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Close"), GTK_RESPONSE_CLOSE,
_("_New"), GTK_RESPONSE_ACCEPT,
NULL);
ui->dialog = d;
g_signal_connect(d, "response", G_CALLBACK(onResponse), ui);
g_object_set_data_full(G_OBJECT(d), "ui", ui, freeMetaUI);

View file

@ -206,8 +206,10 @@ static void onSaveDialogResponse(GtkWidget* d, int response, gpointer data)
static void onSaveRequest(GtkWidget* w, gpointer data)
{
GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(w));
GtkWidget* d = gtk_file_chooser_dialog_new(_("Save Log"), window, GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
GtkWidget* d = gtk_file_chooser_dialog_new(_("Save Log"), window, GTK_FILE_CHOOSER_ACTION_SAVE,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
g_signal_connect(d, "response", G_CALLBACK(onSaveDialogResponse), data);
gtk_widget_show(d);
@ -467,21 +469,36 @@ GtkWidget* gtr_message_log_window_new(GtkWindow* parent, TrCore* core)
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
gtk_style_context_add_class(gtk_widget_get_style_context(toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
item = gtk_tool_button_new_from_stock(GTK_STOCK_SAVE_AS);
g_object_set(G_OBJECT(item), "is-important", TRUE, NULL);
item = gtk_tool_button_new(NULL, NULL);
g_object_set(item,
"icon-name", "document-save-as",
"is-important", TRUE,
"label", _("Save _As"),
"use-underline", TRUE,
NULL);
g_signal_connect(item, "clicked", G_CALLBACK(onSaveRequest), data);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
item = gtk_tool_button_new_from_stock(GTK_STOCK_CLEAR);
g_object_set(G_OBJECT(item), "is-important", TRUE, NULL);
item = gtk_tool_button_new(NULL, NULL);
g_object_set(item,
"icon-name", "edit-clear",
"is-important", TRUE,
"label", _("Clear"),
"use-underline", TRUE,
NULL);
g_signal_connect(item, "clicked", G_CALLBACK(onClearRequest), data);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
item = gtk_separator_tool_item_new();
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);
item = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_MEDIA_PAUSE);
g_object_set(G_OBJECT(item), "is-important", TRUE, NULL);
item = gtk_toggle_tool_button_new();
g_object_set(G_OBJECT(item),
"icon-name", "media-playback-pause",
"is-important", TRUE,
"label", _("P_ause"),
"use-underline", TRUE,
NULL);
g_signal_connect(item, "toggled", G_CALLBACK(onPauseToggled), data);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, -1);

View file

@ -281,8 +281,10 @@ GtkWidget* gtr_torrent_options_dialog_new(GtkWindow* parent, TrCore* core, tr_ct
GSList* list;
/* make the dialog */
d = gtk_dialog_new_with_buttons(_("Torrent Options"), parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
d = gtk_dialog_new_with_buttons(_("Torrent Options"), parent, GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(d), GTK_RESPONSE_ACCEPT);
if (!tr_ctorGetDownloadDir(ctor, TR_FORCE, &str))
@ -452,8 +454,10 @@ GtkWidget* gtr_torrent_open_from_file_dialog_new(GtkWindow* parent, TrCore* core
GtkWidget* c;
char const* folder;
w = gtk_file_chooser_dialog_new(_("Open a Torrent"), parent, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
w = gtk_file_chooser_dialog_new(_("Open a Torrent"), parent, GTK_FILE_CHOOSER_ACTION_OPEN,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(w), TRUE);
addTorrentFilters(GTK_FILE_CHOOSER(w));
g_signal_connect(w, "response", G_CALLBACK(onOpenDialogResponse), core);
@ -515,8 +519,10 @@ GtkWidget* gtr_torrent_open_from_url_dialog_new(GtkWindow* parent, TrCore* core)
GtkWidget* t;
GtkWidget* w;
w = gtk_dialog_new_with_buttons(_("Open URL"), parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
w = gtk_dialog_new_with_buttons(_("Open URL"), parent, GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
g_signal_connect(w, "response", G_CALLBACK(onOpenURLResponse), core);
row = 0;

View file

@ -137,7 +137,9 @@ GtkWidget* gtr_relocate_dialog_new(GtkWindow* parent, TrCore* core, GSList* torr
struct relocate_dialog_data* data;
d = gtk_dialog_new_with_buttons(_("Set Torrent Location"), parent, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, NULL);
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Apply"), GTK_RESPONSE_APPLY,
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(d), GTK_RESPONSE_CANCEL);
g_signal_connect(d, "response", G_CALLBACK(onResponse), NULL);

View file

@ -93,7 +93,10 @@ static void dialogResponse(GtkDialog* dialog, gint response, gpointer gdata)
"Resetting them doesn't affect the statistics logged by your BitTorrent trackers.");
int const flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL;
GtkWidget* w = gtk_message_dialog_new(GTK_WINDOW(dialog), flags, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", primary);
gtk_dialog_add_buttons(GTK_DIALOG(w), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, _("_Reset"), TR_RESPONSE_RESET, NULL);
gtk_dialog_add_buttons(GTK_DIALOG(w),
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Reset"), TR_RESPONSE_RESET,
NULL);
gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(w), "%s", secondary);
if (gtk_dialog_run(GTK_DIALOG(w)) == TR_RESPONSE_RESET)
@ -120,8 +123,10 @@ GtkWidget* gtr_stats_dialog_new(GtkWindow* parent, TrCore* core)
guint row = 0;
struct stat_ui* ui = g_new0(struct stat_ui, 1);
d = gtk_dialog_new_with_buttons(_("Statistics"), parent, GTK_DIALOG_DESTROY_WITH_PARENT, _("_Reset"), TR_RESPONSE_RESET,
GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
d = gtk_dialog_new_with_buttons(_("Statistics"), parent, GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Reset"), TR_RESPONSE_RESET,
_("_Close"), GTK_RESPONSE_CLOSE,
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(d), GTK_RESPONSE_CLOSE);
t = hig_workarea_create();
ui->core = core;

View file

@ -839,12 +839,12 @@ static GtkWidget* remotePage(GObject* core)
page->whitelist_widgets = g_slist_prepend(page->whitelist_widgets, w);
h = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, GUI_PAD);
w = gtk_button_new_from_stock(GTK_STOCK_REMOVE);
w = gtk_button_new_with_mnemonic(_("_Remove"));
g_signal_connect(w, "clicked", G_CALLBACK(onRemoveWhitelistClicked), page);
page->remove_button = w;
onWhitelistSelectionChanged(sel, page);
gtk_box_pack_start(GTK_BOX(h), w, TRUE, TRUE, 0);
w = gtk_button_new_from_stock(GTK_STOCK_ADD);
w = gtk_button_new_with_mnemonic(_("_Add"));
page->whitelist_widgets = g_slist_prepend(page->whitelist_widgets, w);
g_signal_connect(w, "clicked", G_CALLBACK(onAddWhitelistClicked), page);
g_object_set(h, "halign", GTK_ALIGN_END, "valign", GTK_ALIGN_CENTER, NULL);
@ -1241,8 +1241,10 @@ GtkWidget* gtr_prefs_dialog_new(GtkWindow* parent, GObject* core)
data->core = TR_CORE(core);
data->core_prefs_tag = g_signal_connect(TR_CORE(core), "prefs-changed", G_CALLBACK(on_core_prefs_changed), data);
d = gtk_dialog_new_with_buttons(_("Transmission Preferences"), parent, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_HELP,
GTK_RESPONSE_HELP, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
d = gtk_dialog_new_with_buttons(_("Transmission Preferences"), parent, GTK_DIALOG_DESTROY_WITH_PARENT,
_("_Help"), GTK_RESPONSE_HELP,
_("_Close"), GTK_RESPONSE_CLOSE,
NULL);
g_object_weak_ref(G_OBJECT(d), on_prefs_dialog_destroyed, data);
gtk_window_set_role(GTK_WINDOW(d), "transmission-preferences-dialog");
gtk_container_set_border_width(GTK_CONTAINER(d), GUI_PAD);