put a shutdown message in the gtk+ client - http://img208.imageshack.us/img208/7118/closinggy4.png
This commit is contained in:
parent
f9670dc7ac
commit
4f1837c891
25
gtk/main.c
25
gtk/main.c
|
@ -431,9 +431,22 @@ quitThreadFunc( gpointer gdata )
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* since there are no buttons in the dialog, gtk tries to
|
||||||
|
* select one of the labels, which looks ugly... so force
|
||||||
|
* the dialog's primary and secondary labels to be unselectable */
|
||||||
|
static void
|
||||||
|
deselectLabels( GtkWidget * w, gpointer unused UNUSED )
|
||||||
|
{
|
||||||
|
if( GTK_IS_LABEL( w ) )
|
||||||
|
gtk_label_set_selectable( GTK_LABEL(w), FALSE );
|
||||||
|
else if( GTK_IS_CONTAINER( w ) )
|
||||||
|
gtk_container_foreach( GTK_CONTAINER(w), deselectLabels, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wannaquit( void * vdata )
|
wannaquit( void * vdata )
|
||||||
{
|
{
|
||||||
|
GtkWidget * w;
|
||||||
struct cbdata * cbdata = vdata;
|
struct cbdata * cbdata = vdata;
|
||||||
|
|
||||||
/* stop the update timer */
|
/* stop the update timer */
|
||||||
|
@ -442,10 +455,22 @@ wannaquit( void * vdata )
|
||||||
cbdata->timer = 0;
|
cbdata->timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w = gtk_message_dialog_new( cbdata->wind,
|
||||||
|
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
|
GTK_MESSAGE_INFO,
|
||||||
|
GTK_BUTTONS_NONE,
|
||||||
|
_("Closing Connections" ) );
|
||||||
|
gtk_message_dialog_format_secondary_text( GTK_MESSAGE_DIALOG(w),
|
||||||
|
_("Sending upload/download totals to tracker..." ) );
|
||||||
|
gtk_container_foreach( GTK_CONTAINER(GTK_DIALOG(w)->vbox), deselectLabels, NULL );
|
||||||
|
gtk_widget_show( w );
|
||||||
|
|
||||||
/* clear the UI */
|
/* clear the UI */
|
||||||
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
|
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
|
||||||
gtk_widget_set_sensitive( GTK_WIDGET( cbdata->wind ), FALSE );
|
gtk_widget_set_sensitive( GTK_WIDGET( cbdata->wind ), FALSE );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* shut down libT */
|
/* shut down libT */
|
||||||
g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
|
g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue