VirtualBox

Changeset 22964 in vbox


Ignore:
Timestamp:
Sep 11, 2009 6:55:18 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52237
Message:

FE/Qt4: 4011: Network Settings UI: Few fixes for r52231.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/QIArrowButtonPress.h

    r22948 r22964  
    4242public:
    4343
    44     QIArrowButtonPress (bool aNext, const QString &aName = QString::null, QWidget *aParent = 0);
     44    QIArrowButtonPress (QWidget *aParent = 0);
     45    QIArrowButtonPress (bool aNext, const QString &aName, QWidget *aParent = 0);
     46
     47    void setNext (bool aNext) { mNext = aNext; }
    4548
    4649private:
  • trunk/src/VBox/Frontends/VirtualBox/include/QIArrowButtonSwitch.h

    r22948 r22964  
    4343public:
    4444
    45     QIArrowButtonSwitch (const QString &aName = QString::null, QWidget *aParent = 0);
     45    QIArrowButtonSwitch (QWidget *aParent = 0);
     46    QIArrowButtonSwitch (const QString &aName, QWidget *aParent = 0);
     47
    4648    bool isExpanded() const { return mIsExpanded; }
    4749
  • trunk/src/VBox/Frontends/VirtualBox/include/QIRichToolButton.h

    r22948 r22964  
    4040public:
    4141
    42     QIRichToolButton (const QString &aName = QString::null, QWidget *aParent = 0);
     42    QIRichToolButton (QWidget *aParent = 0);
     43    QIRichToolButton (const QString &aName, QWidget *aParent = 0);
    4344
    4445    void animateClick() { mButton->animateClick(); }
    4546    void setText (const QString &aName) { mLabel->setText (aName); }
     47    QString text() const { return mLabel->text(); }
    4648
    4749signals:
     
    5557protected:
    5658
     59    void init();
    5760    bool eventFilter (QObject *aObject, QEvent *aEvent);
    5861    void paintEvent (QPaintEvent *aEvent);
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsNetwork.h

    r22960 r22964  
    2727#include "COMDefs.h"
    2828#include "VBoxSettingsPage.h"
    29 #include "QIArrowButtonSwitch.h"
    3029#include "VBoxVMSettingsNetwork.gen.h"
    3130
    3231/* VBox Forwardes */
    3332class VBoxVMSettingsNetworkPage;
    34 class QIArrowButtonSwitch;
    3533
    3634class VBoxVMSettingsNetwork : public QIWithRetranslateUI <QWidget>,
     
    7371    CNetworkAdapter mAdapter;
    7472    QIWidgetValidator *mValidator;
    75     QIArrowButtonSwitch *mAbsAdvanced;
    7673
    7774    QString mBrgName;
  • trunk/src/VBox/Frontends/VirtualBox/src/QIArrowButtonPress.cpp

    r22948 r22964  
    3636 */
    3737
     38QIArrowButtonPress::QIArrowButtonPress (QWidget *aParent)
     39    : QIRichToolButton (aParent)
     40    , mNext (true)
     41{
     42    updateIcon();
     43}
     44
    3845QIArrowButtonPress::QIArrowButtonPress (bool aNext, const QString &aName, QWidget *aParent)
    3946    : QIRichToolButton (aName, aParent)
  • trunk/src/VBox/Frontends/VirtualBox/src/QIArrowButtonSwitch.cpp

    r22948 r22964  
    3535 *
    3636 */
     37
     38QIArrowButtonSwitch::QIArrowButtonSwitch (QWidget *aParent)
     39    : QIRichToolButton (aParent)
     40    , mIsExpanded (false)
     41{
     42    updateIcon();
     43}
    3744
    3845QIArrowButtonSwitch::QIArrowButtonSwitch (const QString &aName, QWidget *aParent)
  • trunk/src/VBox/Frontends/VirtualBox/src/QIRichToolButton.cpp

    r22948 r22964  
    3333#include <QStyleOptionFocusRect>
    3434
     35QIRichToolButton::QIRichToolButton (QWidget *aParent)
     36    : QWidget (aParent)
     37    , mButton (new QToolButton())
     38    , mLabel (new QLabel())
     39{
     40    init();
     41}
     42
    3543QIRichToolButton::QIRichToolButton (const QString &aName, QWidget *aParent)
    36         : QWidget (aParent)
    37         , mButton (new QToolButton())
    38         , mLabel (new QLabel (aName))
     44    : QWidget (aParent)
     45    , mButton (new QToolButton())
     46    , mLabel (new QLabel (aName))
     47{
     48    init();
     49}
     50
     51void QIRichToolButton::init()
    3952{
    4053    /* Setup itself */
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetwork.cpp

    r22960 r22964  
    4949    mLeMAC->setMinimumWidthByText (QString().fill ('0', 12));
    5050
     51    /* Setup connections */
     52    connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced()));
    5153    connect (mTbMAC, SIGNAL (clicked()), this, SLOT (generateMac()));
    52 
    53     mNetworkChild2->hide();
    54     mAbsAdvanced = new QIArrowButtonSwitch(tr("A&dvanced"));
    55     mNetworkChildGridLayout->addWidget (mAbsAdvanced);
    56 
    57     connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced()));
    5854
    5955#ifdef Q_WS_MAC
     
    6965    mTbMAC->setStyleSheet ("QToolButton {border: 0px none black;}");
    7066#endif /* Q_WS_MAC */
     67
     68    /* Hide advanced items initially */
     69    toggleAdvanced();
    7170
    7271    /* Applying language settings */
     
    410409void VBoxVMSettingsNetwork::toggleAdvanced()
    411410{
    412     mNetworkChild2->setVisible(!mNetworkChild2->isVisible());
     411    mLbAType->setVisible (mAbsAdvanced->isExpanded());
     412    mCbAdapterType->setVisible (mAbsAdvanced->isExpanded());
     413    mLbMAC->setVisible (mAbsAdvanced->isExpanded());
     414    mLeMAC->setVisible (mAbsAdvanced->isExpanded());
     415    mTbMAC->setVisible (mAbsAdvanced->isExpanded());
     416    mCbCable->setVisible (mAbsAdvanced->isExpanded());
    413417}
    414418
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsNetwork.ui

    r22960 r22964  
    4141    </widget>
    4242   </item>
     43   <item row="1" column="0">
     44    <spacer name="horizontalSpacer1">
     45     <property name="orientation">
     46      <enum>Qt::Horizontal</enum>
     47     </property>
     48     <property name="sizeType">
     49      <enum>QSizePolicy::Fixed</enum>
     50     </property>
     51     <property name="sizeHint" stdset="0">
     52      <size>
     53       <width>20</width>
     54       <height>0</height>
     55      </size>
     56     </property>
     57    </spacer>
     58   </item>
    4359   <item row="1" column="1" >
    44     <widget class="QWidget" name="mNetworkChild" native="true">
     60    <widget class="QWidget" name="mNetworkChild" native="1">
    4561     <layout class="QGridLayout" name="mNetworkChildGridLayout">
    4662      <property name="margin">
     
    6076       </widget>
    6177      </item>
    62       <item row="0" column="1" colspan="2" >
     78      <item row="0" column="1">
    6379       <widget class="QComboBox" name="mCbAttachmentType">
     80        <property name="sizePolicy">
     81         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     82          <horstretch>0</horstretch>
     83          <verstretch>0</verstretch>
     84         </sizepolicy>
     85        </property>
    6486        <property name="whatsThis" >
    6587         <string>Controls how this virtual adapter is attached to the real network of the Host OS.</string>
     
    80102       </widget>
    81103      </item>
    82       <item row="1" column="1" colspan="2">
     104      <item row="1" column="1">
    83105       <widget class="QComboBox" name="mCbName">
     106        <property name="sizePolicy">
     107         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     108          <horstretch>0</horstretch>
     109          <verstretch>0</verstretch>
     110         </sizepolicy>
     111        </property>
    84112        <property name="whatsThis" >
    85113         <string>Selects the name of the network adapter if attachment type is equivalent to &lt;b&gt;Bridged Adapter&lt;/b&gt; or &lt;b&gt;Host-only Adapter&lt;/b&gt; and the name of the internal network if attachment type is equivalent to &lt;b&gt;Internal Network&lt;/b&gt;.</string>
     
    87115       </widget>
    88116      </item>
    89       <item row="0" column="3" rowspan="3">
    90        <spacer name="horizontalSpacer6">
     117      <item row="2" column="0">
     118       <widget class="QIArrowButtonSwitch" native="1" name="mAbsAdvanced">
     119        <property name="text">
     120         <string>A&amp;dvanced</string>
     121        </property>
     122        <property name="whatsThis" >
     123         <string>Shows/hide additional network adapter options.</string>
     124        </property>
     125       </widget>
     126      </item>
     127      <item row="3" column="0">
     128       <widget class="QLabel" name="mLbAType">
     129        <property name="text">
     130         <string>Adapter &amp;Type:</string>
     131        </property>
     132        <property name="alignment">
     133         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     134        </property>
     135        <property name="buddy">
     136         <cstring>mCbAdapterType</cstring>
     137        </property>
     138       </widget>
     139      </item>
     140      <item row="3" column="1" colspan="3">
     141       <widget class="QComboBox" name="mCbAdapterType">
     142        <property name="sizePolicy">
     143         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
     144          <horstretch>0</horstretch>
     145          <verstretch>0</verstretch>
     146         </sizepolicy>
     147        </property>
     148        <property name="whatsThis">
     149         <string>Selects the type of the virtual network adapter. Depending on this value, VirtualBox will provide different network hardware to the virtual machine.</string>
     150        </property>
     151       </widget>
     152      </item>
     153      <item row="4" column="0">
     154       <widget class="QLabel" name="mLbMAC">
     155        <property name="text">
     156         <string>&amp;Mac Address:</string>
     157        </property>
     158        <property name="alignment" >
     159         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     160        </property>
     161        <property name="buddy">
     162         <cstring>mLeMAC</cstring>
     163        </property>
     164       </widget>
     165      </item>
     166      <item row="4" column="1" colspan="2">
     167       <widget class="QILineEdit" name="mLeMAC">
     168        <property name="sizePolicy">
     169         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     170          <horstretch>0</horstretch>
     171          <verstretch>0</verstretch>
     172         </sizepolicy>
     173        </property>
     174        <property name="whatsThis">
     175         <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string>
     176        </property>
     177        <property name="frame">
     178         <bool>true</bool>
     179        </property>
     180       </widget>
     181      </item>
     182      <item row="4" column="3">
     183       <widget class="QToolButton" name="mTbMAC">
     184        <property name="whatsThis">
     185         <string>Generates a new random MAC address.</string>
     186        </property>
     187        <property name="icon">
     188         <iconset resource="../VirtualBox.qrc">
     189          <normaloff>:/refresh_16px.png</normaloff>:/refresh_16px.png</iconset>
     190        </property>
     191        <property name="autoRaise">
     192         <bool>true</bool>
     193        </property>
     194       </widget>
     195      </item>
     196      <item row="5" column="1" colspan="3">
     197       <widget class="QCheckBox" name="mCbCable">
     198        <property name="whatsThis">
     199         <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string>
     200        </property>
     201        <property name="text">
     202         <string>&amp;Cable connected</string>
     203        </property>
     204       </widget>
     205      </item>
     206      <item rowspan="2" row="0" column="2" colspan="2">
     207       <spacer name="horizontalSpacer3">
    91208        <property name="orientation">
    92209         <enum>Qt::Horizontal</enum>
     
    103220    </widget>
    104221   </item>
    105    <item row="2" column="1">
    106     <widget class="QWidget" name="mNetworkChild2" native="true">
    107      <layout class="QGridLayout" name="mNetworkChild2GridLayout">
    108       <property name="topMargin">
    109        <number>0</number>
    110       </property>
    111       <item row="0" column="0">
    112        <widget class="QLabel" name="mLbAType">
    113         <property name="text">
    114          <string>Adapter &amp;Type:</string>
    115         </property>
    116         <property name="alignment">
    117          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    118         </property>
    119         <property name="buddy">
    120          <cstring>mCbAdapterType</cstring>
    121         </property>
    122        </widget>
    123       </item>
    124       <item row="1" column="0" colspan="2">
    125        <widget class="QLabel" name="mLbMAC">
    126         <property name="enabled">
    127          <bool>true</bool>
    128         </property>
    129         <property name="text">
    130          <string>&amp;Mac Address:</string>
    131         </property>
    132         <property name="buddy">
    133          <cstring>mLeMAC</cstring>
    134         </property>
    135        </widget>
    136       </item>
    137       <item row="1" column="2">
    138        <widget class="QILineEdit" name="mLeMAC">
    139         <property name="sizePolicy">
    140          <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    141           <horstretch>0</horstretch>
    142           <verstretch>0</verstretch>
    143          </sizepolicy>
    144         </property>
    145         <property name="maximumSize">
    146          <size>
    147           <width>110</width>
    148           <height>22</height>
    149          </size>
    150         </property>
    151         <property name="toolTip">
    152          <string>Displays the MAC address of this adapter. It contains exactly 12 characters chosen from {0-9,A-F}. Note that the second character must be an even digit.</string>
    153         </property>
    154         <property name="frame">
    155          <bool>true</bool>
    156         </property>
    157        </widget>
    158       </item>
    159       <item row="1" column="3">
    160        <widget class="QToolButton" name="mTbMAC">
    161         <property name="toolTip">
    162          <string>Generates a new random MAC address.</string>
    163         </property>
    164         <property name="icon">
    165          <iconset resource="../VirtualBox.qrc">
    166           <normaloff>:/refresh_16px.png</normaloff>:/refresh_16px.png</iconset>
    167         </property>
    168         <property name="autoRaise">
    169          <bool>true</bool>
    170         </property>
    171        </widget>
    172       </item>
    173       <item row="2" column="2" colspan="2">
    174        <widget class="QCheckBox" name="mCbCable">
    175         <property name="toolTip">
    176          <string>Indicates whether the virtual network cable is plugged in on machine startup or not.</string>
    177         </property>
    178         <property name="text">
    179          <string>&amp;Cable connected</string>
    180         </property>
    181        </widget>
    182       </item>
    183       <item row="0" column="2" colspan="3">
    184        <widget class="QComboBox" name="mCbAdapterType">
    185         <property name="whatsThis">
    186          <string>Selects the type of the virtual network adapter. Depending on this value, VirtualBox will provide different network hardware to the virtual machine.</string>
    187         </property>
    188        </widget>
    189       </item>
    190       <item row="0" column="5" rowspan="3">
    191        <spacer name="horizontalSpacer_2">
    192         <property name="orientation">
    193          <enum>Qt::Horizontal</enum>
    194         </property>
    195         <property name="sizeHint" stdset="0">
    196          <size>
    197           <width>40</width>
    198           <height>20</height>
    199          </size>
    200         </property>
    201        </spacer>
    202       </item>
    203       <item row="1" column="4">
    204        <spacer name="horizontalSpacer_3">
    205         <property name="orientation">
    206          <enum>Qt::Horizontal</enum>
    207         </property>
    208         <property name="sizeHint" stdset="0">
    209          <size>
    210           <width>40</width>
    211           <height>20</height>
    212          </size>
    213         </property>
    214        </spacer>
    215       </item>
    216      </layout>
    217     </widget>
    218    </item>
    219    <item row="1" column="0" rowspan="2">
     222   <item row="1" column="2">
    220223    <spacer name="horizontalSpacer2">
    221      <property name="orientation">
    222       <enum>Qt::Horizontal</enum>
    223      </property>
    224      <property name="sizeType">
    225       <enum>QSizePolicy::Fixed</enum>
    226      </property>
    227      <property name="sizeHint" stdset="0">
    228       <size>
    229        <width>20</width>
    230        <height>20</height>
    231       </size>
    232      </property>
    233     </spacer>
    234    </item>
    235    <item row="1" column="2" rowspan="2">
    236     <spacer name="horizontalSpacer4">
    237224     <property name="orientation">
    238225      <enum>Qt::Horizontal</enum>
     
    246233    </spacer>
    247234   </item>
    248    <item row="3" column="1">
    249     <spacer name="verticalSpacer2">
     235   <item row="4" column="0" colspan="3">
     236    <spacer name="verticalSpacer">
    250237     <property name="orientation">
    251238      <enum>Qt::Vertical</enum>
     
    266253   <extends>QLineEdit</extends>
    267254   <header>QILineEdit.h</header>
     255  </customwidget>
     256  <customwidget>
     257   <class>QIArrowButtonSwitch</class>
     258   <extends>QWidget</extends>
     259   <header>QIArrowButtonSwitch.h</header>
     260   <container>1</container>
    268261  </customwidget>
    269262 </customwidgets>
     
    288281   </hints>
    289282  </connection>
    290   <connection>
    291    <sender>mGbAdapter</sender>
    292    <signal>toggled(bool)</signal>
    293    <receiver>mNetworkChild2</receiver>
    294    <slot>setEnabled(bool)</slot>
    295    <hints>
    296     <hint type="sourcelabel">
    297      <x>52</x>
    298      <y>17</y>
    299     </hint>
    300     <hint type="destinationlabel">
    301      <x>49</x>
    302      <y>147</y>
    303     </hint>
    304    </hints>
    305   </connection>
    306283 </connections>
    307284</ui>
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