1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

(trunk, qt) #4991 'control temporary speed limit from icon tray' -- added, patches by rb07 and samkpo

This commit is contained in:
Jordan Lee 2012-08-19 00:01:54 +00:00
parent 4e398476b4
commit 4d111ab95a
2 changed files with 10 additions and 0 deletions

View file

@ -229,6 +229,10 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
actionGroup->addAction( ui.action_SortBySize );
actionGroup->addAction( ui.action_SortByState );
myAltSpeedAction = new QAction( tr( "Speed Limits" ), this );
myAltSpeedAction->setIcon( myPrefs.get<bool>(Prefs::ALT_SPEED_LIMIT_ENABLED) ? mySpeedModeOnIcon : mySpeedModeOffIcon );
connect( myAltSpeedAction, SIGNAL(triggered()), this, SLOT(toggleSpeedMode()) );
QMenu * menu = new QMenu( );
menu->addAction( ui.action_OpenFile );
menu->addAction( ui.action_AddURL );
@ -239,6 +243,7 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
menu->addSeparator( );
menu->addAction( ui.action_StartAll );
menu->addAction( ui.action_PauseAll );
menu->addAction( myAltSpeedAction );
menu->addSeparator( );
menu->addAction( ui.action_Quit );
myTrayIcon.setContextMenu( menu );
@ -937,7 +942,11 @@ TrMainWindow :: setCompactView( bool visible )
void
TrMainWindow :: toggleSpeedMode( )
{
bool mode;
myPrefs.toggleBool( Prefs :: ALT_SPEED_LIMIT_ENABLED );
mode = myPrefs.get<bool>( Prefs::ALT_SPEED_LIMIT_ENABLED );
myAltSpeedAction->setIcon( mode ? mySpeedModeOnIcon : mySpeedModeOffIcon );
}
void
TrMainWindow :: setToolbarVisible( bool visible )

View file

@ -151,6 +151,7 @@ class TrMainWindow: public QMainWindow
QWidget * createStatusBar( void );
QWidget * myStatusBar;
QPushButton * myAltSpeedButton;
QAction * myAltSpeedAction;
QPushButton * myOptionsButton;
QLabel * myVisibleCountLabel;
QPushButton * myStatsModeButton;