VirtualBox

Ignore:
Timestamp:
Sep 23, 2020 10:55:30 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: QIManagerDialog: A bit of rework for prepare/cleanup cascade stuff.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp

    r82968 r86231  
    6767}
    6868
     69void QIManagerDialog::closeEvent(QCloseEvent *pEvent)
     70{
     71    /* Ignore the event itself: */
     72    pEvent->ignore();
     73    /* But tell the listener to close us (once): */
     74    if (!m_fCloseEmitted)
     75    {
     76        m_fCloseEmitted = true;
     77        emit sigClose();
     78    }
     79}
     80
    6981void QIManagerDialog::prepare()
    7082{
     
    219231    cleanupMenuBar();
    220232}
    221 
    222 void QIManagerDialog::closeEvent(QCloseEvent *pEvent)
    223 {
    224     /* Ignore the event itself: */
    225     pEvent->ignore();
    226     /* But tell the listener to close us (once): */
    227     if (!m_fCloseEmitted)
    228     {
    229         m_fCloseEmitted = true;
    230         emit sigClose();
    231     }
    232 }
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.h

    r82968 r86231  
    104104    QIManagerDialog(QWidget *pCenterWidget);
    105105
    106     /** @name Prepare/cleanup cascade.
    107       * @{ */
    108         /** Prepares all.
    109           * @note Normally you don't need to reimplement it. */
    110         void prepare();
     106    /** @name Virtual prepare/cleanup cascade.
     107      * @{ */
    111108        /** Configures all.
    112109          * @note Injected into prepare(), reimplement to configure all there. */
    113110        virtual void configure() {}
    114         /** Prepares central-widget.
    115           * @note Injected into prepare(), normally you don't need to reimplement it. */
    116         void prepareCentralWidget();
    117111        /** Configures central-widget.
    118112          * @note Injected into prepareCentralWidget(), reimplement to configure central-widget there. */
    119113        virtual void configureCentralWidget() {}
    120         /** Prepares button-box.
    121           * @note Injected into prepareCentralWidget(), normally you don't need to reimplement it. */
    122         void prepareButtonBox();
    123114        /** Configures button-box.
    124115          * @note Injected into prepareButtonBox(), reimplement to configure button-box there. */
    125116        virtual void configureButtonBox() {}
    126         /** Prepares menu-bar.
    127           * @note Injected into prepare(), normally you don't need to reimplement it. */
    128         void prepareMenuBar();
    129 #ifdef VBOX_WS_MAC
    130         /** Prepares toolbar.
    131           * @note Injected into prepare(), normally you don't need to reimplement it. */
    132         void prepareToolBar();
    133 #endif
    134117        /** Performs final preparations.
    135118          * @note Injected into prepare(), reimplement to postprocess all there. */
    136119        virtual void finalize() {}
    137         /** Loads dialog setting such as geometry from extradata. */
     120        /** Loads dialog setting from extradata. */
    138121        virtual void loadSettings() {}
    139122
    140123        /** Saves dialog setting into extradata. */
    141         virtual void saveSettings() const {}
    142         /** Cleanup menu-bar.
    143           * @note Injected into cleanup(), normally you don't need to reimplement it. */
    144         void cleanupMenuBar();
    145         /** Cleanups all.
    146           * @note Normally you don't need to reimplement it. */
    147         void cleanup();
     124        virtual void saveSettings() {}
    148125    /** @} */
    149126
     
    172149      * @{ */
    173150        /** Handles close @a pEvent. */
    174         void closeEvent(QCloseEvent *pEvent);
     151        virtual void closeEvent(QCloseEvent *pEvent) /* override */;
    175152    /** @} */
    176153
    177154private:
     155
     156    /** @name Private prepare/cleanup cascade.
     157      * @{ */
     158        /** Prepares all. */
     159        void prepare();
     160        /** Prepares central-widget. */
     161        void prepareCentralWidget();
     162        /** Prepares button-box. */
     163        void prepareButtonBox();
     164        /** Prepares menu-bar. */
     165        void prepareMenuBar();
     166#ifdef VBOX_WS_MAC
     167        /** Prepares toolbar. */
     168        void prepareToolBar();
     169#endif
     170
     171        /** Cleanup menu-bar. */
     172        void cleanupMenuBar();
     173        /** Cleanups all. */
     174        void cleanup();
     175    /** @} */
    178176
    179177    /** @name General stuff.
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.cpp

    r82968 r86231  
    118118}
    119119
    120 void UIFileManagerDialog::saveSettings() const
     120void UIFileManagerDialog::saveSettings()
    121121{
    122122    /* Save geometry to extradata: */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerDialog.h

    r82968 r86231  
    8888        /** Perform final preparations. */
    8989        virtual void finalize() /* override */;
    90         /** Loads dialog setting such as geometry from extradata. */
     90        /** Loads dialog setting from extradata. */
    9191        virtual void loadSettings() /* override */;
    9292
    9393        /** Saves dialog setting into extradata. */
    94         virtual void saveSettings() const /* override */;
     94        virtual void saveSettings() /* override */;
    9595    /** @} */
    9696
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlDialog.cpp

    r82968 r86231  
    119119}
    120120
    121 void UIGuestProcessControlDialog::saveSettings() const
     121void UIGuestProcessControlDialog::saveSettings()
    122122{
    123123    /* Save geometry to extradata: */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIGuestProcessControlDialog.h

    r82968 r86231  
    8686        /** Perform final preparations. */
    8787        virtual void finalize() /* override */;
    88         /** Loads dialog setting such as geometry from extradata. */
     88        /** Loads dialog setting from extradata. */
    8989        virtual void loadSettings() /* override */;
    9090
    9191        /** Saves dialog setting into extradata. */
    92         virtual void saveSettings() const /* override */;
     92        virtual void saveSettings() /* override */;
    9393    /** @} */
    9494
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.cpp

    r82968 r86231  
    136136}
    137137
    138 void UIVMLogViewerDialog::saveSettings() const
     138void UIVMLogViewerDialog::saveSettings()
    139139{
    140140    /* Save geometry to extradata: */
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerDialog.h

    r82968 r86231  
    9595        /** Perform final preparations. */
    9696        virtual void finalize() /* override */;
    97         /** Loads dialog setting such as geometry from extradata. */
     97        /** Loads dialog setting from extradata. */
    9898        virtual void loadSettings() /* override */;
    9999
    100100        /** Saves dialog setting into extradata. */
    101         virtual void saveSettings() const /* override */;
     101        virtual void saveSettings() /* override */;
    102102    /** @} */
    103103
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