VirtualBox

Changeset 73790 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 20, 2018 5:33:37 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: UIActionPool* classes: More strict rules for passing icon names into constructor.

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

Legend:

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

    r73780 r73790  
    271271*********************************************************************************************************************************/
    272272
     273UIActionSimple::UIActionSimple(UIActionPool *pParent)
     274    : UIAction(pParent, UIActionType_Simple)
     275{
     276}
     277
    273278UIActionSimple::UIActionSimple(UIActionPool *pParent,
    274                                const QString &strIcon /* = QString() */, const QString &strIconDisabled /* = QString() */)
     279                               const QString &strIcon, const QString &strIconDisabled)
    275280    : UIAction(pParent, UIActionType_Simple)
    276281{
    277     if (!strIcon.isNull())
    278         setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
     282    setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
    279283}
    280284
     
    299303*********************************************************************************************************************************/
    300304
     305UIActionToggle::UIActionToggle(UIActionPool *pParent)
     306    : UIAction(pParent, UIActionType_Toggle)
     307{
     308}
     309
    301310UIActionToggle::UIActionToggle(UIActionPool *pParent,
    302                                const QString &strIcon /* = QString() */, const QString &strIconDisabled /* = QString() */)
     311                               const QString &strIcon, const QString &strIconDisabled)
    303312    : UIAction(pParent, UIActionType_Toggle)
    304313{
    305     if (!strIcon.isNull())
    306         setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
     314    setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
    307315    prepare();
    308316}
     
    474482    /** Constructs action passing @a pParent to the base-class. */
    475483    UIActionSimplePerformClose(UIActionPool *pParent)
    476         : UIActionSimple(pParent, ":/exit_16px.png")
     484        : UIActionSimple(pParent, ":/exit_16px.png", ":/exit_16px.png")
    477485    {
    478486        setMenuRole(QAction::QuitRole);
     
    714722    /** Constructs action passing @a pParent to the base-class. */
    715723    UIActionSimpleWebSite(UIActionPool *pParent)
    716         : UIActionSimple(pParent, ":/site_16px.png")
     724        : UIActionSimple(pParent, ":/site_16px.png", ":/site_16px.png")
    717725    {
    718726        retranslateUi();
     
    761769    /** Constructs action passing @a pParent to the base-class. */
    762770    UIActionSimpleBugTracker(UIActionPool *pParent)
    763         : UIActionSimple(pParent, ":/site_bugtracker_16px.png")
     771        : UIActionSimple(pParent, ":/site_bugtracker_16px.png", ":/site_bugtracker_16px.png")
    764772    {
    765773        retranslateUi();
     
    808816    /** Constructs action passing @a pParent to the base-class. */
    809817    UIActionSimpleForums(UIActionPool *pParent)
    810         : UIActionSimple(pParent, ":/site_forum_16px.png")
     818        : UIActionSimple(pParent, ":/site_forum_16px.png", ":/site_forum_16px.png")
    811819    {
    812820        retranslateUi();
     
    855863    /** Constructs action passing @a pParent to the base-class. */
    856864    UIActionSimpleOracle(UIActionPool *pParent)
    857         : UIActionSimple(pParent, ":/site_oracle_16px.png")
     865        : UIActionSimple(pParent, ":/site_oracle_16px.png", ":/site_oracle_16px.png")
    858866    {
    859867        retranslateUi();
     
    902910    /** Constructs action passing @a pParent to the base-class. */
    903911    UIActionSimpleResetWarnings(UIActionPool *pParent)
    904         : UIActionSimple(pParent, ":/reset_warnings_16px.png")
     912        : UIActionSimple(pParent, ":/reset_warnings_16px.png", ":/reset_warnings_16px.png")
    905913    {
    906914        setMenuRole(QAction::ApplicationSpecificRole);
     
    951959    /** Constructs action passing @a pParent to the base-class. */
    952960    UIActionSimpleNetworkAccessManager(UIActionPool *pParent)
    953         : UIActionSimple(pParent, ":/download_manager_16px.png")
     961        : UIActionSimple(pParent, ":/download_manager_16px.png", ":/download_manager_16px.png")
    954962    {
    955963        setMenuRole(QAction::ApplicationSpecificRole);
     
    10481056    /** Constructs action passing @a pParent to the base-class. */
    10491057    UIActionSimpleAbout(UIActionPool *pParent)
    1050         : UIActionSimple(pParent, ":/about_16px.png")
     1058        : UIActionSimple(pParent, ":/about_16px.png", ":/about_16px.png")
    10511059    {
    10521060        setMenuRole(QAction::AboutRole);
     
    11081116    /** Constructs action passing @a pParent to the base-class. */
    11091117    UIActionSimplePreferences(UIActionPool *pParent)
    1110         : UIActionSimple(pParent, ":/global_settings_16px.png")
     1118        : UIActionSimple(pParent, ":/global_settings_16px.png", ":/global_settings_16px.png")
    11111119    {
    11121120        setMenuRole(QAction::PreferencesRole);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r73780 r73790  
    289289protected:
    290290
     291    /** Constructs simple action passing @a pParent to the base-class. */
     292    UIActionSimple(UIActionPool *pParent);
    291293    /** Constructs simple action passing @a pParent to the base-class.
    292294      * @param  strIcon          Brings the normal-icon name.
    293295      * @param  strIconDisabled  Brings the disabled-icon name. */
    294296    UIActionSimple(UIActionPool *pParent,
    295                    const QString &strIcon = QString(),
    296                    const QString &strIconDisabled = QString());
     297                   const QString &strIcon, const QString &strIconDisabled);
    297298    /** Constructs simple action passing @a pParent to the base-class.
    298299      * @param  strIconNormal          Brings the normal-icon name.
     
    317318protected:
    318319
     320    /** Constructs toggle action passing @a pParent to the base-class. */
     321    UIActionToggle(UIActionPool *pParent);
    319322    /** Constructs toggle action passing @a pParent to the base-class.
    320323      * @param  strIcon          Brings the normal-icon name.
    321324      * @param  strIconDisabled  Brings the disabled-icon name. */
    322325    UIActionToggle(UIActionPool *pParent,
    323                    const QString &strIcon = QString(), const QString &strIconDisabled = QString());
     326                   const QString &strIcon, const QString &strIconDisabled);
    324327    /** Constructs toggle action passing @a pParent to the base-class.
    325328      * @param  strIconOn           Brings the on-icon name.
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r73780 r73790  
    756756    /** Constructs action passing @a pParent to the base-class. */
    757757    UIActionSimpleRuntimePerformMinimizeWindow(UIActionPool *pParent)
    758         : UIActionSimple(pParent, ":/minimize_16px.png")
     758        : UIActionSimple(pParent, ":/minimize_16px.png", ":/minimize_16px.png")
    759759    {}
    760760
     
    894894};
    895895
    896 /** Simple action extension, used as 'Perform Take Snapshot' action class. */
     896/** Simple action extension, used as 'Perform Take Screenshot' action class. */
    897897class UIActionSimpleRuntimePerformTakeScreenshot : public UIActionSimple
    898898{
     
    990990    /** Constructs action passing @a pParent to the base-class. */
    991991    UIActionSimpleRuntimeShowVideoCaptureSettings(UIActionPool *pParent)
    992         : UIActionSimple(pParent, ":/video_capture_settings_16px.png")
     992        : UIActionSimple(pParent, ":/video_capture_settings_16px.png", ":/video_capture_settings_16px.png")
    993993    {}
    994994
     
    12081208    /** Constructs action passing @a pParent to the base-class. */
    12091209    UIActionToggleRuntimeMenuBar(UIActionPool *pParent)
    1210         : UIActionToggle(pParent, ":/menubar_on_16px.png", ":/menubar_16px.png",
    1211                                   ":/menubar_on_disabled_16px.png", ":/menubar_disabled_16px.png")
     1210        : UIActionToggle(pParent,
     1211                         ":/menubar_on_16px.png", ":/menubar_16px.png",
     1212                         ":/menubar_on_disabled_16px.png", ":/menubar_disabled_16px.png")
    12121213    {}
    12131214
     
    13351336    /** Constructs action passing @a pParent to the base-class. */
    13361337    UIActionToggleRuntimeStatusBar(UIActionPool *pParent)
    1337         : UIActionToggle(pParent, ":/statusbar_on_16px.png", ":/statusbar_16px.png",
    1338                                   ":/statusbar_on_disabled_16px.png", ":/statusbar_disabled_16px.png")
     1338        : UIActionToggle(pParent,
     1339                         ":/statusbar_on_16px.png", ":/statusbar_16px.png",
     1340                         ":/statusbar_on_disabled_16px.png", ":/statusbar_disabled_16px.png")
    13391341    {}
    13401342
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolSelector.cpp

    r73780 r73790  
    7272    /** Constructs action passing @a pParent to the base-class. */
    7373    UIActionSimpleSelectorFileShowVirtualMediaManager(UIActionPool *pParent)
    74         : UIActionSimple(pParent, ":/media_manager_16px.png")
     74        : UIActionSimple(pParent, ":/media_manager_16px.png", ":/media_manager_16px.png")
    7575    {}
    7676
     
    106106    /** Constructs action passing @a pParent to the base-class. */
    107107    UIActionSimpleSelectorFileShowHostNetworkManager(UIActionPool *pParent)
    108         : UIActionSimple(pParent, ":/host_iface_manager_16px.png")
     108        : UIActionSimple(pParent, ":/host_iface_manager_16px.png", ":/host_iface_manager_16px.png")
    109109    {}
    110110
     
    140140    /** Constructs action passing @a pParent to the base-class. */
    141141    UIActionSimpleSelectorFileShowImportApplianceWizard(UIActionPool *pParent)
    142         : UIActionSimple(pParent, ":/import_16px.png")
     142        : UIActionSimple(pParent, ":/import_16px.png", ":/import_16px.png")
    143143    {}
    144144
     
    174174    /** Constructs action passing @a pParent to the base-class. */
    175175    UIActionSimpleSelectorFileShowExportApplianceWizard(UIActionPool *pParent)
    176         : UIActionSimple(pParent, ":/export_16px.png")
     176        : UIActionSimple(pParent, ":/export_16px.png", ":/export_16px.png")
    177177    {}
    178178
     
    209209    /** Constructs action passing @a pParent to the base-class. */
    210210    UIActionSimpleSelectorFileShowExtraDataManager(UIActionPool *pParent)
    211         : UIActionSimple(pParent, ":/edata_manager_16px.png")
     211        : UIActionSimple(pParent, ":/edata_manager_16px.png", ":/edata_manager_16px.png")
    212212    {}
    213213
     
    244244    /** Constructs action passing @a pParent to the base-class. */
    245245    UIActionSimpleSelectorFilePerformExit(UIActionPool *pParent)
    246         : UIActionSimple(pParent, ":/exit_16px.png")
     246        : UIActionSimple(pParent, ":/exit_16px.png", ":/exit_16px.png")
    247247    {
    248248        setMenuRole(QAction::QuitRole);
     
    338338    /** Constructs action passing @a pParent to the base-class. */
    339339    UIActionSimpleSelectorGroupPerformAddMachine(UIActionPool *pParent)
    340         : UIActionSimple(pParent, ":/vm_add_16px.png")
     340        : UIActionSimple(pParent, ":/vm_add_16px.png", ":/vm_add_16px.png")
    341341    {}
    342342
     
    526526    /** Constructs action passing @a pParent to the base-class. */
    527527    UIActionSimpleSelectorMachinePerformAdd(UIActionPool *pParent)
    528         : UIActionSimple(pParent, ":/vm_add_16px.png")
     528        : UIActionSimple(pParent, ":/vm_add_16px.png", ":/vm_add_16px.png")
    529529    {}
    530530
     
    818818    /** Constructs action passing @a pParent to the base-class. */
    819819    UIActionSimpleSelectorCommonPerformStartNormal(UIActionPool *pParent)
    820         : UIActionSimple(pParent, ":/vm_start_16px.png")
     820        : UIActionSimple(pParent, ":/vm_start_16px.png", ":/vm_start_16px.png")
    821821    {}
    822822
     
    846846    /** Constructs action passing @a pParent to the base-class. */
    847847    UIActionSimpleSelectorCommonPerformStartHeadless(UIActionPool *pParent)
    848         : UIActionSimple(pParent, ":/vm_start_headless_16px.png")
     848        : UIActionSimple(pParent, ":/vm_start_headless_16px.png", ":/vm_start_headless_16px.png")
    849849    {}
    850850
     
    874874    /** Constructs action passing @a pParent to the base-class. */
    875875    UIActionSimpleSelectorCommonPerformStartDetachable(UIActionPool *pParent)
    876         : UIActionSimple(pParent, ":/vm_start_separate_16px.png")
     876        : UIActionSimple(pParent, ":/vm_start_separate_16px.png", ":/vm_start_separate_16px.png")
    877877    {}
    878878
     
    13011301    /** Constructs action passing @a pParent to the base-class. */
    13021302    UIActionToggleSelectorToolsMachine(UIActionPool *pParent)
    1303         : UIActionToggle(pParent, ":/tools_machine_32px.png")
     1303        : UIActionToggle(pParent, ":/tools_machine_32px.png", ":/tools_machine_32px.png")
    13041304    {}
    13051305
     
    14481448    /** Constructs action passing @a pParent to the base-class. */
    14491449    UIActionToggleSelectorToolsGlobal(UIActionPool *pParent)
    1450         : UIActionToggle(pParent, ":/tools_global_32px.png")
     1450        : UIActionToggle(pParent, ":/tools_global_32px.png", ":/tools_global_32px.png")
    14511451    {}
    14521452
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