Changeset 4009


Ignore:
Timestamp:
Nov 29, 2007, 2:32:10 AM (14 years ago)
Author:
charles
Message:

put a shutdown message in the gtk+ client - http://img208.imageshack.us/img208/7118/closinggy4.png

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r4000 r4009  
    432432}
    433433
     434/* since there are no buttons in the dialog, gtk tries to
     435 * select one of the labels, which looks ugly... so force
     436 * the dialog's primary and secondary labels to be unselectable */
     437static void
     438deselectLabels( GtkWidget * w, gpointer unused UNUSED )
     439{
     440    if( GTK_IS_LABEL( w ) )
     441        gtk_label_set_selectable( GTK_LABEL(w), FALSE );
     442    else if( GTK_IS_CONTAINER( w ) )
     443        gtk_container_foreach( GTK_CONTAINER(w), deselectLabels, NULL );
     444}
     445
    434446static void
    435447wannaquit( void * vdata )
    436448{
     449    GtkWidget * w;
    437450    struct cbdata * cbdata = vdata;
    438451
     
    443456    }
    444457
     458    w = gtk_message_dialog_new( cbdata->wind,
     459                                GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
     460                                GTK_MESSAGE_INFO,
     461                                GTK_BUTTONS_NONE,
     462                                _("Closing Connections" ) );
     463    gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(w),
     464                                              _("Sending upload/download totals to tracker..." ) );
     465    gtk_container_foreach( GTK_CONTAINER(GTK_DIALOG(w)->vbox), deselectLabels, NULL );
     466    gtk_widget_show( w );
     467
    445468    /* clear the UI */
    446469    gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
    447470    gtk_widget_set_sensitive( GTK_WIDGET( cbdata->wind ), FALSE );
     471
     472   
    448473
    449474    /* shut down libT */
Note: See TracChangeset for help on using the changeset viewer.