VirtualBox

Ignore:
Timestamp:
May 26, 2014 1:42:06 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Move Global Preferences call functionality to appropriate place (from UISession to UIMachineLogic).

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

Legend:

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

    r51308 r51395  
    22522252#endif
    22532253        m_pHostLedsState = NULL;
    2254         }
     2254    }
     2255}
     2256
     2257void UIMachineLogic::sltShowGlobalPreferences()
     2258{
     2259    /* Do not process if window(s) missed! */
     2260    if (!isMachineWindowsCreated())
     2261        return;
     2262
     2263    /* Just show Global Preferences: */
     2264    showGlobalPreferences();
     2265}
     2266
     2267void UIMachineLogic::showGlobalPreferences(const QString &strCategory /* = QString() */, const QString &strControl /* = QString() */)
     2268{
     2269    /* Do not process if window(s) missed! */
     2270    if (!isMachineWindowsCreated())
     2271        return;
     2272
     2273    /* Check that we do NOT handling that already: */
     2274    if (gActionPool->action(UIActionIndex_Simple_Preferences)->data().toBool())
     2275        return;
     2276    /* Remember that we handling that already: */
     2277    gActionPool->action(UIActionIndex_Simple_Preferences)->setData(true);
     2278
     2279    /* Create and execute global settings window: */
     2280    QPointer<UISettingsDialogGlobal> pDialog = new UISettingsDialogGlobal(activeMachineWindow(),
     2281                                                                          strCategory, strControl);
     2282    pDialog->execute();
     2283    if (pDialog)
     2284        delete pDialog;
     2285
     2286    /* Remember that we do NOT handling that already: */
     2287    gActionPool->action(UIActionIndex_Simple_Preferences)->setData(false);
    22552288}
    22562289
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r51187 r51395  
    248248    void sltSwitchKeyboardLedsToPreviousLeds();
    249249
     250    /** Show Global Preferences. */
     251    void sltShowGlobalPreferences();
     252
    250253private:
     254
     255    /** Show Global Preferences on the page defined by @a strCategory and tab defined by @a strControl. */
     256    void showGlobalPreferences(const QString &strCategory = QString(), const QString &strControl = QString());
    251257
    252258    /* Helpers: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r51392 r51395  
    699699}
    700700
    701 void UISession::sltOpenGlobalPreferences()
    702 {
    703     /* Check that we do NOT handling that already: */
    704     if (gActionPool->action(UIActionIndex_Simple_Preferences)->data().toBool())
    705         return;
    706     /* Remember that we handling that already: */
    707     gActionPool->action(UIActionIndex_Simple_Preferences)->setData(true);
    708 
    709     /* Create and execute global settings window: */
    710     QPointer<UISettingsDialogGlobal> pDialog = new UISettingsDialogGlobal(machineLogic()->activeMachineWindow());
    711     pDialog->execute();
    712     if (pDialog)
    713         delete pDialog;
    714 
    715     /* Remember that we do NOT handling that already: */
    716     gActionPool->action(UIActionIndex_Simple_Preferences)->setData(false);
    717 }
    718 
    719701void UISession::sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape)
    720702{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r51392 r51395  
    284284    void sltCloseRuntimeUI();
    285285
    286     /** Open global preferences. */
    287     void sltOpenGlobalPreferences();
    288 
    289286    /* Console events slots */
    290287    void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
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