Changeset 10335 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 7, 2008 4:03:04 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIMainDialog.h
r10325 r10335 49 49 bool isSizeGripEnabled () const; 50 50 51 void setDefaultButton (QPushButton* aButton); 52 QPushButton* defaultButton () const; 53 51 54 public slots: 52 55 … … 80 83 81 84 QPointer<QSizeGrip> mSizeGrip; 82 83 QPushButton* mDefaultButton; 85 QPointer<QPushButton> mDefaultButton; 84 86 }; 85 87 -
trunk/src/VBox/Frontends/VirtualBox4/src/QIMainDialog.cpp
r10327 r10335 41 41 : QMainWindow (aParent, aFlags) 42 42 , mRescode (QDialog::Rejected) 43 , mDefaultButton (NULL)44 43 { 45 44 qApp->installEventFilter (this); … … 111 110 return mSizeGrip; 112 111 } 112 113 void QIMainDialog::setDefaultButton (QPushButton* aButton) 114 { 115 mDefaultButton = aButton; 116 } 117 118 QPushButton* QIMainDialog::defaultButton() const 119 { 120 return mDefaultButton; 121 } 122 113 123 114 124 void QIMainDialog::setVisible (bool aVisible) … … 277 287 /* We handle this, so return true after 278 288 * that. */ 279 currentDefault-> click();289 currentDefault->animateClick(); 280 290 return true; 281 291 } -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMLogViewer.cpp
r10156 r10335 111 111 connect (mBtnRefresh, SIGNAL (clicked()), this, SLOT (refresh())); 112 112 113 /* Save is default */114 mBtnSave->setDefault (true);115 /* Make the [Save] button focused by default */116 mBtnSave->setFocus();117 118 113 /* Reading log files */ 119 114 refresh(); 120 115 /* Set the focus to the initial default button */ 116 defaultButton()->setDefault (true); 117 defaultButton()->setFocus(); 118 #ifdef Q_WS_MAC 119 /* We have to force this to get the default button L&F on the mac. */ 120 defaultButton()->setEnabled (true); 121 #endif /* Q_WS_MAC */ 121 122 /* Loading language constants */ 122 123 retranslateUi(); 124 123 125 } 124 126 … … 201 203 mBtnSave->setEnabled (isAnyLogPresent); 202 204 mLogList->setEnabled (isAnyLogPresent); 205 /* Default to the save button if there are any log files otherwise to the 206 * close button. The initial automatic of the main dialog has to be 207 * overwritten */ 208 setDefaultButton (isAnyLogPresent ? mBtnSave:mBtnClose); 203 209 } 204 210
Note:
See TracChangeset
for help on using the changeset viewer.