Changeset 22964 in vbox
- Timestamp:
- Sep 11, 2009 6:55:18 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 52237
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/QIArrowButtonPress.h
r22948 r22964 42 42 public: 43 43 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; } 45 48 46 49 private: -
trunk/src/VBox/Frontends/VirtualBox/include/QIArrowButtonSwitch.h
r22948 r22964 43 43 public: 44 44 45 QIArrowButtonSwitch (const QString &aName = QString::null, QWidget *aParent = 0); 45 QIArrowButtonSwitch (QWidget *aParent = 0); 46 QIArrowButtonSwitch (const QString &aName, QWidget *aParent = 0); 47 46 48 bool isExpanded() const { return mIsExpanded; } 47 49 -
trunk/src/VBox/Frontends/VirtualBox/include/QIRichToolButton.h
r22948 r22964 40 40 public: 41 41 42 QIRichToolButton (const QString &aName = QString::null, QWidget *aParent = 0); 42 QIRichToolButton (QWidget *aParent = 0); 43 QIRichToolButton (const QString &aName, QWidget *aParent = 0); 43 44 44 45 void animateClick() { mButton->animateClick(); } 45 46 void setText (const QString &aName) { mLabel->setText (aName); } 47 QString text() const { return mLabel->text(); } 46 48 47 49 signals: … … 55 57 protected: 56 58 59 void init(); 57 60 bool eventFilter (QObject *aObject, QEvent *aEvent); 58 61 void paintEvent (QPaintEvent *aEvent); -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxVMSettingsNetwork.h
r22960 r22964 27 27 #include "COMDefs.h" 28 28 #include "VBoxSettingsPage.h" 29 #include "QIArrowButtonSwitch.h"30 29 #include "VBoxVMSettingsNetwork.gen.h" 31 30 32 31 /* VBox Forwardes */ 33 32 class VBoxVMSettingsNetworkPage; 34 class QIArrowButtonSwitch;35 33 36 34 class VBoxVMSettingsNetwork : public QIWithRetranslateUI <QWidget>, … … 73 71 CNetworkAdapter mAdapter; 74 72 QIWidgetValidator *mValidator; 75 QIArrowButtonSwitch *mAbsAdvanced;76 73 77 74 QString mBrgName; -
trunk/src/VBox/Frontends/VirtualBox/src/QIArrowButtonPress.cpp
r22948 r22964 36 36 */ 37 37 38 QIArrowButtonPress::QIArrowButtonPress (QWidget *aParent) 39 : QIRichToolButton (aParent) 40 , mNext (true) 41 { 42 updateIcon(); 43 } 44 38 45 QIArrowButtonPress::QIArrowButtonPress (bool aNext, const QString &aName, QWidget *aParent) 39 46 : QIRichToolButton (aName, aParent) -
trunk/src/VBox/Frontends/VirtualBox/src/QIArrowButtonSwitch.cpp
r22948 r22964 35 35 * 36 36 */ 37 38 QIArrowButtonSwitch::QIArrowButtonSwitch (QWidget *aParent) 39 : QIRichToolButton (aParent) 40 , mIsExpanded (false) 41 { 42 updateIcon(); 43 } 37 44 38 45 QIArrowButtonSwitch::QIArrowButtonSwitch (const QString &aName, QWidget *aParent) -
trunk/src/VBox/Frontends/VirtualBox/src/QIRichToolButton.cpp
r22948 r22964 33 33 #include <QStyleOptionFocusRect> 34 34 35 QIRichToolButton::QIRichToolButton (QWidget *aParent) 36 : QWidget (aParent) 37 , mButton (new QToolButton()) 38 , mLabel (new QLabel()) 39 { 40 init(); 41 } 42 35 43 QIRichToolButton::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 51 void QIRichToolButton::init() 39 52 { 40 53 /* Setup itself */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetwork.cpp
r22960 r22964 49 49 mLeMAC->setMinimumWidthByText (QString().fill ('0', 12)); 50 50 51 /* Setup connections */ 52 connect (mAbsAdvanced, SIGNAL (clicked()), this, SLOT (toggleAdvanced())); 51 53 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()));58 54 59 55 #ifdef Q_WS_MAC … … 69 65 mTbMAC->setStyleSheet ("QToolButton {border: 0px none black;}"); 70 66 #endif /* Q_WS_MAC */ 67 68 /* Hide advanced items initially */ 69 toggleAdvanced(); 71 70 72 71 /* Applying language settings */ … … 410 409 void VBoxVMSettingsNetwork::toggleAdvanced() 411 410 { 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()); 413 417 } 414 418 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsNetwork.ui
r22960 r22964 41 41 </widget> 42 42 </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> 43 59 <item row="1" column="1" > 44 <widget class="QWidget" name="mNetworkChild" native=" true">60 <widget class="QWidget" name="mNetworkChild" native="1"> 45 61 <layout class="QGridLayout" name="mNetworkChildGridLayout"> 46 62 <property name="margin"> … … 60 76 </widget> 61 77 </item> 62 <item row="0" column="1" colspan="2">78 <item row="0" column="1"> 63 79 <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> 64 86 <property name="whatsThis" > 65 87 <string>Controls how this virtual adapter is attached to the real network of the Host OS.</string> … … 80 102 </widget> 81 103 </item> 82 <item row="1" column="1" colspan="2">104 <item row="1" column="1"> 83 105 <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> 84 112 <property name="whatsThis" > 85 113 <string>Selects the name of the network adapter if attachment type is equivalent to <b>Bridged Adapter</b> or <b>Host-only Adapter</b> and the name of the internal network if attachment type is equivalent to <b>Internal Network</b>.</string> … … 87 115 </widget> 88 116 </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&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 &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>&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>&Cable connected</string> 203 </property> 204 </widget> 205 </item> 206 <item rowspan="2" row="0" column="2" colspan="2"> 207 <spacer name="horizontalSpacer3"> 91 208 <property name="orientation"> 92 209 <enum>Qt::Horizontal</enum> … … 103 220 </widget> 104 221 </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 &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>&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>&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"> 220 223 <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">237 224 <property name="orientation"> 238 225 <enum>Qt::Horizontal</enum> … … 246 233 </spacer> 247 234 </item> 248 <item row=" 3" column="1">249 <spacer name="verticalSpacer 2">235 <item row="4" column="0" colspan="3"> 236 <spacer name="verticalSpacer"> 250 237 <property name="orientation"> 251 238 <enum>Qt::Vertical</enum> … … 266 253 <extends>QLineEdit</extends> 267 254 <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> 268 261 </customwidget> 269 262 </customwidgets> … … 288 281 </hints> 289 282 </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>306 283 </connections> 307 284 </ui>
Note:
See TracChangeset
for help on using the changeset viewer.