Changeset 4159


Ignore:
Timestamp:
Dec 13, 2007, 8:46:19 PM (14 years ago)
Author:
charles
Message:

more prefs dialog cleanup from wereHamster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_prefs.c

    r4156 r4159  
    192192}
    193193
     194static void
     195target_cb( GtkWidget * widget, gpointer target )
     196{
     197    gtk_widget_set_sensitive( GTK_WIDGET(target), gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ) );
     198}
     199
     200static void
     201target_invert_cb( GtkWidget * widget, gpointer target )
     202{
     203    gtk_widget_set_sensitive( GTK_WIDGET(target), !gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ) );
     204}
     205
    194206GtkWidget *
    195207tr_prefs_dialog_new( GObject * core, GtkWindow * parent )
     
    218230        w = new_check_button( s, PREF_KEY_UL_LIMIT_ENABLED, core );
    219231        w2 = new_spin_button( PREF_KEY_UL_LIMIT, core, 0, INT_MAX );
     232        gtk_widget_set_sensitive( GTK_WIDGET(w2), pref_flag_get( PREF_KEY_UL_LIMIT_ENABLED ) );
     233        g_signal_connect( w, "toggled", G_CALLBACK(target_cb), w2 );
    220234        hig_workarea_add_double_control( t, &row, w, w2 );
    221235
     
    223237        w = new_check_button( s, PREF_KEY_DL_LIMIT_ENABLED, core );
    224238        w2 = new_spin_button( PREF_KEY_DL_LIMIT, core, 0, INT_MAX );
     239        gtk_widget_set_sensitive( GTK_WIDGET(w2), pref_flag_get( PREF_KEY_DL_LIMIT_ENABLED ) );
     240        g_signal_connect( w, "toggled", G_CALLBACK(target_cb), w2 );
    225241        hig_workarea_add_double_control( t, &row, w, w2 );
    226242
     
    232248        w = new_check_button( s, PREF_KEY_DIR_ASK, core );
    233249        w2 = new_path_chooser_button( PREF_KEY_DIR_DEFAULT, core );
     250        gtk_widget_set_sensitive( GTK_WIDGET(w2), !pref_flag_get( PREF_KEY_DIR_ASK ) );
     251        g_signal_connect( w, "toggled", G_CALLBACK(target_invert_cb), w2 );
    234252        hig_workarea_add_double_control( t, &row, w, w2 );
    235253
Note: See TracChangeset for help on using the changeset viewer.