Changeset 12027


Ignore:
Timestamp:
Feb 24, 2011, 3:10:18 PM (12 years ago)
Author:
jordan
Message:

(2.2x) backport r11978 for #4038 "Prefs dialog's blocklist section allows the 'update' button to be clicked when no blocklist is specified"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2x/gtk/tr-prefs.c

    r11738 r12027  
    458458
    459459static void
     460on_blocklist_url_changed( GtkEditable * e, gpointer gbutton )
     461{
     462    gchar * url = gtk_editable_get_chars( e, 0, -1 );
     463    const gboolean err = tr_urlParse( url, -1, NULL, NULL, NULL, NULL );
     464    gtk_widget_set_sensitive( GTK_WIDGET( gbutton ), !err );
     465    g_free( url );
     466}
     467
     468static void
    460469onIntComboChanged( GtkComboBox * combo_box, gpointer core )
    461470{
     
    517526    g_signal_connect( data->check, "toggled", G_CALLBACK( target_cb ), w ); target_cb( data->check, w );
    518527    hig_workarea_add_wide_control( t, &row, h );
     528    g_signal_connect( e, "changed", G_CALLBACK( on_blocklist_url_changed ), data->updateBlocklistButton );
     529    on_blocklist_url_changed( GTK_EDITABLE( e ), data->updateBlocklistButton );
    519530
    520531    s = _( "Enable _automatic updates" );
Note: See TracChangeset for help on using the changeset viewer.