VirtualBox

Ignore:
Timestamp:
Sep 18, 2015 2:21:13 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Selector-window cleanup/rework (step 1): Doxy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r55554 r57829  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UISelectorWindow_h__
    19 #define __UISelectorWindow_h__
     18#ifndef ___UISelectorWindow_h___
     19#define ___UISelectorWindow_h___
    2020
    2121/* Qt includes: */
     
    2727
    2828/* Forward declarations: */
    29 class QISplitter;
    30 class QMenu;
    3129class UIAction;
     30class UIActionPool;
    3231class UIActionPolymorphic;
     32class UIGChooser;
     33class UIGDetails;
    3334class UIMainBar;
    3435class UIToolBar;
    3536class UIVMDesktop;
    3637class UIVMItem;
    37 class UIGChooser;
    38 class UIGDetails;
    39 class UIActionPool;
     38class QISplitter;
     39class QMenu;
    4040class QStackedWidget;
    4141
    42 /* VM selector window class: */
     42/** QMainWindow extension
     43  * used as VirtualBox Manager (selector-window) instance. */
    4344class UISelectorWindow : public QIWithRetranslateUI2<QMainWindow>
    4445{
     
    4748public:
    4849
    49     /* Constructor/destructor: */
     50    /** Constructs selector-window passing @a pParent to the QMainWindow base-class.
     51      * @param ppSelf brings the pointer to pointer to this window instance used by the external caller.
     52      * @param flags  brings the selector-window flags dialogs should have. */
    5053    UISelectorWindow(UISelectorWindow **ppSelf,
    51                      QWidget* pParent = 0,
     54                     QWidget *pParent = 0,
    5255                     Qt::WindowFlags flags = Qt::Window);
     56    /** Destructs selector-window. */
    5357    ~UISelectorWindow();
    5458
     
    5862private slots:
    5963
    60     /* Handlers: Global-event stuff: */
     64    /** Handles CVirtualBox event about state change for machine with @a strId. */
    6165    void sltStateChanged(QString strId);
     66    /** Handles CVirtualBox event about snapshot change for machine with @a strId. */
    6267    void sltSnapshotChanged(QString strId);
    6368
    64     /* Handler: Details-view stuff: */
     69    /** Handles signal about Details-view @a iWidgetIndex change. */
    6570    void sltDetailsViewIndexChanged(int iWidgetIndex);
    6671
    67     /* Handler: Medium enumeration stuff: */
     72    /** Handles signal about medium-enumeration finished. */
    6873    void sltHandleMediumEnumerationFinish();
    6974
    70     /* Handler: Menubar/status stuff: */
     75    /** Handles selector-window context-menu call for passed @a pos. */
    7176    void sltShowSelectorContextMenu(const QPoint &pos);
    7277
    73     /* Handlers: File-menu stuff: */
     78    /** Handles call to open Media Manager dialog. */
    7479    void sltShowMediumManager();
     80    /** Handles call to open Import Appliance wizard.
     81      * @param strFileName can bring the name of file to import appliance from. */
    7582    void sltShowImportApplianceWizard(const QString &strFileName = QString());
     83    /** Handles call to open Export Appliance wizard. */
    7684    void sltShowExportApplianceWizard();
    7785#ifdef DEBUG
     86    /** Handles call to open Extra-data Manager dialog. */
    7887    void sltOpenExtraDataManagerWindow();
    7988#endif /* DEBUG */
     89    /** Handles call to open Preferences dialog. */
    8090    void sltShowPreferencesDialog();
     91    /** Handles call to exit application. */
    8192    void sltPerformExit();
    8293
    83     /* Handlers: Machine-menu slots: */
     94    /** Handles call to open Add Machine dialog.
     95      * @param strFileName can bring the name of file to add machine from. */
    8496    void sltShowAddMachineDialog(const QString &strFileName = QString());
     97    /** Handles call to open Machine Settings dialog.
     98      * @param strCategory can bring the settings category to start from.
     99      * @param strControl  can bring the widget of the page to focus.
     100      * @param strId       can bring the ID of machine to manage. */
    85101    void sltShowMachineSettingsDialog(const QString &strCategory = QString(),
    86102                                      const QString &strControl = QString(),
    87103                                      const QString &strId = QString());
     104    /** Handles call to open Clone Machine wizard. */
    88105    void sltShowCloneMachineWizard();
     106    /** Handles call to start or show machine. */
    89107    void sltPerformStartOrShowAction();
     108    /** Handles call to start machine in normal mode. */
    90109    void sltPerformStartNormal();
     110    /** Handles call to start machine in headless mode. */
    91111    void sltPerformStartHeadless();
     112    /** Handles call to start machine in detachable mode. */
    92113    void sltPerformStartDetachable();
     114    /** Handles call to discard machine state. */
    93115    void sltPerformDiscardAction();
     116    /** Handles call to @a fPause or resume machine otherwise. */
    94117    void sltPerformPauseResumeAction(bool fPause);
     118    /** Handles call to reset machine. */
    95119    void sltPerformResetAction();
     120    /** Handles call to save machine state. */
    96121    void sltPerformSaveAction();
     122    /** Handles call to ask machine for shutdown. */
    97123    void sltPerformACPIShutdownAction();
     124    /** Handles call to power machine off. */
    98125    void sltPerformPowerOffAction();
     126    /** Handles call to open machine Log dialog. */
    99127    void sltShowLogDialog();
     128    /** Handles call to show machine in File Manager. */
    100129    void sltShowMachineInFileManager();
     130    /** Handles call to create machine shortcut. */
    101131    void sltPerformCreateShortcutAction();
     132    /** Handles call to show group Close menu. */
    102133    void sltGroupCloseMenuAboutToShow();
     134    /** Handles call to show machine Close menu. */
    103135    void sltMachineCloseMenuAboutToShow();
    104136
    105     /* VM list slots: */
     137    /** Handles signal about Chooser-pane index change.
     138      * @param fRefreshDetails     brings whether details should be updated.
     139      * @param fRefreshSnapshots   brings whether snapshots should be updated.
     140      * @param fRefreshDescription brings whether description should be updated. */
    106141    void sltCurrentVMItemChanged(bool fRefreshDetails = true, bool fRefreshSnapshots = true, bool fRefreshDescription = true);
     142
     143    /** Handles call to open a @a list of URLs. */
    107144    void sltOpenUrls(QList<QUrl> list = QList<QUrl>());
    108145
    109     /* Handlers: Group saving stuff: */
     146    /** Handles signal about group saving process status change. */
    110147    void sltGroupSavingUpdate();
    111148
    112149private:
    113150
    114     /* Translation stuff: */
     151    /** Handles translation event. */
    115152    void retranslateUi();
    116153
    117     /* Event handlers: */
     154    /** Handles any Qt @a pEvent. */
    118155    bool event(QEvent *pEvent);
     156    /** Handles Qt show @a pEvent. */
    119157    void showEvent(QShowEvent *pEvent);
     158    /** Handles Qt polish @a pEvent. */
    120159    void polishEvent(QShowEvent *pEvent);
    121160#ifdef Q_WS_MAC
     161    /** Preprocesses any Qt @a pEvent for passed @a pObject. */
    122162    bool eventFilter(QObject *pObject, QEvent *pEvent);
    123163#endif /* Q_WS_MAC */
    124164
    125     /* Helpers: Prepare stuff: */
     165    /** Prepares icon. */
    126166    void prepareIcon();
     167    /** Prepares menu-bar. */
    127168    void prepareMenuBar();
     169    /** Prepares @a pMenu File. */
    128170    void prepareMenuFile(QMenu *pMenu);
     171    /** Prepares @a pMenu Group. */
    129172    void prepareMenuGroup(QMenu *pMenu);
     173    /** Prepares @a pMenu Machine. */
    130174    void prepareMenuMachine(QMenu *pMenu);
     175    /** Prepares @a pMenu Group => Start or Show. */
    131176    void prepareMenuGroupStartOrShow(QMenu *pMenu);
     177    /** Prepares @a pMenu Machine => Start or Show. */
    132178    void prepareMenuMachineStartOrShow(QMenu *pMenu);
     179    /** Prepares @a pMenu Group => Close. */
    133180    void prepareMenuGroupClose(QMenu *pMenu);
     181    /** Prepares @a pMenu Machine => Close. */
    134182    void prepareMenuMachineClose(QMenu *pMenu);
     183    /** Prepares status-bar. */
    135184    void prepareStatusBar();
     185    /** Prepares widgets. */
    136186    void prepareWidgets();
     187    /** Prepares connections. */
    137188    void prepareConnections();
     189    /** Loads settings. */
    138190    void loadSettings();
     191
     192    /** Saves settings. */
    139193    void saveSettings();
     194    /** Cleanups connections. */
    140195    void cleanupConnections();
     196    /** Cleanups menu-bar. */
    141197    void cleanupMenuBar();
    142198
    143     /* Helpers: Current item stuff: */
     199    /** Returns current-item. */
    144200    UIVMItem* currentItem() const;
     201    /** Returns a list of current-items. */
    145202    QList<UIVMItem*> currentItems() const;
    146203
    147     /* Helper: Action update stuff: */
     204    /** Performs update of actions appearance. */
    148205    void updateActionsAppearance();
    149206
    150     /* Helpers: Action stuff: */
     207    /** Returns whether the action with @a iActionIndex is enabled.
     208      * @param items used to calculate verdict about should the action be enabled. */
    151209    bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items);
     210
     211    /** Returns whether all passed @a items are powered off. */
    152212    static bool isItemsPoweredOff(const QList<UIVMItem*> &items);
     213    /** Returns whether at least one of passed @a items is able to shutdown. */
    153214    static bool isAtLeastOneItemAbleToShutdown(const QList<UIVMItem*> &items);
     215    /** Returns whether at least one of passed @a items supports shortcut creation. */
    154216    static bool isAtLeastOneItemSupportsShortcuts(const QList<UIVMItem*> &items);
     217    /** Returns whether at least one of passed @a items is accessible. */
    155218    static bool isAtLeastOneItemAccessible(const QList<UIVMItem*> &items);
     219    /** Returns whether at least one of passed @a items is inaccessible. */
    156220    static bool isAtLeastOneItemInaccessible(const QList<UIVMItem*> &items);
     221    /** Returns whether at least one of passed @a items is removable. */
    157222    static bool isAtLeastOneItemRemovable(const QList<UIVMItem*> &items);
     223    /** Returns whether at least one of passed @a items can be started or shown. */
    158224    static bool isAtLeastOneItemCanBeStartedOrShowed(const QList<UIVMItem*> &items);
     225    /** Returns whether at least one of passed @a items can be discarded. */
    159226    static bool isAtLeastOneItemDiscardable(const QList<UIVMItem*> &items);
     227    /** Returns whether at least one of passed @a items is started. */
    160228    static bool isAtLeastOneItemStarted(const QList<UIVMItem*> &items);
     229    /** Returns whether at least one of passed @a items is running. */
    161230    static bool isAtLeastOneItemRunning(const QList<UIVMItem*> &items);
    162231
    163     /* Variables: */
     232    /** Holds whether the dialog is polished. */
    164233    bool m_fPolished : 1;
     234    /** Holds whether the warning about inaccessible mediums shown. */
    165235    bool m_fWarningAboutInaccessibleMediumShown : 1;
    166236
     
    168238    UIActionPool *m_pActionPool;
    169239
    170     /* Central splitter window: */
     240    /** Holds the central splitter instance. */
    171241    QISplitter *m_pSplitter;
    172242
    173     /* Main toolbar: */
    174243#ifndef Q_WS_MAC
     244    /** Holds the main bar instance. */
    175245    UIMainBar *m_pBar;
    176246#endif /* !Q_WS_MAC */
     247    /** Holds the main toolbar instance. */
    177248    UIToolBar *mVMToolBar;
    178249
    179     /* Details widgets container: */
     250    /** Holds the Details-view container instance. */
    180251    QStackedWidget *m_pContainer;
    181252
    182     /* Graphics chooser/details: */
     253    /** Holds the Chooser-pane instance. */
    183254    UIGChooser *m_pChooser;
     255    /** Holds the Details-pane instance. */
    184256    UIGDetails *m_pDetails;
    185257
    186     /* VM details widget: */
     258    /** Holds the Desktop-widget instance. */
    187259    UIVMDesktop *m_pVMDesktop;
    188260
    189     /* 'Group' menu action pointers: */
     261    /** Holds the list of Group menu actions. */
    190262    QList<UIAction*> m_groupActions;
     263    /** Holds the Group menu parent action. */
    191264    QAction *m_pGroupMenuAction;
    192265
    193     /* 'Machine' menu action pointers: */
     266    /** Holds the list of Machine menu actions. */
    194267    QList<UIAction*> m_machineActions;
     268    /** Holds the Machine menu parent action. */
    195269    QAction *m_pMachineMenuAction;
    196270
    197     /* Other variables: */
     271    /** Holds the dialog geometry. */
    198272    QRect m_geometry;
    199273};
    200274
    201 #endif // __UISelectorWindow_h__
    202 
     275#endif /* !___UISelectorWindow_h___ */
     276
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