Changeset 9257 in vbox for trunk/src/VBox
- Timestamp:
- May 30, 2008 2:29:48 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r9253 r9257 441 441 include/QIRichLabel.h \ 442 442 include/QIAbstractWizard.h \ 443 include/QIAbstractDialog.h \444 443 include/QIListView.h \ 445 444 include/QITreeWidget.h \ … … 524 523 src/QIRichLabel.cpp \ 525 524 src/QIAbstractWizard.cpp \ 526 src/QIAbstractDialog.cpp \527 525 src/QIDialog.cpp \ 528 526 src/QIDialogButtonBox.cpp \ -
trunk/src/VBox/Frontends/VirtualBox4/include/QIMainDialog.h
r9245 r9257 30 30 31 31 class QEventLoop; 32 class QSizeGrip; 32 33 33 34 class QIMainDialog: public QMainWindow … … 45 46 QString fileForProxyIcon () const; 46 47 48 void setSizeGripEnabled (bool aEnabled); 49 bool isSizeGripEnabled () const; 50 47 51 public slots: 48 52 … … 52 56 53 57 virtual bool event (QEvent *aEvent); 58 virtual void resizeEvent (QResizeEvent *aEvent); 59 virtual void keyPressEvent (QKeyEvent *aEvent); 54 60 55 61 protected slots: … … 70 76 71 77 QString mFileForProxyIcon; 78 79 QPointer<QSizeGrip> mSizeGrip; 72 80 }; 73 81 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDiskImageManagerDlg.h
r9245 r9257 67 67 void retranslateUi(); 68 68 virtual void closeEvent (QCloseEvent *aEvent); 69 virtual void keyPressEvent (QKeyEvent *aEvent);70 69 virtual bool eventFilter (QObject *aObject, QEvent *aEvent); 71 70 /* @todo: Currently not used (Ported from Qt3): */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h
r9056 r9257 25 25 26 26 #include "VBoxVMInformationDlg.gen.h" 27 #include "QI AbstractDialog.h"27 #include "QIMainDialog.h" 28 28 #include "COMDefs.h" 29 29 #include "QIWithRetranslateUI.h" … … 32 32 class QTimer; 33 33 34 class VBoxVMInformationDlg : public QIWithRetranslateUI2<QI AbstractDialog>,34 class VBoxVMInformationDlg : public QIWithRetranslateUI2<QIMainDialog>, 35 35 public Ui::VBoxVMInformationDlg 36 36 { -
trunk/src/VBox/Frontends/VirtualBox4/src/QIMainDialog.cpp
r9245 r9257 34 34 #include <QUrl> 35 35 #include <QMenu> 36 #include <QSizeGrip> 37 #include <QPushButton> 36 38 37 39 QIMainDialog::QIMainDialog (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = Qt::Dialog */) … … 82 84 { 83 85 return mFileForProxyIcon; 86 } 87 88 void QIMainDialog::setSizeGripEnabled (bool aEnabled) 89 { 90 if (!mSizeGrip && aEnabled) 91 { 92 mSizeGrip = new QSizeGrip (this); 93 mSizeGrip->resize (mSizeGrip->sizeHint()); 94 mSizeGrip->show(); 95 } 96 else if (mSizeGrip && !aEnabled) 97 delete mSizeGrip; 98 } 99 100 bool QIMainDialog::isSizeGripEnabled () const 101 { 102 return mSizeGrip; 84 103 } 85 104 … … 167 186 } 168 187 188 void QIMainDialog::resizeEvent (QResizeEvent *aEvent) 189 { 190 QMainWindow::resizeEvent (aEvent); 191 192 /* Adjust the size-grip location for the current resize event */ 193 if (mSizeGrip) 194 { 195 if (isRightToLeft()) 196 mSizeGrip->move (rect().bottomLeft() - mSizeGrip->rect().bottomLeft()); 197 else 198 mSizeGrip->move (rect().bottomRight() - mSizeGrip->rect().bottomRight()); 199 aEvent->accept(); 200 } 201 } 202 203 void QIMainDialog::keyPressEvent (QKeyEvent *aEvent) 204 { 205 #ifdef Q_WS_MAC 206 if (aEvent->modifiers() == Qt::ControlModifier && 207 aEvent->key() == Qt::Key_Period) 208 reject(); 209 else 210 #endif 211 if (aEvent->modifiers() == Qt::NoModifier || 212 (aEvent->modifiers() & Qt::KeypadModifier && aEvent->key() == Qt::Key_Enter)) 213 { 214 switch (aEvent->key()) 215 { 216 case Qt::Key_Enter: 217 case Qt::Key_Return: 218 { 219 QList<QPushButton*> list = qFindChildren<QPushButton*> (this); 220 for (int i=0; i < list.size(); ++i) 221 { 222 QPushButton *pb = list.at (i); 223 if (pb->isDefault() && pb->isVisible()) 224 { 225 if (pb->isEnabled()) 226 pb->click(); 227 return; 228 } 229 } 230 break; 231 } 232 case Qt::Key_Escape: 233 { 234 reject(); 235 break; 236 } 237 } 238 } 239 else 240 aEvent->ignore(); 241 } 242 169 243 void QIMainDialog::accept() 170 244 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDiskImageManagerDlg.cpp
r9245 r9257 817 817 mModelessDialog = NULL; 818 818 aEvent->accept(); 819 }820 821 void VBoxDiskImageManagerDlg::keyPressEvent (QKeyEvent *aEvent)822 {823 if (aEvent->modifiers() == Qt::NoModifier ||824 (aEvent->modifiers() != Qt::NoModifier && aEvent->key() == Qt::Key_Enter))825 {826 switch (aEvent->key())827 {828 case Qt::Key_Enter:829 case Qt::Key_Return:830 {831 accept();832 break;833 }834 case Qt::Key_Escape:835 {836 reject();837 break;838 }839 }840 }841 else842 aEvent->ignore();843 819 } 844 820 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r9056 r9257 52 52 const CSession &aSession, 53 53 Qt::WindowFlags aFlags) 54 : QIWithRetranslateUI2<QI AbstractDialog> (aConsole, aFlags)54 : QIWithRetranslateUI2<QIMainDialog> (aConsole, aFlags) 55 55 , mIsPolished (false) 56 56 , mConsole (aConsole) … … 61 61 Ui::VBoxVMInformationDlg::setupUi (this); 62 62 63 /* Initialize parent defaults */ 64 initializeDialog(); 63 #ifdef Q_WS_MAC 64 /* No icon for this window on the mac, cause this would act as proxy icon 65 * which isn't necessary here. */ 66 setWindowIcon (QIcon()); 67 #endif 68 69 /* Enable size grip without using a status bar. */ 70 setSizeGripEnabled (true); 65 71 66 72 /* Setup focus-proxy for pages */ … … 250 256 bool VBoxVMInformationDlg::event (QEvent *aEvent) 251 257 { 252 bool result = QI AbstractDialog::event (aEvent);258 bool result = QIMainDialog::event (aEvent); 253 259 switch (aEvent->type()) 254 260 { … … 269 275 void VBoxVMInformationDlg::resizeEvent (QResizeEvent *aEvent) 270 276 { 271 QI AbstractDialog::resizeEvent (aEvent);277 QIMainDialog::resizeEvent (aEvent); 272 278 273 279 /* Store dialog size for this vm */ … … 281 287 void VBoxVMInformationDlg::showEvent (QShowEvent *aEvent) 282 288 { 283 QI AbstractDialog::showEvent (aEvent);289 QIMainDialog::showEvent (aEvent); 284 290 285 291 /* One may think that QWidget::polish() is the right place to do things -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMInformationDlg.ui
r8790 r9257 1 1 <ui version="4.0" > 2 <class>VBoxVMInformationDlg</class>3 2 <comment> 4 3 VBox frontends: Qt4 GUI ("VirtualBox"): … … 18 17 additional information or have any questions. 19 18 </comment> 19 <class>VBoxVMInformationDlg</class> 20 20 <widget class="QMainWindow" name="VBoxVMInformationDlg" > 21 21 <property name="geometry" > … … 121 121 </layout> 122 122 </widget> 123 <widget class="QStatusBar" name="statusbar" />124 123 </widget> 125 124 <customwidgets> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMLogViewer.ui
r9119 r9257 54 54 </layout> 55 55 </widget> 56 <widget class="QStatusBar" name="statusbar" />57 56 </widget> 58 57 <customwidgets>
Note:
See TracChangeset
for help on using the changeset viewer.