Changeset 6681


Ignore:
Timestamp:
Sep 1, 2008, 10:01:13 AM (13 years ago)
Author:
muks
Message:

Apply changes in scheduled limits when they're updated during the schedule

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r6680 r6681  
    554554        last_state = in_sched_state;
    555555    }
     556    else if( in_sched_state )
     557    {
     558        static int old_dl_limit = 0, old_ul_limit = 0;
     559        int dl_limit = pref_int_get( PREF_KEY_SCHED_DL_LIMIT );
     560        int ul_limit = pref_int_get( PREF_KEY_SCHED_UL_LIMIT );
     561
     562        if( ( dl_limit != old_dl_limit ) || ( ul_limit != old_ul_limit ) )
     563        {
     564            tr_sessionSetSpeedLimitEnabled( tr, TR_DOWN, TRUE );
     565            tr_sessionSetSpeedLimit( tr, TR_DOWN, dl_limit );
     566            tr_sessionSetSpeedLimitEnabled( tr, TR_UP, TRUE );
     567            tr_sessionSetSpeedLimit( tr, TR_UP, ul_limit );
     568
     569            old_dl_limit = dl_limit;
     570            old_ul_limit = ul_limit;
     571        }
     572    }
    556573
    557574    return TRUE;
     
    10701087        const int limit = pref_int_get( key );
    10711088        tr_sessionSetSpeedLimit( tr, TR_UP, limit );
     1089    }
     1090    else if ( !strncmp( key, "sched-", 6 ) )
     1091    {
     1092        updateScheduledLimits( tr );
    10721093    }
    10731094    else if( !strcmp( key, PREF_KEY_PORT_FORWARDING ) )
Note: See TracChangeset for help on using the changeset viewer.