VirtualBox

Changeset 52579 in vbox


Ignore:
Timestamp:
Sep 3, 2014 11:56:06 AM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Action-pool: Move some code (log-viewer action stuff) to corresponding places.

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

Legend:

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

    r52572 r52579  
    309309
    310310
     311#ifdef RT_OS_DARWIN
     312class UIActionMenuApplication : public UIActionMenu
     313{
     314    Q_OBJECT;
     315
     316public:
     317
     318    UIActionMenuApplication(UIActionPool *pParent)
     319        : UIActionMenu(pParent)
     320    {
     321        menu()->setConsumable(true);
     322        retranslateUi();
     323    }
     324
     325protected:
     326
     327    /** Returns action extra-data ID. */
     328    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuType_Application; }
     329    /** Returns action extra-data key. */
     330    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuType_Application); }
     331
     332    void retranslateUi()
     333    {
     334        setName(QApplication::translate("UIActionPool", "&VirtualBox"));
     335    }
     336};
     337
     338class UIActionSimplePerformClose : public UIActionSimple
     339{
     340    Q_OBJECT;
     341
     342public:
     343
     344    UIActionSimplePerformClose(UIActionPool *pParent)
     345        : UIActionSimple(pParent, ":/exit_16px.png")
     346    {
     347        setMenuRole(QAction::QuitRole);
     348    }
     349
     350protected:
     351
     352    /** Returns action extra-data ID. */
     353    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_Close; }
     354    /** Returns action extra-data key. */
     355    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Close); }
     356
     357    QString shortcutExtraDataID() const
     358    {
     359        return QString("Close");
     360    }
     361
     362    QKeySequence defaultShortcut(UIActionPoolType) const
     363    {
     364        return QKeySequence("Q");
     365    }
     366
     367    void retranslateUi()
     368    {
     369        setName(QApplication::translate("UIActionPool", "&Close..."));
     370        setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
     371    }
     372};
     373#endif /* RT_OS_DARWIN */
     374
     375class UIActionMenuHelp : public UIActionMenu
     376{
     377    Q_OBJECT;
     378
     379public:
     380
     381    UIActionMenuHelp(UIActionPool *pParent)
     382        : UIActionMenu(pParent)
     383    {
     384        retranslateUi();
     385    }
     386
     387protected:
     388
     389    /** Returns action extra-data ID. */
     390    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuType_Help; }
     391    /** Returns action extra-data key. */
     392    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuType_Help); }
     393
     394    void retranslateUi()
     395    {
     396        setName(QApplication::translate("UIActionPool", "&Help"));
     397    }
     398};
     399
     400class UIActionSimpleContents : public UIActionSimple
     401{
     402    Q_OBJECT;
     403
     404public:
     405
     406    UIActionSimpleContents(UIActionPool *pParent)
     407        : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_DialogHelp))
     408    {
     409        retranslateUi();
     410    }
     411
     412protected:
     413
     414    /** Returns action extra-data ID. */
     415    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_Contents; }
     416    /** Returns action extra-data key. */
     417    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Contents); }
     418
     419    QString shortcutExtraDataID() const
     420    {
     421        return QString("Help");
     422    }
     423
     424    QKeySequence defaultShortcut(UIActionPoolType actionPoolType) const
     425    {
     426        switch (actionPoolType)
     427        {
     428            case UIActionPoolType_Selector: return QKeySequence(QKeySequence::HelpContents);
     429            case UIActionPoolType_Runtime: break;
     430        }
     431        return QKeySequence();
     432    }
     433
     434    void retranslateUi()
     435    {
     436        setName(QApplication::translate("UIActionPool", "&Contents..."));
     437        setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
     438    }
     439};
     440
     441class UIActionSimpleWebSite : public UIActionSimple
     442{
     443    Q_OBJECT;
     444
     445public:
     446
     447    UIActionSimpleWebSite(UIActionPool *pParent)
     448        : UIActionSimple(pParent, ":/site_16px.png")
     449    {
     450        retranslateUi();
     451    }
     452
     453protected:
     454
     455    /** Returns action extra-data ID. */
     456    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_WebSite; }
     457    /** Returns action extra-data key. */
     458    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_WebSite); }
     459
     460    QString shortcutExtraDataID() const
     461    {
     462        return QString("Web");
     463    }
     464
     465    void retranslateUi()
     466    {
     467        setName(QApplication::translate("UIActionPool", "&VirtualBox Web Site..."));
     468        setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
     469    }
     470};
     471
     472class UIActionSimpleResetWarnings : public UIActionSimple
     473{
     474    Q_OBJECT;
     475
     476public:
     477
     478    UIActionSimpleResetWarnings(UIActionPool *pParent)
     479        : UIActionSimple(pParent, ":/reset_warnings_16px.png")
     480    {
     481        retranslateUi();
     482    }
     483
     484protected:
     485
     486    /** Returns action extra-data ID. */
     487    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings; }
     488    /** Returns action extra-data key. */
     489    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); }
     490
     491    QString shortcutExtraDataID() const
     492    {
     493        return QString("ResetWarnings");
     494    }
     495
     496    void retranslateUi()
     497    {
     498        setName(QApplication::translate("UIActionPool", "&Reset All Warnings"));
     499        setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
     500    }
     501};
     502
     503#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     504class UIActionSimpleNetworkAccessManager : public UIActionSimple
     505{
     506    Q_OBJECT;
     507
     508public:
     509
     510    UIActionSimpleNetworkAccessManager(UIActionPool *pParent)
     511        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
     512    {
     513        retranslateUi();
     514    }
     515
     516protected:
     517
     518    /** Returns action extra-data ID. */
     519    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager; }
     520    /** Returns action extra-data key. */
     521    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); }
     522
     523    QString shortcutExtraDataID() const
     524    {
     525        return QString("NetworkAccessManager");
     526    }
     527
     528    void retranslateUi()
     529    {
     530        setName(QApplication::translate("UIActionPool", "&Network Operations Manager..."));
     531        setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager"));
     532    }
     533};
     534
     535class UIActionSimpleCheckForUpdates : public UIActionSimple
     536{
     537    Q_OBJECT;
     538
     539public:
     540
     541    UIActionSimpleCheckForUpdates(UIActionPool *pParent)
     542        : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
     543    {
     544        setMenuRole(QAction::ApplicationSpecificRole);
     545        retranslateUi();
     546    }
     547
     548protected:
     549
     550    /** Returns action extra-data ID. */
     551    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates; }
     552    /** Returns action extra-data key. */
     553    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); }
     554
     555    QString shortcutExtraDataID() const
     556    {
     557        return QString("Update");
     558    }
     559
     560    void retranslateUi()
     561    {
     562        setName(QApplication::translate("UIActionPool", "C&heck for Updates..."));
     563        setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
     564    }
     565};
     566#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     567
     568class UIActionSimpleAbout : public UIActionSimple
     569{
     570    Q_OBJECT;
     571
     572public:
     573
     574    UIActionSimpleAbout(UIActionPool *pParent)
     575        : UIActionSimple(pParent, ":/about_16px.png")
     576    {
     577        setMenuRole(QAction::AboutRole);
     578        retranslateUi();
     579    }
     580
     581protected:
     582
     583    /** Returns action extra-data ID. */
     584    virtual int extraDataID() const
     585    {
     586#ifdef Q_WS_MAC
     587        return UIExtraDataMetaDefs::MenuApplicationActionType_About;
     588#else /* !Q_WS_MAC */
     589        return UIExtraDataMetaDefs::MenuHelpActionType_About;
     590#endif /* !Q_WS_MAC */
     591    }
     592    /** Returns action extra-data key. */
     593    virtual QString extraDataKey() const
     594    {
     595#ifdef Q_WS_MAC
     596        return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_About);
     597#else /* !Q_WS_MAC */
     598        return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_About);
     599#endif /* !Q_WS_MAC */
     600    }
     601
     602    QString shortcutExtraDataID() const
     603    {
     604        return QString("About");
     605    }
     606
     607    void retranslateUi()
     608    {
     609        setName(QApplication::translate("UIActionPool", "&About VirtualBox..."));
     610        setStatusTip(QApplication::translate("UIActionPool", "Show a window with product information"));
     611    }
     612};
     613
    311614class UIActionSimplePreferences : public UIActionSimple
    312615{
     
    362665        setName(QApplication::translate("UIActionPool", "&Preferences...", "global settings"));
    363666        setStatusTip(QApplication::translate("UIActionPool", "Display the global settings window"));
    364     }
    365 };
    366 
    367 class UIActionSimpleLogDialog : public UIActionSimple
    368 {
    369     Q_OBJECT;
    370 
    371 public:
    372 
    373     UIActionSimpleLogDialog(UIActionPool *pParent)
    374         : UIActionSimple(pParent,
    375                          ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
    376                          ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")
    377     {
    378         retranslateUi();
    379     }
    380 
    381 protected:
    382 
    383     /** Returns action extra-data ID. */
    384     virtual int extraDataID() const
    385     {
    386 #ifdef VBOX_WITH_DEBUGGER_GUI
    387         return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog;
    388 #else /* !VBOX_WITH_DEBUGGER_GUI */
    389         return 0;
    390 #endif /* !VBOX_WITH_DEBUGGER_GUI */
    391     }
    392     /** Returns action extra-data key. */
    393     virtual QString extraDataKey() const
    394     {
    395 #ifdef VBOX_WITH_DEBUGGER_GUI
    396         return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog);
    397 #else /* !VBOX_WITH_DEBUGGER_GUI */
    398         return QString();
    399 #endif /* !VBOX_WITH_DEBUGGER_GUI */
    400     }
    401 
    402     QString shortcutExtraDataID() const
    403     {
    404         return QString("ShowVMLog");
    405     }
    406 
    407     QKeySequence defaultShortcut(UIActionPoolType actionPoolType) const
    408     {
    409         switch (actionPoolType)
    410         {
    411             case UIActionPoolType_Selector: return QKeySequence("Ctrl+L");
    412             case UIActionPoolType_Runtime: break;
    413         }
    414         return QKeySequence();
    415     }
    416 
    417     void retranslateUi()
    418     {
    419         setName(QApplication::translate("UIActionPool", "Show &Log..."));
    420         setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine"));
    421     }
    422 };
    423 
    424 #ifdef RT_OS_DARWIN
    425 class UIActionMenuApplication : public UIActionMenu
    426 {
    427     Q_OBJECT;
    428 
    429 public:
    430 
    431     UIActionMenuApplication(UIActionPool *pParent)
    432         : UIActionMenu(pParent)
    433     {
    434         menu()->setConsumable(true);
    435         retranslateUi();
    436     }
    437 
    438 protected:
    439 
    440     /** Returns action extra-data ID. */
    441     virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuType_Application; }
    442     /** Returns action extra-data key. */
    443     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuType_Application); }
    444 
    445     void retranslateUi()
    446     {
    447         setName(QApplication::translate("UIActionPool", "&VirtualBox"));
    448     }
    449 };
    450 
    451 class UIActionSimplePerformClose : public UIActionSimple
    452 {
    453     Q_OBJECT;
    454 
    455 public:
    456 
    457     UIActionSimplePerformClose(UIActionPool *pParent)
    458         : UIActionSimple(pParent, ":/exit_16px.png")
    459     {
    460         setMenuRole(QAction::QuitRole);
    461     }
    462 
    463 protected:
    464 
    465     /** Returns action extra-data ID. */
    466     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_Close; }
    467     /** Returns action extra-data key. */
    468     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Close); }
    469 
    470     QString shortcutExtraDataID() const
    471     {
    472         return QString("Close");
    473     }
    474 
    475     QKeySequence defaultShortcut(UIActionPoolType) const
    476     {
    477         return QKeySequence("Q");
    478     }
    479 
    480     void retranslateUi()
    481     {
    482         setName(QApplication::translate("UIActionPool", "&Close..."));
    483         setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
    484     }
    485 };
    486 #endif /* RT_OS_DARWIN */
    487 
    488 class UIActionMenuHelp : public UIActionMenu
    489 {
    490     Q_OBJECT;
    491 
    492 public:
    493 
    494     UIActionMenuHelp(UIActionPool *pParent)
    495         : UIActionMenu(pParent)
    496     {
    497         retranslateUi();
    498     }
    499 
    500 protected:
    501 
    502     /** Returns action extra-data ID. */
    503     virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuType_Help; }
    504     /** Returns action extra-data key. */
    505     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuType_Help); }
    506 
    507     void retranslateUi()
    508     {
    509         setName(QApplication::translate("UIActionPool", "&Help"));
    510     }
    511 };
    512 
    513 class UIActionSimpleContents : public UIActionSimple
    514 {
    515     Q_OBJECT;
    516 
    517 public:
    518 
    519     UIActionSimpleContents(UIActionPool *pParent)
    520         : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_DialogHelp))
    521     {
    522         retranslateUi();
    523     }
    524 
    525 protected:
    526 
    527     /** Returns action extra-data ID. */
    528     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_Contents; }
    529     /** Returns action extra-data key. */
    530     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Contents); }
    531 
    532     QString shortcutExtraDataID() const
    533     {
    534         return QString("Help");
    535     }
    536 
    537     QKeySequence defaultShortcut(UIActionPoolType actionPoolType) const
    538     {
    539         switch (actionPoolType)
    540         {
    541             case UIActionPoolType_Selector: return QKeySequence(QKeySequence::HelpContents);
    542             case UIActionPoolType_Runtime: break;
    543         }
    544         return QKeySequence();
    545     }
    546 
    547     void retranslateUi()
    548     {
    549         setName(QApplication::translate("UIActionPool", "&Contents..."));
    550         setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
    551     }
    552 };
    553 
    554 class UIActionSimpleWebSite : public UIActionSimple
    555 {
    556     Q_OBJECT;
    557 
    558 public:
    559 
    560     UIActionSimpleWebSite(UIActionPool *pParent)
    561         : UIActionSimple(pParent, ":/site_16px.png")
    562     {
    563         retranslateUi();
    564     }
    565 
    566 protected:
    567 
    568     /** Returns action extra-data ID. */
    569     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_WebSite; }
    570     /** Returns action extra-data key. */
    571     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_WebSite); }
    572 
    573     QString shortcutExtraDataID() const
    574     {
    575         return QString("Web");
    576     }
    577 
    578     void retranslateUi()
    579     {
    580         setName(QApplication::translate("UIActionPool", "&VirtualBox Web Site..."));
    581         setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
    582     }
    583 };
    584 
    585 class UIActionSimpleResetWarnings : public UIActionSimple
    586 {
    587     Q_OBJECT;
    588 
    589 public:
    590 
    591     UIActionSimpleResetWarnings(UIActionPool *pParent)
    592         : UIActionSimple(pParent, ":/reset_warnings_16px.png")
    593     {
    594         retranslateUi();
    595     }
    596 
    597 protected:
    598 
    599     /** Returns action extra-data ID. */
    600     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings; }
    601     /** Returns action extra-data key. */
    602     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); }
    603 
    604     QString shortcutExtraDataID() const
    605     {
    606         return QString("ResetWarnings");
    607     }
    608 
    609     void retranslateUi()
    610     {
    611         setName(QApplication::translate("UIActionPool", "&Reset All Warnings"));
    612         setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
    613     }
    614 };
    615 
    616 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    617 class UIActionSimpleNetworkAccessManager : public UIActionSimple
    618 {
    619     Q_OBJECT;
    620 
    621 public:
    622 
    623     UIActionSimpleNetworkAccessManager(UIActionPool *pParent)
    624         : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    625     {
    626         retranslateUi();
    627     }
    628 
    629 protected:
    630 
    631     /** Returns action extra-data ID. */
    632     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager; }
    633     /** Returns action extra-data key. */
    634     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); }
    635 
    636     QString shortcutExtraDataID() const
    637     {
    638         return QString("NetworkAccessManager");
    639     }
    640 
    641     void retranslateUi()
    642     {
    643         setName(QApplication::translate("UIActionPool", "&Network Operations Manager..."));
    644         setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager"));
    645     }
    646 };
    647 
    648 class UIActionSimpleCheckForUpdates : public UIActionSimple
    649 {
    650     Q_OBJECT;
    651 
    652 public:
    653 
    654     UIActionSimpleCheckForUpdates(UIActionPool *pParent)
    655         : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
    656     {
    657         setMenuRole(QAction::ApplicationSpecificRole);
    658         retranslateUi();
    659     }
    660 
    661 protected:
    662 
    663     /** Returns action extra-data ID. */
    664     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates; }
    665     /** Returns action extra-data key. */
    666     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); }
    667 
    668     QString shortcutExtraDataID() const
    669     {
    670         return QString("Update");
    671     }
    672 
    673     void retranslateUi()
    674     {
    675         setName(QApplication::translate("UIActionPool", "C&heck for Updates..."));
    676         setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
    677     }
    678 };
    679 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    680 
    681 class UIActionSimpleAbout : public UIActionSimple
    682 {
    683     Q_OBJECT;
    684 
    685 public:
    686 
    687     UIActionSimpleAbout(UIActionPool *pParent)
    688         : UIActionSimple(pParent, ":/about_16px.png")
    689     {
    690         setMenuRole(QAction::AboutRole);
    691         retranslateUi();
    692     }
    693 
    694 protected:
    695 
    696     /** Returns action extra-data ID. */
    697     virtual int extraDataID() const
    698     {
    699 #ifdef Q_WS_MAC
    700         return UIExtraDataMetaDefs::MenuApplicationActionType_About;
    701 #else /* !Q_WS_MAC */
    702         return UIExtraDataMetaDefs::MenuHelpActionType_About;
    703 #endif /* !Q_WS_MAC */
    704     }
    705     /** Returns action extra-data key. */
    706     virtual QString extraDataKey() const
    707     {
    708 #ifdef Q_WS_MAC
    709         return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_About);
    710 #else /* !Q_WS_MAC */
    711         return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_About);
    712 #endif /* !Q_WS_MAC */
    713     }
    714 
    715     QString shortcutExtraDataID() const
    716     {
    717         return QString("About");
    718     }
    719 
    720     void retranslateUi()
    721     {
    722         setName(QApplication::translate("UIActionPool", "&About VirtualBox..."));
    723         setStatusTip(QApplication::translate("UIActionPool", "Show a window with product information"));
    724667    }
    725668};
     
    844787void UIActionPool::preparePool()
    845788{
    846     /* Create various actions: */
    847     m_pool[UIActionIndex_Simple_LogDialog] = new UIActionSimpleLogDialog(this);
    848 
    849789#ifdef RT_OS_DARWIN
    850790    /* Create 'Application' actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r52572 r52579  
    5252enum UIActionIndex
    5353{
    54     /* Various actions: */
    55     UIActionIndex_Simple_LogDialog,
    56 
    5754#ifdef RT_OS_DARWIN
    5855    /* 'Application' menu actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r52572 r52579  
    14961496    {
    14971497        setName(QApplication::translate("UIActionPool", "&Logging...", "debug action"));
     1498    }
     1499};
     1500
     1501class UIActionSimpleShowLogDialog : public UIActionSimple
     1502{
     1503    Q_OBJECT;
     1504
     1505public:
     1506
     1507    UIActionSimpleShowLogDialog(UIActionPool *pParent)
     1508        : UIActionSimple(pParent) {}
     1509
     1510protected:
     1511
     1512    /** Returns action extra-data ID. */
     1513    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog; }
     1514    /** Returns action extra-data key. */
     1515    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog); }
     1516
     1517    QString shortcutExtraDataID() const
     1518    {
     1519        return QString("LogWindow");
     1520    }
     1521
     1522    void retranslateUi()
     1523    {
     1524        setName(QApplication::translate("UIActionPool", "Show &Log...", "debug action"));
    14981525    }
    14991526};
     
    18221849    m_pool[UIActionIndexRT_M_Debug_S_ShowCommandLine] = new UIActionSimpleShowCommandLine(this);
    18231850    m_pool[UIActionIndexRT_M_Debug_T_Logging] = new UIActionToggleLogging(this);
     1851    m_pool[UIActionIndexRT_M_Debug_S_ShowLogDialog] = new UIActionSimpleShowLogDialog(this);
    18241852#endif /* VBOX_WITH_DEBUGGER_GUI */
    18251853
     
    28812909    /* 'Log Dialog' action: */
    28822910    const bool fAllowToShowActionLogDialog = isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog);
    2883     action(UIActionIndex_Simple_LogDialog)->setEnabled(fAllowToShowActionLogDialog);
     2911    action(UIActionIndexRT_M_Debug_S_ShowLogDialog)->setEnabled(fAllowToShowActionLogDialog);
    28842912    if (fAllowToShowActionLogDialog)
    2885         pMenu->addAction(action(UIActionIndex_Simple_LogDialog));
     2913        pMenu->addAction(action(UIActionIndexRT_M_Debug_S_ShowLogDialog));
    28862914
    28872915    /* Mark menu as valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r52558 r52579  
    103103    UIActionIndexRT_M_Debug_S_ShowCommandLine,
    104104    UIActionIndexRT_M_Debug_T_Logging,
     105    UIActionIndexRT_M_Debug_S_ShowLogDialog,
    105106#endif /* VBOX_WITH_DEBUGGER_GUI */
    106107
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r52558 r52579  
    966966    connect(actionPool()->action(UIActionIndexRT_M_Debug_T_Logging), SIGNAL(toggled(bool)),
    967967            this, SLOT(sltLoggingToggled(bool)));
    968     connect(actionPool()->action(UIActionIndex_Simple_LogDialog), SIGNAL(triggered()),
     968    connect(actionPool()->action(UIActionIndexRT_M_Debug_S_ShowLogDialog), SIGNAL(triggered()),
    969969            this, SLOT(sltShowLogDialog()));
    970970#endif /* VBOX_WITH_DEBUGGER_GUI */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp

    r52558 r52579  
    561561        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_S_ShowCommandLine));
    562562        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_T_Logging));
    563         prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_LogDialog));
     563        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndexRT_M_Debug_S_ShowLogDialog));
    564564    }
    565565}
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r52572 r52579  
    677677};
    678678
     679class UIActionSimpleCommonShowLogDialog : public UIActionSimple
     680{
     681    Q_OBJECT;
     682
     683public:
     684
     685    UIActionSimpleCommonShowLogDialog(UIActionPool *pParent)
     686        : UIActionSimple(pParent,
     687                         ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
     688                         ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")
     689    {
     690        retranslateUi();
     691    }
     692
     693protected:
     694
     695    QString shortcutExtraDataID() const
     696    {
     697        return QString("ShowVMLog");
     698    }
     699
     700    QKeySequence defaultShortcut(UIActionPoolType) const
     701    {
     702        return QKeySequence("Ctrl+L");
     703    }
     704
     705    void retranslateUi()
     706    {
     707        setName(QApplication::translate("UIActionPool", "Show &Log..."));
     708        setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine"));
     709    }
     710};
     711
    679712class UIActionSimpleCommonRefresh : public UIActionSimple
    680713{
     
    918951    m_pool[UIActionIndexST_M_Group_M_Close_S_PowerOff] = new UIActionSimplePowerOff(this);
    919952    m_pool[UIActionIndexST_M_Group_S_Discard] = new UIActionSimpleCommonDiscard(this);
     953    m_pool[UIActionIndexST_M_Group_S_ShowLogDialog] = new UIActionSimpleCommonShowLogDialog(this);
    920954    m_pool[UIActionIndexST_M_Group_S_Refresh] = new UIActionSimpleCommonRefresh(this);
    921955    m_pool[UIActionIndexST_M_Group_S_ShowInFileManager] = new UIActionSimpleCommonShowInFileManager(this);
     
    939973    m_pool[UIActionIndexST_M_Machine_M_Close_S_PowerOff] = new UIActionSimplePowerOff(this);
    940974    m_pool[UIActionIndexST_M_Machine_S_Discard] = new UIActionSimpleCommonDiscard(this);
     975    m_pool[UIActionIndexST_M_Machine_S_ShowLogDialog] = new UIActionSimpleCommonShowLogDialog(this);
    941976    m_pool[UIActionIndexST_M_Machine_S_Refresh] = new UIActionSimpleCommonRefresh(this);
    942977    m_pool[UIActionIndexST_M_Machine_S_ShowInFileManager] = new UIActionSimpleCommonShowInFileManager(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r52459 r52579  
    4646    UIActionIndexST_M_Group_S_Rename,
    4747    UIActionIndexST_M_Group_S_Remove,
    48     UIActionIndexST_M_Group_P_StartOrShow, //
    49     UIActionIndexST_M_Group_T_Pause, //
    50     UIActionIndexST_M_Group_S_Reset, //
     48    UIActionIndexST_M_Group_P_StartOrShow,
     49    UIActionIndexST_M_Group_T_Pause,
     50    UIActionIndexST_M_Group_S_Reset,
    5151    UIActionIndexST_M_Group_M_Close,
    5252    UIActionIndexST_M_Group_M_Close_S_SaveState,
    5353    UIActionIndexST_M_Group_M_Close_S_Shutdown,
    5454    UIActionIndexST_M_Group_M_Close_S_PowerOff,
    55     UIActionIndexST_M_Group_S_Discard, //
    56     UIActionIndexST_M_Group_S_Refresh, //
    57     UIActionIndexST_M_Group_S_ShowInFileManager, //
    58     UIActionIndexST_M_Group_S_CreateShortcut, //
     55    UIActionIndexST_M_Group_S_Discard,
     56    UIActionIndexST_M_Group_S_ShowLogDialog,
     57    UIActionIndexST_M_Group_S_Refresh,
     58    UIActionIndexST_M_Group_S_ShowInFileManager,
     59    UIActionIndexST_M_Group_S_CreateShortcut,
    5960    UIActionIndexST_M_Group_S_Sort,
    6061
     
    6768    UIActionIndexST_M_Machine_S_Remove,
    6869    UIActionIndexST_M_Machine_S_AddGroup,
    69     UIActionIndexST_M_Machine_P_StartOrShow, //
    70     UIActionIndexST_M_Machine_T_Pause, //
    71     UIActionIndexST_M_Machine_S_Reset, //
     70    UIActionIndexST_M_Machine_P_StartOrShow,
     71    UIActionIndexST_M_Machine_T_Pause,
     72    UIActionIndexST_M_Machine_S_Reset,
    7273    UIActionIndexST_M_Machine_M_Close,
    7374    UIActionIndexST_M_Machine_M_Close_S_SaveState,
    7475    UIActionIndexST_M_Machine_M_Close_S_Shutdown,
    7576    UIActionIndexST_M_Machine_M_Close_S_PowerOff,
    76     UIActionIndexST_M_Machine_S_Discard, //
    77     UIActionIndexST_M_Machine_S_Refresh, //
    78     UIActionIndexST_M_Machine_S_ShowInFileManager, //
    79     UIActionIndexST_M_Machine_S_CreateShortcut, //
     77    UIActionIndexST_M_Machine_S_Discard,
     78    UIActionIndexST_M_Machine_S_ShowLogDialog,
     79    UIActionIndexST_M_Machine_S_Refresh,
     80    UIActionIndexST_M_Machine_S_ShowInFileManager,
     81    UIActionIndexST_M_Machine_S_CreateShortcut,
    8082    UIActionIndexST_M_Machine_S_SortParent,
    8183
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r52558 r52579  
    760760    {
    761761        /* Check if log could be show for the current item: */
    762         if (!isActionEnabled(UIActionIndex_Simple_LogDialog, QList<UIVMItem*>() << pItem))
     762        if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, QList<UIVMItem*>() << pItem))
    763763            continue;
    764764
     
    11891189    pMenu->addSeparator();
    11901190    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_S_Discard));
     1191    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog));
    11911192    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Group_S_Refresh));
    11921193    pMenu->addSeparator();
     
    12051206                   << actionPool()->action(UIActionIndexST_M_Group_S_Reset)
    12061207                   << actionPool()->action(UIActionIndexST_M_Group_S_Discard)
     1208                   << actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog)
    12071209                   << actionPool()->action(UIActionIndexST_M_Group_S_Refresh)
    12081210                   << actionPool()->action(UIActionIndexST_M_Group_S_ShowInFileManager)
     
    12311233    pMenu->addSeparator();
    12321234    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));
    1233     pMenu->addAction(actionPool()->action(UIActionIndex_Simple_LogDialog));
     1235    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog));
    12341236    pMenu->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Refresh));
    12351237    pMenu->addSeparator();
     
    12501252                     << actionPool()->action(UIActionIndexST_M_Machine_S_Reset)
    12511253                     << actionPool()->action(UIActionIndexST_M_Machine_S_Discard)
    1252                      << actionPool()->action(UIActionIndex_Simple_LogDialog)
     1254                     << actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog)
    12531255                     << actionPool()->action(UIActionIndexST_M_Machine_S_Refresh)
    12541256                     << actionPool()->action(UIActionIndexST_M_Machine_S_ShowInFileManager)
     
    13971399    connect(actionPool()->action(UIActionIndexST_M_Group_S_Reset), SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
    13981400    connect(actionPool()->action(UIActionIndexST_M_Group_S_Discard), SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
     1401    connect(actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog), SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    13991402    connect(actionPool()->action(UIActionIndexST_M_Group_S_ShowInFileManager), SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
    14001403    connect(actionPool()->action(UIActionIndexST_M_Group_S_CreateShortcut), SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
     
    14071410    connect(actionPool()->action(UIActionIndexST_M_Machine_T_Pause), SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
    14081411    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Reset), SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
    1409     connect(actionPool()->action(UIActionIndex_Simple_LogDialog), SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    14101412    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Discard), SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
     1413    connect(actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog), SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    14111414    connect(actionPool()->action(UIActionIndexST_M_Machine_S_ShowInFileManager), SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
    14121415    connect(actionPool()->action(UIActionIndexST_M_Machine_S_CreateShortcut), SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
     
    15691572    actionPool()->action(UIActionIndexST_M_Group_S_Reset)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_S_Reset, items));
    15701573    actionPool()->action(UIActionIndexST_M_Group_S_Discard)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_S_Discard, items));
     1574    actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, items));
    15711575    actionPool()->action(UIActionIndexST_M_Group_S_Refresh)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_S_Refresh, items));
    15721576    actionPool()->action(UIActionIndexST_M_Group_S_ShowInFileManager)->setEnabled(isActionEnabled(UIActionIndexST_M_Group_S_ShowInFileManager, items));
     
    15831587    actionPool()->action(UIActionIndexST_M_Machine_S_Reset)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Reset, items));
    15841588    actionPool()->action(UIActionIndexST_M_Machine_S_Discard)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Discard, items));
    1585     actionPool()->action(UIActionIndex_Simple_LogDialog)->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
     1589    actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_ShowLogDialog, items));
    15861590    actionPool()->action(UIActionIndexST_M_Machine_S_Refresh)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Refresh, items));
    15871591    actionPool()->action(UIActionIndexST_M_Machine_S_ShowInFileManager)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_ShowInFileManager, items));
     
    16911695                   isAtLeastOneItemDiscardable(items);
    16921696        }
     1697        case UIActionIndexST_M_Group_S_ShowLogDialog:
     1698        case UIActionIndexST_M_Machine_S_ShowLogDialog:
     1699        {
     1700            return isAtLeastOneItemAccessible(items);
     1701        }
    16931702        case UIActionIndexST_M_Group_T_Pause:
    16941703        case UIActionIndexST_M_Machine_T_Pause:
     
    17051714        {
    17061715            return isAtLeastOneItemInaccessible(items);
    1707         }
    1708         case UIActionIndex_Simple_LogDialog:
    1709         {
    1710             return items.size() == 1 && pItem->accessible();
    17111716        }
    17121717        case UIActionIndexST_M_Group_S_ShowInFileManager:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r52202 r52579  
    11451145    m_pContextMenuGroup->addSeparator();
    11461146    m_pContextMenuGroup->addAction(actionPool()->action(UIActionIndexST_M_Group_S_Discard));
     1147    m_pContextMenuGroup->addAction(actionPool()->action(UIActionIndexST_M_Group_S_ShowLogDialog));
    11471148    m_pContextMenuGroup->addAction(actionPool()->action(UIActionIndexST_M_Group_S_Refresh));
    11481149    m_pContextMenuGroup->addSeparator();
     
    11651166    m_pContextMenuMachine->addSeparator();
    11661167    m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Discard));
    1167     m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndex_Simple_LogDialog));
     1168    m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ShowLogDialog));
    11681169    m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Refresh));
    11691170    m_pContextMenuMachine->addSeparator();
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