This commit is contained in:
Charles Kerr 2007-11-29 02:32:10 +00:00
parent f9670dc7ac
commit 4f1837c891
1 changed files with 25 additions and 0 deletions

View File

@ -431,9 +431,22 @@ quitThreadFunc( gpointer gdata )
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
wannaquit( void * vdata )
{
GtkWidget * w;
struct cbdata * cbdata = vdata;
/* stop the update timer */
@ -442,10 +455,22 @@ wannaquit( void * vdata )
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 */
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
gtk_widget_set_sensitive( GTK_WIDGET( cbdata->wind ), FALSE );
/* shut down libT */
g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
}