Changeset 9674 in vbox for trunk/src/VBox
- Timestamp:
- Jun 13, 2008 8:48:50 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsDlg.h
r9654 r9674 29 29 class QIWidgetValidator; 30 30 class VBoxMediaComboBox; 31 class VBoxWarnIconLabel; 32 31 33 class QTimer; 32 34 class QWidgetStack; … … 93 95 CMachine mMachine; 94 96 QString mWarnString; 97 VBoxWarnIconLabel *mWarnIconLabel; 95 98 96 99 /* Flags */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp
r9654 r9674 101 101 102 102 103 class VBoxWarnIconLabel: public QWidget 104 { 105 public: 106 VBoxWarnIconLabel (QWidget *aParent = NULL) 107 : QWidget (aParent) 108 { 109 QHBoxLayout *layout = new QHBoxLayout (this); 110 VBoxGlobal::setLayoutMargin (layout, 0); 111 layout->addWidget (&mIcon); 112 layout->addWidget (&mLabel); 113 } 114 void setWarningPixmap (const QPixmap& aPixmap) { mIcon.setPixmap (aPixmap); } 115 void setWarningText (const QString& aText) { mLabel.setText (aText); } 116 117 private: 118 QLabel mIcon; 119 QLabel mLabel; 120 }; 121 103 122 VBoxVMSettingsDlg::VBoxVMSettingsDlg (QWidget *aParent, 104 123 const QString &aCategory, … … 114 133 Ui::VBoxVMSettingsDlg::setupUi (this); 115 134 135 mWarnIconLabel = new VBoxWarnIconLabel(); 136 mWarnIconLabel->setWarningText (tr ("Invalid settings detected")); 137 mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog.")); 138 mButtonBox->button (QDialogButtonBox::Cancel)->setWhatsThis (tr ("Cancels changes and closes the dialog.")); 139 mButtonBox->button (QDialogButtonBox::Help)->setWhatsThis (tr ("Displays the dialog help.")); 140 116 141 /* Setup warning icon */ 117 142 QIcon icon = vboxGlobal().standardIcon (QStyle::SP_MessageBoxWarning, this); 118 143 if (!icon.isNull()) 119 mLbWarnIcon->setPixmap (icon.pixmap (16, 16)); 144 mWarnIconLabel->setWarningPixmap (icon.pixmap (16, 16)); 145 146 mButtonBox->addExtraWidget (mWarnIconLabel); 120 147 121 148 /* Page title font is derived from the system font */ … … 144 171 /* Common connections */ 145 172 146 connect (mB tnOk, SIGNAL (clicked()), this, SLOT (accept()));147 connect (mB tnCancel, SIGNAL (clicked()), this, SLOT (reject()));148 connect (mB tnHelp, SIGNAL (clicked()), &vboxProblem(), SLOT (showHelpHelpDialog()));173 connect (mButtonBox, SIGNAL (accepted()), this, SLOT (accept())); 174 connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject())); 175 connect (mButtonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog())); 149 176 connect (mTwSelector, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)), 150 177 this, SLOT (settingsGroupChanged (QTreeWidgetItem *, QTreeWidgetItem*))); … … 364 391 { 365 392 mValid = newValid; 366 mBtnOk->setEnabled (mValid); 367 mLbWarnText->setHidden (mValid); 368 mLbWarnIcon->setHidden (mValid); 393 mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (mValid); 394 mWarnIconLabel->setVisible (!mValid); 369 395 } 370 396 } -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsDlg.ui
r9654 r9674 348 348 </item> 349 349 <item row="3" column="0" colspan="2" > 350 <layout class="QHBoxLayout" > 351 <item> 352 <widget class="QPushButton" name="mBtnHelp" > 353 <property name="whatsThis" > 354 <string>Displays the dialog help.</string> 355 </property> 356 <property name="text" > 357 <string>Help</string> 358 </property> 359 <property name="shortcut" > 360 <string>F1</string> 361 </property> 362 </widget> 363 </item> 364 <item> 365 <spacer> 366 <property name="orientation" > 367 <enum>Qt::Horizontal</enum> 368 </property> 369 <property name="sizeHint" > 370 <size> 371 <width>40</width> 372 <height>20</height> 373 </size> 374 </property> 375 </spacer> 376 </item> 377 <item> 378 <widget class="QLabel" name="mLbWarnIcon" > 379 <property name="maximumSize" > 380 <size> 381 <width>16</width> 382 <height>16</height> 383 </size> 384 </property> 385 </widget> 386 </item> 387 <item> 388 <widget class="QLabel" name="mLbWarnText" > 389 <property name="text" > 390 <string>Invalid settings detected</string> 391 </property> 392 </widget> 393 </item> 394 <item> 395 <spacer> 396 <property name="orientation" > 397 <enum>Qt::Horizontal</enum> 398 </property> 399 <property name="sizeHint" > 400 <size> 401 <width>40</width> 402 <height>20</height> 403 </size> 404 </property> 405 </spacer> 406 </item> 407 <item> 408 <widget class="QPushButton" name="mBtnOk" > 409 <property name="whatsThis" > 410 <string>Accepts (saves) changes and closes the dialog.</string> 411 </property> 412 <property name="text" > 413 <string>&Ok</string> 414 </property> 415 <property name="default" > 416 <bool>true</bool> 417 </property> 418 </widget> 419 </item> 420 <item> 421 <widget class="QPushButton" name="mBtnCancel" > 422 <property name="whatsThis" > 423 <string>Cancels changes and closes the dialog.</string> 424 </property> 425 <property name="text" > 426 <string>Cancel</string> 427 </property> 428 </widget> 429 </item> 430 </layout> 350 <widget class="QIDialogButtonBox" name="mButtonBox" > 351 <property name="standardButtons" > 352 <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set> 353 </property> 354 </widget> 431 355 </item> 432 356 </layout> 433 357 </widget> 358 <customwidgets> 359 <customwidget> 360 <class>QIDialogButtonBox</class> 361 <extends>QDialogButtonBox</extends> 362 <header>QIDialogButtonBox.h</header> 363 </customwidget> 364 </customwidgets> 434 365 <resources> 435 366 <include location="../VirtualBox.qrc" />
Note:
See TracChangeset
for help on using the changeset viewer.