VirtualBox

Changeset 52572 in vbox


Ignore:
Timestamp:
Sep 2, 2014 3:30:19 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Action-pool: Small connections cleanup.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r52567 r52572  
    880880    /* Retranslate finally: */
    881881    retranslateUi();
     882}
     883
     884void UIActionPool::prepareConnections()
     885{
     886    /* 'Help' menu connections: */
     887    connect(action(UIActionIndex_Simple_Contents), SIGNAL(triggered()),
     888            &msgCenter(), SLOT(sltShowHelpHelpDialog()), Qt::UniqueConnection);
     889    connect(action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()),
     890            &msgCenter(), SLOT(sltShowHelpWebDialog()), Qt::UniqueConnection);
     891    connect(action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()),
     892            &msgCenter(), SLOT(sltResetSuppressedMessages()), Qt::UniqueConnection);
     893#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     894    connect(action(UIActionIndex_Simple_NetworkAccessManager), SIGNAL(triggered()),
     895            gNetworkManager, SLOT(show()), Qt::UniqueConnection);
     896    connect(action(UIActionIndex_Simple_CheckForUpdates), SIGNAL(triggered()),
     897            gUpdateManager, SLOT(sltForceCheck()), Qt::UniqueConnection);
     898#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     899#ifdef RT_OS_DARWIN
     900    connect(action(UIActionIndex_M_Application_S_About), SIGNAL(triggered()),
     901            &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);
     902#else /* !RT_OS_DARWIN */
     903    connect(action(UIActionIndex_Simple_About), SIGNAL(triggered()),
     904            &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);
     905#endif /* !RT_OS_DARWIN */
    882906}
    883907
     
    971995    action(UIActionIndex_M_Application_S_About)->setVisible(fAllowToShowActionAbout);
    972996    if (!pMenu->isConsumed())
    973     {
    974997        pMenu->addAction(action(UIActionIndex_M_Application_S_About));
    975         connect(action(UIActionIndex_M_Application_S_About), SIGNAL(triggered()),
    976                 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);
    977     }
    978998
    979999    /* Only for Runtime pool: */
     
    10181038    {
    10191039        pMenu->addAction(action(UIActionIndex_Simple_Contents));
    1020         connect(action(UIActionIndex_Simple_Contents), SIGNAL(triggered()),
    1021                 &msgCenter(), SLOT(sltShowHelpHelpDialog()), Qt::UniqueConnection);
    10221040        fSeparator = true;
    10231041    }
     
    10291047    {
    10301048        pMenu->addAction(action(UIActionIndex_Simple_WebSite));
    1031         connect(action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()),
    1032                 &msgCenter(), SLOT(sltShowHelpWebDialog()), Qt::UniqueConnection);
    10331049        fSeparator = true;
    10341050    }
     
    10491065    {
    10501066        pMenu->addAction(action(UIActionIndex_Simple_ResetWarnings));
    1051         connect(action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()),
    1052                 &msgCenter(), SLOT(sltResetSuppressedMessages()), Qt::UniqueConnection);
    10531067        fSeparator = true;
    10541068    }
     
    10701084    {
    10711085        pMenu->addAction(action(UIActionIndex_Simple_NetworkAccessManager));
    1072         connect(action(UIActionIndex_Simple_NetworkAccessManager), SIGNAL(triggered()),
    1073                 gNetworkManager, SLOT(show()), Qt::UniqueConnection);
    10741086        fSeparator = true;
    10751087    }
     
    10841096        {
    10851097            pMenu->addAction(action(UIActionIndex_Simple_CheckForUpdates));
    1086             connect(action(UIActionIndex_Simple_CheckForUpdates), SIGNAL(triggered()),
    1087                     gUpdateManager, SLOT(sltForceCheck()), Qt::UniqueConnection);
    10881098            fSeparator = true;
    10891099        }
     
    11051115    action(UIActionIndex_Simple_About)->setEnabled(fAllowToShowActionAbout);
    11061116    if (fAllowToShowActionAbout)
    1107     {
    11081117        pMenu->addAction(action(UIActionIndex_Simple_About));
    1109         connect(action(UIActionIndex_Simple_About), SIGNAL(triggered()),
    1110                 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);
    1111     }
    11121118
    11131119    /* Only for Runtime pool: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r52558 r52572  
    397397    virtual void preparePool();
    398398    /** Prepare connections routine. */
    399     virtual void prepareConnections() = 0;
     399    virtual void prepareConnections();
    400400    /** Cleanup connections routine. */
    401401    virtual void cleanupConnections() {}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r52567 r52572  
    18591859    connect(gShortcutPool, SIGNAL(sigMachineShortcutsReloaded()), this, SLOT(sltApplyShortcuts()));
    18601860    connect(gEDataManager, SIGNAL(sigMenuBarConfigurationChange()), this, SLOT(sltHandleConfigurationChange()));
     1861
     1862    /* Call to base-class: */
     1863    UIActionPool::prepareConnections();
    18611864}
    18621865
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r52215 r52572  
    952952    /* Prepare connections: */
    953953    connect(gShortcutPool, SIGNAL(sigSelectorShortcutsReloaded()), this, SLOT(sltApplyShortcuts()));
     954
     955    /* Call to base-class: */
     956    UIActionPool::prepareConnections();
    954957}
    955958
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