VirtualBox

Changeset 26820 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Feb 26, 2010 9:42:08 AM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: new core: help menu

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.cpp

    r26790 r26820  
    171171    void retranslateUi()
    172172    {
    173         menu()->setTitle(tr("&Machine"));
     173        menu()->setTitle(UIActionsPool::tr("&Machine"));
    174174    }
    175175};
     
    193193    void retranslateUi()
    194194    {
    195         setText(VBoxGlobal::insertKeyToActionText(tr("&Fullscreen Mode"), "F"));
    196         setStatusTip(tr("Switch to fullscreen mode"));
     195        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Fullscreen Mode"), "F"));
     196        setStatusTip(UIActionsPool::tr("Switch to fullscreen mode"));
    197197    }
    198198};
     
    216216    void retranslateUi()
    217217    {
    218         setText(VBoxGlobal::insertKeyToActionText(tr("Seam&less Mode"), "L"));
    219         setStatusTip(tr("Switch to seamless desktop integration mode"));
     218        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Seam&less Mode"), "L"));
     219        setStatusTip(UIActionsPool::tr("Switch to seamless desktop integration mode"));
    220220    }
    221221};
     
    239239    void retranslateUi()
    240240    {
    241         setText(VBoxGlobal::insertKeyToActionText(tr("Auto-resize &Guest Display"), "G"));
    242         setStatusTip(tr("Automatically resize the guest display when the window is resized (requires Guest Additions)"));
     241        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Auto-resize &Guest Display"), "G"));
     242        setStatusTip(UIActionsPool::tr("Automatically resize the guest display when the window is resized (requires Guest Additions)"));
    243243    }
    244244};
     
    261261    void retranslateUi()
    262262    {
    263         setText(VBoxGlobal::insertKeyToActionText(tr("&Adjust Window Size"), "A"));
    264         setStatusTip(tr("Adjust window size and position to best fit the guest display"));
     263        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Adjust Window Size"), "A"));
     264        setStatusTip(UIActionsPool::tr("Adjust window size and position to best fit the guest display"));
    265265    }
    266266};
     
    305305        if (!isChecked())
    306306        {
    307             setText(VBoxGlobal::insertKeyToActionText(tr("Disable &Mouse Integration"), "I"));
    308             setStatusTip(tr("Temporarily disable host mouse pointer integration"));
     307            setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Disable &Mouse Integration"), "I"));
     308            setStatusTip(UIActionsPool::tr("Temporarily disable host mouse pointer integration"));
    309309        }
    310310        else
    311311        {
    312             setText(VBoxGlobal::insertKeyToActionText(tr("Enable &Mouse Integration"), "I"));
    313             setStatusTip(tr("Enable temporarily disabled host mouse pointer integration"));
     312            setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Enable &Mouse Integration"), "I"));
     313            setStatusTip(UIActionsPool::tr("Enable temporarily disabled host mouse pointer integration"));
    314314        }
    315315    }
     
    333333    void retranslateUi()
    334334    {
    335         setText(VBoxGlobal::insertKeyToActionText(tr("&Insert Ctrl-Alt-Del"), "Del"));
    336         setStatusTip(tr("Send the Ctrl-Alt-Del sequence to the virtual machine"));
     335        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Insert Ctrl-Alt-Del"), "Del"));
     336        setStatusTip(UIActionsPool::tr("Send the Ctrl-Alt-Del sequence to the virtual machine"));
    337337    }
    338338};
     
    356356    void retranslateUi()
    357357    {
    358         setText(VBoxGlobal::insertKeyToActionText(tr("&Insert Ctrl-Alt-Backspace"), "Backspace"));
    359         setStatusTip(tr("Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
     358        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Insert Ctrl-Alt-Backspace"), "Backspace"));
     359        setStatusTip(UIActionsPool::tr("Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
    360360    }
    361361};
     
    379379    void retranslateUi()
    380380    {
    381         setText(VBoxGlobal::insertKeyToActionText(tr("Take &Snapshot..."), "S"));
    382         setStatusTip(tr("Take a snapshot of the virtual machine"));
     381        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Take &Snapshot..."), "S"));
     382        setStatusTip(UIActionsPool::tr("Take a snapshot of the virtual machine"));
    383383    }
    384384};
     
    401401    void retranslateUi()
    402402    {
    403         setText(VBoxGlobal::insertKeyToActionText(tr("Session I&nformation Dialog"), "N"));
    404         setStatusTip(tr("Show Session Information Dialog"));
     403        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("Session I&nformation Dialog"), "N"));
     404        setStatusTip(UIActionsPool::tr("Show Session Information Dialog"));
    405405    }
    406406};
     
    425425        if (!isChecked())
    426426        {
    427             setText(VBoxGlobal::insertKeyToActionText(tr ("&Pause"), "P"));
    428             setStatusTip(tr("Suspend the execution of the virtual machine"));
     427            setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Pause"), "P"));
     428            setStatusTip(UIActionsPool::tr("Suspend the execution of the virtual machine"));
    429429        }
    430430        else
    431431        {
    432             setText(VBoxGlobal::insertKeyToActionText(tr ("R&esume"), "P"));
    433             setStatusTip(tr("Resume the execution of the virtual machine"));
     432            setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("R&esume"), "P"));
     433            setStatusTip(UIActionsPool::tr("Resume the execution of the virtual machine"));
    434434        }
    435435    }
     
    453453    void retranslateUi()
    454454    {
    455         setText(VBoxGlobal::insertKeyToActionText(tr ("&Reset"), "R"));
    456         setStatusTip(tr("Reset the virtual machine"));
     455        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Reset"), "R"));
     456        setStatusTip(UIActionsPool::tr("Reset the virtual machine"));
    457457    }
    458458};
     
    477477#ifdef Q_WS_MAC
    478478        /* Host+H is Hide on the mac */
    479         setText(VBoxGlobal::insertKeyToActionText(tr ("ACPI Sh&utdown"), "U"));
     479        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("ACPI Sh&utdown"), "U"));
    480480#else /* Q_WS_MAC */
    481         setText(VBoxGlobal::insertKeyToActionText(tr ("ACPI S&hutdown"), "H"));
     481        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("ACPI S&hutdown"), "H"));
    482482#endif /* !Q_WS_MAC */
    483         setStatusTip(tr("Send the ACPI Power Button press event to the virtual machine"));
     483        setStatusTip(UIActionsPool::tr("Send the ACPI Power Button press event to the virtual machine"));
    484484    }
    485485};
     
    503503    void retranslateUi()
    504504    {
    505         setText(VBoxGlobal::insertKeyToActionText(tr("&Close..." ), "Q"));
    506         setStatusTip(tr("Close the virtual machine"));
     505        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Close..." ), "Q"));
     506        setStatusTip(UIActionsPool::tr("Close the virtual machine"));
    507507    }
    508508};
     
    524524    void retranslateUi()
    525525    {
    526         menu()->setTitle(tr("&Devices"));
     526        menu()->setTitle(UIActionsPool::tr("&Devices"));
    527527    }
    528528};
     
    545545    void retranslateUi()
    546546    {
    547         menu()->setTitle(tr("&CD/DVD Devices"));
     547        menu()->setTitle(UIActionsPool::tr("&CD/DVD Devices"));
    548548    }
    549549};
     
    566566    void retranslateUi()
    567567    {
    568         menu()->setTitle(tr("&Floppy Devices"));
     568        menu()->setTitle(UIActionsPool::tr("&Floppy Devices"));
    569569    }
    570570};
     
    587587    void retranslateUi()
    588588    {
    589         menu()->setTitle(tr("&USB Devices"));
     589        menu()->setTitle(UIActionsPool::tr("&USB Devices"));
    590590    }
    591591};
     
    627627    void retranslateUi()
    628628    {
    629         setText(tr("&Network Adapters..."));
    630         setStatusTip(tr("Change the settings of network adapters"));
     629        setText(UIActionsPool::tr("&Network Adapters..."));
     630        setStatusTip(UIActionsPool::tr("Change the settings of network adapters"));
    631631    }
    632632};
     
    668668    void retranslateUi()
    669669    {
    670         setText(tr("&Shared Folders..."));
    671         setStatusTip(tr("Create or modify shared folders"));
     670        setText(UIActionsPool::tr("&Shared Folders..."));
     671        setStatusTip(UIActionsPool::tr("Create or modify shared folders"));
    672672    }
    673673};
     
    691691    void retranslateUi()
    692692    {
    693         setText(tr("&Remote Display"));
    694         setStatusTip(tr("Enable or disable remote desktop (RDP) connections to this machine"));
     693        setText(UIActionsPool::tr("&Remote Display"));
     694        setStatusTip(UIActionsPool::tr("Enable or disable remote desktop (RDP) connections to this machine"));
    695695    }
    696696};
     
    713713    void retranslateUi()
    714714    {
    715         setText(VBoxGlobal::insertKeyToActionText(tr("&Install Guest Additions..."), "D"));
    716         setStatusTip(tr("Mount the Guest Additions installation image"));
     715        setText(VBoxGlobal::insertKeyToActionText(UIActionsPool::tr("&Install Guest Additions..."), "D"));
     716        setStatusTip(UIActionsPool::tr("Mount the Guest Additions installation image"));
    717717    }
    718718};
     
    735735    void retranslateUi()
    736736    {
    737         menu()->setTitle(tr("De&bug"));
     737        menu()->setTitle(UIActionsPool::tr("De&bug"));
    738738    }
    739739};
     
    755755    void retranslateUi()
    756756    {
    757         setText(tr("&Statistics...", "debug action"));
     757        setText(UIActionsPool::tr("&Statistics...", "debug action"));
    758758    }
    759759};
     
    775775    void retranslateUi()
    776776    {
    777         setText(tr("&Command Line...", "debug action"));
     777        setText(UIActionsPool::tr("&Command Line...", "debug action"));
    778778    }
    779779};
     
    795795    void retranslateUi()
    796796    {
    797         setText(tr("&Logging...", "debug action"));
     797        setText(UIActionsPool::tr("&Logging...", "debug action"));
    798798    }
    799799};
    800800#endif
     801
     802class MenuHelpAction : public UIMenuAction
     803{
     804    Q_OBJECT;
     805
     806public:
     807
     808    MenuHelpAction(QObject *pParent)
     809        : UIMenuAction(pParent)
     810    {
     811        retranslateUi();
     812    }
     813
     814protected:
     815
     816    void retranslateUi()
     817    {
     818        setText(UIActionsPool::tr("&Help"));
     819    }
     820};
     821
     822class ShowHelpAction : public UISimpleAction
     823{
     824    Q_OBJECT;
     825
     826public:
     827
     828    ShowHelpAction(QObject *pParent)
     829        : UISimpleAction(pParent,
     830                         ":/help_16px.png")
     831    {
     832        retranslateUi();
     833    }
     834
     835protected:
     836
     837    void retranslateUi()
     838    {
     839        setShortcut(QKeySequence::HelpContents);
     840        setText(UIActionsPool::tr("&Contents..."));
     841        setStatusTip(UIActionsPool::tr("Show the online help contents"));
     842    }
     843};
     844
     845class ShowWebAction : public UISimpleAction
     846{
     847    Q_OBJECT;
     848
     849public:
     850
     851    ShowWebAction(QObject *pParent)
     852        : UISimpleAction(pParent,
     853                         ":/site_16px.png")
     854    {
     855        retranslateUi();
     856    }
     857
     858protected:
     859
     860    void retranslateUi()
     861    {
     862        setText(UIActionsPool::tr("&VirtualBox Web Site..."));
     863        setStatusTip(UIActionsPool::tr("Open the browser and go to the VirtualBox product web site"));
     864    }
     865};
     866
     867class PerformResetWarningsAction : public UISimpleAction
     868{
     869    Q_OBJECT;
     870
     871public:
     872
     873    PerformResetWarningsAction(QObject *pParent)
     874        : UISimpleAction(pParent,
     875                         ":/reset_16px.png")
     876    {
     877        retranslateUi();
     878    }
     879
     880protected:
     881
     882    void retranslateUi()
     883    {
     884        setText(UIActionsPool::tr("&Reset All Warnings"));
     885        setStatusTip(UIActionsPool::tr("Go back to showing all suppressed warnings and messages"));
     886    }
     887};
     888
     889class PerformRegisterAction : public UISimpleAction
     890{
     891    Q_OBJECT;
     892
     893public:
     894
     895    PerformRegisterAction(QObject *pParent)
     896        : UISimpleAction(pParent,
     897                         ":/register_16px.png", ":/register_disabled_16px.png")
     898    {
     899        setEnabled(vboxGlobal().virtualBox().
     900                   GetExtraData(VBoxDefs::GUI_RegistrationDlgWinID).isEmpty());
     901        retranslateUi();
     902    }
     903
     904protected:
     905
     906    void retranslateUi()
     907    {
     908        setText(UIActionsPool::tr("R&egister VirtualBox..."));
     909        setStatusTip(UIActionsPool::tr("Open VirtualBox registration form"));
     910    }
     911};
     912
     913class PerformUpdateAction : public UISimpleAction
     914{
     915    Q_OBJECT;
     916
     917public:
     918
     919    PerformUpdateAction(QObject *pParent)
     920        : UISimpleAction(pParent,
     921                         ":/refresh_16px.png", ":/refresh_disabled_16px.png")
     922    {
     923        setMenuRole(QAction::ApplicationSpecificRole);
     924        retranslateUi();
     925    }
     926
     927protected:
     928
     929    void retranslateUi()
     930    {
     931        setText(UIActionsPool::tr("C&heck for Updates..."));
     932        setStatusTip(UIActionsPool::tr("Check for a new VirtualBox version"));
     933    }
     934};
     935
     936class ShowAboutAction : public UISimpleAction
     937{
     938    Q_OBJECT;
     939
     940public:
     941
     942    ShowAboutAction(QObject *pParent)
     943        : UISimpleAction(pParent,
     944                         ":/about_16px.png")
     945    {
     946        setMenuRole(QAction::AboutRole);
     947        retranslateUi();
     948    }
     949
     950protected:
     951
     952    void retranslateUi()
     953    {
     954        setText(UIActionsPool::tr("&About VirtualBox..."));
     955        setStatusTip(UIActionsPool::tr("Show a dialog with product information"));
     956    }
     957};
     958
    801959
    802960UIActionsPool::UIActionsPool(QObject *pParent)
     
    8451003    m_actionsPool[UIActionIndex_Toggle_Logging] = new ToggleLoggingAction(this);
    8461004#endif
     1005
     1006    /* "Help" menu actions: */
     1007    m_actionsPool[UIActionIndex_Menu_Help] = new MenuHelpAction(this);
     1008    m_actionsPool[UIActionIndex_Simple_Help] = new ShowHelpAction(this);
     1009    m_actionsPool[UIActionIndex_Simple_Web] = new ShowWebAction(this);
     1010    m_actionsPool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this);
     1011    m_actionsPool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this);
     1012    m_actionsPool[UIActionIndex_Simple_Update] = new PerformUpdateAction(this);
     1013    m_actionsPool[UIActionIndex_Simple_About] = new ShowAboutAction(this);
    8471014
    8481015    /* Test all actions were initialized */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.h

    r26790 r26820  
    9797#endif
    9898
     99    /* "Help" menu actions: */
     100    UIActionIndex_Menu_Help,
     101    UIActionIndex_Simple_Help,
     102    UIActionIndex_Simple_Web,
     103    UIActionIndex_Simple_ResetWarnings,
     104    UIActionIndex_Simple_Register,
     105    UIActionIndex_Simple_Update,
     106    UIActionIndex_Simple_About,
     107
    99108    UIActionIndex_End
    100109};
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r26815 r26820  
    515515            this, SLOT(sltLoggingToggled(bool)));
    516516#endif
     517
     518    /* "Help" actions connections: */
     519    connect(actionsPool()->action(UIActionIndex_Simple_Help), SIGNAL(triggered()),
     520            &vboxProblem(), SLOT(showHelpHelpDialog()));
     521    connect(actionsPool()->action(UIActionIndex_Simple_Web), SIGNAL(triggered()),
     522            &vboxProblem(), SLOT(showHelpWebDialog()));
     523    connect(actionsPool()->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()),
     524            &vboxProblem(), SLOT(resetSuppressedMessages()));
     525    connect(actionsPool()->action(UIActionIndex_Simple_Register), SIGNAL(triggered()),
     526            &vboxGlobal(), SLOT(showRegistrationDialog()));
     527    connect(actionsPool()->action(UIActionIndex_Simple_Update), SIGNAL(triggered()),
     528            &vboxGlobal(), SLOT(showUpdateDialog()));
     529    connect(actionsPool()->action(UIActionIndex_Simple_About), SIGNAL(triggered()),
     530            &vboxProblem(), SLOT(showHelpAboutDialog()));
     531
     532    connect(&vboxGlobal(), SIGNAL (canShowRegDlg (bool)),
     533            actionsPool()->action(UIActionIndex_Simple_Register), SLOT(setEnabled(bool)));
     534    connect(&vboxGlobal(), SIGNAL (canShowUpdDlg (bool)),
     535            actionsPool()->action(UIActionIndex_Simple_Update), SLOT(setEnabled(bool)));
    517536}
    518537
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r26815 r26820  
    466466#endif /* VBOX_WITH_DEBUGGER_GUI */
    467467
     468void UIMachineWindow::prepareMenuHelp()
     469{
     470    QMenu *menu = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Help)->menu();
     471
     472    menu->clear();
     473
     474    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Help));
     475    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Web));
     476    menu->addSeparator();
     477    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_ResetWarnings));
     478    menu->addSeparator();
     479
     480#ifdef VBOX_WITH_REGISTRATION
     481    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Register));
     482#endif
     483
     484    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_Update));
     485
     486#ifndef Q_WS_MAC
     487    menu->addSeparator();
     488#endif /* Q_WS_MAC */
     489    menu->addAction(machineLogic()->actionsPool()->action(UIActionIndex_Simple_About));
     490}
     491
    468492void UIMachineWindow::updateAppearanceOf(int iElement)
    469493{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r26815 r26820  
    8080    virtual void prepareMenuDebug();
    8181#endif
     82    virtual void prepareMenuHelp();
    8283    //virtual void loadWindowSettings() {}
    8384
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp

    r26815 r26820  
    357357    }
    358358#endif
     359
     360    /* Help submenu: */
     361    QMenu *pMenuHelp = machineLogic()->actionsPool()->action(UIActionIndex_Menu_Help)->menu();
     362    prepareMenuHelp();
     363    menuBar()->addMenu(pMenuHelp);
    359364}
    360365
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