guint seedGlobalRadioTag;
guint seedCustomRadioTag;
guint seedCustomSpinTag;
+ guint maxPeersSpinTag;
GtkWidget * state_lb;
GtkWidget * progress_lb;
/* seedCustomSpin */
if( n ) {
const double baseline = tr_torrentGetRatioLimit( torrents[0] );
- int i;
- for( i=1; i<n; ++i )
- if( (int)(100*baseline) != (int)(100*tr_torrentGetRatioLimit(torrents[i])) )
- break;
- if( i == n )
- set_double_spin_if_different( di->seedCustomSpin,
- di->seedCustomSpinTag, baseline );
+ set_double_spin_if_different( di->seedCustomSpin,
+ di->seedCustomSpinTag, baseline );
+ }
+
+ /* maxPeersSpin */
+ if( n ) {
+ const int baseline = tr_torrentGetPeerLimit( torrents[0] );
+ set_int_spin_if_different( di->maxPeersSpin,
+ di->maxPeersSpinTag, baseline );
}
}
w = gtk_spin_button_new_with_range( 1, 3000, 5 );
hig_workarea_add_row( t, &row, _( "_Maximum peers:" ), w, w );
- g_signal_connect( w, "value-changed", G_CALLBACK( max_peers_spun_cb ), d );
+ tag = g_signal_connect( w, "value-changed", G_CALLBACK( max_peers_spun_cb ), d );
d->maxPeersSpin = w;
+ d->maxPeersSpinTag = tag;
hig_workarea_finish( t, &row );
return t;
action_sensitize( "delete-torrent", counts.totalCount != 0 );
action_sensitize( "verify-torrent", counts.totalCount != 0 );
action_sensitize( "open-torrent-folder", counts.totalCount == 1 );
- action_sensitize( "show-torrent-properties", counts.totalCount != 0 );
canUpdate = 0;
gtk_tree_selection_selected_foreach( s, accumulateCanUpdateForeach, &canUpdate );
}
static gpointer
-quitThreadFunc( gpointer core )
+quitThreadFunc( gpointer gdata )
{
- tr_core_close( core );
+ struct cbdata * cbdata = gdata;
+
+ tr_core_close( cbdata->core );
+
+ /* shutdown the gui */
+ if( cbdata->details )
+ gtk_widget_destroy( GTK_WIDGET( cbdata->details ) );
+ if( cbdata->prefs )
+ gtk_widget_destroy( GTK_WIDGET( cbdata->prefs ) );
+ if( cbdata->wind )
+ gtk_widget_destroy( GTK_WIDGET( cbdata->wind ) );
+ g_object_unref( cbdata->core );
+ if( cbdata->icon )
+ g_object_unref( cbdata->icon );
+ if( cbdata->errqueue ) {
+ g_slist_foreach( cbdata->errqueue, (GFunc)g_free, NULL );
+ g_slist_free( cbdata->errqueue );
+ }
+ if( cbdata->dupqueue ) {
+ g_slist_foreach( cbdata->dupqueue, (GFunc)g_free, NULL );
+ g_slist_free( cbdata->dupqueue );
+ }
+ g_free( cbdata );
+
gtk_main_quit( );
return NULL;
}
static void
wannaquit( void * vdata )
{
- TrCore * core;
GtkWidget *r, *p, *b, *w, *c;
struct cbdata *cbdata = vdata;
/* clear the UI */
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
- /* shutdown the gui */
- core = cbdata->core;
- if( cbdata->details )
- gtk_widget_destroy( GTK_WIDGET( cbdata->details ) );
- if( cbdata->prefs )
- gtk_widget_destroy( GTK_WIDGET( cbdata->prefs ) );
- if( cbdata->wind )
- gtk_widget_destroy( GTK_WIDGET( cbdata->wind ) );
- g_object_unref( cbdata->core );
- if( cbdata->icon )
- g_object_unref( cbdata->icon );
- if( cbdata->errqueue ) {
- g_slist_foreach( cbdata->errqueue, (GFunc)g_free, NULL );
- g_slist_free( cbdata->errqueue );
- }
- if( cbdata->dupqueue ) {
- g_slist_foreach( cbdata->dupqueue, (GFunc)g_free, NULL );
- g_slist_free( cbdata->dupqueue );
- }
- g_free( cbdata );
-
/* shut down libT */
- g_thread_create( quitThreadFunc, core, TRUE, NULL );
+ g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
}
static void