Changeset 10696 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- Jul 16, 2008 12:18:55 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsNetwork.h
r10167 r10696 80 80 void prepareComboboxes(); 81 81 82 void setTapEnabled (bool aEnabled); 83 void setTapVisible (bool aVisible); 84 82 85 CNetworkAdapter mAdapter; 83 86 QIWidgetValidator *mValidator; … … 93 96 * QGroupBox sub-class which represents network interface list. 94 97 */ 95 class VBoxNIList : public QIWithRetranslateUI<Q GroupBox>98 class VBoxNIList : public QIWithRetranslateUI<QWidget> 96 99 { 97 100 Q_OBJECT; … … 123 126 void populateInterfacesList(); 124 127 125 QTreeWidget *mList; 128 QILabelSeparator *mLbTitle; 129 QTreeWidget *mList; 126 130 127 131 QAction *mAddAction; … … 180 184 }; 181 185 186 #undef Q_WS_WIN 187 182 188 #endif // __VBoxVMSettingsNetwork_h__ 183 189 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsNetwork.cpp
r10176 r10696 65 65 /* Setup dialog for current platform */ 66 66 #ifndef Q_WS_X11 67 mGbTAP->setHidden (true);67 setTapVisible (false); 68 68 #endif 69 69 #ifdef Q_WS_MAC 70 70 /* No Host Interface Networking on the Mac yet */ 71 mGbTAP->setHidden (true);71 setTapVisible (false); 72 72 #endif 73 73 #ifdef Q_WS_X11 … … 78 78 ":/select_file_dis_16px.png")); 79 79 #endif 80 81 layout()->activate(); 80 82 81 83 /* Applying language settings */ … … 266 268 bool enableHostIf = vboxGlobal().toNetworkAttachmentType (aString) == 267 269 KNetworkAttachmentType_HostInterface; 268 mGbTAP->setEnabled (enableHostIf);270 setTapEnabled (enableHostIf); 269 271 #endif 270 272 if (mValidator) … … 307 309 mCbAType->insertItem (0, 308 310 vboxGlobal().toString (KNetworkAdapterType_Am79C970A)); 311 mCbAType->setItemData (0, 312 mCbAType->itemText(0), Qt::ToolTipRole); 309 313 mCbAType->insertItem (1, 310 314 vboxGlobal().toString (KNetworkAdapterType_Am79C973)); 315 mCbAType->setItemData (1, 316 mCbAType->itemText(1), Qt::ToolTipRole); 311 317 #ifdef VBOX_WITH_E1000 312 318 mCbAType->insertItem (2, 313 319 vboxGlobal().toString (KNetworkAdapterType_I82540EM)); 320 mCbAType->setItemData (2, 321 mCbAType->itemText(2), Qt::ToolTipRole); 314 322 mCbAType->insertItem (3, 315 323 vboxGlobal().toString (KNetworkAdapterType_I82543GC)); 324 mCbAType->setItemData (3, 325 mCbAType->itemText(3), Qt::ToolTipRole); 316 326 #endif 317 327 /* Set the old value */ … … 325 335 mCbNAType->insertItem (0, 326 336 vboxGlobal().toString (KNetworkAttachmentType_Null)); 337 mCbNAType->setItemData (0, 338 mCbNAType->itemText(0), Qt::ToolTipRole); 327 339 mCbNAType->insertItem (1, 328 340 vboxGlobal().toString (KNetworkAttachmentType_NAT)); 341 mCbNAType->setItemData (1, 342 mCbNAType->itemText(1), Qt::ToolTipRole); 329 343 #ifndef Q_WS_MAC /* Not yet on the Mac */ 330 344 mCbNAType->insertItem (2, 331 345 vboxGlobal().toString (KNetworkAttachmentType_HostInterface)); 346 mCbNAType->setItemData (2, 347 mCbNAType->itemText(2), Qt::ToolTipRole); 332 348 mCbNAType->insertItem (3, 333 349 vboxGlobal().toString (KNetworkAttachmentType_Internal)); 350 mCbNAType->setItemData (3, 351 mCbNAType->itemText(3), Qt::ToolTipRole); 334 352 #endif 335 353 /* Set the old value */ … … 337 355 } 338 356 357 void VBoxVMSettingsNetwork::setTapEnabled (bool aEnabled) 358 { 359 mGbTap->setEnabled (aEnabled); 360 mLbInterface_x11->setEnabled (aEnabled); 361 mLeInterface_x11->setEnabled (aEnabled); 362 mLbSetup_x11->setEnabled (aEnabled); 363 mLeSetup_x11->setEnabled (aEnabled); 364 mTbSetup_x11->setEnabled (aEnabled); 365 mLbTerminate_x11->setEnabled (aEnabled); 366 mLeTerminate_x11->setEnabled (aEnabled); 367 mTbTerminate_x11->setEnabled (aEnabled); 368 } 369 370 void VBoxVMSettingsNetwork::setTapVisible (bool aVisible) 371 { 372 mGbTap->setVisible (aVisible); 373 mLbInterface_x11->setVisible (aVisible); 374 mLeInterface_x11->setVisible (aVisible); 375 mLbSetup_x11->setVisible (aVisible); 376 mLeSetup_x11->setVisible (aVisible); 377 mTbSetup_x11->setVisible (aVisible); 378 mLbTerminate_x11->setVisible (aVisible); 379 mLeTerminate_x11->setVisible (aVisible); 380 mTbTerminate_x11->setVisible (aVisible); 381 } 339 382 340 383 /* VBoxNIList Stuff */ … … 379 422 380 423 VBoxNIList::VBoxNIList (QWidget *aParent) 381 : QIWithRetranslateUI<QGroupBox> (aParent) 382 { 424 : QIWithRetranslateUI<QWidget> (aParent) 425 { 426 QGridLayout *mainLayout = new QGridLayout (this); 427 VBoxGlobal::setLayoutMargin (mainLayout, 0); 428 mLbTitle = new QILabelSeparator(); 429 mainLayout->addWidget (mLbTitle, 0, 0, 1, 2); 430 // mainLayout->addItem (new QSpacerItem (8, 16, QSizePolicy::Fixed, QSizePolicy::Minimum), 1, 0); 383 431 /* Creating List Widget */ 384 QHBoxLayout *layout = new QHBoxLayout (this); 432 QHBoxLayout *layout = new QHBoxLayout (); 433 mainLayout->addLayout (layout, 1, 0); 385 434 mList = new QTreeWidget (this); 386 435 setFocusProxy (mList); 436 mLbTitle->setBuddy (mList); 387 437 mList->setColumnCount (1); 388 438 mList->header()->hide(); … … 574 624 void VBoxNIList::retranslateUi() 575 625 { 576 setTitle(tr ("Host &Interfaces"));626 mLbTitle->setText (tr ("Host &Interfaces")); 577 627 578 628 mList->setWhatsThis (tr ("Lists all available host interfaces.")); … … 635 685 layout->addWidget (mNIList); 636 686 #else 637 layout->addStretch(); 638 #endif 687 // layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); 688 #endif 689 // layout->activate(); 639 690 } 640 691 … … 672 723 connect (page->mCbNetwork, SIGNAL (editTextChanged (const QString&)), 673 724 this, SLOT (updateNetworksList())); 725 page->layout()->activate(); 726 page->updateGeometry(); 674 727 } 675 728 -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsNetwork.ui
r9781 r10696 23 23 <x>0</x> 24 24 <y>0</y> 25 <width> 318</width>26 <height> 403</height>25 <width>417</width> 26 <height>348</height> 27 27 </rect> 28 28 </property> 29 <layout class="QVBoxLayout" > 30 <item> 31 <widget class="QGroupBox" name="mGbAdapter" > 32 <property name="sizePolicy" > 33 <sizepolicy vsizetype="Minimum" hsizetype="Preferred" > 34 <horstretch>0</horstretch> 35 <verstretch>0</verstretch> 36 </sizepolicy> 37 </property> 29 <layout class="QGridLayout" > 30 <item row="0" column="0" colspan="2" > 31 <widget class="QCheckBox" name="mGbAdapter" > 38 32 <property name="whatsThis" > 39 33 <string>When checked, plugs this virtual network adapter into the virtual machine.</string> 40 34 </property> 41 <property name="t itle" >35 <property name="text" > 42 36 <string>&Enable Network Adapter</string> 43 </property>44 <property name="checkable" >45 <bool>true</bool>46 37 </property> 47 38 <property name="checked" > 48 39 <bool>true</bool> 49 40 </property> 41 </widget> 42 </item> 43 <item row="1" column="0" > 44 <spacer> 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" > 52 <size> 53 <width>20</width> 54 <height>20</height> 55 </size> 56 </property> 57 </spacer> 58 </item> 59 <item row="1" column="1" > 60 <widget class="QWidget" native="1" name="mNetworkChild" > 50 61 <layout class="QGridLayout" > 62 <property name="leftMargin" > 63 <number>0</number> 64 </property> 51 65 <property name="topMargin" > 52 <number>5</number> 66 <number>0</number> 67 </property> 68 <property name="rightMargin" > 69 <number>0</number> 70 </property> 71 <property name="bottomMargin" > 72 <number>0</number> 53 73 </property> 54 74 <item row="0" column="0" > 55 75 <widget class="QLabel" name="mLbAType" > 56 76 <property name="text" > 57 <string>A&dapter Type</string> 77 <string>A&dapter Type:</string> 78 </property> 79 <property name="alignment" > 80 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 58 81 </property> 59 82 <property name="buddy" > … … 62 85 </widget> 63 86 </item> 64 <item row="0" column="1" colspan="2">87 <item row="0" column="1" > 65 88 <widget class="QComboBox" name="mCbAType" > 66 89 <property name="whatsThis" > … … 72 95 <widget class="QLabel" name="mLbNAType" > 73 96 <property name="text" > 74 <string>&Attached to</string> 97 <string>&Attached to:</string> 98 </property> 99 <property name="alignment" > 100 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 75 101 </property> 76 102 <property name="buddy" > … … 79 105 </widget> 80 106 </item> 81 <item row="1" column="1" colspan="2">107 <item row="1" column="1" > 82 108 <widget class="QComboBox" name="mCbNAType" > 83 109 <property name="whatsThis" > … … 89 115 <widget class="QLabel" name="mLbNetwork" > 90 116 <property name="text" > 91 <string>&Network Name</string> 117 <string>&Network Name:</string> 118 </property> 119 <property name="alignment" > 120 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 92 121 </property> 93 122 <property name="buddy" > … … 96 125 </widget> 97 126 </item> 98 <item row="2" column="1" colspan="2">127 <item row="2" column="1" > 99 128 <widget class="QComboBox" name="mCbNetwork" > 100 129 <property name="whatsThis" > … … 109 138 <widget class="QLabel" name="mLbMAC" > 110 139 <property name="text" > 111 <string>&MAC Address</string> 140 <string>&MAC Address:</string> 141 </property> 142 <property name="alignment" > 143 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 112 144 </property> 113 145 <property name="buddy" > … … 118 150 <item row="3" column="1" > 119 151 <widget class="QLineEdit" name="mLeMAC" > 152 <property name="sizePolicy" > 153 <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > 154 <horstretch>0</horstretch> 155 <verstretch>0</verstretch> 156 </sizepolicy> 157 </property> 120 158 <property name="whatsThis" > 121 159 <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> … … 136 174 </widget> 137 175 </item> 138 <item row="4" column=" 0" colspan="3" >176 <item row="4" column="1" > 139 177 <widget class="QCheckBox" name="mCbCable" > 140 178 <property name="whatsThis" > … … 143 181 <property name="text" > 144 182 <string>Ca&ble Connected</string> 183 </property> 184 </widget> 185 </item> 186 <item row="5" column="0" colspan="3" > 187 <widget class="QILabelSeparator" name="mGbTap" > 188 <property name="text" > 189 <string>&Host Interface Settings</string> 190 </property> 191 <property name="buddy" > 192 <cstring>mLeInterface_x11</cstring> 193 </property> 194 </widget> 195 </item> 196 <item row="6" column="0" > 197 <widget class="QLabel" name="mLbInterface_x11" > 198 <property name="text" > 199 <string>&Interface Name:</string> 200 </property> 201 <property name="alignment" > 202 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 203 </property> 204 <property name="buddy" > 205 <cstring>mLeInterface_x11</cstring> 206 </property> 207 </widget> 208 </item> 209 <item row="6" column="1" > 210 <widget class="QLineEdit" name="mLeInterface_x11" > 211 <property name="sizePolicy" > 212 <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > 213 <horstretch>0</horstretch> 214 <verstretch>0</verstretch> 215 </sizepolicy> 216 </property> 217 <property name="whatsThis" > 218 <string>Displays the TAP interface name.</string> 219 </property> 220 </widget> 221 </item> 222 <item row="7" column="0" > 223 <widget class="QLabel" name="mLbSetup_x11" > 224 <property name="text" > 225 <string>&Setup Application:</string> 226 </property> 227 <property name="alignment" > 228 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 229 </property> 230 <property name="buddy" > 231 <cstring>mLeSetup_x11</cstring> 232 </property> 233 </widget> 234 </item> 235 <item row="7" column="1" > 236 <widget class="QLineEdit" name="mLeSetup_x11" > 237 <property name="sizePolicy" > 238 <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > 239 <horstretch>0</horstretch> 240 <verstretch>0</verstretch> 241 </sizepolicy> 242 </property> 243 <property name="whatsThis" > 244 <string>Displays the command executed to set up the TAP interface.</string> 245 </property> 246 </widget> 247 </item> 248 <item row="7" column="2" > 249 <widget class="QToolButton" name="mTbSetup_x11" > 250 <property name="whatsThis" > 251 <string>Selects the setup application.</string> 252 </property> 253 <property name="autoRaise" > 254 <bool>true</bool> 255 </property> 256 </widget> 257 </item> 258 <item row="8" column="0" > 259 <widget class="QLabel" name="mLbTerminate_x11" > 260 <property name="text" > 261 <string>&Terminate Application:</string> 262 </property> 263 <property name="alignment" > 264 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 265 </property> 266 <property name="buddy" > 267 <cstring>mLeTerminate_x11</cstring> 268 </property> 269 </widget> 270 </item> 271 <item row="8" column="1" > 272 <widget class="QLineEdit" name="mLeTerminate_x11" > 273 <property name="sizePolicy" > 274 <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > 275 <horstretch>0</horstretch> 276 <verstretch>0</verstretch> 277 </sizepolicy> 278 </property> 279 <property name="whatsThis" > 280 <string>Displays the command executed to terminate the TAP interface.</string> 281 </property> 282 </widget> 283 </item> 284 <item row="8" column="2" > 285 <widget class="QToolButton" name="mTbTerminate_x11" > 286 <property name="whatsThis" > 287 <string>Selects the terminate application.</string> 288 </property> 289 <property name="autoRaise" > 290 <bool>true</bool> 145 291 </property> 146 292 </widget> … … 149 295 </widget> 150 296 </item> 151 <item> 152 <widget class="QGroupBox" name="mGbTAP" > 153 <property name="sizePolicy" > 154 <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > 155 <horstretch>0</horstretch> 156 <verstretch>0</verstretch> 157 </sizepolicy> 158 </property> 159 <property name="whatsThis" > 160 <string>Host Interface Settings</string> 161 </property> 162 <property name="title" > 163 <string>Host Interface Settings</string> 164 </property> 165 <layout class="QVBoxLayout" > 166 <property name="topMargin" > 167 <number>5</number> 168 </property> 169 <item> 170 <layout class="QVBoxLayout" > 171 <property name="spacing" > 172 <number>0</number> 173 </property> 174 <item> 175 <widget class="QLabel" name="mLbInterface_x11" > 176 <property name="text" > 177 <string>&Interface Name</string> 178 </property> 179 <property name="buddy" > 180 <cstring>mLeInterface_x11</cstring> 181 </property> 182 </widget> 183 </item> 184 <item> 185 <widget class="QLineEdit" name="mLeInterface_x11" > 186 <property name="whatsThis" > 187 <string>Displays the TAP interface name.</string> 188 </property> 189 </widget> 190 </item> 191 </layout> 192 </item> 193 <item> 194 <layout class="QVBoxLayout" > 195 <property name="spacing" > 196 <number>0</number> 197 </property> 198 <item> 199 <widget class="QLabel" name="mLbSetup_x11" > 200 <property name="text" > 201 <string>&Setup Application</string> 202 </property> 203 <property name="buddy" > 204 <cstring>mLeSetup_x11</cstring> 205 </property> 206 </widget> 207 </item> 208 <item> 209 <layout class="QHBoxLayout" > 210 <property name="spacing" > 211 <number>6</number> 212 </property> 213 <item> 214 <widget class="QLineEdit" name="mLeSetup_x11" > 215 <property name="whatsThis" > 216 <string>Displays the command executed to set up the TAP interface.</string> 217 </property> 218 </widget> 219 </item> 220 <item> 221 <widget class="QToolButton" name="mTbSetup_x11" > 222 <property name="whatsThis" > 223 <string>Selects the setup application.</string> 224 </property> 225 <property name="autoRaise" > 226 <bool>true</bool> 227 </property> 228 </widget> 229 </item> 230 </layout> 231 </item> 232 </layout> 233 </item> 234 <item> 235 <layout class="QVBoxLayout" > 236 <property name="spacing" > 237 <number>0</number> 238 </property> 239 <item> 240 <widget class="QLabel" name="mLbTerminate_x11" > 241 <property name="text" > 242 <string>&Terminate Application</string> 243 </property> 244 <property name="buddy" > 245 <cstring>mLeTerminate_x11</cstring> 246 </property> 247 </widget> 248 </item> 249 <item> 250 <layout class="QHBoxLayout" > 251 <property name="spacing" > 252 <number>6</number> 253 </property> 254 <item> 255 <widget class="QLineEdit" name="mLeTerminate_x11" > 256 <property name="whatsThis" > 257 <string>Displays the command executed to terminate the TAP interface.</string> 258 </property> 259 </widget> 260 </item> 261 <item> 262 <widget class="QToolButton" name="mTbTerminate_x11" > 263 <property name="whatsThis" > 264 <string>Selects the terminate application.</string> 265 </property> 266 <property name="autoRaise" > 267 <bool>true</bool> 268 </property> 269 </widget> 270 </item> 271 </layout> 272 </item> 273 </layout> 274 </item> 275 </layout> 276 </widget> 297 <item row="1" column="2" > 298 <spacer> 299 <property name="orientation" > 300 <enum>Qt::Horizontal</enum> 301 </property> 302 <property name="sizeHint" > 303 <size> 304 <width>40</width> 305 <height>20</height> 306 </size> 307 </property> 308 </spacer> 309 </item> 310 <item row="2" column="1" > 311 <spacer> 312 <property name="orientation" > 313 <enum>Qt::Vertical</enum> 314 </property> 315 <property name="sizeHint" > 316 <size> 317 <width>20</width> 318 <height>40</height> 319 </size> 320 </property> 321 </spacer> 277 322 </item> 278 323 </layout> 279 324 </widget> 325 <customwidgets> 326 <customwidget> 327 <class>QILabelSeparator</class> 328 <extends>QLabel</extends> 329 <header>QILabelSeparator.h</header> 330 </customwidget> 331 </customwidgets> 280 332 <resources/> 281 <connections/> 333 <connections> 334 <connection> 335 <sender>mGbAdapter</sender> 336 <signal>toggled(bool)</signal> 337 <receiver>mNetworkChild</receiver> 338 <slot>setEnabled(bool)</slot> 339 <hints> 340 <hint type="sourcelabel" > 341 <x>190</x> 342 <y>19</y> 343 </hint> 344 <hint type="destinationlabel" > 345 <x>203</x> 346 <y>164</y> 347 </hint> 348 </hints> 349 </connection> 350 </connections> 282 351 </ui>
Note:
See TracChangeset
for help on using the changeset viewer.