VirtualBox

Changeset 76933 in vbox


Ignore:
Timestamp:
Jan 22, 2019 11:58:11 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager UI: A bit of refactoring for Chooser pane: Merge machine item constructors contents into one function for reuse.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

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

    r76932 r76933  
    4747    : UIChooserItem(pParent, pParent->isTemporary(), 0, 100)
    4848    , UIVirtualMachineItem(machine)
     49    , m_iPosition(iPosition)
    4950    , m_iDefaultLightnessMin(0)
    5051    , m_iDefaultLightnessMax(0)
     
    6162    /* Prepare: */
    6263    prepare();
    63 
    64     /* Add item to the parent: */
    65     AssertMsg(parentItem(), ("No parent set for machine-item!"));
    66     parentItem()->addItem(this, iPosition);
    67     setZValue(parentItem()->zValue() + 1);
    68 
    69     /* Configure connections: */
    70     connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
    71             this, &UIChooserItemMachine::sltHandleWindowRemapped);
    72 
    73     /* Init: */
    74     updatePixmaps();
    75     updateName();
    76     updateSnapshotName();
    77 
    78     /* Apply language settings: */
    79     retranslateUi();
    8064}
    8165
     
    8569    : UIChooserItem(pParent, pParent->isTemporary(), 0, 100)
    8670    , UIVirtualMachineItem(pCopyFrom->machine())
     71    , m_iPosition(iPosition)
    8772    , m_iDefaultLightnessMin(0)
    8873    , m_iDefaultLightnessMax(0)
     
    9984    /* Prepare: */
    10085    prepare();
    101 
    102     /* Add item to the parent: */
    103     AssertMsg(parentItem(), ("No parent set for machine-item!"));
    104     parentItem()->addItem(this, iPosition);
    105     setZValue(parentItem()->zValue() + 1);
    106 
    107     /* Configure connections: */
    108     connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
    109             this, &UIChooserItemMachine::sltHandleWindowRemapped);
    110 
    111     /* Init: */
    112     updatePixmaps();
    113     updateName();
    114     updateSnapshotName();
    115 
    116     /* Apply language settings: */
    117     retranslateUi();
    11886}
    11987
     
    643611    m_iMinimumSnapshotNameWidth = 0;
    644612    m_iMaximumSnapshotNameWidth = 0;
     613
     614    /* Add item to the parent: */
     615    AssertMsg(parentItem(), ("No parent set for machine-item!"));
     616    parentItem()->addItem(this, m_iPosition);
     617    setZValue(parentItem()->zValue() + 1);
     618
     619    /* Configure connections: */
     620    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     621            this, &UIChooserItemMachine::sltHandleWindowRemapped);
     622
     623    /* Init: */
     624    updatePixmaps();
     625    updateName();
     626    updateSnapshotName();
     627
     628    /* Apply language settings: */
     629    retranslateUi();
    645630}
    646631
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h

    r76581 r76933  
    276276    /** @name Item stuff.
    277277      * @{ */
     278        /** Holds initial item position. */
     279        const int  m_iPosition;
     280
    278281        /** Holds item minimum default lightness. */
    279282        int  m_iDefaultLightnessMin;
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