Changeset 9504


Ignore:
Timestamp:
Nov 9, 2009, 7:38:22 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #2567: Close the preferences window when the torrent is deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r9427 r9504  
    3535struct DetailsImpl
    3636{
     37    GtkWidget * dialog;
     38
    3739    GtkWidget * peersPage;
    3840    GtkWidget * trackerPage;
     
    20862088    refreshOptions( di, torrents, n );
    20872089
     2090    if( n == 0 )
     2091        gtk_dialog_response( GTK_DIALOG( di->dialog ), GTK_RESPONSE_CLOSE );
     2092
    20882093    g_free( torrents );
    20892094}
     
    21072112}
    21082113
    2109 static void
    2110 response_cb( GtkDialog * dialog, int a UNUSED, gpointer b UNUSED )
    2111 {
    2112     GtkWidget * w = GTK_WIDGET( dialog );
    2113     torrent_inspector_set_torrents( w, NULL );
    2114     gtk_widget_destroy( w );
    2115 }
    2116 
    21172114GtkWidget*
    21182115torrent_inspector_new( GtkWindow * parent, TrCore * core )
     
    21262123                                     GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
    21272124                                     NULL );
     2125    di->dialog = d;
    21282126    gtk_window_set_role( GTK_WINDOW( d ), "tr-info" );
    2129     g_signal_connect( d, "response", G_CALLBACK( response_cb ), NULL );
     2127    g_signal_connect_swapped( d, "response",
     2128                              G_CALLBACK( gtk_widget_destroy ), d );
    21302129    gtk_dialog_set_has_separator( GTK_DIALOG( d ), FALSE );
    21312130    gtk_container_set_border_width( GTK_CONTAINER( d ), GUI_PAD );
     
    21612160    di->periodic_refresh_tag = gtr_timeout_add_seconds( UPDATE_INTERVAL_SECONDS,
    21622161                                                        periodic_refresh, di );
    2163     periodic_refresh( di );
    21642162    gtk_widget_show_all( GTK_DIALOG( d )->vbox );
    21652163    return d;
Note: See TracChangeset for help on using the changeset viewer.