mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +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:
parent
3de5847158
commit
300f070104
1 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue