1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-21 21:57:01 +00:00

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)
This commit is contained in:
Jordan Lee 2012-01-13 22:10:26 +00:00
parent 3de5847158
commit 300f070104

View file

@ -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;
}