VirtualBox

Changeset 42760 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 10, 2012 4:53:11 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: VM Selector: Action pool refactoring/cleanup (part 1).

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

Legend:

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

    r42755 r42760  
    247247    {
    248248        setText(QApplication::translate("UIActionPool", "Show &Log..."));
    249         setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine"));
     249        setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machines"));
    250250    }
    251251};
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r42755 r42760  
    179179};
    180180
    181 class UIActionSimpleGroupNewWizard : public UIActionSimple
    182 {
    183     Q_OBJECT;
    184 
    185 public:
    186 
    187     UIActionSimpleGroupNewWizard(QObject *pParent)
     181class UIActionSimpleGroupRename : public UIActionSimple
     182{
     183    Q_OBJECT;
     184
     185public:
     186
     187    UIActionSimpleGroupRename(QObject *pParent)
     188        : UIActionSimple(pParent, ":/name_16px.png")
     189    {
     190        retranslateUi();
     191    }
     192
     193protected:
     194
     195    void retranslateUi()
     196    {
     197        setText(QApplication::translate("UIActionPool", "Rena&me Group..."));
     198        setStatusTip(QApplication::translate("UIActionPool", "Rename the selected virtual machine group"));
     199        setShortcut(gSS->keySequence(UISelectorShortcuts::RenameVMGroupShortcut));
     200    }
     201};
     202
     203class UIActionSimpleGroupRemove : public UIActionSimple
     204{
     205    Q_OBJECT;
     206
     207public:
     208
     209    UIActionSimpleGroupRemove(QObject *pParent)
     210        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     211                         ":/vm_delete_32px.png", ":/delete_16px.png",
     212                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
     213    {
     214        retranslateUi();
     215    }
     216
     217protected:
     218
     219    void retranslateUi()
     220    {
     221        setText(QApplication::translate("UIActionPool", "&Break Group..."));
     222        setStatusTip(QApplication::translate("UIActionPool", "Break the selected virtual machine group"));
     223        setShortcut(gSS->keySequence(UISelectorShortcuts::BreakVMGroupShortcut));
     224    }
     225};
     226
     227class UIActionSimpleGroupSort : public UIActionSimple
     228{
     229    Q_OBJECT;
     230
     231public:
     232
     233    UIActionSimpleGroupSort(QObject *pParent)
     234        : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
     235    {
     236        retranslateUi();
     237    }
     238
     239protected:
     240
     241    void retranslateUi()
     242    {
     243        setText(QApplication::translate("UIActionPool", "Sort Group"));
     244        setStatusTip(QApplication::translate("UIActionPool", "Sort the items of the selected virtual machine group alphabetically"));
     245        setShortcut(gSS->keySequence(UISelectorShortcuts::SortGroup));
     246    }
     247};
     248
     249
     250class UIActionMenuMachine : public UIActionMenu
     251{
     252    Q_OBJECT;
     253
     254public:
     255
     256    UIActionMenuMachine(QObject *pParent)
     257        : UIActionMenu(pParent)
     258    {
     259        retranslateUi();
     260    }
     261
     262protected:
     263
     264    void retranslateUi()
     265    {
     266        menu()->setTitle(QApplication::translate("UIActionPool", "&Machine"));
     267    }
     268};
     269
     270class UIActionSimpleMachineAddGroup : public UIActionSimple
     271{
     272    Q_OBJECT;
     273
     274public:
     275
     276    UIActionSimpleMachineAddGroup(QObject *pParent)
     277        : UIActionSimple(pParent, ":/add_shared_folder_16px.png")
     278    {
     279        retranslateUi();
     280    }
     281
     282protected:
     283
     284    void retranslateUi()
     285    {
     286        setText(QApplication::translate("UIActionPool", "&Add Group..."));
     287        setStatusTip(QApplication::translate("UIActionPool", "Add a new group based on the items selected"));
     288        setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMGroupShortcut));
     289    }
     290};
     291
     292class UIActionSimpleMachineSettings : public UIActionSimple
     293{
     294    Q_OBJECT;
     295
     296public:
     297
     298    UIActionSimpleMachineSettings(QObject *pParent)
     299        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     300                         ":/vm_settings_32px.png", ":/settings_16px.png",
     301                         ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")
     302    {
     303        retranslateUi();
     304    }
     305
     306protected:
     307
     308    void retranslateUi()
     309    {
     310        setText(QApplication::translate("UIActionPool", "&Settings..."));
     311        setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
     312        setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
     313        setToolTip(text().remove('&').remove('.') +
     314                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     315    }
     316};
     317
     318class UIActionSimpleMachineClone : public UIActionSimple
     319{
     320    Q_OBJECT;
     321
     322public:
     323
     324    UIActionSimpleMachineClone(QObject *pParent)
     325        : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
     326    {
     327        retranslateUi();
     328    }
     329
     330protected:
     331
     332    void retranslateUi()
     333    {
     334        setText(QApplication::translate("UIActionPool", "Cl&one..."));
     335        setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine"));
     336        setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut));
     337    }
     338};
     339
     340class UIActionSimpleMachineRemove : public UIActionSimple
     341{
     342    Q_OBJECT;
     343
     344public:
     345
     346    UIActionSimpleMachineRemove(QObject *pParent)
     347        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     348                         ":/vm_delete_32px.png", ":/delete_16px.png",
     349                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
     350    {
     351        retranslateUi();
     352    }
     353
     354protected:
     355
     356    void retranslateUi()
     357    {
     358        setText(QApplication::translate("UIActionPool", "&Remove..."));
     359        setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machines"));
     360        setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
     361    }
     362};
     363
     364
     365class UIActionSimpleCommonNew : public UIActionSimple
     366{
     367    Q_OBJECT;
     368
     369public:
     370
     371    UIActionSimpleCommonNew(QObject *pParent)
    188372        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
    189373    {
     
    195379    void retranslateUi()
    196380    {
    197         setText(QApplication::translate("UIActionPool", "&New Machine..."));
     381        setText(QApplication::translate("UIActionPool", "&New..."));
    198382        setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
    199383        setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
     
    203387};
    204388
    205 class UIActionSimpleGroupAddDialog : public UIActionSimple
    206 {
    207     Q_OBJECT;
    208 
    209 public:
    210 
    211     UIActionSimpleGroupAddDialog(QObject *pParent)
     389class UIActionSimpleCommonAdd : public UIActionSimple
     390{
     391    Q_OBJECT;
     392
     393public:
     394
     395    UIActionSimpleCommonAdd(QObject *pParent)
    212396        : UIActionSimple(pParent, ":/vm_add_16px.png")
    213397    {
     
    219403    void retranslateUi()
    220404    {
    221         setText(QApplication::translate("UIActionPool", "&Add Machine..."));
     405        setText(QApplication::translate("UIActionPool", "&Add..."));
    222406        setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
    223407        setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
     
    225409};
    226410
    227 class UIActionSimpleGroupRenameDialog : public UIActionSimple
    228 {
    229     Q_OBJECT;
    230 
    231 public:
    232 
    233     UIActionSimpleGroupRenameDialog(QObject *pParent)
    234         : UIActionSimple(pParent, ":/name_16px.png")
    235     {
    236         retranslateUi();
    237     }
    238 
    239 protected:
    240 
    241     void retranslateUi()
    242     {
    243         setText(QApplication::translate("UIActionPool", "Rena&me Group..."));
    244         setStatusTip(QApplication::translate("UIActionPool", "Rename the selected virtual machine group"));
    245         setShortcut(gSS->keySequence(UISelectorShortcuts::RenameVMGroupShortcut));
    246     }
    247 };
    248 
    249 class UIActionSimpleGroupRemoveDialog : public UIActionSimple
    250 {
    251     Q_OBJECT;
    252 
    253 public:
    254 
    255     UIActionSimpleGroupRemoveDialog(QObject *pParent)
    256         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    257                          ":/vm_delete_32px.png", ":/delete_16px.png",
    258                          ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
    259     {
    260         retranslateUi();
    261     }
    262 
    263 protected:
    264 
    265     void retranslateUi()
    266     {
    267         setText(QApplication::translate("UIActionPool", "&Break Group..."));
    268         setStatusTip(QApplication::translate("UIActionPool", "Break the selected virtual machine group"));
    269         setShortcut(gSS->keySequence(UISelectorShortcuts::BreakVMGroupShortcut));
    270     }
    271 };
    272 
    273 class UIActionStateGroupStartOrShow : public UIActionState
    274 {
    275     Q_OBJECT;
    276 
    277 public:
    278 
    279     UIActionStateGroupStartOrShow(QObject *pParent)
     411class UIActionStateCommonStartOrShow : public UIActionState
     412{
     413    Q_OBJECT;
     414
     415public:
     416
     417    UIActionStateCommonStartOrShow(QObject *pParent)
    280418        : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
    281                          ":/vm_start_32px.png", ":/start_16px.png",
    282                          ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
     419                        ":/vm_start_32px.png", ":/start_16px.png",
     420                        ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
    283421    {
    284422        retranslateUi();
     
    294432            {
    295433                setText(QApplication::translate("UIActionPool", "S&tart"));
    296                 setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machine"));
     434                setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machines"));
    297435                setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
    298436                setToolTip(text().remove('&').remove('.') +
     
    303441            {
    304442                setText(QApplication::translate("UIActionPool", "S&how"));
    305                 setStatusTip(QApplication::translate("UIActionPool", "Switch to the window of the selected virtual machine"));
     443                setStatusTip(QApplication::translate("UIActionPool", "Switch to the windows of the selected virtual machines"));
    306444                setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
    307445                setToolTip(text().remove('&').remove('.') +
     
    315453};
    316454
    317 class UIActionToggleGroupPauseAndResume : public UIActionToggle
    318 {
    319     Q_OBJECT;
    320 
    321 public:
    322 
    323     UIActionToggleGroupPauseAndResume(QObject *pParent)
     455class UIActionToggleCommonPauseAndResume : public UIActionToggle
     456{
     457    Q_OBJECT;
     458
     459public:
     460
     461    UIActionToggleCommonPauseAndResume(QObject *pParent)
    324462        : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
    325463                         ":/vm_pause_32px.png", ":/pause_16px.png",
     
    334472    {
    335473        setText(QApplication::translate("UIActionPool", "&Pause"));
    336         setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
     474        setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the selected virtual machines"));
    337475        setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
    338476    }
    339477};
    340478
    341 class UIActionSimpleGroupReset : public UIActionSimple
    342 {
    343     Q_OBJECT;
    344 
    345 public:
    346 
    347     UIActionSimpleGroupReset(QObject *pParent)
     479class UIActionSimpleCommonReset : public UIActionSimple
     480{
     481    Q_OBJECT;
     482
     483public:
     484
     485    UIActionSimpleCommonReset(QObject *pParent)
    348486        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    349487    {
     
    356494    {
    357495        setText(QApplication::translate("UIActionPool", "&Reset"));
    358         setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine"));
     496        setStatusTip(QApplication::translate("UIActionPool", "Reset the selected virtual machines"));
    359497        setShortcut(gSS->keySequence(UISelectorShortcuts::ResetVMShortcut));
    360498    }
    361499};
    362500
    363 class UIActionSimpleGroupRefresh : public UIActionSimple
    364 {
    365     Q_OBJECT;
    366 
    367 public:
    368 
    369     UIActionSimpleGroupRefresh(QObject *pParent)
     501class UIActionSimpleCommonDiscard : public UIActionSimple
     502{
     503    Q_OBJECT;
     504
     505public:
     506
     507    UIActionSimpleCommonDiscard(QObject *pParent)
     508        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     509                         ":/vm_discard_32px.png", ":/discard_16px.png",
     510                         ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png")
     511    {
     512        retranslateUi();
     513    }
     514
     515protected:
     516
     517    void retranslateUi()
     518    {
     519        setIconText(QApplication::translate("UIActionPool", "Discard"));
     520        setText(QApplication::translate("UIActionPool", "D&iscard saved state..."));
     521        setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machines"));
     522        setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
     523        setToolTip(text().remove('&').remove('.') +
     524                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     525    }
     526};
     527
     528class UIActionSimpleCommonRefresh : public UIActionSimple
     529{
     530    Q_OBJECT;
     531
     532public:
     533
     534    UIActionSimpleCommonRefresh(QObject *pParent)
    370535        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    371536                         ":/refresh_32px.png", ":/refresh_16px.png",
     
    385550};
    386551
    387 class UIActionSimpleGroupShowInFileManager : public UIActionSimple
    388 {
    389     Q_OBJECT;
    390 
    391 public:
    392 
    393     UIActionSimpleGroupShowInFileManager(QObject *pParent)
     552class UIActionSimpleCommonShowInFileManager : public UIActionSimple
     553{
     554    Q_OBJECT;
     555
     556public:
     557
     558    UIActionSimpleCommonShowInFileManager(QObject *pParent)
    394559        : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    395560    {
     
    403568#if defined(Q_WS_MAC)
    404569        setText(QApplication::translate("UIActionPool", "Show in Finder"));
    405         setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder."));
     570        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder"));
    406571#elif defined(Q_WS_WIN)
    407572        setText(QApplication::translate("UIActionPool", "Show in Explorer"));
    408         setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer."));
     573        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer"));
    409574#else
    410575        setText(QApplication::translate("UIActionPool", "Show in File Manager"));
     
    415580};
    416581
    417 class UIActionSimpleGroupCreateShortcut : public UIActionSimple
    418 {
    419     Q_OBJECT;
    420 
    421 public:
    422 
    423     UIActionSimpleGroupCreateShortcut(QObject *pParent)
     582class UIActionSimpleCommonCreateShortcut : public UIActionSimple
     583{
     584    Q_OBJECT;
     585
     586public:
     587
     588    UIActionSimpleCommonCreateShortcut(QObject *pParent)
    424589        : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
    425590    {
     
    433598#if defined(Q_WS_MAC)
    434599        setText(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
    435         setStatusTip(QApplication::translate("UIActionPool", "Creates an alias file to the VirtualBox Machine Definition file on your desktop."));
     600        setStatusTip(QApplication::translate("UIActionPool", "Creates an alias file to the VirtualBox Machine Definition file on your desktop"));
    436601#else
    437602        setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
    438         setStatusTip(QApplication::translate("UIActionPool", "Creates an shortcut file to the VirtualBox Machine Definition file on your desktop."));
    439 #endif
    440         setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
    441     }
    442 };
    443 
    444 class UIActionSimpleGroupSort : public UIActionSimple
    445 {
    446     Q_OBJECT;
    447 
    448 public:
    449 
    450     UIActionSimpleGroupSort(QObject *pParent)
    451         : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
    452     {
    453         retranslateUi();
    454     }
    455 
    456 protected:
    457 
    458     void retranslateUi()
    459     {
    460         setText(QApplication::translate("UIActionPool", "Sort Group"));
    461         setStatusTip(QApplication::translate("UIActionPool", "Sort the items of the selected group alphabetically"));
    462         setShortcut(gSS->keySequence(UISelectorShortcuts::SortGroup));
    463     }
    464 };
    465 
    466 
    467 class UIActionMenuMachine : public UIActionMenu
    468 {
    469     Q_OBJECT;
    470 
    471 public:
    472 
    473     UIActionMenuMachine(QObject *pParent)
    474         : UIActionMenu(pParent)
    475     {
    476         retranslateUi();
    477     }
    478 
    479 protected:
    480 
    481     void retranslateUi()
    482     {
    483         menu()->setTitle(QApplication::translate("UIActionPool", "&Machine"));
    484     }
    485 };
    486 
    487 class UIActionSimpleMachineNewWizard : public UIActionSimple
    488 {
    489     Q_OBJECT;
    490 
    491 public:
    492 
    493     UIActionSimpleMachineNewWizard(QObject *pParent)
    494         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
    495     {
    496         retranslateUi();
    497     }
    498 
    499 protected:
    500 
    501     void retranslateUi()
    502     {
    503         setText(QApplication::translate("UIActionPool", "&New..."));
    504         setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
    505         setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
    506         setToolTip(text().remove('&').remove('.') +
    507                    (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    508     }
    509 };
    510 
    511 class UIActionSimpleMachineAddDialog : public UIActionSimple
    512 {
    513     Q_OBJECT;
    514 
    515 public:
    516 
    517     UIActionSimpleMachineAddDialog(QObject *pParent)
    518         : UIActionSimple(pParent, ":/vm_add_16px.png")
    519     {
    520         retranslateUi();
    521     }
    522 
    523 protected:
    524 
    525     void retranslateUi()
    526     {
    527         setText(QApplication::translate("UIActionPool", "&Add..."));
    528         setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
    529         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
    530     }
    531 };
    532 
    533 class UIActionSimpleMachineAddGroupDialog : public UIActionSimple
    534 {
    535     Q_OBJECT;
    536 
    537 public:
    538 
    539     UIActionSimpleMachineAddGroupDialog(QObject *pParent)
    540         : UIActionSimple(pParent, ":/add_shared_folder_16px.png")
    541     {
    542         retranslateUi();
    543     }
    544 
    545 protected:
    546 
    547     void retranslateUi()
    548     {
    549         setText(QApplication::translate("UIActionPool", "&Add Group..."));
    550         setStatusTip(QApplication::translate("UIActionPool", "Add a new group based on the items selected"));
    551         setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMGroupShortcut));
    552     }
    553 };
    554 
    555 class UIActionSimpleMachineSettingsDialog : public UIActionSimple
    556 {
    557     Q_OBJECT;
    558 
    559 public:
    560 
    561     UIActionSimpleMachineSettingsDialog(QObject *pParent)
    562         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    563                          ":/vm_settings_32px.png", ":/settings_16px.png",
    564                          ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")
    565     {
    566         retranslateUi();
    567     }
    568 
    569 protected:
    570 
    571     void retranslateUi()
    572     {
    573         setText(QApplication::translate("UIActionPool", "&Settings..."));
    574         setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
    575         setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
    576         setToolTip(text().remove('&').remove('.') +
    577                    (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    578     }
    579 };
    580 
    581 class UIActionSimpleMachineCloneWizard : public UIActionSimple
    582 {
    583     Q_OBJECT;
    584 
    585 public:
    586 
    587     UIActionSimpleMachineCloneWizard(QObject *pParent)
    588         : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
    589     {
    590         retranslateUi();
    591     }
    592 
    593 protected:
    594 
    595     void retranslateUi()
    596     {
    597         setText(QApplication::translate("UIActionPool", "Cl&one..."));
    598         setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine"));
    599         setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut));
    600     }
    601 };
    602 
    603 class UIActionSimpleMachineRemoveDialog : public UIActionSimple
    604 {
    605     Q_OBJECT;
    606 
    607 public:
    608 
    609     UIActionSimpleMachineRemoveDialog(QObject *pParent)
    610         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    611                          ":/vm_delete_32px.png", ":/delete_16px.png",
    612                          ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
    613     {
    614         retranslateUi();
    615     }
    616 
    617 protected:
    618 
    619     void retranslateUi()
    620     {
    621         setText(QApplication::translate("UIActionPool", "&Remove..."));
    622         setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine"));
    623         setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
    624     }
    625 };
    626 
    627 class UIActionStateMachineStartOrShow : public UIActionState
    628 {
    629     Q_OBJECT;
    630 
    631 public:
    632 
    633     UIActionStateMachineStartOrShow(QObject *pParent)
    634         : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
    635                          ":/vm_start_32px.png", ":/start_16px.png",
    636                          ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
    637     {
    638         retranslateUi();
    639     }
    640 
    641 protected:
    642 
    643     void retranslateUi()
    644     {
    645         switch (m_iState)
    646         {
    647             case 1:
    648             {
    649                 setText(QApplication::translate("UIActionPool", "S&tart"));
    650                 setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machine"));
    651                 setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
    652                 setToolTip(text().remove('&').remove('.') +
    653                            (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    654                 break;
    655             }
    656             case 2:
    657             {
    658                 setText(QApplication::translate("UIActionPool", "S&how"));
    659                 setStatusTip(QApplication::translate("UIActionPool", "Switch to the window of the selected virtual machine"));
    660                 setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
    661                 setToolTip(text().remove('&').remove('.') +
    662                            (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    663                 break;
    664             }
    665             default:
    666                 break;
    667         }
    668     }
    669 };
    670 
    671 class UIActionSimpleMachineDiscard : public UIActionSimple
    672 {
    673     Q_OBJECT;
    674 
    675 public:
    676 
    677     UIActionSimpleMachineDiscard(QObject *pParent)
    678         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    679                          ":/vm_discard_32px.png", ":/discard_16px.png",
    680                          ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png")
    681     {
    682         retranslateUi();
    683     }
    684 
    685 protected:
    686 
    687     void retranslateUi()
    688     {
    689         setIconText(QApplication::translate("UIActionPool", "Discard"));
    690         setText(QApplication::translate("UIActionPool", "D&iscard saved state..."));
    691         setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machine"));
    692         setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
    693         setToolTip(text().remove('&').remove('.') +
    694                    (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    695     }
    696 };
    697 
    698 class UIActionToggleMachinePauseAndResume : public UIActionToggle
    699 {
    700     Q_OBJECT;
    701 
    702 public:
    703 
    704     UIActionToggleMachinePauseAndResume(QObject *pParent)
    705         : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
    706                          ":/vm_pause_32px.png", ":/pause_16px.png",
    707                          ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png")
    708     {
    709         retranslateUi();
    710     }
    711 
    712 protected:
    713 
    714     void retranslateUi()
    715     {
    716         setText(QApplication::translate("UIActionPool", "&Pause"));
    717         setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
    718         setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
    719     }
    720 };
    721 
    722 class UIActionSimpleMachineReset : public UIActionSimple
    723 {
    724     Q_OBJECT;
    725 
    726 public:
    727 
    728     UIActionSimpleMachineReset(QObject *pParent)
    729         : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    730     {
    731         retranslateUi();
    732     }
    733 
    734 protected:
    735 
    736     void retranslateUi()
    737     {
    738         setText(QApplication::translate("UIActionPool", "&Reset"));
    739         setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine"));
    740         setShortcut(gSS->keySequence(UISelectorShortcuts::ResetVMShortcut));
    741     }
    742 };
    743 
    744 class UIActionSimpleMachineRefresh : public UIActionSimple
    745 {
    746     Q_OBJECT;
    747 
    748 public:
    749 
    750     UIActionSimpleMachineRefresh(QObject *pParent)
    751         : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    752                          ":/refresh_32px.png", ":/refresh_16px.png",
    753                          ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
    754     {
    755         retranslateUi();
    756     }
    757 
    758 protected:
    759 
    760     void retranslateUi()
    761     {
    762         setText(QApplication::translate("UIActionPool", "Re&fresh..."));
    763         setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine"));
    764         setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut));
    765     }
    766 };
    767 
    768 class UIActionSimpleMachineShowInFileManager : public UIActionSimple
    769 {
    770     Q_OBJECT;
    771 
    772 public:
    773 
    774     UIActionSimpleMachineShowInFileManager(QObject *pParent)
    775         : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    776     {
    777         retranslateUi();
    778     }
    779 
    780 protected:
    781 
    782     void retranslateUi()
    783     {
    784 #if defined(Q_WS_MAC)
    785         setText(QApplication::translate("UIActionPool", "Show in Finder"));
    786         setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder."));
    787 #elif defined(Q_WS_WIN)
    788         setText(QApplication::translate("UIActionPool", "Show in Explorer"));
    789         setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer."));
    790 #else
    791         setText(QApplication::translate("UIActionPool", "Show in File Manager"));
    792         setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in the File Manager"));
    793 #endif
    794         setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMInFileManagerShortcut));
    795     }
    796 };
    797 
    798 class UIActionSimpleMachineCreateShortcut : public UIActionSimple
    799 {
    800     Q_OBJECT;
    801 
    802 public:
    803 
    804     UIActionSimpleMachineCreateShortcut(QObject *pParent)
    805         : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
    806     {
    807         retranslateUi();
    808     }
    809 
    810 protected:
    811 
    812     void retranslateUi()
    813     {
    814 #if defined(Q_WS_MAC)
    815         setText(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
    816         setStatusTip(QApplication::translate("UIActionPool", "Creates an alias file to the VirtualBox Machine Definition file on your desktop."));
    817 #else
    818         setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
    819         setStatusTip(QApplication::translate("UIActionPool", "Creates an shortcut file to the VirtualBox Machine Definition file on your desktop."));
     603        setStatusTip(QApplication::translate("UIActionPool", "Creates an shortcut file to the VirtualBox Machine Definition file on your desktop"));
    820604#endif
    821605        setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
     
    863647    {
    864648        menu()->setTitle(QApplication::translate("UIActionPool", "&Close"));
    865         menu()->setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
    866649    }
    867650};
     
    884667    {
    885668        setText(QApplication::translate("UIActionPool", "Save State"));
    886         setStatusTip(QApplication::translate("UIActionPool", "Save the machine state of the selected virtual machine"));
     669        setStatusTip(QApplication::translate("UIActionPool", "Save the machine state of the selected virtual machines"));
    887670        setShortcut(gSS->keySequence(UISelectorShortcuts::SaveVMShortcut));
    888671    }
     
    906689    {
    907690        setText(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
    908         setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the virtual machine"));
     691        setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the selected virtual machines"));
    909692        setShortcut(gSS->keySequence(UISelectorShortcuts::ACPIShutdownVMShortcut));
    910693    }
     
    928711    {
    929712        setText(QApplication::translate("UIActionPool", "Po&wer Off"));
    930         setStatusTip(QApplication::translate("UIActionPool", "Power off the virtual machine"));
     713        setStatusTip(QApplication::translate("UIActionPool", "Power off the selected virtual machines"));
    931714        setShortcut(gSS->keySequence(UISelectorShortcuts::PowerOffVMShortcut));
    932715    }
     
    973756
    974757    /* 'Group' actions: */
    975     m_pool[UIActionIndexSelector_Simple_Group_NewWizard] = new UIActionSimpleGroupNewWizard(this);
    976     m_pool[UIActionIndexSelector_Simple_Group_AddDialog] = new UIActionSimpleGroupAddDialog(this);
    977     m_pool[UIActionIndexSelector_Simple_Group_RenameDialog] = new UIActionSimpleGroupRenameDialog(this);
    978     m_pool[UIActionIndexSelector_Simple_Group_RemoveDialog] = new UIActionSimpleGroupRemoveDialog(this);
    979     m_pool[UIActionIndexSelector_State_Group_StartOrShow] = new UIActionStateGroupStartOrShow(this);
    980     m_pool[UIActionIndexSelector_Toggle_Group_PauseAndResume] = new UIActionToggleGroupPauseAndResume(this);
    981     m_pool[UIActionIndexSelector_Simple_Group_Reset] = new UIActionSimpleGroupReset(this);
    982     m_pool[UIActionIndexSelector_Simple_Group_Refresh] = new UIActionSimpleGroupRefresh(this);
    983     m_pool[UIActionIndexSelector_Simple_Group_ShowInFileManager] = new UIActionSimpleGroupShowInFileManager(this);
    984     m_pool[UIActionIndexSelector_Simple_Group_CreateShortcut] = new UIActionSimpleGroupCreateShortcut(this);
     758    m_pool[UIActionIndexSelector_Simple_Group_Rename] = new UIActionSimpleGroupRename(this);
     759    m_pool[UIActionIndexSelector_Simple_Group_Remove] = new UIActionSimpleGroupRemove(this);
    985760    m_pool[UIActionIndexSelector_Simple_Group_Sort] = new UIActionSimpleGroupSort(this);
    986761
    987762    /* 'Machine' actions: */
    988     m_pool[UIActionIndexSelector_Simple_Machine_NewWizard] = new UIActionSimpleMachineNewWizard(this);
    989     m_pool[UIActionIndexSelector_Simple_Machine_AddDialog] = new UIActionSimpleMachineAddDialog(this);
    990     m_pool[UIActionIndexSelector_Simple_Machine_AddGroupDialog] = new UIActionSimpleMachineAddGroupDialog(this);
    991     m_pool[UIActionIndexSelector_Simple_Machine_SettingsDialog] = new UIActionSimpleMachineSettingsDialog(this);
    992     m_pool[UIActionIndexSelector_Simple_Machine_CloneWizard] = new UIActionSimpleMachineCloneWizard(this);
    993     m_pool[UIActionIndexSelector_Simple_Machine_RemoveDialog] = new UIActionSimpleMachineRemoveDialog(this);
    994     m_pool[UIActionIndexSelector_State_Machine_StartOrShow] = new UIActionStateMachineStartOrShow(this);
    995     m_pool[UIActionIndexSelector_Simple_Machine_Discard] = new UIActionSimpleMachineDiscard(this);
    996     m_pool[UIActionIndexSelector_Toggle_Machine_PauseAndResume] = new UIActionToggleMachinePauseAndResume(this);
    997     m_pool[UIActionIndexSelector_Simple_Machine_Reset] = new UIActionSimpleMachineReset(this);
    998     m_pool[UIActionIndexSelector_Simple_Machine_Refresh] = new UIActionSimpleMachineRefresh(this);
    999     m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UIActionSimpleMachineShowInFileManager(this);
    1000     m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UIActionSimpleMachineCreateShortcut(this);
     763    m_pool[UIActionIndexSelector_Simple_Machine_Settings] = new UIActionSimpleMachineSettings(this);
     764    m_pool[UIActionIndexSelector_Simple_Machine_Clone] = new UIActionSimpleMachineClone(this);
     765    m_pool[UIActionIndexSelector_Simple_Machine_Remove] = new UIActionSimpleMachineRemove(this);
     766    m_pool[UIActionIndexSelector_Simple_Machine_AddGroup] = new UIActionSimpleMachineAddGroup(this);
    1001767
    1002768    /* Common actions: */
     769    m_pool[UIActionIndexSelector_Simple_Common_New] = new UIActionSimpleCommonNew(this);
     770    m_pool[UIActionIndexSelector_Simple_Common_Add] = new UIActionSimpleCommonAdd(this);
     771    m_pool[UIActionIndexSelector_State_Common_StartOrShow] = new UIActionStateCommonStartOrShow(this);
     772    m_pool[UIActionIndexSelector_Toggle_Common_PauseAndResume] = new UIActionToggleCommonPauseAndResume(this);
     773    m_pool[UIActionIndexSelector_Simple_Common_Reset] = new UIActionSimpleCommonReset(this);
     774    m_pool[UIActionIndexSelector_Simple_Common_Discard] = new UIActionSimpleCommonDiscard(this);
     775    m_pool[UIActionIndexSelector_Simple_Common_Refresh] = new UIActionSimpleCommonRefresh(this);
     776    m_pool[UIActionIndexSelector_Simple_Common_ShowInFileManager] = new UIActionSimpleCommonShowInFileManager(this);
     777    m_pool[UIActionIndexSelector_Simple_Common_CreateShortcut] = new UIActionSimpleCommonCreateShortcut(this);
    1003778    m_pool[UIActionIndexSelector_Simple_Common_SortParent] = new UIActionSimpleCommonSortParent(this);
    1004779
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r42751 r42760  
    3636    /* 'Group' menu actions: */
    3737    UIActionIndexSelector_Menu_Group,
    38     UIActionIndexSelector_Simple_Group_NewWizard,
    39     UIActionIndexSelector_Simple_Group_AddDialog,
    40     UIActionIndexSelector_Simple_Group_RenameDialog,
    41     UIActionIndexSelector_Simple_Group_RemoveDialog,
    42     UIActionIndexSelector_State_Group_StartOrShow,
    43     UIActionIndexSelector_Toggle_Group_PauseAndResume,
    44     UIActionIndexSelector_Simple_Group_Reset,
    45     UIActionIndexSelector_Simple_Group_Refresh,
    46     UIActionIndexSelector_Simple_Group_ShowInFileManager,
    47     UIActionIndexSelector_Simple_Group_CreateShortcut,
     38    UIActionIndexSelector_Simple_Group_Rename,
     39    UIActionIndexSelector_Simple_Group_Remove,
    4840    UIActionIndexSelector_Simple_Group_Sort,
    4941
    5042    /* 'Machine' menu actions: */
    5143    UIActionIndexSelector_Menu_Machine,
    52     UIActionIndexSelector_Simple_Machine_NewWizard,
    53     UIActionIndexSelector_Simple_Machine_AddDialog,
    54     UIActionIndexSelector_Simple_Machine_AddGroupDialog,
    55     UIActionIndexSelector_Simple_Machine_SettingsDialog,
    56     UIActionIndexSelector_Simple_Machine_CloneWizard,
    57     UIActionIndexSelector_Simple_Machine_RemoveDialog,
    58     UIActionIndexSelector_State_Machine_StartOrShow,
    59     UIActionIndexSelector_Simple_Machine_Discard,
    60     UIActionIndexSelector_Toggle_Machine_PauseAndResume,
    61     UIActionIndexSelector_Simple_Machine_Reset,
    62     UIActionIndexSelector_Simple_Machine_Refresh,
    63     UIActionIndexSelector_Simple_Machine_ShowInFileManager,
    64     UIActionIndexSelector_Simple_Machine_CreateShortcut,
     44    UIActionIndexSelector_Simple_Machine_Settings,
     45    UIActionIndexSelector_Simple_Machine_Clone,
     46    UIActionIndexSelector_Simple_Machine_Remove,
     47    UIActionIndexSelector_Simple_Machine_AddGroup,
    6548
    66     /* Common menu action: */
     49    /* Common 'Group' / 'Machine' menu actions: */
     50    UIActionIndexSelector_Simple_Common_New,
     51    UIActionIndexSelector_Simple_Common_Add,
     52    UIActionIndexSelector_State_Common_StartOrShow,
     53    UIActionIndexSelector_Toggle_Common_PauseAndResume,
     54    UIActionIndexSelector_Simple_Common_Reset,
     55    UIActionIndexSelector_Simple_Common_Discard,
     56    UIActionIndexSelector_Simple_Common_Refresh,
     57    UIActionIndexSelector_Simple_Common_ShowInFileManager,
     58    UIActionIndexSelector_Simple_Common_CreateShortcut,
    6759    UIActionIndexSelector_Simple_Common_SortParent,
    6860
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r42756 r42760  
    371371{
    372372    /* Check that we do NOT handling that already: */
    373     if (m_pActionMachineSettingsDialog->data().toBool())
     373    if (m_pAction_Machine_Settings->data().toBool())
    374374        return;
    375375    /* Remember that we handling that already: */
    376     m_pActionMachineSettingsDialog->setData(true);
     376    m_pAction_Machine_Settings->setData(true);
    377377
    378378    /* Process href from VM details / description: */
     
    407407
    408408    /* Remember that we do NOT handling that already: */
    409     m_pActionMachineSettingsDialog->setData(false);
     409    m_pAction_Machine_Settings->setData(false);
    410410}
    411411
     
    423423void UISelectorWindow::sltPerformStartOrShowAction()
    424424{
    425     /* Check if the action is enabled: */
    426     if (!m_pActionMachineStartOrShow->isEnabled())
    427         return;
    428 
    429425    /* Get selected items: */
    430426    QList<UIVMItem*> items = currentItems();
     
    435431    {
    436432        /* Check if current item could be started/showed: */
    437         if (!isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items))
     433        if (!isActionEnabled(UIActionIndexSelector_State_Common_StartOrShow, items))
    438434            continue;
    439435
     
    488484
    489485        /* Check if current item could be paused/resumed: */
    490         if (!isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items))
     486        if (!isActionEnabled(UIActionIndexSelector_Toggle_Common_PauseAndResume, items))
    491487            continue;
    492488
     
    547543
    548544        /* Check if current item could be reseted: */
    549         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items))
     545        if (!isActionEnabled(UIActionIndexSelector_Simple_Common_Reset, items))
    550546            continue;
    551547
     
    732728
    733729        /* Check if that item could be shown in file-browser: */
    734         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items))
     730        if (!isActionEnabled(UIActionIndexSelector_Simple_Common_ShowInFileManager, items))
    735731            continue;
    736732
     
    753749
    754750        /* Check if shortcuts could be created for this item: */
    755         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items))
     751        if (!isActionEnabled(UIActionIndexSelector_Simple_Common_CreateShortcut, items))
    756752            continue;
    757753
     
    10661062    prepareMenuMachineClose(m_pMachineCloseMenu);
    10671063
     1064    /* Create actions for 'Group' and 'Machine' menus: */
     1065    prepareCommonActions();
     1066    prepareGroupActions();
     1067    prepareMachineActions();
     1068
    10681069    /* Prepare Group-menu: */
    10691070    m_pGroupMenu = gActionPool->action(UIActionIndexSelector_Menu_Group)->menu();
     
    11141115}
    11151116
     1117void UISelectorWindow::prepareCommonActions()
     1118{
     1119    m_pAction_Common_New               = gActionPool->action(UIActionIndexSelector_Simple_Common_New);
     1120    m_pAction_Common_Add               = gActionPool->action(UIActionIndexSelector_Simple_Common_Add);
     1121    m_pAction_Common_StartOrShow       = gActionPool->action(UIActionIndexSelector_State_Common_StartOrShow);
     1122    m_pAction_Common_PauseAndResume    = gActionPool->action(UIActionIndexSelector_Toggle_Common_PauseAndResume);
     1123    m_pAction_Common_Reset             = gActionPool->action(UIActionIndexSelector_Simple_Common_Reset);
     1124    m_pAction_Common_Discard           = gActionPool->action(UIActionIndexSelector_Simple_Common_Discard);
     1125    m_pAction_Common_LogDialog         = gActionPool->action(UIActionIndex_Simple_LogDialog);
     1126    m_pAction_Common_Refresh           = gActionPool->action(UIActionIndexSelector_Simple_Common_Refresh);
     1127    m_pAction_Common_ShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Common_ShowInFileManager);
     1128    m_pAction_Common_CreateShortcut    = gActionPool->action(UIActionIndexSelector_Simple_Common_CreateShortcut);
     1129    m_pAction_Common_SortParent        = gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent);
     1130}
     1131
     1132void UISelectorWindow::prepareGroupActions()
     1133{
     1134    m_pAction_Group_Rename = gActionPool->action(UIActionIndexSelector_Simple_Group_Rename);
     1135    m_pAction_Group_Remove = gActionPool->action(UIActionIndexSelector_Simple_Group_Remove);
     1136    m_pAction_Group_Sort   = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort);
     1137}
     1138
     1139void UISelectorWindow::prepareMachineActions()
     1140{
     1141    m_pAction_Machine_Settings = gActionPool->action(UIActionIndexSelector_Simple_Machine_Settings);
     1142    m_pAction_Machine_Clone    = gActionPool->action(UIActionIndexSelector_Simple_Machine_Clone);
     1143    m_pAction_Machine_Remove   = gActionPool->action(UIActionIndexSelector_Simple_Machine_Remove);
     1144    m_pAction_Machine_AddGroup = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroup);
     1145}
     1146
    11161147void UISelectorWindow::prepareMenuGroup(QMenu *pMenu)
    11171148{
     
    11211152
    11221153    /* Populate Machine-menu: */
    1123     m_pActionGroupNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Group_NewWizard);
    1124     pMenu->addAction(m_pActionGroupNewWizard);
    1125     m_pActionGroupAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_AddDialog);
    1126     pMenu->addAction(m_pActionGroupAddDialog);
     1154    pMenu->addAction(m_pAction_Common_New);
     1155    pMenu->addAction(m_pAction_Common_Add);
    11271156    pMenu->addSeparator();
    1128     m_pActionGroupRenameDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RenameDialog);
    1129     pMenu->addAction(m_pActionGroupRenameDialog);
    1130     m_pActionGroupRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RemoveDialog);
    1131     pMenu->addAction(m_pActionGroupRemoveDialog);
     1157    pMenu->addAction(m_pAction_Group_Rename);
     1158    pMenu->addAction(m_pAction_Group_Remove);
    11321159    pMenu->addSeparator();
    1133     m_pActionGroupStartOrShow = gActionPool->action(UIActionIndexSelector_State_Group_StartOrShow);
    1134     pMenu->addAction(m_pActionGroupStartOrShow);
    1135     m_pActionGroupPauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Group_PauseAndResume);
    1136     pMenu->addAction(m_pActionGroupPauseAndResume);
    1137     m_pActionGroupReset = gActionPool->action(UIActionIndexSelector_Simple_Group_Reset);
    1138     pMenu->addAction(m_pActionGroupReset);
     1160    pMenu->addAction(m_pAction_Common_StartOrShow);
     1161    pMenu->addAction(m_pAction_Common_PauseAndResume);
     1162    pMenu->addAction(m_pAction_Common_Reset);
    11391163    pMenu->addMenu(m_pMachineCloseMenu);
    11401164    pMenu->addSeparator();
    1141     m_pActionGroupRefresh = gActionPool->action(UIActionIndexSelector_Simple_Group_Refresh);
    1142     pMenu->addAction(m_pActionGroupRefresh);
    1143     m_pActionGroupLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog);
    1144     pMenu->addAction(m_pActionGroupLogDialog);
     1165    pMenu->addAction(m_pAction_Common_Discard);
     1166    pMenu->addAction(m_pAction_Common_LogDialog);
     1167    pMenu->addAction(m_pAction_Common_Refresh);
    11451168    pMenu->addSeparator();
    1146     m_pActionGroupShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Group_ShowInFileManager);
    1147     pMenu->addAction(m_pActionGroupShowInFileManager);
    1148     m_pActionGroupCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Group_CreateShortcut);
    1149     pMenu->addAction(m_pActionGroupCreateShortcut);
     1169    pMenu->addAction(m_pAction_Common_ShowInFileManager);
     1170    pMenu->addAction(m_pAction_Common_CreateShortcut);
    11501171    pMenu->addSeparator();
    1151     m_pActionGroupSortParent = gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent);
    1152     pMenu->addAction(m_pActionGroupSortParent);
    1153     m_pActionGroupSort = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort);
    1154     pMenu->addAction(m_pActionGroupSort);
     1172    pMenu->addAction(m_pAction_Common_SortParent);
     1173    pMenu->addAction(m_pAction_Group_Sort);
    11551174
    11561175    /* Remember action list: */
    1157     m_groupActions << m_pActionGroupNewWizard << m_pActionGroupAddDialog
    1158                    << m_pActionGroupRenameDialog << m_pActionGroupRemoveDialog
    1159                    << m_pActionGroupStartOrShow << m_pActionGroupPauseAndResume
    1160                    << m_pActionGroupReset << m_pActionGroupRefresh
    1161                    << m_pActionGroupLogDialog << m_pActionGroupShowInFileManager
    1162                    << m_pActionGroupCreateShortcut << m_pActionGroupSort;
     1176    m_groupActions << m_pAction_Group_Rename
     1177                   << m_pAction_Group_Remove
     1178                   << m_pAction_Group_Sort;
    11631179}
    11641180
     
    11701186
    11711187    /* Populate Machine-menu: */
    1172     m_pActionMachineNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard);
    1173     pMenu->addAction(m_pActionMachineNewWizard);
    1174     m_pActionMachineAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddDialog);
    1175     pMenu->addAction(m_pActionMachineAddDialog);
    1176     m_pActionMachineSettingsDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog);
    1177     pMenu->addAction(m_pActionMachineSettingsDialog);
    1178     m_pActionMachineCloneWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard);
    1179     pMenu->addAction(m_pActionMachineCloneWizard);
    1180     m_pActionMachineRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog);
    1181     pMenu->addAction(m_pActionMachineRemoveDialog);
    1182     m_pActionMachineAddGroupDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroupDialog);
    1183     pMenu->addAction(m_pActionMachineAddGroupDialog);
     1188    pMenu->addAction(m_pAction_Common_New);
     1189    pMenu->addAction(m_pAction_Common_Add);
     1190    pMenu->addAction(m_pAction_Machine_Settings);
     1191    pMenu->addAction(m_pAction_Machine_Clone);
     1192    pMenu->addAction(m_pAction_Machine_Remove);
     1193    pMenu->addAction(m_pAction_Machine_AddGroup);
    11841194    pMenu->addSeparator();
    1185     m_pActionMachineStartOrShow = gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow);
    1186     pMenu->addAction(m_pActionMachineStartOrShow);
    1187     m_pActionMachinePauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume);
    1188     pMenu->addAction(m_pActionMachinePauseAndResume);
    1189     m_pActionMachineReset = gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset);
    1190     pMenu->addAction(m_pActionMachineReset);
     1195    pMenu->addAction(m_pAction_Common_StartOrShow);
     1196    pMenu->addAction(m_pAction_Common_PauseAndResume);
     1197    pMenu->addAction(m_pAction_Common_Reset);
    11911198    pMenu->addMenu(m_pMachineCloseMenu);
    11921199    pMenu->addSeparator();
    1193     m_pActionMachineDiscard = gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard);
    1194     pMenu->addAction(m_pActionMachineDiscard);
    1195     m_pActionMachineRefresh = gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh);
    1196     pMenu->addAction(m_pActionMachineRefresh);
    1197     m_pActionMachineLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog);
    1198     pMenu->addAction(m_pActionMachineLogDialog);
     1200    pMenu->addAction(m_pAction_Common_Discard);
     1201    pMenu->addAction(m_pAction_Common_LogDialog);
     1202    pMenu->addAction(m_pAction_Common_Refresh);
    11991203    pMenu->addSeparator();
    1200     m_pActionMachineShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager);
    1201     pMenu->addAction(m_pActionMachineShowInFileManager);
    1202     m_pActionMachineCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut);
    1203     pMenu->addAction(m_pActionMachineCreateShortcut);
     1204    pMenu->addAction(m_pAction_Common_ShowInFileManager);
     1205    pMenu->addAction(m_pAction_Common_CreateShortcut);
    12041206    pMenu->addSeparator();
    1205     m_pActionMachineSortParent = gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent);
    1206     pMenu->addAction(m_pActionMachineSortParent);
     1207    pMenu->addAction(m_pAction_Common_SortParent);
    12071208
    12081209    /* Remember action list: */
    1209     m_machineActions << m_pActionMachineNewWizard << m_pActionMachineAddDialog
    1210                      << m_pActionMachineSettingsDialog << m_pActionMachineCloneWizard
    1211                      << m_pActionMachineAddGroupDialog
    1212                      << m_pActionMachineRemoveDialog << m_pActionMachineStartOrShow
    1213                      << m_pActionMachineDiscard << m_pActionMachinePauseAndResume
    1214                      << m_pActionMachineReset << m_pActionMachineRefresh
    1215                      << m_pActionMachineLogDialog << m_pActionMachineShowInFileManager
    1216                      << m_pActionMachineCreateShortcut;
     1210    m_machineActions << m_pAction_Machine_Settings
     1211                     << m_pAction_Machine_Clone
     1212                     << m_pAction_Machine_Remove
     1213                     << m_pAction_Machine_AddGroup;
    12171214}
    12181215
     
    12861283    mVMToolBar->setIconSize(QSize(32, 32));
    12871284    mVMToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    1288     mVMToolBar->addAction(m_pActionMachineNewWizard);
    1289     mVMToolBar->addAction(m_pActionMachineSettingsDialog);
    1290     mVMToolBar->addAction(m_pActionMachineStartOrShow);
    1291     mVMToolBar->addAction(m_pActionMachineDiscard);
     1285    mVMToolBar->addAction(m_pAction_Common_New);
     1286    mVMToolBar->addAction(m_pAction_Machine_Settings);
     1287    mVMToolBar->addAction(m_pAction_Common_StartOrShow);
     1288    mVMToolBar->addAction(m_pAction_Common_Discard);
    12921289
    12931290    /* Prepare graphics VM list: */
     
    12991296
    13001297    /* Prepare details and snapshots tabs: */
    1301     m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pActionMachineRefresh, this);
     1298    m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pAction_Common_Refresh, this);
    13021299
    13031300    /* Crate container: */
     
    13491346    connect(m_pExitAction, SIGNAL(triggered()), this, SLOT(sltPerformExit()));
    13501347
    1351     /* 'Group' menu connections: */
    1352     connect(m_pActionGroupAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
    1353     connect(m_pActionGroupStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
    1354     connect(m_pActionGroupPauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
    1355     connect(m_pActionGroupReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
    1356     connect(m_pActionGroupRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
    1357     connect(m_pActionGroupLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    1358     connect(m_pActionGroupShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
    1359     connect(m_pActionGroupCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
     1348    /* 'Group'/'Machine' menu common connections: */
     1349    connect(m_pAction_Common_Add, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
     1350    connect(m_pAction_Common_StartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
     1351    connect(m_pAction_Common_PauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
     1352    connect(m_pAction_Common_Reset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
     1353    connect(m_pAction_Common_Discard, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
     1354    connect(m_pAction_Common_LogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
     1355    connect(m_pAction_Common_Refresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
     1356    connect(m_pAction_Common_ShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
     1357    connect(m_pAction_Common_CreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
    13601358
    13611359    /* 'Machine' menu connections: */
    1362     connect(m_pActionMachineAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
    1363     connect(m_pActionMachineSettingsDialog, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog()));
    1364     connect(m_pActionMachineCloneWizard, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard()));
    1365     connect(m_pActionMachineStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
    1366     connect(m_pActionMachineDiscard, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
    1367     connect(m_pActionMachinePauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
    1368     connect(m_pActionMachineReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
    1369     connect(m_pActionMachineRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
    1370     connect(m_pActionMachineLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    1371     connect(m_pActionMachineShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
    1372     connect(m_pActionMachineCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
     1360    connect(m_pAction_Machine_Settings, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog()));
     1361    connect(m_pAction_Machine_Clone, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard()));
    13731362
    13741363    /* 'Machine/Close' menu connections: */
     
    15501539    QList<UIVMItem*> items = currentItems();
    15511540
     1541    /* Enable/disable common actions: */
     1542    m_pAction_Common_StartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Common_StartOrShow, items));
     1543    m_pAction_Common_PauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Common_PauseAndResume, items));
     1544    m_pAction_Common_Reset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_Reset, items));
     1545    m_pAction_Common_Discard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_Discard, items));
     1546    m_pAction_Common_LogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
     1547    m_pAction_Common_Refresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_Refresh, items));
     1548    m_pAction_Common_ShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_ShowInFileManager, items));
     1549    m_pAction_Common_CreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_CreateShortcut, items));
     1550    m_pAction_Common_SortParent->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_SortParent, items));
     1551
    15521552    /* Enable/disable group actions: */
    1553     m_pActionGroupRenameDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RenameDialog, items));
    1554     m_pActionGroupRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RemoveDialog, items));
    1555     m_pActionGroupStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Group_StartOrShow, items));
    1556     m_pActionGroupPauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Group_PauseAndResume, items));
    1557     m_pActionGroupReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Reset, items));
    1558     m_pActionGroupRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Refresh, items));
    1559     m_pActionGroupLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
    1560     m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items));
    1561     m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items));
    1562     m_pActionGroupSortParent->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_SortParent, items));
    1563     m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
     1553    m_pAction_Group_Rename->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Rename, items));
     1554    m_pAction_Group_Remove->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Remove, items));
     1555    m_pAction_Group_Sort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
    15641556
    15651557    /* Enable/disable machine actions: */
    1566     m_pActionMachineSettingsDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, items));
    1567     m_pActionMachineCloneWizard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, items));
    1568     m_pActionMachineAddGroupDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_AddGroupDialog, items));
    1569     m_pActionMachineRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items));
    1570     m_pActionMachineStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items));
    1571     m_pActionMachineDiscard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, items));
    1572     m_pActionMachinePauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items));
    1573     m_pActionMachineReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items));
    1574     m_pActionMachineRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, items));
    1575     m_pActionMachineLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
    1576     m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items));
    1577     m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items));
    1578     m_pActionMachineSortParent->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_SortParent, items));
     1558    m_pAction_Machine_Settings->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Settings, items));
     1559    m_pAction_Machine_Clone->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Clone, items));
     1560    m_pAction_Machine_Remove->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Remove, items));
     1561    m_pAction_Machine_AddGroup->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_AddGroup, items));
    15791562
    15801563    /* Enable/disable machine-close actions: */
     
    15961579            state == KMachineState_Aborted)
    15971580        {
    1598             m_pActionGroupStartOrShow->setState(1);
    1599             m_pActionMachineStartOrShow->setState(1);
     1581            m_pAction_Common_StartOrShow->setState(1);
    16001582#ifdef QT_MAC_USE_COCOA
    16011583            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    16081590        else
    16091591        {
    1610             m_pActionGroupStartOrShow->setState(2);
    1611             m_pActionMachineStartOrShow->setState(2);
     1592            m_pAction_Common_StartOrShow->setState(2);
    16121593#ifdef QT_MAC_USE_COCOA
    16131594            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    16231604            state == KMachineState_TeleportingPausedVM)
    16241605        {
    1625             m_pActionGroupPauseAndResume->blockSignals(true);
    1626             m_pActionGroupPauseAndResume->setChecked(true);
    1627             m_pActionGroupPauseAndResume->blockSignals(false);
    1628             m_pActionMachinePauseAndResume->blockSignals(true);
    1629             m_pActionMachinePauseAndResume->setChecked(true);
    1630             m_pActionMachinePauseAndResume->blockSignals(false);
     1606            m_pAction_Common_PauseAndResume->blockSignals(true);
     1607            m_pAction_Common_PauseAndResume->setChecked(true);
     1608            m_pAction_Common_PauseAndResume->blockSignals(false);
    16311609        }
    16321610        else
    16331611        {
    1634             m_pActionGroupPauseAndResume->blockSignals(true);
    1635             m_pActionGroupPauseAndResume->setChecked(false);
    1636             m_pActionGroupPauseAndResume->blockSignals(false);
    1637             m_pActionMachinePauseAndResume->blockSignals(true);
    1638             m_pActionMachinePauseAndResume->setChecked(false);
    1639             m_pActionMachinePauseAndResume->blockSignals(false);
    1640         }
    1641         m_pActionGroupPauseAndResume->updateAppearance();
    1642         m_pActionMachinePauseAndResume->updateAppearance();
     1612            m_pAction_Common_PauseAndResume->blockSignals(true);
     1613            m_pAction_Common_PauseAndResume->setChecked(false);
     1614            m_pAction_Common_PauseAndResume->blockSignals(false);
     1615        }
     1616        m_pAction_Common_PauseAndResume->updateAppearance();
    16431617    }
    16441618    else
    16451619    {
    16461620        /* Update the Start button action appearance: */
    1647         m_pActionGroupStartOrShow->setState(1);
    1648         m_pActionMachineStartOrShow->setState(1);
     1621        m_pAction_Common_StartOrShow->setState(1);
    16491622    }
    16501623}
     
    16621635    switch (iActionIndex)
    16631636    {
    1664         case UIActionIndexSelector_Simple_Machine_SettingsDialog:
     1637        case UIActionIndexSelector_Simple_Machine_Settings:
    16651638        {
    16661639            /* Check that we are not saving groups,
     
    16721645                   pItem->machineState() != KMachineState_Stuck;
    16731646        }
    1674         case UIActionIndexSelector_Simple_Machine_CloneWizard:
     1647        case UIActionIndexSelector_Simple_Machine_Clone:
    16751648        {
    16761649            /* Check that there is only one item, its accessible
     
    16801653                   pItem->sessionState() == KSessionState_Unlocked;
    16811654        }
    1682         case UIActionIndexSelector_Simple_Machine_AddGroupDialog:
     1655        case UIActionIndexSelector_Simple_Group_Rename:
     1656        case UIActionIndexSelector_Simple_Group_Remove:
     1657        {
     1658            /* Make sure we are not saving groups: */
     1659            if (m_pChooser->isGroupSavingInProgress())
     1660                return false;
     1661
     1662            /* Group can be always removed/renamed: */
     1663            return true;
     1664        }
     1665        case UIActionIndexSelector_Simple_Machine_Remove:
     1666        {
     1667            /* Make sure we are not saving groups: */
     1668            if (m_pChooser->isGroupSavingInProgress())
     1669                return false;
     1670
     1671            /* Check that all machines are NOT accessible
     1672             * or session states of all machines are unlocked. */
     1673            return isItemsInaccessible(items) || isItemsHasUnlockedSession(items);
     1674        }
     1675        case UIActionIndexSelector_Simple_Machine_AddGroup:
    16831676        {
    16841677            /* Check that there is more than one item,
     
    16881681                   isItemsPoweredOff(items);
    16891682        }
    1690         case UIActionIndexSelector_Simple_Group_RenameDialog:
    1691         case UIActionIndexSelector_Simple_Group_RemoveDialog:
    1692         {
    1693             /* Make sure we are not saving groups: */
    1694             if (m_pChooser->isGroupSavingInProgress())
    1695                 return false;
    1696 
    1697             /* Group can be always removed/renamed: */
    1698             return true;
    1699         }
    1700         case UIActionIndexSelector_Simple_Machine_RemoveDialog:
    1701         {
    1702             /* Make sure we are not saving groups: */
    1703             if (m_pChooser->isGroupSavingInProgress())
    1704                 return false;
    1705 
    1706             /* Check that all machines are NOT accessible
    1707              * or session states of all machines are unlocked. */
    1708             return isItemsInaccessible(items) || isItemsHasUnlockedSession(items);
    1709         }
    1710         case UIActionIndexSelector_State_Group_StartOrShow:
    1711         case UIActionIndexSelector_State_Machine_StartOrShow:
     1683        case UIActionIndexSelector_State_Common_StartOrShow:
    17121684        {
    17131685            /* Make sure all items are accessible: */
     
    17331705            return pItem->canSwitchTo();
    17341706        }
    1735         case UIActionIndexSelector_Simple_Machine_Discard:
     1707        case UIActionIndexSelector_Simple_Common_Discard:
    17361708        {
    17371709            /* Check that there is only one item, its accessible
     
    17421714                   pItem->sessionState() == KSessionState_Unlocked;
    17431715        }
    1744         case UIActionIndexSelector_Toggle_Group_PauseAndResume:
    1745         case UIActionIndexSelector_Toggle_Machine_PauseAndResume:
     1716        case UIActionIndexSelector_Toggle_Common_PauseAndResume:
    17461717        {
    17471718            /* Make sure all items are accessible: */
     
    17561727                   pItem->machineState() == KMachineState_TeleportingPausedVM;
    17571728        }
    1758         case UIActionIndexSelector_Simple_Group_Reset:
    1759         case UIActionIndexSelector_Simple_Machine_Reset:
     1729        case UIActionIndexSelector_Simple_Common_Reset:
    17601730        {
    17611731            /* Make sure all items are accessible: */
     
    18091779            return isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items);
    18101780        }
    1811         case UIActionIndexSelector_Simple_Group_Refresh:
    1812         case UIActionIndexSelector_Simple_Machine_Refresh:
     1781        case UIActionIndexSelector_Simple_Common_Refresh:
    18131782        {
    18141783            /* Make sure all items are NOT accessible: */
     
    18161785        }
    18171786        case UIActionIndex_Simple_LogDialog:
    1818         case UIActionIndexSelector_Simple_Group_ShowInFileManager:
    1819         case UIActionIndexSelector_Simple_Machine_ShowInFileManager:
     1787        case UIActionIndexSelector_Simple_Common_ShowInFileManager:
    18201788        case UIActionIndexSelector_Simple_Common_SortParent:
    18211789        case UIActionIndexSelector_Simple_Group_Sort:
     
    18241792            return items.size() > 0 && isItemsAccessible(items);
    18251793        }
    1826         case UIActionIndexSelector_Simple_Group_CreateShortcut:
    1827         case UIActionIndexSelector_Simple_Machine_CreateShortcut:
     1794        case UIActionIndexSelector_Simple_Common_CreateShortcut:
    18281795        {
    18291796            /* Make sure all items supports shortcuts: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r42751 r42760  
    125125    void prepareMenuBar();
    126126    void prepareMenuFile(QMenu *pMenu);
     127    void prepareCommonActions();
     128    void prepareGroupActions();
     129    void prepareMachineActions();
    127130    void prepareMenuGroup(QMenu *pMenu);
    128131    void prepareMenuMachine(QMenu *pMenu);
     
    177180    UIAction *m_pExitAction;
    178181
     182    /* Common Group/Machine actions: */
     183    UIAction *m_pAction_Common_New;
     184    UIAction *m_pAction_Common_Add;
     185    UIAction *m_pAction_Common_StartOrShow;
     186    UIAction *m_pAction_Common_PauseAndResume;
     187    UIAction *m_pAction_Common_Reset;
     188    UIAction *m_pAction_Common_Discard;
     189    UIAction *m_pAction_Common_LogDialog;
     190    UIAction *m_pAction_Common_Refresh;
     191    UIAction *m_pAction_Common_ShowInFileManager;
     192    UIAction *m_pAction_Common_CreateShortcut;
     193    UIAction *m_pAction_Common_SortParent;
     194
    179195    /* 'Group' menu action pointers: */
    180196    QList<UIAction*> m_groupActions;
    181197    QAction *m_pGroupMenuAction;
    182198    QMenu *m_pGroupMenu;
    183     UIAction *m_pActionGroupNewWizard;
    184     UIAction *m_pActionGroupAddDialog;
    185     UIAction *m_pActionGroupRenameDialog;
    186     UIAction *m_pActionGroupRemoveDialog;
    187     UIAction *m_pActionGroupStartOrShow;
    188     UIAction *m_pActionGroupPauseAndResume;
    189     UIAction *m_pActionGroupReset;
    190     UIAction *m_pActionGroupRefresh;
    191     UIAction *m_pActionGroupLogDialog;
    192     UIAction *m_pActionGroupShowInFileManager;
    193     UIAction *m_pActionGroupCreateShortcut;
    194     UIAction *m_pActionGroupSortParent;
    195     UIAction *m_pActionGroupSort;
     199    UIAction *m_pAction_Group_Rename;
     200    UIAction *m_pAction_Group_Remove;
     201    UIAction *m_pAction_Group_Sort;
    196202
    197203    /* 'Machine' menu action pointers: */
     
    199205    QAction *m_pMachineMenuAction;
    200206    QMenu *m_pMachineMenu;
    201     UIAction *m_pActionMachineNewWizard;
    202     UIAction *m_pActionMachineAddDialog;
    203     UIAction *m_pActionMachineSettingsDialog;
    204     UIAction *m_pActionMachineCloneWizard;
    205     UIAction *m_pActionMachineAddGroupDialog;
    206     UIAction *m_pActionMachineRemoveDialog;
    207     UIAction *m_pActionMachineStartOrShow;
    208     UIAction *m_pActionMachineDiscard;
    209     UIAction *m_pActionMachinePauseAndResume;
    210     UIAction *m_pActionMachineReset;
    211     UIAction *m_pActionMachineRefresh;
    212     UIAction *m_pActionMachineLogDialog;
    213     UIAction *m_pActionMachineShowInFileManager;
    214     UIAction *m_pActionMachineCreateShortcut;
    215     UIAction *m_pActionMachineSortParent;
     207    UIAction *m_pAction_Machine_Settings;
     208    UIAction *m_pAction_Machine_Clone;
     209    UIAction *m_pAction_Machine_Remove;
     210    UIAction *m_pAction_Machine_AddGroup;
    216211
    217212    /* 'Machine / Close' menu action pointers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r42734 r42760  
    814814
    815815    connect(m_pSettingsButton, SIGNAL(sigButtonClicked()),
    816             gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog), SLOT(trigger()),
     816            gActionPool->action(UIActionIndexSelector_Simple_Machine_Settings), SLOT(trigger()),
    817817            Qt::QueuedConnection);
    818818    connect(m_pStartButton, SIGNAL(sigButtonClicked()),
    819             gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow), SLOT(trigger()),
     819            gActionPool->action(UIActionIndexSelector_State_Common_StartOrShow), SLOT(trigger()),
    820820            Qt::QueuedConnection);
    821821    connect(m_pPauseButton, SIGNAL(sigButtonClicked()),
    822             gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume), SLOT(trigger()),
     822            gActionPool->action(UIActionIndexSelector_Toggle_Common_PauseAndResume), SLOT(trigger()),
    823823            Qt::QueuedConnection);
    824824    connect(m_pCloseButton, SIGNAL(sigButtonClicked()),
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r42756 r42760  
    465465void UIGChooserModel::activate()
    466466{
    467     gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow)->activate(QAction::Trigger);
     467    gActionPool->action(UIActionIndexSelector_State_Common_StartOrShow)->activate(QAction::Trigger);
    468468}
    469469
     
    897897    /* Context menu for group: */
    898898    m_pContextMenuGroup = new QMenu;
    899     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_NewWizard));
    900     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_AddDialog));
     899    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_New));
     900    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Add));
    901901    m_pContextMenuGroup->addSeparator();
    902     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_RenameDialog));
    903     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_RemoveDialog));
     902    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Rename));
     903    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Remove));
    904904    m_pContextMenuGroup->addSeparator();
    905     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_State_Group_StartOrShow));
    906     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Toggle_Group_PauseAndResume));
    907     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Reset));
     905    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_State_Common_StartOrShow));
     906    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Toggle_Common_PauseAndResume));
     907    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Reset));
    908908    m_pContextMenuGroup->addMenu(gActionPool->action(UIActionIndexSelector_Menu_Machine_Close)->menu());
    909909    m_pContextMenuGroup->addSeparator();
     910    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Discard));
    910911    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndex_Simple_LogDialog));
    911     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Refresh));
     912    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Refresh));
    912913    m_pContextMenuGroup->addSeparator();
    913     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_ShowInFileManager));
    914     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_CreateShortcut));
     914    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_ShowInFileManager));
     915    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_CreateShortcut));
    915916    m_pContextMenuGroup->addSeparator();
    916917    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent));
     
    919920    /* Context menu for machine(s): */
    920921    m_pContextMenuMachine = new QMenu;
    921     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog));
    922     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard));
    923     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog));
    924     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroupDialog));
     922    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Settings));
     923    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Clone));
     924    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Remove));
     925    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroup));
    925926    m_pContextMenuMachine->addSeparator();
    926     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow));
    927     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume));
    928     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset));
     927    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_State_Common_StartOrShow));
     928    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Toggle_Common_PauseAndResume));
     929    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Reset));
    929930    m_pContextMenuMachine->addMenu(gActionPool->action(UIActionIndexSelector_Menu_Machine_Close)->menu());
    930931    m_pContextMenuMachine->addSeparator();
    931     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard));
     932    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Discard));
    932933    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndex_Simple_LogDialog));
    933     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh));
     934    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_Refresh));
    934935    m_pContextMenuMachine->addSeparator();
    935     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager));
    936     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut));
     936    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_ShowInFileManager));
     937    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_CreateShortcut));
    937938    m_pContextMenuMachine->addSeparator();
    938939    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent));
     
    941942    connect(m_pContextMenuMachine, SIGNAL(hovered(QAction*)), this, SLOT(sltActionHovered(QAction*)));
    942943
    943     connect(gActionPool->action(UIActionIndexSelector_Simple_Group_NewWizard), SIGNAL(triggered()),
     944    connect(gActionPool->action(UIActionIndexSelector_Simple_Common_New), SIGNAL(triggered()),
    944945            this, SLOT(sltCreateNewMachine()));
    945     connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard), SIGNAL(triggered()),
    946             this, SLOT(sltCreateNewMachine()));
    947     connect(gActionPool->action(UIActionIndexSelector_Simple_Group_RenameDialog), SIGNAL(triggered()),
     946    connect(gActionPool->action(UIActionIndexSelector_Simple_Group_Rename), SIGNAL(triggered()),
    948947            this, SLOT(sltStartEditingSelectedGroup()));
    949     connect(gActionPool->action(UIActionIndexSelector_Simple_Group_RemoveDialog), SIGNAL(triggered()),
     948    connect(gActionPool->action(UIActionIndexSelector_Simple_Group_Remove), SIGNAL(triggered()),
    950949            this, SLOT(sltRemoveCurrentlySelectedGroup()));
    951     connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroupDialog), SIGNAL(triggered()),
     950    connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_Remove), SIGNAL(triggered()),
     951            this, SLOT(sltRemoveCurrentlySelectedMachine()));
     952    connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_AddGroup), SIGNAL(triggered()),
    952953            this, SLOT(sltAddGroupBasedOnChosenItems()));
    953     connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog), SIGNAL(triggered()),
    954             this, SLOT(sltRemoveCurrentlySelectedMachine()));
    955954    connect(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent), SIGNAL(triggered()),
    956955            this, SLOT(sltSortParentGroup()));
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