VirtualBox

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


Ignore:
Timestamp:
Apr 17, 2020 1:57:48 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137276
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Cleanup for isItemCanBeSwitchedTo stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r83752 r83755  
    21832183        if (   pItem->toLocal()
    21842184            && pItem->isItemStarted()
    2185             && (   pItem->toLocal()->canSwitchTo()
    2186                 || pItem->isItemRunningHeadless()))
     2185            && pItem->isItemCanBeSwitchedTo())
    21872186            return true;
    21882187    }
     
    21992198                    && pItem->isItemEditable())
    22002199                || (   pItem->isItemStarted()
    2201                     && (   pItem->toLocal()->canSwitchTo()
    2202                         || pItem->isItemRunningHeadless()))))
     2200                    && pItem->isItemCanBeSwitchedTo())))
    22032201            return true;
    22042202    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h

    r83290 r83755  
    120120    /** @name Validation stuff.
    121121      * @{ */
    122         /** Returns whether passed machine @a pItem is editable. */
     122        /** Returns whether this item is editable. */
    123123        virtual bool isItemEditable() const = 0;
    124         /** Returns whether passed machine @a pItem is saved. */
     124        /** Returns whether this item is saved. */
    125125        virtual bool isItemSaved() const = 0;
    126         /** Returns whether passed machine @a pItem is powered off. */
     126        /** Returns whether this item is powered off. */
    127127        virtual bool isItemPoweredOff() const = 0;
    128         /** Returns whether passed machine @a pItem is started. */
     128        /** Returns whether this item is started. */
    129129        virtual bool isItemStarted() const = 0;
    130         /** Returns whether passed machine @a pItem is running. */
     130        /** Returns whether this item is running. */
    131131        virtual bool isItemRunning() const = 0;
    132         /** Returns whether passed machine @a pItem is running headless. */
     132        /** Returns whether this item is running headless. */
    133133        virtual bool isItemRunningHeadless() const = 0;
    134         /** Returns whether passed machine @a pItem is paused. */
     134        /** Returns whether this item is paused. */
    135135        virtual bool isItemPaused() const = 0;
    136         /** Returns whether passed machine @a pItem is stuck. */
     136        /** Returns whether this item is stuck. */
    137137        virtual bool isItemStuck() const = 0;
     138        /** Returns whether this item can be switched to. */
     139        virtual bool isItemCanBeSwitchedTo() const = 0;
    138140    /** @} */
    139141
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.cpp

    r83700 r83755  
    219219    return    accessible()
    220220           && machineState() == KMachineState_Stuck;
     221}
     222
     223bool UIVirtualMachineItemCloud::isItemCanBeSwitchedTo() const
     224{
     225    return false;
    221226}
    222227
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemCloud.h

    r83654 r83755  
    9797    /** @name Validation stuff.
    9898      * @{ */
    99         /** Returns whether passed machine @a pItem is editable. */
     99        /** Returns whether this item is editable. */
    100100        virtual bool isItemEditable() const /* override */;
    101         /** Returns whether passed machine @a pItem is saved. */
     101        /** Returns whether this item is saved. */
    102102        virtual bool isItemSaved() const /* override */;
    103         /** Returns whether passed machine @a pItem is powered off. */
     103        /** Returns whether this item is powered off. */
    104104        virtual bool isItemPoweredOff() const /* override */;
    105         /** Returns whether passed machine @a pItem is started. */
     105        /** Returns whether this item is started. */
    106106        virtual bool isItemStarted() const /* override */;
    107         /** Returns whether passed machine @a pItem is running. */
     107        /** Returns whether this item is running. */
    108108        virtual bool isItemRunning() const /* override */;
    109         /** Returns whether passed machine @a pItem is running headless. */
     109        /** Returns whether this item is running headless. */
    110110        virtual bool isItemRunningHeadless() const /* override */;
    111         /** Returns whether passed machine @a pItem is paused. */
     111        /** Returns whether this item is paused. */
    112112        virtual bool isItemPaused() const /* override */;
    113         /** Returns whether passed machine @a pItem is stuck. */
     113        /** Returns whether this item is stuck. */
    114114        virtual bool isItemStuck() const /* override */;
     115        /** Returns whether this item can be switched to. */
     116        virtual bool isItemCanBeSwitchedTo() const /* override */;
    115117    /** @} */
    116118
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemLocal.cpp

    r83290 r83755  
    167167}
    168168
    169 bool UIVirtualMachineItemLocal::canSwitchTo() const
    170 {
    171     return const_cast <CMachine&>(m_comMachine).CanShowConsoleWindow();
    172 }
    173 
    174169bool UIVirtualMachineItemLocal::switchTo()
    175170{
     
    281276}
    282277
     278bool UIVirtualMachineItemLocal::isItemCanBeSwitchedTo() const
     279{
     280    return    const_cast<CMachine&>(m_comMachine).CanShowConsoleWindow()
     281           || isItemRunningHeadless();
     282}
     283
    283284void UIVirtualMachineItemLocal::retranslateUi()
    284285{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItemLocal.h

    r83108 r83755  
    7575    /** @name Console attributes.
    7676      * @{ */
    77         /** Returns whether we can switch to main window of VM process. */
    78         bool canSwitchTo() const;
    7977        /** Tries to switch to the main window of the VM process.
    8078          * @return true if switched successfully. */
     
    9290    /** @name Validation stuff.
    9391      * @{ */
    94         /** Returns whether passed machine @a pItem is editable. */
     92        /** Returns whether this item is editable. */
    9593        virtual bool isItemEditable() const /* override */;
    96         /** Returns whether passed machine @a pItem is saved. */
     94        /** Returns whether this item is saved. */
    9795        virtual bool isItemSaved() const /* override */;
    98         /** Returns whether passed machine @a pItem is powered off. */
     96        /** Returns whether this item is powered off. */
    9997        virtual bool isItemPoweredOff() const /* override */;
    100         /** Returns whether passed machine @a pItem is started. */
     98        /** Returns whether this item is started. */
    10199        virtual bool isItemStarted() const /* override */;
    102         /** Returns whether passed machine @a pItem is running. */
     100        /** Returns whether this item is running. */
    103101        virtual bool isItemRunning() const /* override */;
    104         /** Returns whether passed machine @a pItem is running headless. */
     102        /** Returns whether this item is running headless. */
    105103        virtual bool isItemRunningHeadless() const /* override */;
    106         /** Returns whether passed machine @a pItem is paused. */
     104        /** Returns whether this item is paused. */
    107105        virtual bool isItemPaused() const /* override */;
    108         /** Returns whether passed machine @a pItem is stuck. */
     106        /** Returns whether this item is stuck. */
    109107        virtual bool isItemStuck() const /* override */;
     108        /** Returns whether this item can be switched to. */
     109        virtual bool isItemCanBeSwitchedTo() const /* override */;
    110110    /** @} */
    111111
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