VirtualBox

Ignore:
Timestamp:
May 26, 2014 12:18:11 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Move 'Global Preferences' to global action-pool.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r51378 r51390  
    277277}
    278278
     279
     280class UIActionSimplePreferences : public UIActionSimple
     281{
     282    Q_OBJECT;
     283
     284public:
     285
     286    UIActionSimplePreferences(UIActionPool *pParent)
     287        : UIActionSimple(pParent, ":/global_settings_16px.png")
     288    {
     289        setMenuRole(QAction::PreferencesRole);
     290        retranslateUi();
     291    }
     292
     293protected:
     294
     295    QString shortcutExtraDataID() const
     296    {
     297        return QString("Preferences");
     298    }
     299
     300    QKeySequence defaultShortcut(UIActionPoolType) const
     301    {
     302        switch (actionPool()->type())
     303        {
     304            case UIActionPoolType_Selector: return QKeySequence("Ctrl+G");
     305            case UIActionPoolType_Runtime: break;
     306        }
     307        return QKeySequence();
     308    }
     309
     310    void retranslateUi()
     311    {
     312        setName(QApplication::translate("UIActionPool", "&Preferences...", "global settings"));
     313        setStatusTip(QApplication::translate("UIActionPool", "Display the global settings window"));
     314    }
     315};
    279316
    280317class UIActionSimpleLogDialog : public UIActionSimple
     
    639676{
    640677    /* Various dialog actions: */
     678    m_pool[UIActionIndex_Simple_Preferences] = new UIActionSimplePreferences(this);
    641679    m_pool[UIActionIndex_Simple_LogDialog] = new UIActionSimpleLogDialog(this);
    642680    /* 'Help' actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r51378 r51390  
    5151{
    5252    /* Various dialog actions: */
     53    UIActionIndex_Simple_Preferences,
    5354    UIActionIndex_Simple_LogDialog,
    5455
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r51379 r51390  
    137137        setName(QApplication::translate("UIActionPool", "&Export Appliance..."));
    138138        setStatusTip(QApplication::translate("UIActionPool", "Export one or more VirtualBox virtual machines as an appliance"));
    139     }
    140 };
    141 
    142 class UIActionSimplePreferencesDialog : public UIActionSimple
    143 {
    144     Q_OBJECT;
    145 
    146 public:
    147 
    148     UIActionSimplePreferencesDialog(UIActionPool *pParent)
    149         : UIActionSimple(pParent, ":/global_settings_16px.png")
    150     {
    151         setMenuRole(QAction::PreferencesRole);
    152         retranslateUi();
    153     }
    154 
    155 protected:
    156 
    157     QString shortcutExtraDataID() const
    158     {
    159         return QString("Preferences");
    160     }
    161 
    162     QKeySequence defaultShortcut(UIActionPoolType) const
    163     {
    164         return QKeySequence("Ctrl+G");
    165     }
    166 
    167     void retranslateUi()
    168     {
    169         setName(QApplication::translate("UIActionPool", "&Preferences...", "global settings"));
    170         setStatusTip(QApplication::translate("UIActionPool", "Display the global settings window"));
    171139    }
    172140};
     
    1006974    m_pool[UIActionIndexSelector_Simple_File_ImportApplianceWizard] = new UIActionSimpleImportApplianceWizard(this);
    1007975    m_pool[UIActionIndexSelector_Simple_File_ExportApplianceWizard] = new UIActionSimpleExportApplianceWizard(this);
    1008     m_pool[UIActionIndexSelector_Simple_File_PreferencesDialog] = new UIActionSimplePreferencesDialog(this);
    1009976    m_pool[UIActionIndexSelector_Simple_File_Exit] = new UIActionSimpleExit(this);
    1010977
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r51375 r51390  
    3131    UIActionIndexSelector_Simple_File_ImportApplianceWizard,
    3232    UIActionIndexSelector_Simple_File_ExportApplianceWizard,
    33     UIActionIndexSelector_Simple_File_PreferencesDialog,
    3433    UIActionIndexSelector_Simple_File_Exit,
    3534
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r51054 r51390  
    11621162    pMenu->addSeparator();
    11631163#endif /* Q_WS_MAC */
    1164     m_pPreferencesDialogAction = gActionPool->action(UIActionIndexSelector_Simple_File_PreferencesDialog);
     1164    m_pPreferencesDialogAction = gActionPool->action(UIActionIndex_Simple_Preferences);
    11651165    pMenu->addAction(m_pPreferencesDialogAction);
    11661166#ifndef Q_WS_MAC
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette