From 300f07010402abb148302c2fea23a632dc1ed5c0 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 13 Jan 2012 22:10:26 +0000 Subject: [PATCH] Silence a minor compiler warning. We used to pass no button text + response_id pairs when creating the dialog because only gtk_dialog_add_button() would return back the actual button widget s.t. we could use a grab on it. However as of GTK+ 2.20 we can use gtk_dialog_get_widget_for_response() to get the button, so we can create dialogs in the more common way (which also fixes the gcc warning) --- gtk/open-dialog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/open-dialog.c b/gtk/open-dialog.c index 790ff68f4..d10497003 100644 --- a/gtk/open-dialog.c +++ b/gtk/open-dialog.c @@ -261,7 +261,6 @@ gtr_torrent_options_dialog_new( GtkWindow * parent, TrCore * core, tr_ctor * cto GtkWidget * d; GtkWidget * t; GtkWidget * l; - GtkWidget * grab; GtkWidget * source_chooser; struct OpenData * data; bool flag; @@ -271,9 +270,9 @@ gtr_torrent_options_dialog_new( GtkWindow * parent, TrCore * core, tr_ctor * cto /* 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 ); - gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL ); - grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT ); gtk_dialog_set_default_response( GTK_DIALOG( d ), GTK_RESPONSE_ACCEPT ); gtk_dialog_set_alternative_button_order( GTK_DIALOG( d ), @@ -381,7 +380,8 @@ gtr_torrent_options_dialog_new( GtkWindow * parent, TrCore * core, tr_ctor * cto sourceChanged( GTK_FILE_CHOOSER_BUTTON( w ), data ); gtr_dialog_set_content( GTK_DIALOG( d ), t ); - gtk_widget_grab_focus( grab ); + w = gtk_dialog_get_widget_for_response( GTK_DIALOG( d ), GTK_RESPONSE_ACCEPT ); + gtk_widget_grab_focus( w ); return d; }