VirtualBox

Ignore:
Timestamp:
Sep 2, 2008 10:08:52 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
35922
Message:

FE/Qt4: Unified the Help menu (using the VBoxHelpActions struct).

Location:
trunk/src/VBox/Frontends/VirtualBox4/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h

    r12007 r12010  
    2525
    2626#include "COMDefs.h"
     27
    2728#include "QIWithRetranslateUI.h"
     29
     30#include "VBoxProblemReporter.h"
    2831
    2932/* Qt includes */
     
    3235#include <QColor>
    3336#include <QDialog>
    34 
    3537
    3638#ifdef VBOX_WITH_DEBUGGER_GUI
     
    239241
    240242    // Help actions
    241     QAction *helpContentsAction;
    242     QAction *helpWebAction;
    243     QAction *helpRegisterAction;
    244     QAction *helpUpdateAction;
    245     QAction *helpAboutAction;
    246     QAction *helpResetMessagesAction;
     243    VBoxHelpActions mHelpActions;
    247244
    248245    // Machine popup menus
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h

    r11399 r12010  
    198198};
    199199
    200 // VBoxGlobal
     200// VBoxGlobal class
    201201////////////////////////////////////////////////////////////////////////////////
    202202
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h

    r11228 r12010  
    3030#include <QObject>
    3131
     32class QAction;
     33class QMenu;
     34
     35// VBoxHelpActions class
     36////////////////////////////////////////////////////////////////////////////////
     37
     38/**
     39 * Help Menu action container.
     40 *
     41 * Contains actions for all help menu items and methods to insert them to a
     42 * QMenu and to perform NLS string translation.
     43 *
     44 * Instances of this class are to be created as members of QWidget classes that
     45 * need a Help menu. The containing class usually passes itself as an argument
     46 * to the #setup() method and then calls #addTo() to add actions to its Help
     47 * menu. The #retranslateUi() method is called when it is necessary to
     48 * re-translate all action NLS according to the current language.
     49 */
     50struct VBoxHelpActions
     51{
     52    VBoxHelpActions()
     53        : contentsAction (NULL), webAction (NULL)
     54        , resetMessagesAction (NULL), registerAction (NULL)
     55        , updateAction (NULL), aboutAction (NULL)
     56        {}
     57
     58    void setup (QObject *aParent);
     59    void addTo (QMenu *aMenu);
     60    void retranslateUi();
     61
     62    QAction *contentsAction;
     63    QAction *webAction;
     64    QAction *resetMessagesAction;
     65    QAction *registerAction;
     66    QAction *updateAction;
     67    QAction *aboutAction;
     68};
     69
     70// VBoxProblemReporter class
     71////////////////////////////////////////////////////////////////////////////////
     72
     73/**
     74 * The VBoxProblemReporter class is a central place to handle all problem/error
     75 * situations that happen during application runtime and require the user's
     76 * attention.
     77 *
     78 * The role of this class is to describe the problem and/or the cause of the
     79 * error to the user and give him the opportunity to select an action (when
     80 * appropriate).
     81 *
     82 * Every problem sutiation has its own (correspondingly named) method in this
     83 * class that takes a list of arguments necessary to describe the situation and
     84 * to provide the appropriate actions. The method then returns the choice to the
     85 * caller.
     86 */
    3287class VBoxProblemReporter : public QObject
    3388{
     
    3691public:
    3792
    38     enum Type {
     93    enum Type
     94    {
    3995        Info = 1,
    4096        Question,
     
    44100        GuruMeditation
    45101    };
    46     enum {
     102
     103    enum
     104    {
    47105        AutoConfirmed = 0x8000
    48106    };
     
    339397};
    340398
     399/**
     400 * Shortcut to the static VBoxProblemReporter::instance() method, for
     401 * convenience.
     402 */
    341403inline VBoxProblemReporter &vboxProblem() { return VBoxProblemReporter::instance(); }
    342404
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h

    r11107 r12010  
    2727
    2828#include "QIWithRetranslateUI.h"
     29
    2930#include "VBoxGlobal.h"
     31#include "VBoxProblemReporter.h"
    3032
    3133/* Qt includes */
     
    126128    QAction *vmRefreshAction;
    127129    QAction *vmShowLogsAction;
    128     QAction *helpContentsAction;
    129     QAction *helpWebAction;
    130     QAction *helpRegisterAction;
    131     QAction *helpUpdateAction;
    132     QAction *helpAboutAction;
    133     QAction *helpResetMessagesAction;
     130
     131    VBoxHelpActions mHelpActions;
    134132
    135133    /* The vm list view/model */
Note: See TracChangeset for help on using the changeset viewer.

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