Ignore:
Timestamp:
Jan 13, 2012, 10:10:26 PM (11 years ago)
Author:
jordan
Message:

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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/open-dialog.c

    r12679 r13157  
    262262    GtkWidget *      t;
    263263    GtkWidget *      l;
    264     GtkWidget *      grab;
    265264    GtkWidget *      source_chooser;
    266265    struct OpenData * data;
     
    272271    d = gtk_dialog_new_with_buttons( _( "Torrent Options" ), parent,
    273272                                     GTK_DIALOG_DESTROY_WITH_PARENT,
     273                                     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
     274                                     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
    274275                                     NULL );
    275     gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL );
    276     grab = gtk_dialog_add_button( GTK_DIALOG( d ), GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT );
    277276    gtk_dialog_set_default_response( GTK_DIALOG( d ),
    278277                                     GTK_RESPONSE_ACCEPT );
     
    382381
    383382    gtr_dialog_set_content( GTK_DIALOG( d ), t );
    384     gtk_widget_grab_focus( grab );
     383    w = gtk_dialog_get_widget_for_response( GTK_DIALOG( d ), GTK_RESPONSE_ACCEPT );
     384    gtk_widget_grab_focus( w );
    385385    return d;
    386386}
Note: See TracChangeset for help on using the changeset viewer.