Changeset 13446


Ignore:
Timestamp:
Aug 19, 2012, 12:01:54 AM (9 years ago)
Author:
jordan
Message:

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

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r13438 r13446  
    230230    actionGroup->addAction( ui.action_SortByState );
    231231
     232    myAltSpeedAction = new QAction( tr( "Speed Limits" ), this );
     233    myAltSpeedAction->setIcon( myPrefs.get<bool>(Prefs::ALT_SPEED_LIMIT_ENABLED) ? mySpeedModeOnIcon : mySpeedModeOffIcon );
     234    connect( myAltSpeedAction, SIGNAL(triggered()), this, SLOT(toggleSpeedMode()) );
     235
    232236    QMenu * menu = new QMenu( );
    233237    menu->addAction( ui.action_OpenFile );
     
    240244    menu->addAction( ui.action_StartAll );
    241245    menu->addAction( ui.action_PauseAll );
     246    menu->addAction( myAltSpeedAction );
    242247    menu->addSeparator( );
    243248    menu->addAction( ui.action_Quit );
     
    938943TrMainWindow :: toggleSpeedMode( )
    939944{
     945    bool mode;
     946   
    940947    myPrefs.toggleBool( Prefs :: ALT_SPEED_LIMIT_ENABLED );
     948    mode = myPrefs.get<bool>( Prefs::ALT_SPEED_LIMIT_ENABLED );
     949    myAltSpeedAction->setIcon( mode ? mySpeedModeOnIcon : mySpeedModeOffIcon );
    941950}
    942951void
  • trunk/qt/mainwin.h

    r12611 r13446  
    152152        QWidget * myStatusBar;
    153153        QPushButton * myAltSpeedButton;
     154        QAction * myAltSpeedAction;
    154155        QPushButton * myOptionsButton;
    155156        QLabel * myVisibleCountLabel;
Note: See TracChangeset for help on using the changeset viewer.