Ticket #2570: transmission-bug-2570-radio-button-active.2.patch

File transmission-bug-2570-radio-button-active.2.patch, 2.1 KB (added by WouterBolsterlee, 13 years ago)

Alternative patch with some additional cleanups

  • gtk/details.c

    === modified file 'gtk/details.c'
     
    435435ratio_spun_cb( GtkSpinButton * s, struct DetailsImpl * di )
    436436{
    437437    torrent_set_real( di, "seedRatioLimit", gtk_spin_button_get_value( s ) );
     438    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( di->seedCustomRadio ), TRUE );
    438439}
    439440
    440441static void
     
    546547    group = NULL;
    547548    s = _( "Use _global settings" );
    548549    w = gtk_radio_button_new_with_mnemonic( group, s );
    549     group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( w ) );
    550550    hig_workarea_add_wide_control( t, &row, w );
    551551    g_object_set_data( G_OBJECT( w ), RATIO_KEY, GINT_TO_POINTER( TR_RATIOLIMIT_GLOBAL ) );
    552552    tag = g_signal_connect( w, "toggled", G_CALLBACK( ratio_mode_changed_cb ), d );
    553553    d->seedGlobalRadio = w;
    554554    d->seedGlobalRadioTag = tag;
    555555
    556     w = gtk_radio_button_new_with_mnemonic( group, _( "Seed _regardless of ratio" ) );
    557     group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( w ) );
     556    s = _( "Seed _regardless of ratio" );
     557    w = gtk_radio_button_new_with_mnemonic_from_widget( w, s );
    558558    hig_workarea_add_wide_control( t, &row, w );
    559559    g_object_set_data( G_OBJECT( w ), RATIO_KEY, GINT_TO_POINTER( TR_RATIOLIMIT_UNLIMITED ) );
    560560    tag = g_signal_connect( w, "toggled", G_CALLBACK( ratio_mode_changed_cb ), d );
     
    563563
    564564    h = gtk_hbox_new( FALSE, GUI_PAD );
    565565    s = _( "_Seed torrent until its ratio reaches:" );
    566     w = gtk_radio_button_new_with_mnemonic( group, s );
     566    w = gtk_radio_button_new_with_mnemonic_from_widget( w, s );
    567567    d->seedCustomRadio = w;
    568568    g_object_set_data( G_OBJECT( w ), RATIO_KEY, GINT_TO_POINTER( TR_RATIOLIMIT_SINGLE ) );
    569569    tag = g_signal_connect( w, "toggled", G_CALLBACK( ratio_mode_changed_cb ), d );
    570570    d->seedCustomRadioTag = tag;
    571     group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( w ) );
    572571    gtk_box_pack_start( GTK_BOX( h ), w, FALSE, FALSE, 0 );
    573572    w = gtk_spin_button_new_with_range( 0, INT_MAX, .05 );
    574573    gtk_spin_button_set_digits( GTK_SPIN_BUTTON( w ), 2 );