Changeset 10167 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 3, 2008 5:09:23 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32709
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 15 deleted
- 37 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r10160 r10167 87 87 VBOX_PATH_QT4_SHARE ?= $(VBOX_PATH_QT4) 88 88 89 VBOX_MODULE_QT4 = QtCore QtGui 90 VBOX_DEFS_QT4 = QT_CORE_LIB QT_GUI_LIB 89 VBOX_MODULE_QT4 = QtCore QtGui 90 VBOX_DEFS_QT4 = QT_CORE_LIB QT_GUI_LIB 91 91 92 92 ifeq ($(KBUILD_TARGET),darwin) … … 449 449 include/QIMainDialog.h \ 450 450 include/QIHelpButton.h \ 451 include/VBoxUtils.h \ 451 452 include/VBoxGlobalSettings.h \ 452 453 include/VBoxGlobal.h \ … … 471 472 include/VBoxVMLogViewer.h \ 472 473 include/VBoxDiskImageManagerDlg.h \ 473 include/VBox VMSettingsUtils.h \474 include/VBoxSettingsUtils.h \ 474 475 include/VBoxVMSettingsGeneral.h \ 475 476 include/VBoxVMSettingsHD.h \ … … 483 484 include/VBoxVMSettingsSF.h \ 484 485 include/VBoxVMSettingsVRDP.h \ 485 include/VBoxVMSettingsDlg.h \ 486 include/VBoxGlobalSettingsGeneral.h \ 487 include/VBoxGlobalSettingsInput.h \ 488 include/VBoxGlobalSettingsLanguage.h \ 489 include/VBoxGlobalSettingsDlg.h 486 include/VBoxGLSettingsGeneral.h \ 487 include/VBoxGLSettingsInput.h \ 488 include/VBoxGLSettingsLanguage.h \ 489 include/VBoxSettingsDialog.h \ 490 include/VBoxSettingsDialogSpecific.h \ 491 include/VBoxSettingsPage.h 490 492 491 493 # Sources containing local definitions of classes that use the Q_OBJECT macro … … 565 567 src/VBoxVMSettingsSF.cpp \ 566 568 src/VBoxVMSettingsVRDP.cpp \ 567 src/VBox VMSettingsDlg.cpp \568 src/VBoxG lobalSettingsGeneral.cpp \569 src/VBoxG lobalSettingsInput.cpp \570 src/VBox GlobalSettingsLanguage.cpp \571 src/VBox GlobalSettingsDlg.cpp569 src/VBoxGLSettingsGeneral.cpp \ 570 src/VBoxGLSettingsInput.cpp \ 571 src/VBoxGLSettingsLanguage.cpp \ 572 src/VBoxSettingsDialog.cpp \ 573 src/VBoxSettingsDialogSpecific.cpp 572 574 573 575 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 -
trunk/src/VBox/Frontends/VirtualBox4/VBoxUI.pro
r10102 r10167 28 28 ui/VBoxCloseVMDlg.ui \ 29 29 ui/VBoxDiskImageManagerDlg.ui \ 30 ui/VBox GlobalSettingsDlg.ui \30 ui/VBoxSettingsDialog.ui \ 31 31 ui/VBoxGlobalSettingsGeneral.ui \ 32 32 ui/VBoxGlobalSettingsInput.ui \ … … 43 43 ui/VBoxVMSettingsAudio.ui \ 44 44 ui/VBoxVMSettingsCD.ui \ 45 ui/VBoxVMSettingsDlg.ui \46 45 ui/VBoxVMSettingsFD.ui \ 47 46 ui/VBoxVMSettingsGeneral.ui \ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSettingsUtils.h
r10148 r10167 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox VMSettingsUtils class declaration4 * VBoxSettingsUtils class declaration 5 5 */ 6 6 … … 21 21 */ 22 22 23 #ifndef __VBox VMSettingsUtils_h__24 #define __VBox VMSettingsUtils_h__23 #ifndef __VBoxSettingsUtils_h__ 24 #define __VBoxSettingsUtils_h__ 25 25 26 26 #include <VBoxGlobal.h> … … 41 41 { 42 42 /* mTwSelector column numbers */ 43 listView_Category = 0, 44 listView_Id = 1, 45 listView_Link = 2, 43 treeWidget_Category = 0, 44 treeWidget_Id = 1, 45 treeWidget_Link = 2, 46 46 47 /* mTwUSBFilters column numbers */ 47 lvUSBFilters_Name = 0,48 twUSBFilters_Name = 0, 48 49 }; 49 50 … … 237 238 layout->addWidget (&mIcon); 238 239 layout->addWidget (&mLabel); 240 setVisible (false); 239 241 } 240 242 … … 248 250 }; 249 251 250 #endif // __VBox VMSettingsUtils_h__251 252 #endif // __VBoxSettingsUtils_h__ 253 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsAudio.h
r9751 r10167 24 24 #define __VBoxVMSettingsAudio_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsAudio.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxVMSettingsAudio : public QIWithRetranslateUI<QWidget>,30 class VBoxVMSettingsAudio : public VBoxSettingsPage, 31 31 public Ui::VBoxVMSettingsAudio 32 32 { … … 35 35 public: 36 36 37 VBoxVMSettingsAudio (QWidget *aParent);37 VBoxVMSettingsAudio(); 38 38 39 static void getFromMachine (const CMachine &aMachine, 40 QWidget *aPage); 41 static void putBackToMachine(); 39 protected: 42 40 43 41 void getFrom (const CMachine &aMachine); 44 42 void putBackTo(); 45 43 46 protected: 44 void setOrderAfter (QWidget *aWidget); 47 45 48 46 void retranslateUi(); … … 52 50 void prepareComboboxes(); 53 51 54 /* Private member vars */55 static VBoxVMSettingsAudio *mSettings;56 57 52 CMachine mMachine; 58 53 }; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsCD.h
r9751 r10167 24 24 #define __VBoxVMSettingsCD_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsCD.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxVMSettingsDlg; 31 class QIWidgetValidator; 32 33 class VBoxVMSettingsCD : public QIWithRetranslateUI<QWidget>, 30 class VBoxVMSettingsCD : public VBoxSettingsPage, 34 31 public Ui::VBoxVMSettingsCD 35 32 { … … 38 35 public: 39 36 40 VBoxVMSettingsCD (QWidget *aParent, VBoxVMSettingsDlg *aDlg, 41 const QString &aPath); 42 43 static void getFromMachine (const CMachine &aMachine, 44 QWidget *aPage, 45 VBoxVMSettingsDlg *aDlg, 46 const QString &aPath); 47 static void putBackToMachine(); 48 static bool revalidate (QString &aWarning); 49 50 void getFrom (const CMachine &aMachine); 51 void putBackTo(); 52 bool validate (QString &aWarning); 37 VBoxVMSettingsCD(); 53 38 54 39 signals: … … 58 43 protected: 59 44 45 void getFrom (const CMachine &aMachine); 46 void putBackTo(); 47 48 void setValidator (QIWidgetValidator *aVal); 49 bool revalidate (QString &aWarning, QString &aTitle); 50 51 void setOrderAfter (QWidget *aWidget); 52 60 53 void retranslateUi(); 61 54 62 55 private slots: 63 56 64 void onMediaChanged(); 57 void onGbChange (bool aSwitchedOn); 58 void onRbChange(); 59 void onCbChange(); 65 60 void showImageManager(); 66 61 67 62 private: 68 69 static VBoxVMSettingsCD *mSettings;70 63 71 64 CMachine mMachine; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsFD.h
r9751 r10167 24 24 #define __VBoxVMSettingsFD_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsFD.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxVMSettingsDlg; 31 class QIWidgetValidator; 32 33 class VBoxVMSettingsFD : public QIWithRetranslateUI<QWidget>, 30 class VBoxVMSettingsFD : public VBoxSettingsPage, 34 31 public Ui::VBoxVMSettingsFD 35 32 { … … 38 35 public: 39 36 40 VBoxVMSettingsFD (QWidget *aParent, VBoxVMSettingsDlg *aDlg, 41 const QString &aPath); 42 43 static void getFromMachine (const CMachine &aMachine, 44 QWidget *aPage, 45 VBoxVMSettingsDlg *aDlg, 46 const QString &aPath); 47 static void putBackToMachine(); 48 static bool revalidate (QString &aWarning); 49 50 void getFrom (const CMachine &aMachine); 51 void putBackTo(); 52 bool validate (QString &aWarning); 37 VBoxVMSettingsFD(); 53 38 54 39 signals: … … 58 43 protected: 59 44 45 void getFrom (const CMachine &aMachine); 46 void putBackTo(); 47 48 void setValidator (QIWidgetValidator *aVal); 49 bool revalidate (QString &aWarning, QString &aTitle); 50 51 void setOrderAfter (QWidget *aWidget); 52 60 53 void retranslateUi(); 61 54 62 55 private slots: 63 56 64 void onMediaChanged(); 57 void onGbChange (bool aSwitchedOn); 58 void onRbChange(); 59 void onCbChange(); 65 60 void showImageManager(); 66 61 67 62 private: 68 69 static VBoxVMSettingsFD *mSettings;70 63 71 64 CMachine mMachine; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsGeneral.h
r9751 r10167 24 24 #define __VBoxVMSettingsGeneral_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsGeneral.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxVMSettingsDlg; 31 class QIWidgetValidator; 32 33 class VBoxVMSettingsGeneral : public QIWithRetranslateUI<QWidget>, 30 class VBoxVMSettingsGeneral : public VBoxSettingsPage, 34 31 public Ui::VBoxVMSettingsGeneral 35 32 { … … 38 35 public: 39 36 40 VBoxVMSettingsGeneral (QWidget *aParent, VBoxVMSettingsDlg *aDlg, 41 const QString &aPath); 42 43 static void getFromMachine (const CMachine &aMachine, 44 QWidget *aPage, 45 VBoxVMSettingsDlg *aDlg, 46 const QString &aPath); 47 static void putBackToMachine(); 48 49 void getFrom (const CMachine &aMachine); 50 void putBackTo(); 37 VBoxVMSettingsGeneral(); 51 38 52 39 signals: … … 55 42 56 43 protected: 44 45 void getFrom (const CMachine &aMachine); 46 void putBackTo(); 47 48 void setOrderAfter (QWidget *aWidget); 57 49 58 50 void retranslateUi(); … … 78 70 void adjustBootOrderTWSize (); 79 71 80 static VBoxVMSettingsGeneral *mSettings; 72 bool eventFilter (QObject *aObject, QEvent *aEvent); 73 void showEvent (QShowEvent *aEvent); 81 74 82 bool eventFilter (QObject *aObject, QEvent *aEvent);83 84 QIWidgetValidator *mValidator;85 75 CMachine mMachine; 86 76 }; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsHD.h
r9751 r10167 24 24 #define __VBoxVMSettingsHD_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsHD.gen.h" 27 28 #include "COMDefs.h" 28 #include "QIWithRetranslateUI.h"29 29 #include "VBoxMediaComboBox.h" 30 30 31 /* Qt includes */32 31 #include <QComboBox> 33 34 class VBoxVMSettingsDlg;35 class QIWidgetValidator;36 32 37 33 /** Register type to store slot data */ … … 245 241 246 242 static HDSlotUniquizer* instance (QWidget *aParent = 0, 247 HDItemsModel *aWatched = 0); 243 HDItemsModel *aWatched = 0, 244 const CMachine &aMachine = CMachine()); 248 245 249 246 QList<HDSltValue> list (const HDSltValue &aIncluding, bool aFilter = true); … … 256 253 } 257 254 255 const CMachine& machine() const { return mMachine; } 256 258 257 protected: 259 258 260 HDSlotUniquizer (QWidget *aParent, HDItemsModel *aWatched); 259 HDSlotUniquizer (QWidget *aParent, HDItemsModel *aWatched, 260 const CMachine &aMachine); 261 261 virtual ~HDSlotUniquizer(); 262 262 … … 272 272 QList<HDSltValue> mIDEList; 273 273 QList<HDSltValue> mSATAList; 274 const CMachine &mMachine; 274 275 }; 275 276 276 277 /** QWidget class reimplementation used as hard disks settings */ 277 class VBoxVMSettingsHD : public QIWithRetranslateUI<QWidget>,278 class VBoxVMSettingsHD : public VBoxSettingsPage, 278 279 public Ui::VBoxVMSettingsHD 279 280 { … … 282 283 public: 283 284 284 VBoxVMSettingsHD (QWidget *aParent, VBoxVMSettingsDlg *aDlg, 285 const QString &aPath); 286 ~VBoxVMSettingsHD(); 287 288 static void getFromMachine (const CMachine &aMachine, 289 QWidget *aPage, 290 VBoxVMSettingsDlg *aDlg, 291 const QString &aPath); 292 static void putBackToMachine(); 293 static bool revalidate (QString &aWarning); 294 295 bool eventFilter (QObject *aObj, QEvent *aEvent); 296 297 static CMachine mMachine; 285 VBoxVMSettingsHD(); 298 286 299 287 signals: … … 303 291 protected: 304 292 293 void getFrom (const CMachine &aMachine); 294 void putBackTo(); 295 296 void setValidator (QIWidgetValidator *aVal); 297 bool revalidate (QString &aWarning, QString &aTitle); 298 299 void setOrderAfter (QWidget *aWidget); 300 305 301 void retranslateUi(); 306 307 void getFrom();308 void putBackTo();309 bool validate (QString &aWarning);310 302 311 303 private slots: … … 321 313 private: 322 314 315 bool eventFilter (QObject *aObj, QEvent *aEvent); 316 323 317 int maxNameLength() const; 324 318 void showEvent (QShowEvent *aEvent); 325 319 326 static VBoxVMSettingsHD *mSettings; 327 320 CMachine mMachine; 328 321 QIWidgetValidator *mValidator; 329 322 HDItemsModel *mModel; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsNetwork.h
r9951 r10167 24 24 #define __VBoxVMSettingsNetwork_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsNetwork.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class QIWidgetValidator;31 class VBoxVMSettingsDlg;32 30 #ifdef Q_WS_WIN 33 31 class QTreeWidget; … … 54 52 55 53 void setValidator (QIWidgetValidator *aValidator); 54 55 QWidget* setOrderAfter (QWidget *aAfter); 56 56 57 void setNetworksList (const QStringList &aList); 57 58 … … 133 134 * QWidget sub-class which represents network settings page itself. 134 135 */ 135 class VBoxVMSettingsNetworkPage : public QIWithRetranslateUI<QWidget>136 class VBoxVMSettingsNetworkPage : public VBoxSettingsPage 136 137 { 137 138 Q_OBJECT; … … 139 140 public: 140 141 141 static void getFromMachine (const CMachine &aMachine, 142 QWidget *aPage, 143 VBoxVMSettingsDlg *aDlg, 144 const QString &aPath); 145 static void putBackToMachine(); 146 static bool revalidate (QString &aWarning, QString &aTitle); 142 VBoxVMSettingsNetworkPage(); 147 143 148 protected slots: 144 protected: 145 146 void getFrom (const CMachine &aMachine); 147 void putBackTo(); 148 149 void setValidator (QIWidgetValidator *aVal); 150 bool revalidate (QString &aWarning, QString &aTitle); 151 152 void retranslateUi(); 153 154 private slots: 149 155 150 156 void updateNetworksList(); … … 154 160 #endif 155 161 156 protected: 157 158 VBoxVMSettingsNetworkPage (QWidget *aParent); 159 160 void getFrom (const CMachine &aMachine, 161 VBoxVMSettingsDlg *aDlg, 162 const QString &aPath); 163 void putBackTo(); 164 bool validate (QString &aWarning, QString &aTitle); 165 166 void retranslateUi(); 162 private: 167 163 168 164 void populateNetworksList(); 169 170 static VBoxVMSettingsNetworkPage *mSettings;171 165 172 166 /* Widgets */ … … 175 169 VBoxNIList *mNIList; 176 170 #endif 171 172 /* Widget Validator*/ 173 QIWidgetValidator *mValidator; 177 174 178 175 /* Lists */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsParallel.h
r9751 r10167 24 24 #define __VBoxVMSettingsParallel_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsParallel.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 30 class VBoxVMSettingsDlg;31 29 32 30 class VBoxVMSettingsParallel : public QIWithRetranslateUI<QWidget>, … … 37 35 public: 38 36 39 VBoxVMSettingsParallel (QWidget *aParent = NULL);37 VBoxVMSettingsParallel(); 40 38 41 static void getFromMachine (const CMachine &aMachine, 42 QWidget *aPage, 43 VBoxVMSettingsDlg *aDlg, 44 const QString &aPath); 39 void getFromPort (const CParallelPort &aPort); 40 void putBackToPort(); 45 41 46 static void putBackToMachine();42 void setValidator (QIWidgetValidator *aVal); 47 43 48 static bool revalidate (QString &aWarning, QString &aTitle); 44 QWidget* setOrderAfter (QWidget *aAfter); 45 46 QString pageTitle() const; 47 bool isUserDefined(); 49 48 50 49 protected: … … 59 58 private: 60 59 61 void getFromPort (const CParallelPort &aPort);62 void putBackToPort();63 bool isUserDefined();60 QIWidgetValidator *mValidator; 61 CParallelPort mPort; 62 }; 64 63 65 QString pageTitle() const; 64 class VBoxVMSettingsParallelPage : public VBoxSettingsPage 65 { 66 Q_OBJECT; 66 67 67 static QTabWidget *mTabWidget; 68 public: 68 69 69 CParallelPort mPort; 70 VBoxVMSettingsParallelPage(); 71 72 protected: 73 74 void getFrom (const CMachine &aMachine); 75 void putBackTo(); 76 77 void setValidator (QIWidgetValidator *aVal); 78 bool revalidate (QString &aWarning, QString &aTitle); 79 80 void retranslateUi(); 81 82 private: 83 84 QIWidgetValidator *mValidator; 85 QTabWidget *mTabWidget; 70 86 }; 71 87 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsSF.h
r9729 r10167 24 24 #define __VBoxVMSettingsSF_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsSF.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 29 /* Qt includes */30 29 #include <QDialog> 31 30 32 class VBoxVMSettingsDlg;33 31 class SFTreeViewItem; 34 32 class QIDialogButtonBox; … … 48 46 typedef QList<SFolderName> SFoldersNameList; 49 47 50 class VBoxVMSettingsSF : public QIWithRetranslateUI<QWidget>,48 class VBoxVMSettingsSF : public VBoxSettingsPage, 51 49 public Ui::VBoxVMSettingsSF 52 50 { … … 55 53 public: 56 54 57 VBoxVMSettingsSF (QWidget *aParent = 0, int aType = WrongType); 58 59 static void getFromMachineEx (const CMachine &aMachine, 60 QWidget *aParent, 61 VBoxVMSettingsDlg *aDlg); 62 static void putBackToMachineEx(); 63 64 int dialogType() { return mDialogType; } 55 VBoxVMSettingsSF (int aType = WrongType, QWidget *aParent = 0); 65 56 66 57 void getFromGlobal(); … … 72 63 void putBackToConsole(); 73 64 65 int dialogType() { return mDialogType; } 66 74 67 protected: 68 69 void getFrom (const CMachine &aMachine); 70 void putBackTo(); 71 72 void setOrderAfter (QWidget *aWidget); 75 73 76 74 void retranslateUi(); … … 108 106 SFoldersNameList usedList (bool aIncludeSelected); 109 107 110 static VBoxVMSettingsSF *mSettings;111 112 108 int mDialogType; 113 109 QMenu *mMenu; … … 138 134 bool aEnableSelector /* for "permanent" checkbox */, 139 135 const SFoldersNameList &aUsedNames); 140 136 ~VBoxAddSFDialog() {} 141 137 142 138 QString getPath(); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsSerial.h
r9751 r10167 24 24 #define __VBoxVMSettingsSerial_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsSerial.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 30 class VBoxVMSettingsDlg;31 29 32 30 class VBoxVMSettingsSerial : public QIWithRetranslateUI<QWidget>, … … 35 33 Q_OBJECT; 36 34 35 public: 37 36 38 public: 39 VBoxVMSettingsSerial (QWidget* aParent = NULL); 37 VBoxVMSettingsSerial(); 40 38 41 static void getFromMachine (const CMachine &aMachine, 42 QWidget *aPage, 43 VBoxVMSettingsDlg *aDlg, 44 const QString &aPath); 39 void getFromPort (const CSerialPort &aPort); 40 void putBackToPort(); 45 41 46 static void putBackToMachine();42 void setValidator (QIWidgetValidator *aVal); 47 43 48 static bool revalidate (QString &aWarning, QString &aTitle); 44 QWidget* setOrderAfter (QWidget *aAfter); 45 46 QString pageTitle() const; 47 bool isUserDefined(); 49 48 50 49 protected: … … 60 59 private: 61 60 62 QString pageTitle() const; 61 QIWidgetValidator *mValidator; 62 CSerialPort mPort; 63 }; 63 64 64 void getFromPort (const CSerialPort &aPort); 65 void putBackToPort(); 66 bool isUserDefined();65 class VBoxVMSettingsSerialPage : public VBoxSettingsPage 66 { 67 Q_OBJECT; 67 68 68 static QTabWidget *mTabWidget; 69 public: 69 70 70 CSerialPort mPort; 71 VBoxVMSettingsSerialPage(); 72 73 protected: 74 75 void getFrom (const CMachine &aMachine); 76 void putBackTo(); 77 78 void setValidator (QIWidgetValidator *aVal); 79 bool revalidate (QString &aWarning, QString &aTitle); 80 81 void retranslateUi(); 82 83 private: 84 85 QIWidgetValidator *mValidator; 86 QTabWidget *mTabWidget; 71 87 }; 72 88 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsUSB.h
r9889 r10167 24 24 #define __VBoxVMSettingsUSB_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsUSB.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxGlobalSettingsDlg;31 class VBoxVMSettingsDlg;32 class QIWidgetValidator;33 30 class VBoxUSBMenu; 34 31 35 class VBoxVMSettingsUSB : public QIWithRetranslateUI<QWidget>,32 class VBoxVMSettingsUSB : public VBoxSettingsPage, 36 33 public Ui::VBoxVMSettingsUSB 37 34 { … … 47 44 }; 48 45 49 static void getFrom (QWidget *aPage, 50 VBoxGlobalSettingsDlg *aDlg, 51 const QString &aPath); 52 static void getFrom (const CMachine &aMachine, 53 QWidget *aPage, 54 VBoxVMSettingsDlg *aDlg, 55 const QString &aPath); 56 static void putBackTo(); 46 VBoxVMSettingsUSB (FilterType aType); 57 47 58 48 protected: 59 49 60 VBoxVMSettingsUSB (QWidget *aParent,61 FilterType aType,62 QWidget *aDlg,63 const QString &aPath);50 void getFrom (const CSystemProperties &aProps, 51 const VBoxGlobalSettings &aGs); 52 void putBackTo (CSystemProperties &aProps, 53 VBoxGlobalSettings &aGs); 64 54 65 ~VBoxVMSettingsUSB(); 55 void getFrom (const CMachine &aMachine); 56 void putBackTo(); 66 57 67 void getFromHost(); 68 void putBackToHost(); 58 void setValidator (QIWidgetValidator *aVal); 69 59 70 void getFromMachine (const CMachine &aMachine); 71 void putBackToMachine(); 60 void setOrderAfter (QWidget *aWidget); 72 61 73 62 void retranslateUi(); 74 75 FilterType mType;76 63 77 64 private slots: … … 93 80 void addUSBFilter (const CUSBDeviceFilter &aFilter, bool isNew); 94 81 95 static VBoxVMSettingsUSB *mSettings;96 97 82 CMachine mMachine; 98 83 QIWidgetValidator *mValidator; 84 FilterType mType; 99 85 QAction *mNewAction; 100 86 QAction *mAddAction; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsVRDP.h
r9751 r10167 24 24 #define __VBoxVMSettingsVRDP_h__ 25 25 26 #include "VBoxSettingsPage.h" 26 27 #include "VBoxVMSettingsVRDP.gen.h" 27 #include "QIWithRetranslateUI.h"28 28 #include "COMDefs.h" 29 29 30 class VBoxVMSettingsDlg; 31 class QIWidgetValidator; 32 33 class VBoxVMSettingsVRDP : public QIWithRetranslateUI<QWidget>, 30 class VBoxVMSettingsVRDP : public VBoxSettingsPage, 34 31 public Ui::VBoxVMSettingsVRDP 35 32 { … … 38 35 public: 39 36 40 VBoxVMSettingsVRDP (QWidget *aParent, VBoxVMSettingsDlg *aDlg, 41 const QString &aPath); 37 VBoxVMSettingsVRDP(); 42 38 43 static void getFromMachine (const CMachine &aMachine, 44 QWidget *aPage, 45 VBoxVMSettingsDlg *aDlg, 46 const QString &aPath); 47 static void putBackToMachine(); 39 protected: 48 40 49 41 void getFrom (const CMachine &aMachine); 50 42 void putBackTo(); 51 43 52 protected: 44 void setValidator (QIWidgetValidator *aVal); 45 46 void setOrderAfter (QWidget *aWidget); 53 47 54 48 void retranslateUi(); 55 49 56 50 private: 57 58 static VBoxVMSettingsVRDP *mSettings;59 51 60 52 CMachine mMachine; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r10166 r10167 3518 3518 3519 3519 /* Setup settings layout */ 3520 mSettings = new VBoxVMSettingsSF ( this, MachineType | ConsoleType);3520 mSettings = new VBoxVMSettingsSF (MachineType | ConsoleType, this); 3521 3521 mSettings->getFromConsole (aSession.GetConsole()); 3522 3522 mSettings->getFromMachine (aSession.GetMachine()); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r10149 r10167 1534 1534 CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties(); 1535 1535 QString virt = m.GetHWVirtExEnabled() == KTSBool_True ? 1536 tr ("Enabled", "details report (VT-x/AMD-V)") :1537 m.GetHWVirtExEnabled() == KTSBool_False ?1538 tr ("Disabled", "details report (VT-x/AMD-V)") :1539 props.GetHWVirtExEnabled() ?1540 1536 tr ("Enabled", "details report (VT-x/AMD-V)") : 1541 1537 tr ("Disabled", "details report (VT-x/AMD-V)"); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r10146 r10167 30 30 #include "VBoxNewVMWzd.h" 31 31 #include "VBoxDiskImageManagerDlg.h" 32 #include "VBoxVMSettingsDlg.h" 33 #include "VBoxGlobalSettingsDlg.h" 32 #include "VBoxSettingsDialogSpecific.h" 34 33 #include "VBoxVMLogViewer.h" 35 34 #include "VBoxGlobal.h" … … 742 741 CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties(); 743 742 744 VBoxGlobalSettingsDlg dlg (this); 745 dlg.getFrom (props, settings); 746 747 if (dlg.exec() == QDialog::Accepted) 748 { 749 VBoxGlobalSettings s = settings; 750 dlg.putBackTo (props, s); 751 if (!props.isOk()) 752 vboxProblem().cannotSetSystemProperties (props); 753 else 754 { 755 // see whether the user has changed something or not 756 if (!(settings == s)) 757 vboxGlobal().setSettings (s); 758 } 759 } 743 VBoxSettingsDialog *dlg = new VBoxGLSettingsDlg (this); 744 dlg->getFrom(); 745 746 if (dlg->exec() == QDialog::Accepted) 747 dlg->putBackTo(); 748 749 delete dlg; 760 750 } 761 751 … … 785 775 /** 786 776 * Opens the VM settings dialog. 787 *788 * @param aCategory Category to select in the settings dialog. See789 * VBoxVMSettingsDlg::setup().790 * @param aControl Widget name to select in the settings dialog. See791 * VBoxVMSettingsDlg::setup().792 777 */ 793 778 void VBoxSelectorWnd::vmSettings (const QString &aCategory, const QString &aControl) … … 813 798 AssertMsgReturn (!m.isNull(), ("Machine must not be null"), (void) 0); 814 799 815 VBox VMSettingsDlg dlg (this, aCategory, aControl);816 dlg .getFromMachine (m);817 818 if (dlg .exec() == QDialog::Accepted)800 VBoxSettingsDialog *dlg = new VBoxVMSettingsDlg (this, m, aCategory, aControl); 801 dlg->getFrom(); 802 803 if (dlg->exec() == QDialog::Accepted) 819 804 { 820 805 QString oldName = m.GetName(); 821 COMResult res = dlg.putBackToMachine(); 822 if (res.isOk()) 823 { 824 m.SaveSettings(); 825 if (m.isOk()) 826 { 827 if (oldName.compare (m.GetName())) 828 mVMModel->sort(); 829 } 830 else 831 { 832 vboxProblem().cannotSaveMachineSettings (m); 833 } 806 dlg->putBackTo(); 807 808 m.SaveSettings(); 809 if (m.isOk()) 810 { 811 if (oldName.compare (m.GetName())) 812 mVMModel->sort(); 834 813 } 835 814 else 836 { 837 vboxProblem().cannotApplyMachineSettings (m, res); 838 } 839 } 815 vboxProblem().cannotSaveMachineSettings (m); 816 817 /* To check use the result in future 818 * vboxProblem().cannotApplyMachineSettings (m, res); */ 819 } 820 821 delete dlg; 840 822 841 823 mVMListView->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsAudio.cpp
r9751 r10167 24 24 #include "VBoxGlobal.h" 25 25 26 VBoxVMSettingsAudio* VBoxVMSettingsAudio::mSettings = 0; 27 28 VBoxVMSettingsAudio::VBoxVMSettingsAudio (QWidget *aParent) 29 : QIWithRetranslateUI<QWidget> (aParent) 26 VBoxVMSettingsAudio::VBoxVMSettingsAudio() 30 27 { 31 28 /* Apply UI decorations */ … … 33 30 /* Applying language settings */ 34 31 retranslateUi(); 35 }36 37 void VBoxVMSettingsAudio::getFromMachine (const CMachine &aMachine,38 QWidget *aPage)39 {40 mSettings = new VBoxVMSettingsAudio (aPage);41 QVBoxLayout *layout = new QVBoxLayout (aPage);42 layout->setContentsMargins (0, 0, 0, 0);43 layout->addWidget (mSettings);44 mSettings->getFrom (aMachine);45 }46 47 void VBoxVMSettingsAudio::putBackToMachine()48 {49 mSettings->putBackTo();50 32 } 51 33 … … 71 53 } 72 54 55 void VBoxVMSettingsAudio::setOrderAfter (QWidget *aWidget) 56 { 57 setTabOrder (aWidget, mGbAudio); 58 setTabOrder (mGbAudio, mCbAudioDriver); 59 setTabOrder (mCbAudioDriver, mCbAudioController); 60 } 73 61 74 62 void VBoxVMSettingsAudio::retranslateUi() -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsCD.cpp
r9751 r10167 22 22 23 23 #include "VBoxVMSettingsCD.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "VBoxGlobal.h" 26 #include "VBoxProblemReporter.h"27 25 #include "QIWidgetValidator.h" 28 26 #include "VBoxDiskImageManagerDlg.h" 29 27 30 /* Qt includes */31 28 #include <QFileInfo> 32 29 33 VBoxVMSettingsCD* VBoxVMSettingsCD::mSettings = 0; 34 35 VBoxVMSettingsCD::VBoxVMSettingsCD (QWidget *aParent, 36 VBoxVMSettingsDlg *aDlg, 37 const QString &aPath) 38 : QIWithRetranslateUI<QWidget> (aParent) 30 VBoxVMSettingsCD::VBoxVMSettingsCD() 31 : mValidator (0) 39 32 , mLastSelected (0) 40 33 { … … 42 35 Ui::VBoxVMSettingsCD::setupUi (this); 43 36 44 /* Setup validation */45 mValidator = new QIWidgetValidator (aPath, aParent, this);46 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator*)),47 aDlg, SLOT (enableOk (const QIWidgetValidator*)));48 connect (mValidator, SIGNAL (isValidRequested (QIWidgetValidator*)),49 aDlg, SLOT (revalidate (QIWidgetValidator*)));50 51 37 /* Setup connections */ 52 connect (mGbCD, SIGNAL (toggled (bool)), this, SLOT (onMediaChanged())); 53 connect (mCbIsoCD, SIGNAL (activated (int)), this, SLOT (onMediaChanged())); 38 connect (mGbCD, SIGNAL (toggled (bool)), this, SLOT (onGbChange (bool))); 39 connect (mRbHostCD, SIGNAL (toggled (bool)), this, SLOT (onRbChange())); 40 connect (mRbIsoCD, SIGNAL (toggled (bool)), this, SLOT (onRbChange())); 41 connect (mCbIsoCD, SIGNAL (activated (int)), this, SLOT (onCbChange())); 54 42 connect (mTbIsoCD, SIGNAL (clicked()), this, SLOT (showImageManager())); 55 connect (mRbHostCD, SIGNAL (toggled (bool)), mValidator, SLOT (revalidate()));56 connect (mRbIsoCD, SIGNAL (toggled (bool)), mValidator, SLOT (revalidate()));57 43 58 44 /* Setup iconsets */ … … 62 48 /* Setup dialog */ 63 49 mCbIsoCD->setType (VBoxDefs::CD); 64 65 50 mLastSelected = mRbHostCD; 51 66 52 /* Applying language settings */ 67 53 retranslateUi(); 68 }69 70 void VBoxVMSettingsCD::getFromMachine (const CMachine &aMachine,71 QWidget *aPage,72 VBoxVMSettingsDlg *aDlg,73 const QString &aPath)74 {75 mSettings = new VBoxVMSettingsCD (aPage, aDlg, aPath);76 QVBoxLayout *layout = new QVBoxLayout (aPage);77 layout->setContentsMargins (0, 0, 0, 0);78 layout->addWidget (mSettings);79 connect (mSettings, SIGNAL (cdChanged()), aDlg, SLOT (resetFirstRunFlag()));80 mSettings->getFrom (aMachine);81 }82 83 void VBoxVMSettingsCD::putBackToMachine()84 {85 mSettings->putBackTo();86 }87 88 bool VBoxVMSettingsCD::revalidate (QString &aWarning)89 {90 return mSettings->validate (aWarning);91 54 } 92 55 … … 167 130 mCbIsoCD->refresh(); 168 131 169 mValidator->revalidate(); 132 if (mValidator) 133 mValidator->revalidate(); 170 134 } 171 135 … … 194 158 } 195 159 196 bool VBoxVMSettingsCD::validate (QString &aWarning) 160 void VBoxVMSettingsCD::setValidator (QIWidgetValidator *aVal) 161 { 162 mValidator = aVal; 163 } 164 165 bool VBoxVMSettingsCD::revalidate (QString &aWarning, QString &) 166 { 167 if (mRbHostCD->isChecked() && mCbHostCD->currentText().isNull()) 168 aWarning = tr ("Host CD/DVD drive is not selected"); 169 else if (mRbIsoCD->isChecked() && mUuidIsoCD.isNull()) 170 aWarning = tr ("CD/DVD image file is not selected"); 171 172 return aWarning.isNull(); 173 } 174 175 void VBoxVMSettingsCD::setOrderAfter (QWidget *aWidget) 176 { 177 setTabOrder (aWidget, mGbCD); 178 setTabOrder (mGbCD, mRbHostCD); 179 setTabOrder (mRbHostCD, mCbHostCD); 180 setTabOrder (mCbHostCD, mCbPassthrough); 181 setTabOrder (mCbPassthrough, mRbIsoCD); 182 setTabOrder (mRbIsoCD, mCbIsoCD); 183 setTabOrder (mCbIsoCD, mTbIsoCD); 184 } 185 186 void VBoxVMSettingsCD::retranslateUi() 187 { 188 /* Translate uic generated strings */ 189 Ui::VBoxVMSettingsCD::retranslateUi (this); 190 } 191 192 void VBoxVMSettingsCD::onGbChange (bool aSwitchedOn) 197 193 { 198 194 /* Toggle auto-exclusiveness on/off to let the buttons be 199 195 * unchecked both in case of group-box is not checked and 200 196 * exclusively checked in case of group-box is checked. */ 201 mRbHostCD->setAutoExclusive ( mGbCD->isChecked());202 mRbIsoCD->setAutoExclusive ( mGbCD->isChecked());197 mRbHostCD->setAutoExclusive (aSwitchedOn); 198 mRbIsoCD->setAutoExclusive (aSwitchedOn); 203 199 204 200 /* Toggle both buttons off when the group box unchecked. */ 205 if (! mGbCD->isChecked())201 if (!aSwitchedOn) 206 202 { 207 203 mLastSelected = mRbIsoCD->isChecked() ? mRbIsoCD : mRbHostCD; … … 222 218 } 223 219 220 onCbChange(); 221 } 222 223 void VBoxVMSettingsCD::onRbChange() 224 { 224 225 /* Check the 'host' group. */ 225 226 mCbHostCD->setEnabled (mRbHostCD->isChecked()); … … 230 231 mTbIsoCD->setEnabled (mRbIsoCD->isChecked()); 231 232 232 /* Compose the error string. */ 233 if (mRbHostCD->isChecked() && mCbHostCD->currentText().isNull()) 234 aWarning = tr ("Host CD/DVD drive is not selected"); 235 else if (mRbIsoCD->isChecked() && mUuidIsoCD.isNull()) 236 aWarning = tr ("CD/DVD image file is not selected"); 237 238 return aWarning.isNull(); 239 } 240 241 242 void VBoxVMSettingsCD::retranslateUi() 243 { 244 /* Translate uic generated strings */ 245 Ui::VBoxVMSettingsCD::retranslateUi (this); 246 } 247 248 249 void VBoxVMSettingsCD::onMediaChanged() 233 onCbChange(); 234 } 235 236 void VBoxVMSettingsCD::onCbChange() 250 237 { 251 238 mUuidIsoCD = mGbCD->isChecked() ? mCbIsoCD->getId() : QUuid(); 252 mValidator->revalidate();253 239 emit cdChanged(); 240 if (mValidator) 241 mValidator->revalidate(); 254 242 } 255 243 … … 272 260 273 261 mCbIsoCD->setFocus(); 274 mValidator->revalidate(); 275 } 276 262 if (mValidator) 263 mValidator->revalidate(); 264 } 265 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsFD.cpp
r9751 r10167 22 22 23 23 #include "VBoxVMSettingsFD.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "VBoxGlobal.h" 26 25 #include "VBoxProblemReporter.h" … … 28 27 #include "VBoxDiskImageManagerDlg.h" 29 28 30 /* Qt includes */31 29 #include <QFileInfo> 32 30 33 VBoxVMSettingsFD* VBoxVMSettingsFD::mSettings = 0; 34 35 VBoxVMSettingsFD::VBoxVMSettingsFD (QWidget *aParent, 36 VBoxVMSettingsDlg *aDlg, 37 const QString &aPath) 38 : QIWithRetranslateUI<QWidget> (aParent) 31 VBoxVMSettingsFD::VBoxVMSettingsFD() 32 : mValidator (0) 39 33 , mLastSelected (0) 40 34 { … … 42 36 Ui::VBoxVMSettingsFD::setupUi (this); 43 37 44 /* Setup validation */45 mValidator = new QIWidgetValidator (aPath, aParent, this);46 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator*)),47 aDlg, SLOT (enableOk (const QIWidgetValidator*)));48 connect (mValidator, SIGNAL (isValidRequested (QIWidgetValidator*)),49 aDlg, SLOT (revalidate (QIWidgetValidator*)));50 51 38 /* Setup connections */ 52 connect (mGbFD, SIGNAL (toggled (bool)), this, SLOT (onMediaChanged())); 53 connect (mCbIsoFD, SIGNAL (activated (int)), this, SLOT (onMediaChanged())); 39 connect (mGbFD, SIGNAL (toggled (bool)), this, SLOT (onGbChange (bool))); 40 connect (mRbHostFD, SIGNAL (toggled (bool)), this, SLOT (onRbChange())); 41 connect (mRbIsoFD, SIGNAL (toggled (bool)), this, SLOT (onRbChange())); 42 connect (mCbIsoFD, SIGNAL (activated (int)), this, SLOT (onCbChange())); 54 43 connect (mTbIsoFD, SIGNAL (clicked()), this, SLOT (showImageManager())); 55 connect (mRbHostFD, SIGNAL (toggled (bool)), mValidator, SLOT (revalidate()));56 connect (mRbIsoFD, SIGNAL (toggled (bool)), mValidator, SLOT (revalidate()));57 44 58 45 /* Setup iconsets */ … … 66 53 /* Applying language settings */ 67 54 retranslateUi(); 68 }69 70 void VBoxVMSettingsFD::getFromMachine (const CMachine &aMachine,71 QWidget *aPage,72 VBoxVMSettingsDlg *aDlg,73 const QString &aPath)74 {75 mSettings = new VBoxVMSettingsFD (aPage, aDlg, aPath);76 QVBoxLayout *layout = new QVBoxLayout (aPage);77 layout->setContentsMargins (0, 0, 0, 0);78 layout->addWidget (mSettings);79 connect (mSettings, SIGNAL (fdChanged()), aDlg, SLOT (resetFirstRunFlag()));80 mSettings->getFrom (aMachine);81 }82 83 void VBoxVMSettingsFD::putBackToMachine()84 {85 mSettings->putBackTo();86 }87 88 bool VBoxVMSettingsFD::revalidate (QString &aWarning)89 {90 return mSettings->validate (aWarning);91 55 } 92 56 … … 167 131 mCbIsoFD->refresh(); 168 132 169 mValidator->revalidate(); 133 if (mValidator) 134 mValidator->revalidate(); 170 135 } 171 136 … … 191 156 } 192 157 193 bool VBoxVMSettingsFD::validate (QString &aWarning) 158 void VBoxVMSettingsFD::setValidator (QIWidgetValidator *aVal) 159 { 160 mValidator = aVal; 161 } 162 163 bool VBoxVMSettingsFD::revalidate (QString &aWarning, QString &) 164 { 165 if (mRbHostFD->isChecked() && mCbHostFD->currentText().isNull()) 166 aWarning = tr ("Host floppy drive is not selected"); 167 else if (mRbIsoFD->isChecked() && mUuidIsoFD.isNull()) 168 aWarning = tr ("Floppy image file is not selected"); 169 170 return aWarning.isNull(); 171 } 172 173 void VBoxVMSettingsFD::setOrderAfter (QWidget *aWidget) 174 { 175 setTabOrder (aWidget, mGbFD); 176 setTabOrder (mGbFD, mRbHostFD); 177 setTabOrder (mRbHostFD, mCbHostFD); 178 setTabOrder (mCbHostFD, mRbIsoFD); 179 setTabOrder (mRbIsoFD, mCbIsoFD); 180 setTabOrder (mCbIsoFD, mTbIsoFD); 181 } 182 183 void VBoxVMSettingsFD::retranslateUi() 184 { 185 /* Translate uic generated strings */ 186 Ui::VBoxVMSettingsFD::retranslateUi (this); 187 } 188 189 void VBoxVMSettingsFD::onGbChange (bool aSwitchedOn) 194 190 { 195 191 /* Toggle auto-exclusiveness on/off to let the buttons be unchecked both in 196 192 * case of group-box is not checked and exclusively checked in case of 197 193 * group-box is checked. */ 198 mRbHostFD->setAutoExclusive ( mGbFD->isChecked());199 mRbIsoFD->setAutoExclusive ( mGbFD->isChecked());194 mRbHostFD->setAutoExclusive (aSwitchedOn); 195 mRbIsoFD->setAutoExclusive (aSwitchedOn); 200 196 201 197 /* Toggle both buttons off when the group box unchecked. */ 202 if (! mGbFD->isChecked())198 if (!aSwitchedOn) 203 199 { 204 200 mLastSelected = mRbIsoFD->isChecked() ? mRbIsoFD : mRbHostFD; … … 219 215 } 220 216 217 onCbChange(); 218 } 219 220 void VBoxVMSettingsFD::onRbChange() 221 { 221 222 /* Check the 'host' group. */ 222 223 mCbHostFD->setEnabled (mRbHostFD->isChecked()); … … 226 227 mTbIsoFD->setEnabled (mRbIsoFD->isChecked()); 227 228 228 /* Compose the error string. */ 229 if (mRbHostFD->isChecked() && mCbHostFD->currentText().isNull()) 230 aWarning = tr ("Host floppy drive is not selected"); 231 else if (mRbIsoFD->isChecked() && mUuidIsoFD.isNull()) 232 aWarning = tr ("Floppy image file is not selected"); 233 234 return aWarning.isNull(); 235 } 236 237 238 void VBoxVMSettingsFD::retranslateUi() 239 { 240 /* Translate uic generated strings */ 241 Ui::VBoxVMSettingsFD::retranslateUi (this); 242 } 243 244 245 void VBoxVMSettingsFD::onMediaChanged() 229 onCbChange(); 230 } 231 232 void VBoxVMSettingsFD::onCbChange() 246 233 { 247 234 mUuidIsoFD = mGbFD->isChecked() ? mCbIsoFD->getId() : QUuid(); 248 mValidator->revalidate();249 235 emit fdChanged(); 236 if (mValidator) 237 mValidator->revalidate(); 250 238 } 251 239 … … 268 256 269 257 mCbIsoFD->setFocus(); 270 mValidator->revalidate(); 271 } 272 258 if (mValidator) 259 mValidator->revalidate(); 260 } 261 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp
r9948 r10167 22 22 23 23 #include "VBoxVMSettingsGeneral.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "VBoxGlobal.h" 26 25 #include "VBoxProblemReporter.h" 27 #include "QIWidgetValidator.h" 28 29 /* Qt includes */ 26 30 27 #include <QDir> 31 28 32 29 #define ITEM_TYPE_ROLE Qt::UserRole + 1 33 34 VBoxVMSettingsGeneral* VBoxVMSettingsGeneral::mSettings = 0;35 30 36 31 /** … … 54 49 } 55 50 56 VBoxVMSettingsGeneral::VBoxVMSettingsGeneral (QWidget *aParent, 57 VBoxVMSettingsDlg *aDlg, 58 const QString &aPath) 59 : QIWithRetranslateUI<QWidget> (aParent) 51 VBoxVMSettingsGeneral::VBoxVMSettingsGeneral() 60 52 { 61 53 /* Apply UI decorations */ 62 54 Ui::VBoxVMSettingsGeneral::setupUi (this); 63 55 64 /* Setup validators */56 /* Setup constants */ 65 57 CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties(); 66 58 const uint MinRAM = sys.GetMinGuestRAM(); … … 69 61 const uint MaxVRAM = sys.GetMaxGuestVRAM(); 70 62 71 mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), aDlg)); 72 mLeRam->setValidator (new QIntValidator (MinRAM, MaxRAM, aDlg)); 73 mLeVideo->setValidator (new QIntValidator (MinVRAM, MaxVRAM, aDlg)); 74 75 mValidator = new QIWidgetValidator (aPath, aParent, aDlg); 76 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator *)), 77 aDlg, SLOT (enableOk (const QIWidgetValidator *))); 63 /* Setup validators */ 64 mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this)); 65 mLeRam->setValidator (new QIntValidator (MinRAM, MaxRAM, this)); 66 mLeVideo->setValidator (new QIntValidator (MinVRAM, MaxVRAM, this)); 78 67 79 68 /* Setup connections */ … … 152 141 153 142 qApp->installEventFilter (this); 143 154 144 /* Applying language settings */ 155 145 retranslateUi(); 156 }157 158 void VBoxVMSettingsGeneral::getFromMachine (const CMachine &aMachine,159 QWidget *aPage,160 VBoxVMSettingsDlg *aDlg,161 const QString &aPath)162 {163 mSettings = new VBoxVMSettingsGeneral (aPage, aDlg, aPath);164 QVBoxLayout *layout = new QVBoxLayout (aPage);165 layout->setContentsMargins (0, 0, 0, 0);166 layout->addWidget (mSettings);167 connect (mSettings, SIGNAL (tableChanged()), aDlg, SLOT (resetFirstRunFlag()));168 mSettings->getFrom (aMachine);169 }170 171 void VBoxVMSettingsGeneral::putBackToMachine()172 {173 mSettings->putBackTo();174 146 } 175 147 … … 224 196 } 225 197 } 226 adjustBootOrderTWSize 198 adjustBootOrderTWSize(); 227 199 } 228 200 … … 234 206 235 207 /* VT-x/AMD-V */ 236 aMachine.GetHWVirtExEnabled() == KTSBool_False ?237 mCbVirt->setCheckState (Qt::Unchecked) :238 208 aMachine.GetHWVirtExEnabled() == KTSBool_True ? 239 209 mCbVirt->setCheckState (Qt::Checked) : 240 mCbVirt->setCheckState (Qt:: PartiallyChecked);210 mCbVirt->setCheckState (Qt::Unchecked); 241 211 242 212 /* PAE/NX */ … … 311 281 /* VT-x/AMD-V */ 312 282 mMachine.SetHWVirtExEnabled ( 313 mCbVirt->checkState() == Qt::Unchecked ? KTSBool_False : 314 mCbVirt->checkState() == Qt::Checked ? KTSBool_True : KTSBool_Default); 283 mCbVirt->checkState() == Qt::Checked ? KTSBool_True : KTSBool_False); 315 284 316 285 /* PAE/NX */ … … 342 311 } 343 312 313 void VBoxVMSettingsGeneral::setOrderAfter (QWidget *aWidget) 314 { 315 /* Setup Tab order */ 316 setTabOrder (aWidget, mTabGeneral->focusProxy()); 317 setTabOrder (mTabGeneral->focusProxy(), mLeName); 318 setTabOrder (mLeName, mCbOsType); 319 setTabOrder (mCbOsType, mSlRam); 320 setTabOrder (mSlRam, mLeRam); 321 setTabOrder (mLeRam, mSlVideo); 322 setTabOrder (mSlVideo, mLeVideo); 323 324 setTabOrder (mLeVideo, mTwBootOrder); 325 setTabOrder (mTwBootOrder, mTbBootItemUp); 326 setTabOrder (mTbBootItemUp, mTbBootItemDown); 327 setTabOrder (mTbBootItemDown, mCbAcpi); 328 setTabOrder (mCbAcpi, mCbPae); 329 setTabOrder (mCbPae, mCbApic); 330 setTabOrder (mCbApic, mCbVirt); 331 setTabOrder (mCbVirt, mCbClipboard); 332 setTabOrder (mCbClipboard, mCbIDEController); 333 setTabOrder (mCbIDEController, mLeSnapshot); 334 setTabOrder (mLeSnapshot, mTbSelectSnapshot); 335 setTabOrder (mTbSelectSnapshot, mTbResetSnapshot); 336 337 setTabOrder (mTbResetSnapshot, mTeDescription); 338 339 setTabOrder (mTeDescription, mCbSaveMounted); 340 } 344 341 345 342 void VBoxVMSettingsGeneral::retranslateUi() … … 367 364 } 368 365 /* Readjust the tree widget size */ 369 adjustBootOrderTWSize 366 adjustBootOrderTWSize(); 370 367 371 368 /* Shared Clipboard mode */ … … 473 470 mLeSnapshot->selectAll(); 474 471 mLeSnapshot->del(); 472 } 473 474 void VBoxVMSettingsGeneral::adjustBootOrderTWSize() 475 { 476 /* Calculate the optimal size of the tree widget & set it as fixed 477 * size. */ 478 mTwBootOrder->setFixedSize ( 479 static_cast<QAbstractItemView*> (mTwBootOrder) 480 ->sizeHintForColumn (0) + 2 * mTwBootOrder->frameWidth(), 481 static_cast<QAbstractItemView*> (mTwBootOrder) 482 ->sizeHintForRow (0) * mTwBootOrder->topLevelItemCount() + 483 2 * mTwBootOrder->frameWidth()); 484 485 /* Update the layout system */ 486 mWBootContainer->layout()->activate(); 487 mTabAdvanced->layout()->activate(); 488 mTabAdvanced->layout()->update(); 475 489 } 476 490 … … 515 529 } 516 530 517 void VBoxVMSettingsGeneral::adjustBootOrderTWSize () 518 { 519 if (mTwBootOrder) 520 { 521 /* Calculate the optimal size of the tree widget & set it as fixed 522 * size. */ 523 mTwBootOrder->setFixedSize (static_cast<QAbstractItemView*> (mTwBootOrder)->sizeHintForColumn (0) + 2 * mTwBootOrder->frameWidth(), 524 static_cast<QAbstractItemView*> (mTwBootOrder)->sizeHintForRow (0) * mTwBootOrder->topLevelItemCount() + 2 * mTwBootOrder->frameWidth()); 525 } 526 } 531 void VBoxVMSettingsGeneral::showEvent (QShowEvent *aEvent) 532 { 533 QCoreApplication::sendPostedEvents(); 534 VBoxSettingsPage::showEvent (aEvent); 535 } 536 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsHD.cpp
r9751 r10167 22 22 23 23 #include "VBoxVMSettingsHD.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "VBoxGlobal.h" 26 25 #include "VBoxProblemReporter.h" … … 30 29 #include "VBoxNewHDWzd.h" 31 30 32 /* Qt includes */33 31 #include <QHeaderView> 34 32 #include <QItemEditorFactory> … … 262 260 : VBoxMediaComboBox (aParent, VBoxDefs::HD) 263 261 { 264 setBelongsTo ( VBoxVMSettingsHD::mMachine.GetId());262 setBelongsTo (HDSlotUniquizer::instance()->machine().GetId()); 265 263 connect (this, SIGNAL (currentIndexChanged (int)), this, SLOT (onActivate())); 266 264 connect (this, SIGNAL (readyToCommit (QWidget *)), … … 320 318 HDSlotUniquizer* HDSlotUniquizer::mInstance = 0; 321 319 HDSlotUniquizer* HDSlotUniquizer::instance (QWidget *aParent, 322 HDItemsModel *aWatched) 320 HDItemsModel *aWatched, 321 const CMachine &aMachine) 323 322 { 324 323 if (!mInstance) 325 324 { 326 Assert (aParent && aWatched );327 mInstance = new HDSlotUniquizer (aParent, aWatched );325 Assert (aParent && aWatched && !aMachine.isNull()); 326 mInstance = new HDSlotUniquizer (aParent, aWatched, aMachine); 328 327 } 329 328 return mInstance; 330 329 } 331 330 332 HDSlotUniquizer::HDSlotUniquizer (QWidget *aParent, HDItemsModel *aWatched) 331 HDSlotUniquizer::HDSlotUniquizer (QWidget *aParent, HDItemsModel *aWatched, 332 const CMachine &aMachine) 333 333 : QObject (aParent) 334 334 , mSataCount (SATAPortsCount) 335 335 , mModel (aWatched) 336 , mMachine (aMachine) 336 337 { 337 338 makeIDEList(); … … 390 391 } 391 392 392 VBoxVMSettingsHD* VBoxVMSettingsHD::mSettings = 0; 393 CMachine VBoxVMSettingsHD::mMachine = CMachine(); 394 395 VBoxVMSettingsHD::VBoxVMSettingsHD (QWidget *aParent, 396 VBoxVMSettingsDlg *aDlg, 397 const QString &aPath) 398 : QIWithRetranslateUI<QWidget> (aParent) 393 394 VBoxVMSettingsHD::VBoxVMSettingsHD() 395 : mValidator (0) 399 396 { 400 397 /* Apply UI decorations */ 401 398 Ui::VBoxVMSettingsHD::setupUi (this); 402 403 /* Setup validation */404 mValidator = new QIWidgetValidator (aPath, aParent, aDlg);405 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator*)),406 aDlg, SLOT (enableOk (const QIWidgetValidator*)));407 connect (mValidator, SIGNAL (isValidRequested (QIWidgetValidator*)),408 aDlg, SLOT (revalidate (QIWidgetValidator*)));409 399 410 400 /* Setup model/view factory */ … … 423 413 mModel = new HDItemsModel (this, idHDSlt, idHDVdi); 424 414 connect (mModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), 425 mValidator, SLOT (revalidate()));426 connect (mModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)),427 415 this, SIGNAL (hdChanged())); 428 429 /* Setup slot uniquizer */430 HDSlotUniquizer::instance (mTwAts, mModel);431 416 432 417 /* Setup table-view */ … … 487 472 qApp->installEventFilter (this); 488 473 489 /* Fixing tab-order */490 setTabOrder (aDlg->mTwSelector, mCbSATA);491 setTabOrder (mCbSATA, mTwAts);492 474 /* Applying language settings */ 493 475 retranslateUi(); 494 476 } 495 477 496 VBoxVMSettingsHD::~VBoxVMSettingsHD() 497 { 498 mMachine = CMachine(); 499 } 500 501 void VBoxVMSettingsHD::getFromMachine (const CMachine &aMachine, 502 QWidget *aPage, 503 VBoxVMSettingsDlg *aDlg, 504 const QString &aPath) 478 void VBoxVMSettingsHD::getFrom (const CMachine &aMachine) 505 479 { 506 480 mMachine = aMachine; 507 mSettings = new VBoxVMSettingsHD (aPage, aDlg, aPath); 508 QVBoxLayout *layout = new QVBoxLayout (aPage); 509 layout->setContentsMargins (0, 0, 0, 0); 510 layout->addWidget (mSettings); 511 connect (mSettings, SIGNAL (hdChanged()), aDlg, SLOT (resetFirstRunFlag())); 512 mSettings->getFrom(); 513 } 514 515 void VBoxVMSettingsHD::putBackToMachine() 516 { 517 mSettings->putBackTo(); 518 } 519 520 bool VBoxVMSettingsHD::revalidate (QString &aWarning) 521 { 522 return mSettings->validate (aWarning); 481 482 /* Setup slot uniquizer */ 483 HDSlotUniquizer::instance (mTwAts, mModel, mMachine); 484 485 CSATAController ctl = mMachine.GetSATAController(); 486 /* Hide the SATA check box if the SATA controller is not available 487 * (i.e. in VirtualBox OSE) */ 488 if (ctl.isNull()) 489 mCbSATA->setHidden (true); 490 else 491 mCbSATA->setChecked (ctl.GetEnabled()); 492 cbSATAToggled (mCbSATA->checkState()); 493 494 CHardDiskAttachmentEnumerator en = 495 mMachine.GetHardDiskAttachments().Enumerate(); 496 while (en.HasMore()) 497 { 498 CHardDiskAttachment hda = en.GetNext(); 499 HDSltValue slt (vboxGlobal().toFullString (hda.GetBus(), 500 hda.GetChannel(), 501 hda.GetDevice()), 502 hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 503 HDVdiValue vdi (VBoxMediaComboBox::fullItemName (hda.GetHardDisk() 504 .GetLocation()), 505 hda.GetHardDisk().GetRoot().GetId()); 506 mModel->addItem (slt, vdi); 507 } 508 509 mTwAts->setCurrentIndex (mModel->index (0, 1)); 510 onCurrentChanged (mTwAts->currentIndex()); 511 512 if (mValidator) 513 mValidator->revalidate(); 514 } 515 516 void VBoxVMSettingsHD::putBackTo() 517 { 518 CSATAController ctl = mMachine.GetSATAController(); 519 if (!ctl.isNull()) 520 { 521 ctl.SetEnabled (mCbSATA->isChecked()); 522 } 523 524 /* Detach all attached Hard Disks */ 525 CHardDiskAttachmentEnumerator en = 526 mMachine.GetHardDiskAttachments().Enumerate(); 527 while (en.HasMore()) 528 { 529 CHardDiskAttachment hda = en.GetNext(); 530 mMachine.DetachHardDisk (hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 531 if (!mMachine.isOk()) 532 vboxProblem().cannotDetachHardDisk (this, mMachine, 533 hda.GetBus(), hda.GetChannel(), hda.GetDevice()); 534 } 535 536 /* Attach all listed Hard Disks */ 537 LONG maxSATAPort = 1; 538 QList<HDValue> list (mModel->fullList()); 539 for (int i = 0; i < list.size(); ++ i) 540 { 541 if (list [i].slt.bus == KStorageBus_SATA) 542 maxSATAPort = maxSATAPort < (list [i].slt.channel + 1) ? 543 (list [i].slt.channel + 1) : maxSATAPort; 544 mMachine.AttachHardDisk (list [i].vdi.id, 545 list [i].slt.bus, list [i].slt.channel, list [i].slt.device); 546 if (!mMachine.isOk()) 547 vboxProblem().cannotAttachHardDisk (this, mMachine, list [i].vdi.id, 548 list [i].slt.bus, list [i].slt.channel, list [i].slt.device); 549 } 550 551 if (!ctl.isNull()) 552 { 553 mMachine.GetSATAController().SetPortCount (maxSATAPort); 554 } 555 } 556 557 void VBoxVMSettingsHD::setValidator (QIWidgetValidator *aVal) 558 { 559 mValidator = aVal; 560 connect (mModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), 561 mValidator, SLOT (revalidate())); 562 } 563 564 bool VBoxVMSettingsHD::revalidate (QString &aWarning, QString &) 565 { 566 QList<HDSltValue> sltList (mModel->slotsList()); 567 QList<HDVdiValue> vdiList (mModel->vdiList()); 568 for (int i = 0; i < vdiList.size(); ++ i) 569 { 570 /* Check for emptiness */ 571 if (vdiList [i].name.isNull()) 572 { 573 aWarning = tr ("No hard disk is selected for <i>%1</i>") 574 .arg (sltList [i].name); 575 break; 576 } 577 578 /* Check for coincidence */ 579 if (vdiList.count (vdiList [i]) > 1) 580 { 581 int first = vdiList.indexOf (vdiList [i]); 582 int second = vdiList.indexOf (vdiList [i], first + 1); 583 Assert (first != -1 && second != -1); 584 aWarning = tr ("<i>%1</i> uses the hard disk that is " 585 "already attached to <i>%2</i>") 586 .arg (sltList [second].name, 587 sltList [first].name); 588 break; 589 } 590 } 591 592 return aWarning.isNull(); 593 } 594 595 void VBoxVMSettingsHD::setOrderAfter (QWidget *aWidget) 596 { 597 setTabOrder (aWidget, mCbSATA); 598 setTabOrder (mCbSATA, mTwAts); 599 } 600 601 void VBoxVMSettingsHD::retranslateUi() 602 { 603 /* Translate uic generated strings */ 604 Ui::VBoxVMSettingsHD::retranslateUi (this); 605 606 mNewAction->setText (tr ("&Add Attachment")); 607 mDelAction->setText (tr ("&Remove Attachment")); 608 mVdmAction->setText (tr ("&Select Hard Disk")); 609 610 mNewAction->setToolTip (mNewAction->text().remove ('&') + 611 QString (" (%1)").arg (mNewAction->shortcut().toString())); 612 mDelAction->setToolTip (mDelAction->text().remove ('&') + 613 QString (" (%1)").arg (mDelAction->shortcut().toString())); 614 mVdmAction->setToolTip (mVdmAction->text().remove ('&') + 615 QString (" (%1)").arg (mVdmAction->shortcut().toString())); 616 617 mNewAction->setWhatsThis (tr ("Adds a new hard disk attachment.")); 618 mDelAction->setWhatsThis (tr ("Removes the highlighted hard disk attachment.")); 619 mVdmAction->setWhatsThis (tr ("Invokes the Virtual Disk Manager to select " 620 "a hard disk to attach to the currently " 621 "highlighted slot.")); 622 } 623 624 void VBoxVMSettingsHD::newClicked() 625 { 626 /* Remember the current vdis list */ 627 QList<HDVdiValue> vdis (mModel->vdiList()); 628 629 /* Add new index */ 630 mModel->addItem(); 631 632 /* Set the default data into the new index for column #1 */ 633 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 1)); 634 /* Set the default data into the new index for column #0 */ 635 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 0)); 636 637 /* Set column #1 of new index to be the current */ 638 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 1)); 639 640 HDVdiEditor *editor = HDVdiEditor::activeEditor(); 641 if (editor) 642 { 643 /* Try to select unique vdi */ 644 editor->tryToChooseUniqueVdi (vdis); 645 646 /* Ask the user for method to add new vdi */ 647 int result = mModel->rowCount() - 1 > editor->count() ? 648 vboxProblem().confirmRunNewHDWzdOrVDM (this) : 649 QIMessageBox::Cancel; 650 if (result == QIMessageBox::Yes) 651 { 652 mTwAts->closePersistentEditor (mTwAts->currentIndex()); 653 VBoxNewHDWzd dlg (this); 654 if (dlg.exec() == QDialog::Accepted) 655 { 656 CHardDisk hd = dlg.hardDisk(); 657 QVariant result; 658 HDVdiValue val (VBoxMediaComboBox::fullItemName (hd.GetLocation()), 659 hd.GetId()); 660 result.setValue (val); 661 mModel->setData (mTwAts->currentIndex(), result); 662 vboxGlobal().startEnumeratingMedia(); 663 } 664 } 665 else if (result == QIMessageBox::No) 666 vdmClicked(); 667 } 668 } 669 670 void VBoxVMSettingsHD::delClicked() 671 { 672 QModelIndex current = mTwAts->currentIndex(); 673 if (current.isValid()) 674 { 675 /* Storing current attributes */ 676 int row = current.row(); 677 int col = current.column(); 678 679 /* Erase current index */ 680 mTwAts->setCurrentIndex (QModelIndex()); 681 682 /* Calculate new current index */ 683 int newRow = row < mModel->rowCount() - 2 ? row : 684 row > 0 ? row - 1 : -1; 685 QModelIndex next = newRow == -1 ? mModel->index (0, col) : 686 mModel->index (newRow, col); 687 688 /* Delete current index */ 689 mModel->delItem (current.row()); 690 691 /* Set the new index to be the current */ 692 mTwAts->setCurrentIndex (next); 693 onCurrentChanged (next); 694 695 if (mValidator) 696 mValidator->revalidate(); 697 emit hdChanged(); 698 } 699 } 700 701 void VBoxVMSettingsHD::vdmClicked() 702 { 703 Assert (mTwAts->currentIndex().isValid()); 704 705 VBoxDiskImageManagerDlg dlg (this); 706 QUuid machineId = mMachine.GetId(); 707 HDVdiValue vdiInfo (mModel->data (mTwAts->currentIndex(), Qt::EditRole) 708 .value<HDVdiValue>()); 709 QUuid hdId = vdiInfo.id; 710 dlg.setup (VBoxDefs::HD, true, &machineId, true, mMachine, hdId); 711 712 if (dlg.exec() == QDialog::Accepted) 713 { 714 QVariant result; 715 HDVdiValue val (VBoxMediaComboBox::fullItemName (dlg.selectedPath()), 716 dlg.selectedUuid()); 717 result.setValue (val); 718 mModel->setData (mTwAts->currentIndex(), result); 719 } 720 721 vboxGlobal().startEnumeratingMedia(); 722 } 723 724 void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex &aIndex) 725 { 726 mNewAction->setEnabled (mModel->rowCount() - 1 < 727 HDSlotUniquizer::instance()->list (HDSltValue(), false).count()); 728 mDelAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1); 729 mVdmAction->setEnabled (aIndex.isValid() && aIndex.column() == 1); 730 } 731 732 void VBoxVMSettingsHD::cbSATAToggled (int aState) 733 { 734 if (aState == Qt::Unchecked) 735 { 736 /* Search the list for at least one SATA port in */ 737 QList<HDSltValue> list (mModel->slotsList()); 738 int firstSataPort = 0; 739 for (; firstSataPort < list.size(); ++ firstSataPort) 740 if (list [firstSataPort].bus == KStorageBus_SATA) 741 break; 742 743 /* If list contains at least one SATA port */ 744 if (firstSataPort < list.size()) 745 { 746 int rc = vboxProblem().confirmDetachSATASlots (this); 747 if (rc != QIMessageBox::Ok) 748 { 749 /* Switch check-box back to "Qt::Checked" */ 750 mCbSATA->blockSignals (true); 751 mCbSATA->setCheckState (Qt::Checked); 752 mCbSATA->blockSignals (false); 753 return; 754 } 755 else 756 { 757 /* Delete SATA items */ 758 mModel->removeSata(); 759 if (mValidator) 760 mValidator->revalidate(); 761 } 762 } 763 } 764 765 int newSataCount = aState == Qt::Checked ? SATAPortsCount : 0; 766 if (HDSlotUniquizer::instance()->sataCount() != newSataCount) 767 HDSlotUniquizer::instance()->setSataCount (newSataCount); 768 onCurrentChanged (mTwAts->currentIndex()); 769 } 770 771 void VBoxVMSettingsHD::onMediaRemoved (VBoxDefs::DiskType aType, const QUuid &aId) 772 { 773 /* Check if it is necessary to update data-model if 774 * some media was removed */ 775 if (aType == VBoxDefs::HD) 776 { 777 QList<HDVdiValue> vdis (mModel->vdiList()); 778 for (int i = 0; i < vdis.size(); ++ i) 779 { 780 if (vdis [i].id == aId) 781 { 782 QVariant emptyVal; 783 emptyVal.setValue (HDVdiValue()); 784 mModel->setData (mModel->index (i, 1), emptyVal); 785 } 786 } 787 } 523 788 } 524 789 … … 592 857 } 593 858 594 595 void VBoxVMSettingsHD::retranslateUi()596 {597 /* Translate uic generated strings */598 Ui::VBoxVMSettingsHD::retranslateUi (this);599 600 mNewAction->setText (tr ("&Add Attachment"));601 mDelAction->setText (tr ("&Remove Attachment"));602 mVdmAction->setText (tr ("&Select Hard Disk"));603 604 mNewAction->setToolTip (mNewAction->text().remove ('&') +605 QString (" (%1)").arg (mNewAction->shortcut().toString()));606 mDelAction->setToolTip (mDelAction->text().remove ('&') +607 QString (" (%1)").arg (mDelAction->shortcut().toString()));608 mVdmAction->setToolTip (mVdmAction->text().remove ('&') +609 QString (" (%1)").arg (mVdmAction->shortcut().toString()));610 611 mNewAction->setWhatsThis (tr ("Adds a new hard disk attachment."));612 mDelAction->setWhatsThis (tr ("Removes the highlighted hard disk attachment."));613 mVdmAction->setWhatsThis (tr ("Invokes the Virtual Disk Manager to select "614 "a hard disk to attach to the currently "615 "highlighted slot."));616 }617 618 void VBoxVMSettingsHD::getFrom()619 {620 CSATAController ctl = mMachine.GetSATAController();621 /* Hide the SATA check box if the SATA controller is not available622 * (i.e. in VirtualBox OSE) */623 if (ctl.isNull())624 mCbSATA->setHidden (true);625 else626 mCbSATA->setChecked (ctl.GetEnabled());627 cbSATAToggled (mCbSATA->checkState());628 629 CHardDiskAttachmentEnumerator en =630 mMachine.GetHardDiskAttachments().Enumerate();631 while (en.HasMore())632 {633 CHardDiskAttachment hda = en.GetNext();634 HDSltValue slt (vboxGlobal().toFullString (hda.GetBus(),635 hda.GetChannel(),636 hda.GetDevice()),637 hda.GetBus(), hda.GetChannel(), hda.GetDevice());638 HDVdiValue vdi (VBoxMediaComboBox::fullItemName (hda.GetHardDisk()639 .GetLocation()),640 hda.GetHardDisk().GetRoot().GetId());641 mModel->addItem (slt, vdi);642 }643 644 mTwAts->setCurrentIndex (mModel->index (0, 1));645 onCurrentChanged (mTwAts->currentIndex());646 647 mValidator->revalidate();648 }649 650 void VBoxVMSettingsHD::putBackTo()651 {652 CSATAController ctl = mMachine.GetSATAController();653 if (!ctl.isNull())654 {655 ctl.SetEnabled (mCbSATA->isChecked());656 }657 658 /* Detach all attached Hard Disks */659 CHardDiskAttachmentEnumerator en =660 mMachine.GetHardDiskAttachments().Enumerate();661 while (en.HasMore())662 {663 CHardDiskAttachment hda = en.GetNext();664 mMachine.DetachHardDisk (hda.GetBus(), hda.GetChannel(), hda.GetDevice());665 if (!mMachine.isOk())666 vboxProblem().cannotDetachHardDisk (this, mMachine,667 hda.GetBus(), hda.GetChannel(), hda.GetDevice());668 }669 670 /* Attach all listed Hard Disks */671 LONG maxSATAPort = 1;672 QList<HDValue> list (mModel->fullList());673 for (int i = 0; i < list.size(); ++ i)674 {675 if (list [i].slt.bus == KStorageBus_SATA)676 maxSATAPort = maxSATAPort < (list [i].slt.channel + 1) ?677 (list [i].slt.channel + 1) : maxSATAPort;678 mMachine.AttachHardDisk (list [i].vdi.id,679 list [i].slt.bus, list [i].slt.channel, list [i].slt.device);680 if (!mMachine.isOk())681 vboxProblem().cannotAttachHardDisk (this, mMachine, list [i].vdi.id,682 list [i].slt.bus, list [i].slt.channel, list [i].slt.device);683 }684 685 if (!ctl.isNull())686 {687 mMachine.GetSATAController().SetPortCount (maxSATAPort);688 }689 }690 691 bool VBoxVMSettingsHD::validate (QString &aWarning)692 {693 QList<HDSltValue> sltList (mModel->slotsList());694 QList<HDVdiValue> vdiList (mModel->vdiList());695 for (int i = 0; i < vdiList.size(); ++ i)696 {697 /* Check for emptiness */698 if (vdiList [i].name.isNull())699 {700 aWarning = tr ("No hard disk is selected for <i>%1</i>")701 .arg (sltList [i].name);702 break;703 }704 705 /* Check for coincidence */706 if (vdiList.count (vdiList [i]) > 1)707 {708 int first = vdiList.indexOf (vdiList [i]);709 int second = vdiList.indexOf (vdiList [i], first + 1);710 Assert (first != -1 && second != -1);711 aWarning = tr ("<i>%1</i> uses the hard disk that is "712 "already attached to <i>%2</i>")713 .arg (sltList [second].name,714 sltList [first].name);715 break;716 }717 }718 719 return aWarning.isNull();720 }721 722 void VBoxVMSettingsHD::newClicked()723 {724 /* Remember the current vdis list */725 QList<HDVdiValue> vdis (mModel->vdiList());726 727 /* Add new index */728 mModel->addItem();729 730 /* Set the default data into the new index for column #1 */731 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 1));732 /* Set the default data into the new index for column #0 */733 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 0));734 735 /* Set column #1 of new index to be the current */736 mTwAts->setCurrentIndex (mModel->index (mModel->rowCount() - 2, 1));737 738 HDVdiEditor *editor = HDVdiEditor::activeEditor();739 if (editor)740 {741 /* Try to select unique vdi */742 editor->tryToChooseUniqueVdi (vdis);743 744 /* Ask the user for method to add new vdi */745 int result = mModel->rowCount() - 1 > editor->count() ?746 vboxProblem().confirmRunNewHDWzdOrVDM (this) :747 QIMessageBox::Cancel;748 if (result == QIMessageBox::Yes)749 {750 mTwAts->closePersistentEditor (mTwAts->currentIndex());751 VBoxNewHDWzd dlg (this);752 if (dlg.exec() == QDialog::Accepted)753 {754 CHardDisk hd = dlg.hardDisk();755 QVariant result;756 HDVdiValue val (VBoxMediaComboBox::fullItemName (hd.GetLocation()),757 hd.GetId());758 result.setValue (val);759 mModel->setData (mTwAts->currentIndex(), result);760 vboxGlobal().startEnumeratingMedia();761 }762 }763 else if (result == QIMessageBox::No)764 vdmClicked();765 }766 }767 768 void VBoxVMSettingsHD::delClicked()769 {770 QModelIndex current = mTwAts->currentIndex();771 if (current.isValid())772 {773 /* Storing current attributes */774 int row = current.row();775 int col = current.column();776 777 /* Erase current index */778 mTwAts->setCurrentIndex (QModelIndex());779 780 /* Calculate new current index */781 int newRow = row < mModel->rowCount() - 2 ? row :782 row > 0 ? row - 1 : -1;783 QModelIndex next = newRow == -1 ? mModel->index (0, col) :784 mModel->index (newRow, col);785 786 /* Delete current index */787 mModel->delItem (current.row());788 789 /* Set the new index to be the current */790 mTwAts->setCurrentIndex (next);791 onCurrentChanged (next);792 793 mValidator->revalidate();794 emit hdChanged();795 }796 }797 798 void VBoxVMSettingsHD::vdmClicked()799 {800 Assert (mTwAts->currentIndex().isValid());801 802 VBoxDiskImageManagerDlg dlg (this);803 QUuid machineId = mMachine.GetId();804 HDVdiValue vdiInfo (mModel->data (mTwAts->currentIndex(), Qt::EditRole)805 .value<HDVdiValue>());806 QUuid hdId = vdiInfo.id;807 dlg.setup (VBoxDefs::HD, true, &machineId, true, mMachine, hdId);808 809 if (dlg.exec() == QDialog::Accepted)810 {811 QVariant result;812 HDVdiValue val (VBoxMediaComboBox::fullItemName (dlg.selectedPath()),813 dlg.selectedUuid());814 result.setValue (val);815 mModel->setData (mTwAts->currentIndex(), result);816 }817 818 vboxGlobal().startEnumeratingMedia();819 }820 821 void VBoxVMSettingsHD::onCurrentChanged (const QModelIndex &aIndex)822 {823 mNewAction->setEnabled (mModel->rowCount() - 1 <824 HDSlotUniquizer::instance()->list (HDSltValue(), false).count());825 mDelAction->setEnabled (mTwAts->currentIndex().row() != mModel->rowCount() - 1);826 mVdmAction->setEnabled (aIndex.isValid() && aIndex.column() == 1);827 }828 829 void VBoxVMSettingsHD::cbSATAToggled (int aState)830 {831 if (aState == Qt::Unchecked)832 {833 /* Search the list for at least one SATA port in */834 QList<HDSltValue> list (mModel->slotsList());835 int firstSataPort = 0;836 for (; firstSataPort < list.size(); ++ firstSataPort)837 if (list [firstSataPort].bus == KStorageBus_SATA)838 break;839 840 /* If list contains at least one SATA port */841 if (firstSataPort < list.size())842 {843 int rc = vboxProblem().confirmDetachSATASlots (this);844 if (rc != QIMessageBox::Ok)845 {846 /* Switch check-box back to "Qt::Checked" */847 mCbSATA->blockSignals (true);848 mCbSATA->setCheckState (Qt::Checked);849 mCbSATA->blockSignals (false);850 return;851 }852 else853 {854 /* Delete SATA items */855 mModel->removeSata();856 mValidator->revalidate();857 }858 }859 }860 861 int newSataCount = aState == Qt::Checked ? SATAPortsCount : 0;862 if (HDSlotUniquizer::instance()->sataCount() != newSataCount)863 HDSlotUniquizer::instance()->setSataCount (newSataCount);864 onCurrentChanged (mTwAts->currentIndex());865 }866 867 void VBoxVMSettingsHD::onMediaRemoved (VBoxDefs::DiskType aType, const QUuid &aId)868 {869 /* Check if it is necessary to update data-model if870 * some media was removed */871 if (aType == VBoxDefs::HD)872 {873 QList<HDVdiValue> vdis (mModel->vdiList());874 for (int i = 0; i < vdis.size(); ++ i)875 {876 if (vdis [i].id == aId)877 {878 QVariant emptyVal;879 emptyVal.setValue (HDVdiValue());880 mModel->setData (mModel->index (i, 1), emptyVal);881 }882 }883 }884 }885 886 859 int VBoxVMSettingsHD::maxNameLength() const 887 860 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsNetwork.cpp
r10101 r10167 23 23 /* Common Includes */ 24 24 #include "VBoxVMSettingsNetwork.h" 25 #include "VBoxVMSettingsDlg.h"26 25 #include "QIWidgetValidator.h" 27 26 #include "VBoxGlobal.h" 28 27 #ifdef Q_WS_WIN 29 28 #include "VBoxToolBar.h" 30 #include "VBox VMSettingsUtils.h"29 #include "VBoxSettingsUtils.h" 31 30 #include "VBoxProblemReporter.h" 32 31 #endif … … 197 196 } 198 197 198 QWidget* VBoxVMSettingsNetwork::setOrderAfter (QWidget *aAfter) 199 { 200 setTabOrder (aAfter, mGbAdapter); 201 setTabOrder (mGbAdapter, mCbAType); 202 setTabOrder (mCbAType, mCbNAType); 203 setTabOrder (mCbNAType, mCbNetwork); 204 setTabOrder (mCbNetwork, mLeMAC); 205 setTabOrder (mLeMAC, mPbMAC); 206 setTabOrder (mPbMAC, mCbCable); 207 setTabOrder (mCbCable, mLeInterface_x11); 208 setTabOrder (mLeInterface_x11, mLeSetup_x11); 209 setTabOrder (mLeSetup_x11, mTbSetup_x11); 210 setTabOrder (mTbSetup_x11, mLeTerminate_x11); 211 setTabOrder (mLeTerminate_x11, mTbTerminate_x11); 212 return mTbTerminate_x11; 213 } 214 199 215 void VBoxVMSettingsNetwork::setNetworksList (const QStringList &aList) 200 216 { … … 600 616 601 617 /* VBoxVMSettingsNetworkPage Stuff */ 602 VBoxVMSettingsNetworkPage* VBoxVMSettingsNetworkPage::mSettings = 0; 603 604 void VBoxVMSettingsNetworkPage::getFromMachine (const CMachine &aMachine, 605 QWidget *aPage, 606 VBoxVMSettingsDlg *aDlg, 607 const QString &aPath) 608 { 609 mSettings = new VBoxVMSettingsNetworkPage (aPage); 610 QVBoxLayout *layout = new QVBoxLayout (aPage); 611 layout->setContentsMargins (0, 5, 0, 0); 612 layout->addWidget (mSettings); 613 mSettings->getFrom (aMachine, aDlg, aPath); 614 } 615 616 void VBoxVMSettingsNetworkPage::putBackToMachine() 617 { 618 mSettings->putBackTo(); 619 } 620 621 bool VBoxVMSettingsNetworkPage::revalidate (QString &aWarning, 622 QString &aTitle) 623 { 624 return mSettings->validate (aWarning, aTitle); 625 } 626 627 VBoxVMSettingsNetworkPage::VBoxVMSettingsNetworkPage (QWidget *aParent) 628 : QIWithRetranslateUI<QWidget> (aParent) 618 VBoxVMSettingsNetworkPage::VBoxVMSettingsNetworkPage() 619 : mValidator (0) 629 620 , mLockNetworkListUpdate (true) 630 621 { 631 622 QVBoxLayout *layout = new QVBoxLayout (this); 632 layout->setContentsMargins (0, 0, 0, 0);623 layout->setContentsMargins (0, 5, 0, 5); 633 624 634 625 /* Creating Tab Widget */ 635 mTwAdapters = new QTabWidget ( aParent);626 mTwAdapters = new QTabWidget (this); 636 627 layout->addWidget (mTwAdapters); 637 628 /* Prepare Networks Lists */ … … 640 631 #ifdef Q_WS_WIN 641 632 /* Creating Interfaces List */ 642 mNIList = new VBoxNIList ( aParent);633 mNIList = new VBoxNIList (this); 643 634 layout->addWidget (mNIList); 644 635 #else … … 647 638 } 648 639 649 void VBoxVMSettingsNetworkPage::getFrom (const CMachine &aMachine, 650 VBoxVMSettingsDlg *aDlg, 651 const QString &aPath) 652 { 640 void VBoxVMSettingsNetworkPage::getFrom (const CMachine &aMachine) 641 { 642 Assert (mFirstWidget); 643 setTabOrder (mFirstWidget, mTwAdapters->focusProxy()); 644 QWidget *lastFocusWidget = mTwAdapters->focusProxy(); 645 653 646 /* Creating Tab Pages */ 654 647 CVirtualBox vbox = vboxGlobal().virtualBox(); … … 670 663 671 664 /* Setup validation */ 672 QIWidgetValidator *wval = 673 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()), 674 (QWidget*)parent(), aDlg); 675 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), 676 aDlg, SLOT (enableOk (const QIWidgetValidator*))); 677 connect (wval, SIGNAL (isValidRequested (QIWidgetValidator *)), 678 aDlg, SLOT (revalidate (QIWidgetValidator*))); 665 page->setValidator (mValidator); 666 667 /* Setup tab order */ 668 lastFocusWidget = page->setOrderAfter (lastFocusWidget); 669 670 /* Setup connections */ 679 671 connect (page->mCbNetwork, SIGNAL (editTextChanged (const QString&)), 680 672 this, SLOT (updateNetworksList())); 681 #ifdef Q_WS_WIN 682 connect (mNIList, SIGNAL (listChanged()), wval, SLOT (revalidate())); 683 #endif 684 page->setValidator (wval); 685 } 686 687 #ifdef Q_WS_WIN 673 } 674 675 #ifdef Q_WS_WIN 676 setTabOrder (lastFocusWidget, mNIList); 688 677 connect (mTwAdapters, SIGNAL (currentChanged (int)), 689 678 this, SLOT (onCurrentPageChanged (int))); … … 708 697 } 709 698 710 bool VBoxVMSettingsNetworkPage::validate (QString &aWarning, 711 QString &aTitle) 699 void VBoxVMSettingsNetworkPage::setValidator (QIWidgetValidator *aVal) 700 { 701 mValidator = aVal; 702 #ifdef Q_WS_WIN 703 connect (mNIList, SIGNAL (listChanged()), mValidator, SLOT (revalidate())); 704 #endif 705 } 706 707 bool VBoxVMSettingsNetworkPage::revalidate (QString &aWarning, 708 QString &aTitle) 712 709 { 713 710 bool valid = true; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsParallel.cpp
r9889 r10167 22 22 23 23 #include "VBoxVMSettingsParallel.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "QIWidgetValidator.h" 26 25 #include "VBoxGlobal.h" 27 26 28 /* Qt includes */29 27 #include <QDir> 30 28 31 QTabWidget* VBoxVMSettingsParallel::mTabWidget = 0; 32 33 VBoxVMSettingsParallel::VBoxVMSettingsParallel(QWidget* aParent /* = NULL */)34 : QIWithRetranslateUI<QWidget> (aParent)29 /* VBoxVMSettingsParallel stuff */ 30 VBoxVMSettingsParallel::VBoxVMSettingsParallel() 31 : QIWithRetranslateUI<QWidget> (0) 32 , mValidator (0) 35 33 { 36 34 /* Apply UI decorations */ … … 58 56 connect (mCbNumber, SIGNAL (activated (const QString &)), 59 57 this, SLOT (mCbNumberActivated (const QString &))); 58 60 59 /* Applying language settings */ 61 60 retranslateUi(); 62 61 } 63 62 64 void VBoxVMSettingsParallel::getFromMachine (const CMachine &aMachine, 65 QWidget *aPage, 66 VBoxVMSettingsDlg *aDlg, 67 const QString &aPath) 63 void VBoxVMSettingsParallel::getFromPort (const CParallelPort &aPort) 64 { 65 mPort = aPort; 66 67 mGbParallel->setChecked (mPort.GetEnabled()); 68 ulong IRQ = mPort.GetIRQ(); 69 ulong IOBase = mPort.GetIOBase(); 70 mCbNumber->setCurrentIndex (mCbNumber-> 71 findText (vboxGlobal().toCOMPortName (IRQ, IOBase))); 72 mLeIRQ->setText (QString::number (IRQ)); 73 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 74 mLePath->setText (mPort.GetPath()); 75 76 /* Ensure everything is up-to-date */ 77 mGbParallelToggled (mGbParallel->isChecked()); 78 } 79 80 void VBoxVMSettingsParallel::putBackToPort() 81 { 82 mPort.SetEnabled (mGbParallel->isChecked()); 83 mPort.SetIRQ (mLeIRQ->text().toULong (NULL, 0)); 84 mPort.SetIOBase (mLeIOPort->text().toULong (NULL, 0)); 85 mPort.SetPath (QDir::convertSeparators (mLePath->text())); 86 } 87 88 void VBoxVMSettingsParallel::setValidator (QIWidgetValidator *aVal) 89 { 90 Assert (aVal); 91 mValidator = aVal; 92 connect (mLeIRQ, SIGNAL (textChanged (const QString &)), 93 mValidator, SLOT (revalidate())); 94 connect (mLeIOPort, SIGNAL (textChanged (const QString &)), 95 mValidator, SLOT (revalidate())); 96 connect (mLePath, SIGNAL (textChanged (const QString &)), 97 mValidator, SLOT (revalidate())); 98 mValidator->revalidate(); 99 } 100 101 QWidget* VBoxVMSettingsParallel::setOrderAfter (QWidget *aAfter) 102 { 103 setTabOrder (aAfter, mGbParallel); 104 setTabOrder (mGbParallel, mCbNumber); 105 setTabOrder (mCbNumber, mLeIRQ); 106 setTabOrder (mLeIRQ, mLeIOPort); 107 setTabOrder (mLeIOPort, mLePath); 108 return mLePath; 109 } 110 111 QString VBoxVMSettingsParallel::pageTitle() const 112 { 113 QString pageTitle; 114 if (!mPort.isNull()) 115 pageTitle = QString (tr ("Port %1", "parallel ports")) 116 .arg (mPort.GetSlot()); 117 return pageTitle; 118 } 119 120 bool VBoxVMSettingsParallel::isUserDefined() 121 { 122 ulong a, b; 123 return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b); 124 } 125 126 void VBoxVMSettingsParallel::retranslateUi() 127 { 128 /* Translate uic generated strings */ 129 Ui::VBoxVMSettingsParallel::retranslateUi (this); 130 131 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); 132 } 133 134 void VBoxVMSettingsParallel::mGbParallelToggled (bool aOn) 135 { 136 if (aOn) 137 mCbNumberActivated (mCbNumber->currentText()); 138 if (mValidator) 139 mValidator->revalidate(); 140 } 141 142 void VBoxVMSettingsParallel::mCbNumberActivated (const QString &aText) 143 { 144 ulong IRQ, IOBase; 145 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase); 146 147 mLeIRQ->setEnabled (!std); 148 mLeIOPort->setEnabled (!std); 149 if (std) 150 { 151 mLeIRQ->setText (QString::number (IRQ)); 152 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 153 } 154 } 155 156 157 /* VBoxVMSettingsParallelPage stuff */ 158 VBoxVMSettingsParallelPage::VBoxVMSettingsParallelPage() 159 : mValidator (0) 68 160 { 69 161 /* TabWidget creation */ 70 mTabWidget = new QTabWidget ( aPage);162 mTabWidget = new QTabWidget (this); 71 163 mTabWidget->setSizePolicy (QSizePolicy::Expanding, 72 164 QSizePolicy::Fixed); 73 QVBoxLayout *layout = new QVBoxLayout ( aPage);74 layout->setContentsMargins (0, 5, 0, 0);165 QVBoxLayout *layout = new QVBoxLayout (this); 166 layout->setContentsMargins (0, 5, 0, 5); 75 167 layout->addWidget (mTabWidget); 76 168 layout->addStretch(); 169 } 170 171 void VBoxVMSettingsParallelPage::getFrom (const CMachine &aMachine) 172 { 173 Assert (mFirstWidget); 174 setTabOrder (mFirstWidget, mTabWidget->focusProxy()); 175 QWidget *lastFocusWidget = mTabWidget->focusProxy(); 77 176 78 177 /* Tab pages loading */ … … 85 184 page->getFromPort (port); 86 185 mTabWidget->addTab (page, page->pageTitle()); 87 88 /* Setup validation. */ 89 QIWidgetValidator *wval = 90 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()), 91 aPage, mTabWidget); 92 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), 93 aDlg, SLOT (enableOk (const QIWidgetValidator *))); 94 connect (wval, SIGNAL (isValidRequested (QIWidgetValidator *)), 95 aDlg, SLOT (revalidate (QIWidgetValidator *))); 96 97 connect (page->mGbParallel, SIGNAL (toggled (bool)), 98 wval, SLOT (revalidate())); 99 connect (page->mLeIRQ, SIGNAL (textChanged (const QString &)), 100 wval, SLOT (revalidate())); 101 connect (page->mLeIOPort, SIGNAL (textChanged (const QString &)), 102 wval, SLOT (revalidate())); 103 104 wval->revalidate(); 105 } 106 } 107 108 void VBoxVMSettingsParallel::putBackToMachine() 109 { 110 if (mTabWidget) 111 for (int index = 0; index < mTabWidget->count(); ++ index) 112 { 113 VBoxVMSettingsParallel *page = 114 (VBoxVMSettingsParallel*) mTabWidget->widget (index); 115 Assert (page); 116 page->putBackToPort(); 117 } 118 } 119 120 bool VBoxVMSettingsParallel::revalidate (QString &aWarning, QString &aTitle) 186 Assert (mValidator); 187 page->setValidator (mValidator); 188 lastFocusWidget = page->setOrderAfter (lastFocusWidget); 189 } 190 } 191 192 void VBoxVMSettingsParallelPage::putBackTo() 193 { 194 for (int index = 0; index < mTabWidget->count(); ++ index) 195 { 196 VBoxVMSettingsParallel *page = 197 (VBoxVMSettingsParallel*) mTabWidget->widget (index); 198 Assert (page); 199 page->putBackToPort(); 200 } 201 } 202 203 void VBoxVMSettingsParallelPage::setValidator (QIWidgetValidator *aVal) 204 { 205 mValidator = aVal; 206 } 207 208 bool VBoxVMSettingsParallelPage::revalidate (QString &aWarning, QString &aTitle) 121 209 { 122 210 bool valid = true; … … 167 255 } 168 256 169 170 void VBoxVMSettingsParallel::retranslateUi() 171 { 172 /* Translate uic generated strings */ 173 Ui::VBoxVMSettingsParallel::retranslateUi (this); 174 175 mTabWidget->setTabText (mTabWidget->indexOf (this), pageTitle()); 176 177 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); 178 } 179 180 181 void VBoxVMSettingsParallel::mGbParallelToggled (bool aOn) 182 { 183 if (aOn) 184 mCbNumberActivated (mCbNumber->currentText()); 185 } 186 187 void VBoxVMSettingsParallel::mCbNumberActivated (const QString &aText) 188 { 189 ulong IRQ, IOBase; 190 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase); 191 192 mLeIRQ->setEnabled (!std); 193 mLeIOPort->setEnabled (!std); 194 if (std) 195 { 196 mLeIRQ->setText (QString::number (IRQ)); 197 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 198 } 199 } 200 201 void VBoxVMSettingsParallel::getFromPort (const CParallelPort &aPort) 202 { 203 mPort = aPort; 204 205 mGbParallel->setChecked (mPort.GetEnabled()); 206 ulong IRQ = mPort.GetIRQ(); 207 ulong IOBase = mPort.GetIOBase(); 208 mCbNumber->setCurrentIndex (mCbNumber-> 209 findText (vboxGlobal().toCOMPortName (IRQ, IOBase))); 210 mLeIRQ->setText (QString::number (IRQ)); 211 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 212 mLePath->setText (mPort.GetPath()); 213 214 /* Ensure everything is up-to-date */ 215 mGbParallelToggled (mGbParallel->isChecked()); 216 } 217 218 void VBoxVMSettingsParallel::putBackToPort() 219 { 220 mPort.SetEnabled (mGbParallel->isChecked()); 221 mPort.SetIRQ (mLeIRQ->text().toULong (NULL, 0)); 222 mPort.SetIOBase (mLeIOPort->text().toULong (NULL, 0)); 223 mPort.SetPath (QDir::convertSeparators (mLePath->text())); 224 } 225 226 bool VBoxVMSettingsParallel::isUserDefined() 227 { 228 ulong a, b; 229 return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b); 230 } 231 232 QString VBoxVMSettingsParallel::pageTitle() const 233 { 234 QString pageTitle; 235 if (!mPort.isNull()) 236 pageTitle = QString (tr ("Port %1", "parallel ports")) 237 .arg (mPort.GetSlot()); 238 return pageTitle; 239 } 240 257 void VBoxVMSettingsParallelPage::retranslateUi() 258 { 259 for (int i = 0; i < mTabWidget->count(); ++ i) 260 { 261 VBoxVMSettingsParallel *page = 262 static_cast<VBoxVMSettingsParallel*> (mTabWidget->widget (i)); 263 mTabWidget->setTabText (i, page->pageTitle()); 264 } 265 } 266 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsSF.cpp
r10112 r10167 22 22 23 23 #include "VBoxVMSettingsSF.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "VBoxGlobal.h" 26 25 #include "VBoxProblemReporter.h" … … 29 28 #include "VBoxToolBar.h" 30 29 31 /* Qt includes */32 30 #include <QLineEdit> 33 31 #include <QToolButton> … … 174 172 175 173 176 VBoxVMSettingsSF* VBoxVMSettingsSF::mSettings = 0; 177 178 VBoxVMSettingsSF::VBoxVMSettingsSF (QWidget *aParent, int aType) 179 : QIWithRetranslateUI<QWidget> (aParent) 174 VBoxVMSettingsSF::VBoxVMSettingsSF (int aType, QWidget *aParent) 175 : VBoxSettingsPage (aParent) 180 176 , mDialogType (aType) 181 177 , mIsListViewChanged (false) … … 277 273 278 274 279 void VBoxVMSettingsSF::getFromMachineEx (const CMachine &aMachine,280 QWidget *aPage,281 VBoxVMSettingsDlg *aDlg)282 {283 mSettings = new VBoxVMSettingsSF (aPage, MachineType);284 QVBoxLayout *layout = new QVBoxLayout (aPage);285 layout->setContentsMargins (0, 0, 0, 0);286 layout->addWidget (mSettings);287 mSettings->getFromMachine (aMachine);288 289 /* Fixing Tab Order */290 setTabOrder (aDlg->mTwSelector, mSettings->mTreeView);291 }292 293 void VBoxVMSettingsSF::putBackToMachineEx()294 {295 mSettings->putBackToMachine();296 }297 298 299 275 void VBoxVMSettingsSF::getFromGlobal() 300 276 { … … 366 342 } 367 343 344 345 void VBoxVMSettingsSF::getFrom (const CMachine &aMachine) 346 { 347 getFromMachine (aMachine); 348 } 349 350 void VBoxVMSettingsSF::putBackTo() 351 { 352 putBackToMachine(); 353 } 354 355 void VBoxVMSettingsSF::setOrderAfter (QWidget *aWidget) 356 { 357 setTabOrder (aWidget, mTreeView); 358 } 359 368 360 void VBoxVMSettingsSF::retranslateUi() 369 361 { … … 374 366 mTrReadOnly = tr ("Read-only"); 375 367 } 368 376 369 377 370 void VBoxVMSettingsSF::addTriggered() … … 487 480 488 481 void VBoxVMSettingsSF::processDoubleClick (QTreeWidgetItem *aItem, 489 482 int /* aColumn */) 490 483 { 491 484 bool editEnabled = aItem && aItem->parent() && … … 551 544 552 545 void VBoxVMSettingsSF::removeSharedFolder (const QString & aName, 553 554 546 const QString & aPath, 547 SFDialogType aType) 555 548 { 556 549 switch (aType) … … 588 581 589 582 void VBoxVMSettingsSF::createSharedFolder (const QString & aName, 590 591 592 583 const QString & aPath, 584 bool aWritable, 585 SFDialogType aType) 593 586 { 594 587 switch (aType) … … 627 620 628 621 void VBoxVMSettingsSF::getFrom (const CSharedFolderEnumerator &aEn, 629 622 SFTreeViewItem *aRoot) 630 623 { 631 624 while (aEn.HasMore()) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsSerial.cpp
r9751 r10167 22 22 23 23 #include "VBoxVMSettingsSerial.h" 24 #include "VBoxVMSettingsDlg.h"25 24 #include "QIWidgetValidator.h" 26 25 #include "VBoxGlobal.h" 27 26 28 /* Qt includes */29 27 #include <QDir> 30 28 31 QTabWidget* VBoxVMSettingsSerial::mTabWidget = 0; 32 33 VBoxVMSettingsSerial::VBoxVMSettingsSerial(QWidget* aParent /* = NULL */)34 : QIWithRetranslateUI<QWidget> (aParent)29 /* VBoxVMSettingsSerial stuff */ 30 VBoxVMSettingsSerial::VBoxVMSettingsSerial() 31 : QIWithRetranslateUI<QWidget> (0) 32 , mValidator (0) 35 33 { 36 34 /* Apply UI decorations */ … … 64 62 connect (mCbMode, SIGNAL (activated (const QString &)), 65 63 this, SLOT (mCbModeActivated (const QString &))); 64 66 65 /* Applying language settings */ 67 66 retranslateUi(); 68 }69 70 void VBoxVMSettingsSerial::getFromMachine (const CMachine &aMachine,71 QWidget *aPage,72 VBoxVMSettingsDlg *aDlg,73 const QString &aPath)74 {75 /* TabWidget creation */76 mTabWidget = new QTabWidget (aPage);77 mTabWidget->setSizePolicy (QSizePolicy::Expanding,78 QSizePolicy::Fixed);79 QVBoxLayout *layout = new QVBoxLayout (aPage);80 layout->setContentsMargins (0, 5, 0, 0);81 layout->addWidget (mTabWidget);82 layout->addStretch();83 84 /* Tab pages loading */85 ulong count = vboxGlobal().virtualBox().86 GetSystemProperties().GetSerialPortCount();87 for (ulong slot = 0; slot < count; ++ slot)88 {89 CSerialPort port = aMachine.GetSerialPort (slot);90 VBoxVMSettingsSerial *page = new VBoxVMSettingsSerial();91 page->getFromPort (port);92 mTabWidget->addTab (page, page->pageTitle());93 94 /* Setup validation. */95 QIWidgetValidator *wval =96 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()),97 aPage, mTabWidget);98 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)),99 aDlg, SLOT (enableOk (const QIWidgetValidator *)));100 connect (wval, SIGNAL (isValidRequested (QIWidgetValidator *)),101 aDlg, SLOT (revalidate (QIWidgetValidator *)));102 103 connect (page->mGbSerial, SIGNAL (toggled (bool)),104 wval, SLOT (revalidate()));105 connect (page->mLeIRQ, SIGNAL (textChanged (const QString &)),106 wval, SLOT (revalidate()));107 connect (page->mLeIOPort, SIGNAL (textChanged (const QString &)),108 wval, SLOT (revalidate()));109 connect (page->mCbMode, SIGNAL (activated (const QString &)),110 wval, SLOT (revalidate()));111 112 wval->revalidate();113 }114 }115 116 void VBoxVMSettingsSerial::putBackToMachine()117 {118 for (int index = 0; index < mTabWidget->count(); ++ index)119 {120 VBoxVMSettingsSerial *page =121 (VBoxVMSettingsSerial*) mTabWidget->widget (index);122 Assert (page);123 page->putBackToPort();124 }125 }126 127 void VBoxVMSettingsSerial::mGbSerialToggled (bool aOn)128 {129 if (aOn)130 {131 mCbNumberActivated (mCbNumber->currentText());132 mCbModeActivated (mCbMode->currentText());133 }134 }135 136 void VBoxVMSettingsSerial::mCbNumberActivated (const QString &aText)137 {138 ulong IRQ, IOBase;139 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase);140 141 mLeIRQ->setEnabled (!std);142 mLeIOPort->setEnabled (!std);143 if (std)144 {145 mLeIRQ->setText (QString::number (IRQ));146 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper());147 }148 }149 150 void VBoxVMSettingsSerial::mCbModeActivated (const QString &aText)151 {152 KPortMode mode = vboxGlobal().toPortMode (aText);153 mCbPipe->setEnabled (mode == KPortMode_HostPipe);154 mLePath->setEnabled (mode != KPortMode_Disconnected);155 }156 157 QString VBoxVMSettingsSerial::pageTitle() const158 {159 QString pageTitle;160 if (!mPort.isNull())161 {162 pageTitle = QString (tr ("Port %1", "serial ports"))163 .arg (mPort.GetSlot());164 }165 return pageTitle;166 67 } 167 68 … … 196 97 } 197 98 99 void VBoxVMSettingsSerial::setValidator (QIWidgetValidator *aVal) 100 { 101 Assert (aVal); 102 mValidator = aVal; 103 connect (mLeIRQ, SIGNAL (textChanged (const QString &)), 104 mValidator, SLOT (revalidate())); 105 connect (mLeIOPort, SIGNAL (textChanged (const QString &)), 106 mValidator, SLOT (revalidate())); 107 connect (mLePath, SIGNAL (textChanged (const QString &)), 108 mValidator, SLOT (revalidate())); 109 mValidator->revalidate(); 110 } 111 112 QWidget* VBoxVMSettingsSerial::setOrderAfter (QWidget *aAfter) 113 { 114 setTabOrder (aAfter, mGbSerial); 115 setTabOrder (mGbSerial, mCbNumber); 116 setTabOrder (mCbNumber, mLeIRQ); 117 setTabOrder (mLeIRQ, mLeIOPort); 118 setTabOrder (mLeIOPort, mCbMode); 119 setTabOrder (mCbMode, mCbPipe); 120 setTabOrder (mCbPipe, mLePath); 121 return mLePath; 122 } 123 124 QString VBoxVMSettingsSerial::pageTitle() const 125 { 126 QString pageTitle; 127 if (!mPort.isNull()) 128 { 129 pageTitle = QString (tr ("Port %1", "serial ports")) 130 .arg (mPort.GetSlot()); 131 } 132 return pageTitle; 133 } 134 198 135 bool VBoxVMSettingsSerial::isUserDefined() 199 136 { … … 202 139 } 203 140 204 205 141 void VBoxVMSettingsSerial::retranslateUi() 206 142 { 207 143 /* Translate uic generated strings */ 208 144 Ui::VBoxVMSettingsSerial::retranslateUi (this); 209 210 mTabWidget->setTabText (mTabWidget->indexOf (this), pageTitle());211 145 212 146 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); … … 217 151 } 218 152 219 220 bool VBoxVMSettingsSerial::revalidate (QString &aWarning, QString &aTitle) 153 void VBoxVMSettingsSerial::mGbSerialToggled (bool aOn) 154 { 155 if (aOn) 156 { 157 mCbNumberActivated (mCbNumber->currentText()); 158 mCbModeActivated (mCbMode->currentText()); 159 } 160 if (mValidator) 161 mValidator->revalidate(); 162 } 163 164 void VBoxVMSettingsSerial::mCbNumberActivated (const QString &aText) 165 { 166 ulong IRQ, IOBase; 167 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase); 168 169 mLeIRQ->setEnabled (!std); 170 mLeIOPort->setEnabled (!std); 171 if (std) 172 { 173 mLeIRQ->setText (QString::number (IRQ)); 174 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 175 } 176 } 177 178 void VBoxVMSettingsSerial::mCbModeActivated (const QString &aText) 179 { 180 KPortMode mode = vboxGlobal().toPortMode (aText); 181 mCbPipe->setEnabled (mode == KPortMode_HostPipe); 182 mLePath->setEnabled (mode != KPortMode_Disconnected); 183 if (mValidator) 184 mValidator->revalidate(); 185 } 186 187 188 /* VBoxVMSettingsSerialPage stuff */ 189 VBoxVMSettingsSerialPage::VBoxVMSettingsSerialPage() 190 : mValidator (0) 191 { 192 /* TabWidget creation */ 193 mTabWidget = new QTabWidget (this); 194 mTabWidget->setSizePolicy (QSizePolicy::Expanding, 195 QSizePolicy::Fixed); 196 QVBoxLayout *layout = new QVBoxLayout (this); 197 layout->setContentsMargins (0, 5, 0, 5); 198 layout->addWidget (mTabWidget); 199 layout->addStretch(); 200 201 /* Applying language settings */ 202 retranslateUi(); 203 } 204 205 void VBoxVMSettingsSerialPage::getFrom (const CMachine &aMachine) 206 { 207 Assert (mFirstWidget); 208 setTabOrder (mFirstWidget, mTabWidget->focusProxy()); 209 QWidget *lastFocusWidget = mTabWidget->focusProxy(); 210 211 /* Tab pages loading */ 212 ulong count = vboxGlobal().virtualBox(). 213 GetSystemProperties().GetSerialPortCount(); 214 for (ulong slot = 0; slot < count; ++ slot) 215 { 216 CSerialPort port = aMachine.GetSerialPort (slot); 217 VBoxVMSettingsSerial *page = new VBoxVMSettingsSerial(); 218 page->getFromPort (port); 219 mTabWidget->addTab (page, page->pageTitle()); 220 Assert (mValidator); 221 page->setValidator (mValidator); 222 lastFocusWidget = page->setOrderAfter (lastFocusWidget); 223 } 224 } 225 226 void VBoxVMSettingsSerialPage::putBackTo() 227 { 228 for (int index = 0; index < mTabWidget->count(); ++ index) 229 { 230 VBoxVMSettingsSerial *page = 231 (VBoxVMSettingsSerial*) mTabWidget->widget (index); 232 Assert (page); 233 page->putBackToPort(); 234 } 235 } 236 237 void VBoxVMSettingsSerialPage::setValidator (QIWidgetValidator * aVal) 238 { 239 mValidator = aVal; 240 } 241 242 bool VBoxVMSettingsSerialPage::revalidate (QString &aWarning, QString &aTitle) 221 243 { 222 244 bool valid = true; … … 269 291 } 270 292 293 void VBoxVMSettingsSerialPage::retranslateUi() 294 { 295 for (int i = 0; i < mTabWidget->count(); ++ i) 296 { 297 VBoxVMSettingsSerial *page = 298 static_cast<VBoxVMSettingsSerial*> (mTabWidget->widget (i)); 299 mTabWidget->setTabText (i, page->pageTitle()); 300 } 301 } 302 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsUSB.cpp
r9889 r10167 22 22 23 23 #include "VBoxVMSettingsUSB.h" 24 #include "VBoxGlobalSettingsDlg.h" 25 #include "VBoxVMSettingsDlg.h" 26 #include "VBoxVMSettingsUtils.h" 24 #include "VBoxSettingsUtils.h" 27 25 #include "QIWidgetValidator.h" 28 26 #include "VBoxToolBar.h" 29 27 #include "VBoxGlobal.h" 30 #include "VBoxProblemReporter.h" 28 29 #include <QHeaderView> 31 30 32 31 inline static QString emptyToNull (const QString &str) … … 35 34 } 36 35 37 VBoxVMSettingsUSB* VBoxVMSettingsUSB::mSettings = 0; 38 39 void VBoxVMSettingsUSB::getFrom (QWidget *aPage, 40 VBoxGlobalSettingsDlg *aDlg, 41 const QString &aPath) 42 { 43 mSettings = new VBoxVMSettingsUSB (aPage, HostType, aDlg, aPath); 44 QVBoxLayout *layout = new QVBoxLayout (aPage); 45 layout->setContentsMargins (0, 0, 0, 0); 46 layout->addWidget (mSettings); 47 48 mSettings->getFromHost(); 49 50 /* Fixing tab-order */ 51 setTabOrder (aDlg->mTwSelector, mSettings->mTwFilters); 52 setTabOrder (mSettings->mTwFilters, mSettings->mLeName); 53 setTabOrder (mSettings->mLeName, mSettings->mLeVendorID); 54 setTabOrder (mSettings->mLeVendorID, mSettings->mLeManufacturer); 55 setTabOrder (mSettings->mLeManufacturer, mSettings->mLeProductID); 56 setTabOrder (mSettings->mLeProductID, mSettings->mLeProduct); 57 setTabOrder (mSettings->mLeProduct, mSettings->mLeRevision); 58 setTabOrder (mSettings->mLeRevision, mSettings->mLeSerialNo); 59 setTabOrder (mSettings->mLeSerialNo, mSettings->mLePort); 60 setTabOrder (mSettings->mLePort, mSettings->mCbAction); 61 } 62 63 void VBoxVMSettingsUSB::getFrom (const CMachine &aMachine, 64 QWidget *aPage, 65 VBoxVMSettingsDlg *aDlg, 66 const QString &aPath) 67 { 68 mSettings = new VBoxVMSettingsUSB (aPage, MachineType, aDlg, aPath); 69 QVBoxLayout *layout = new QVBoxLayout (aPage); 70 layout->setContentsMargins (0, 0, 0, 0); 71 layout->addWidget (mSettings); 72 73 mSettings->getFromMachine (aMachine); 74 75 /* Fixing tab-order */ 76 setTabOrder (aDlg->mTwSelector, mSettings->mGbUSB); 77 setTabOrder (mSettings->mGbUSB, mSettings->mCbUSB2); 78 setTabOrder (mSettings->mCbUSB2, mSettings->mTwFilters); 79 setTabOrder (mSettings->mTwFilters, mSettings->mLeName); 80 setTabOrder (mSettings->mLeName, mSettings->mLeVendorID); 81 setTabOrder (mSettings->mLeVendorID, mSettings->mLeManufacturer); 82 setTabOrder (mSettings->mLeManufacturer, mSettings->mLeProductID); 83 setTabOrder (mSettings->mLeProductID, mSettings->mLeProduct); 84 setTabOrder (mSettings->mLeProduct, mSettings->mLeRevision); 85 setTabOrder (mSettings->mLeRevision, mSettings->mLeSerialNo); 86 setTabOrder (mSettings->mLeSerialNo, mSettings->mLePort); 87 setTabOrder (mSettings->mLePort, mSettings->mCbRemote); 88 } 89 90 void VBoxVMSettingsUSB::putBackTo() 91 { 92 if (mSettings) 93 mSettings->mType == MachineType ? mSettings->putBackToMachine() : 94 mSettings->putBackToHost(); 95 } 96 97 98 VBoxVMSettingsUSB::VBoxVMSettingsUSB (QWidget *aParent, 99 FilterType aType, 100 QWidget *aDlg, 101 const QString &aPath) 102 : QIWithRetranslateUI<QWidget> (aParent) 36 VBoxVMSettingsUSB::VBoxVMSettingsUSB (FilterType aType) 37 : mValidator (0) 103 38 , mType (aType) 104 39 { 105 40 /* Apply UI decorations */ 106 41 Ui::VBoxVMSettingsUSB::setupUi (this); 107 108 /* Setup validation */109 mValidator = new QIWidgetValidator (aPath, aParent, aDlg);110 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator *)),111 aDlg, SLOT (enableOk (const QIWidgetValidator *)));112 42 113 43 /* Prepare actions */ … … 146 76 147 77 /* Prepare toolbar */ 148 VBoxToolBar *toolBar = new VBoxToolBar (m GbUSBFilters);78 VBoxToolBar *toolBar = new VBoxToolBar (mWtFilterHandler); 149 79 toolBar->setUsesTextLabel (false); 150 80 toolBar->setUsesBigPixmaps (false); … … 156 86 toolBar->addAction (mMdnAction); 157 87 toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); 158 m GbUSBFilters->layout()->addWidget (toolBar);88 mWtFilterHandler->layout()->addWidget (toolBar); 159 89 160 90 /* Setup connections */ … … 166 96 this, SLOT (showContextMenu (const QPoint &))); 167 97 168 mUSBDevicesMenu = new VBoxUSBMenu ( aParent);98 mUSBDevicesMenu = new VBoxUSBMenu (this); 169 99 connect (mUSBDevicesMenu, SIGNAL (triggered (QAction*)), 170 100 this, SLOT (addConfirmed (QAction *))); … … 219 149 } 220 150 221 VBoxVMSettingsUSB::~VBoxVMSettingsUSB() 222 { 223 mSettings = 0; 224 } 225 226 void VBoxVMSettingsUSB::getFromHost() 151 void VBoxVMSettingsUSB::getFrom (const CSystemProperties &, const VBoxGlobalSettings &) 227 152 { 228 153 mGbUSB->setVisible (false); … … 241 166 } 242 167 243 void VBoxVMSettingsUSB::putBackTo Host()168 void VBoxVMSettingsUSB::putBackTo (CSystemProperties &, VBoxGlobalSettings &) 244 169 { 245 170 CHost host = vboxGlobal().virtualBox().GetHost(); … … 266 191 } 267 192 268 void VBoxVMSettingsUSB::getFrom Machine(const CMachine &aMachine)193 void VBoxVMSettingsUSB::getFrom (const CMachine &aMachine) 269 194 { 270 195 mMachine = aMachine; … … 283 208 } 284 209 285 void VBoxVMSettingsUSB::putBackTo Machine()210 void VBoxVMSettingsUSB::putBackTo() 286 211 { 287 212 CUSBController ctl = mMachine.GetUSBController(); … … 309 234 } 310 235 236 void VBoxVMSettingsUSB::setValidator (QIWidgetValidator *aVal) 237 { 238 mValidator = aVal; 239 } 240 241 void VBoxVMSettingsUSB::setOrderAfter (QWidget *aWidget) 242 { 243 setTabOrder (aWidget, mGbUSB); 244 setTabOrder (mGbUSB, mCbUSB2); 245 setTabOrder (mCbUSB2, mTwFilters); 246 setTabOrder (mTwFilters, mLeName); 247 setTabOrder (mLeName, mLeVendorID); 248 setTabOrder (mLeVendorID, mLeManufacturer); 249 setTabOrder (mLeManufacturer, mLeProductID); 250 setTabOrder (mLeProductID, mLeProduct); 251 setTabOrder (mLeProduct, mLeRevision); 252 setTabOrder (mLeRevision, mLeSerialNo); 253 setTabOrder (mLeSerialNo, mLePort); 254 setTabOrder (mLePort, mCbRemote); 255 setTabOrder (mCbRemote, mCbAction); 256 } 311 257 312 258 void VBoxVMSettingsUSB::retranslateUi() … … 354 300 mUSBFilterName = tr ("New Filter %1", "usb"); 355 301 } 356 357 302 358 303 void VBoxVMSettingsUSB::usbAdapterToggled (bool aOn) … … 443 388 { 444 389 filter.SetName (aText); 445 item->setText ( lvUSBFilters_Name, aText);390 item->setText (twUSBFilters_Name, aText); 446 391 } else 447 392 if (sdr == mLeVendorID) … … 493 438 while (*iterator) 494 439 { 495 QString filterName = (*iterator)->text ( lvUSBFilters_Name);440 QString filterName = (*iterator)->text (twUSBFilters_Name); 496 441 int pos = regExp.indexIn (filterName); 497 442 if (pos != -1) … … 600 545 mLeRevision->setValidator (0); 601 546 mLePort->setValidator (0); 602 mValidator->rescan(); 603 mValidator->revalidate(); 547 if (mValidator) 548 { 549 mValidator->rescan(); 550 mValidator->revalidate(); 551 } 604 552 } 605 553 … … 657 605 new QTreeWidgetItem (mTwFilters); 658 606 item->setCheckState (0, aFilter.GetActive() ? Qt::Checked : Qt::Unchecked); 659 item->setText ( lvUSBFilters_Name, aFilter.GetName());607 item->setText (twUSBFilters_Name, aFilter.GetName()); 660 608 661 609 /* Setup validators */ … … 667 615 mLeRevision->setValidator (new QRegExpValidator (QRegExp ("[0-9]{0,4}"), this)); 668 616 mLePort->setValidator (new QRegExpValidator (QRegExp ("[0-9]*"), this)); 669 mValidator->rescan(); 617 if (mValidator) 618 mValidator->rescan(); 670 619 } 671 620 … … 676 625 } 677 626 678 mValidator->revalidate(); 679 } 680 627 if (mValidator) 628 mValidator->revalidate(); 629 } 630 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsVRDP.cpp
r9889 r10167 22 22 23 23 #include "VBoxVMSettingsVRDP.h" 24 #include "VBoxVMSettingsDlg.h"25 #include "VBoxVMSettingsUtils.h"26 24 #include "VBoxGlobal.h" 27 #include "VBoxProblemReporter.h"28 25 #include "QIWidgetValidator.h" 29 26 30 VBoxVMSettingsVRDP* VBoxVMSettingsVRDP::mSettings = 0; 31 32 VBoxVMSettingsVRDP::VBoxVMSettingsVRDP (QWidget *aParent, 33 VBoxVMSettingsDlg *aDlg, 34 const QString &aPath) 35 : QIWithRetranslateUI<QWidget> (aParent) 27 VBoxVMSettingsVRDP::VBoxVMSettingsVRDP() 36 28 { 37 29 /* Apply UI decorations */ … … 39 31 40 32 /* Setup validation */ 41 mLeVRDPPort->setValidator (new QIntValidator (0, 0xFFFF, aDlg)); 42 mLeVRDPTimeout->setValidator (new QIntValidator (aDlg)); 43 44 mValidator = new QIWidgetValidator (aPath, aParent, aDlg); 45 connect (mValidator, SIGNAL (validityChanged (const QIWidgetValidator*)), 46 aDlg, SLOT (enableOk (const QIWidgetValidator*))); 47 connect (mValidator, SIGNAL (isValidRequested (QIWidgetValidator*)), 48 aDlg, SLOT (revalidate (QIWidgetValidator*))); 49 50 /* Setup connections */ 51 connect (mGbVRDP, SIGNAL (toggled (bool)), 52 mValidator, SLOT (revalidate())); 53 connect (mLeVRDPPort, SIGNAL (textChanged (const QString&)), 54 mValidator, SLOT (revalidate())); 55 connect (mLeVRDPTimeout, SIGNAL (textChanged (const QString&)), 56 mValidator, SLOT (revalidate())); 33 mLeVRDPPort->setValidator (new QIntValidator (0, 0xFFFF, this)); 34 mLeVRDPTimeout->setValidator (new QIntValidator (this)); 57 35 58 36 /* Setup dialog */ … … 63 41 /* Applying language settings */ 64 42 retranslateUi(); 65 }66 67 void VBoxVMSettingsVRDP::getFromMachine (const CMachine &aMachine,68 QWidget *aPage,69 VBoxVMSettingsDlg *aDlg,70 const QString &aPath)71 {72 mSettings = new VBoxVMSettingsVRDP (aPage, aDlg, aPath);73 QVBoxLayout *layout = new QVBoxLayout (aPage);74 layout->setContentsMargins (0, 0, 0, 0);75 layout->addWidget (mSettings);76 77 mSettings->getFrom (aMachine);78 79 /* Fixing Tab Order */80 setTabOrder (aDlg->mTwSelector, mSettings->mGbVRDP);81 setTabOrder (mSettings->mGbVRDP, mSettings->mLeVRDPPort);82 setTabOrder (mSettings->mLeVRDPPort, mSettings->mCbVRDPMethod);83 setTabOrder (mSettings->mCbVRDPMethod, mSettings->mLeVRDPTimeout);84 }85 86 void VBoxVMSettingsVRDP::putBackToMachine()87 {88 if (mSettings)89 mSettings->putBackTo();90 43 } 91 44 … … 111 64 } 112 65 66 void VBoxVMSettingsVRDP::setValidator (QIWidgetValidator *aVal) 67 { 68 mValidator = aVal; 69 connect (mGbVRDP, SIGNAL (toggled (bool)), 70 mValidator, SLOT (revalidate())); 71 connect (mLeVRDPPort, SIGNAL (textChanged (const QString&)), 72 mValidator, SLOT (revalidate())); 73 connect (mLeVRDPTimeout, SIGNAL (textChanged (const QString&)), 74 mValidator, SLOT (revalidate())); 75 } 76 77 void VBoxVMSettingsVRDP::setOrderAfter (QWidget *aWidget) 78 { 79 setTabOrder (aWidget, mGbVRDP); 80 setTabOrder (mGbVRDP, mLeVRDPPort); 81 setTabOrder (mLeVRDPPort, mCbVRDPMethod); 82 setTabOrder (mCbVRDPMethod, mLeVRDPTimeout); 83 } 113 84 114 85 void VBoxVMSettingsVRDP::retranslateUi() -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsAudio.ui
r9654 r10167 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsCD.ui
r9654 r10167 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsFD.ui
r9654 r10167 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsGeneral.ui
r9751 r10167 23 23 <x>0</x> 24 24 <y>0</y> 25 <width>6 47</width>26 <height> 548</height>25 <width>624</width> 26 <height>420</height> 27 27 </rect> 28 28 </property> … … 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> … … 935 935 <class>BootItemsTable</class> 936 936 <extends>QTreeWidget</extends> 937 <header>VBox VMSettingsUtils.h</header>937 <header>VBoxSettingsUtils.h</header> 938 938 </customwidget> 939 939 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsHD.ui
r9781 r10167 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> … … 74 74 </property> 75 75 <property name="whatsThis" > 76 <string>Lists all hard disks attached to this machine. Use a mouse click or the <tt>F2</tt>key on the highlighted item to activate the drop-down list and choose the desired value. Use the context menu or buttons to the right to add or remove hard disk attachments.</string>76 <string>Lists all hard disks attached to this machine. Use a mouse click or the F2 key on the highlighted item to activate the drop-down list and choose the desired value. Use the context menu or buttons to the right to add or remove hard disk attachments.</string> 77 77 </property> 78 78 <property name="horizontalScrollBarPolicy" > … … 111 111 <class>QITableView</class> 112 112 <extends>QTableView</extends> 113 <header>VBox VMSettingsUtils.h</header>113 <header>VBoxSettingsUtils.h</header> 114 114 </customwidget> 115 115 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsParallel.ui
r9781 r10167 23 23 <x>0</x> 24 24 <y>0</y> 25 <width>3 53</width>25 <width>378</width> 26 26 <height>163</height> 27 27 </rect> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsSF.ui
r9970 r10167 44 44 </property> 45 45 <property name="bottomMargin" > 46 <number> 0</number>46 <number>5</number> 47 47 </property> 48 48 <item> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsSerial.ui
r9781 r10167 23 23 <x>0</x> 24 24 <y>0</y> 25 <width>3 52</width>25 <width>379</width> 26 26 <height>163</height> 27 27 </rect> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsUSB.ui
r9827 r10167 23 23 <x>0</x> 24 24 <y>0</y> 25 <width> 402</width>25 <width>392</width> 26 26 <height>424</height> 27 27 </rect> … … 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item> … … 76 76 <string>USB Device &Filters</string> 77 77 </property> 78 <layout class="Q HBoxLayout" >78 <layout class="QVBoxLayout" > 79 79 <property name="topMargin" > 80 80 <number>5</number> 81 81 </property> 82 82 <item> 83 <widget class="QTreeWidget" name="mTwFilters" > 84 <property name="contextMenuPolicy" > 85 <enum>Qt::CustomContextMenu</enum> 86 </property> 87 <property name="whatsThis" > 88 <string>Lists all USB filters of this machine. The checkbox to the left defines whether the particular filter is enabled or not. Use the context menu or buttons to the right to add or remove USB filters.</string> 89 </property> 90 <property name="rootIsDecorated" > 91 <bool>false</bool> 92 </property> 93 <column> 94 <property name="text" > 95 <string>[filter]</string> 96 </property> 97 </column> 83 <widget class="QWidget" native="1" name="mWtFilterHandler" > 84 <layout class="QHBoxLayout" > 85 <property name="leftMargin" > 86 <number>0</number> 87 </property> 88 <property name="topMargin" > 89 <number>0</number> 90 </property> 91 <property name="rightMargin" > 92 <number>0</number> 93 </property> 94 <property name="bottomMargin" > 95 <number>0</number> 96 </property> 97 <item> 98 <widget class="QTreeWidget" name="mTwFilters" > 99 <property name="contextMenuPolicy" > 100 <enum>Qt::CustomContextMenu</enum> 101 </property> 102 <property name="whatsThis" > 103 <string>Lists all USB filters of this machine. The checkbox to the left defines whether the particular filter is enabled or not. Use the context menu or buttons to the right to add or remove USB filters.</string> 104 </property> 105 <property name="rootIsDecorated" > 106 <bool>false</bool> 107 </property> 108 <column> 109 <property name="text" > 110 <string>[filter]</string> 111 </property> 112 </column> 113 </widget> 114 </item> 115 </layout> 98 116 </widget> 99 117 </item> 100 </layout>101 </widget>102 </item>103 <item>104 <widget class="QWidget" native="1" name="mWtProperties" >105 <layout class="QVBoxLayout" >106 <property name="leftMargin" >107 <number>0</number>108 </property>109 <property name="topMargin" >110 <number>0</number>111 </property>112 <property name="rightMargin" >113 <number>0</number>114 </property>115 <property name="bottomMargin" >116 <number>0</number>117 </property>118 118 <item> 119 <layout class="QHBoxLayout" > 120 <item> 121 <widget class="QLabel" name="mLbName" > 122 <property name="text" > 123 <string>&Name</string> 124 </property> 125 <property name="buddy" > 126 <cstring>mLeName</cstring> 127 </property> 128 </widget> 129 </item> 130 <item> 131 <widget class="QLineEdit" name="mLeName" > 132 <property name="whatsThis" > 133 <string>Displays the filter name.</string> 134 </property> 135 </widget> 136 </item> 137 </layout> 138 </item> 139 <item> 140 <layout class="QGridLayout" > 141 <item row="0" column="0" > 142 <widget class="QLabel" name="mLbVendorID" > 143 <property name="text" > 144 <string>&Vendor ID</string> 145 </property> 146 <property name="buddy" > 147 <cstring>mLeVendorID</cstring> 148 </property> 149 </widget> 150 </item> 151 <item row="0" column="1" > 152 <widget class="QLineEdit" name="mLeVendorID" > 153 <property name="whatsThis" > 154 <string>Defines the vendor ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</string> 155 </property> 156 </widget> 157 </item> 158 <item row="0" column="2" > 159 <widget class="QLabel" name="mLbManufacturer" > 160 <property name="text" > 161 <string>&Manufacturer</string> 162 </property> 163 <property name="buddy" > 164 <cstring>mLeManufacturer</cstring> 165 </property> 166 </widget> 167 </item> 168 <item row="0" column="3" > 169 <widget class="QLineEdit" name="mLeManufacturer" > 170 <property name="whatsThis" > 171 <string>Defines the manufacturer filter as an <i>exact match</i> string. An empty string will match any value.</string> 172 </property> 173 </widget> 174 </item> 175 <item row="1" column="0" > 176 <widget class="QLabel" name="mLbProductID" > 177 <property name="text" > 178 <string>&Product ID</string> 179 </property> 180 <property name="buddy" > 181 <cstring>mLeProductID</cstring> 182 </property> 183 </widget> 184 </item> 185 <item row="1" column="1" > 186 <widget class="QLineEdit" name="mLeProductID" > 187 <property name="whatsThis" > 188 <string>Defines the product ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</string> 189 </property> 190 </widget> 191 </item> 192 <item row="1" column="2" > 193 <widget class="QLabel" name="mLbProduct" > 194 <property name="text" > 195 <string>Pro&duct</string> 196 </property> 197 <property name="buddy" > 198 <cstring>mLeProduct</cstring> 199 </property> 200 </widget> 201 </item> 202 <item row="1" column="3" > 203 <widget class="QLineEdit" name="mLeProduct" > 204 <property name="whatsThis" > 205 <string>Defines the product name filter as an <i>exact match</i> string. An empty string will match any value.</string> 206 </property> 207 </widget> 208 </item> 209 <item row="2" column="0" > 210 <widget class="QLabel" name="mLbRevision" > 211 <property name="text" > 212 <string>&Revision</string> 213 </property> 214 <property name="buddy" > 215 <cstring>mLeRevision</cstring> 216 </property> 217 </widget> 218 </item> 219 <item row="2" column="1" > 220 <widget class="QLineEdit" name="mLeRevision" > 221 <property name="whatsThis" > 222 <string>Defines the revision number filter. The <i>exact match</i> string format is <tt>IIFF</tt> where <tt>I</tt> is a decimal digit of the integer part and <tt>F</tt> is a decimal digit of the fractional part. An empty string will match any value.</string> 223 </property> 224 </widget> 225 </item> 226 <item row="2" column="2" > 227 <widget class="QLabel" name="mLbSerialNo" > 228 <property name="text" > 229 <string>&Serial No.</string> 230 </property> 231 <property name="buddy" > 232 <cstring>mLeSerialNo</cstring> 233 </property> 234 </widget> 235 </item> 236 <item row="2" column="3" > 237 <widget class="QLineEdit" name="mLeSerialNo" > 238 <property name="whatsThis" > 239 <string>Defines the serial number filter as an <i>exact match</i> string. An empty string will match any value.</string> 240 </property> 241 </widget> 242 </item> 243 <item row="3" column="0" > 244 <widget class="QLabel" name="mLbPort" > 245 <property name="text" > 246 <string>Por&t</string> 247 </property> 248 <property name="buddy" > 249 <cstring>mLePort</cstring> 250 </property> 251 </widget> 252 </item> 253 <item row="3" column="1" > 254 <widget class="QLineEdit" name="mLePort" > 255 <property name="whatsThis" > 256 <string>Defines the host USB port filter as an <i>exact match</i> string. An empty string will match any value.</string> 257 </property> 258 </widget> 259 </item> 260 <item row="3" column="2" > 261 <layout class="QVBoxLayout" > 262 <item> 263 <widget class="QLabel" name="mLbRemote" > 264 <property name="text" > 265 <string>R&emote</string> 266 </property> 267 <property name="buddy" > 268 <cstring>mCbRemote</cstring> 269 </property> 270 </widget> 271 </item> 272 <item> 273 <widget class="QLabel" name="mLbAction" > 274 <property name="text" > 275 <string>&Action</string> 276 </property> 277 <property name="buddy" > 278 <cstring>mCbAction</cstring> 279 </property> 280 </widget> 281 </item> 282 </layout> 283 </item> 284 <item row="3" column="3" > 285 <layout class="QVBoxLayout" > 286 <item> 287 <widget class="QComboBox" name="mCbRemote" > 288 <property name="sizePolicy" > 289 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 290 <horstretch>0</horstretch> 291 <verstretch>0</verstretch> 292 </sizepolicy> 293 </property> 294 <property name="whatsThis" > 295 <string>Defines whether this filter applies to USB devices attached locally to the host computer (<i>No</i>), to a VRDP client's computer (<i>Yes</i>), or both (<i>Any</i>).</string> 296 </property> 297 </widget> 298 </item> 299 <item> 300 <widget class="QComboBox" name="mCbAction" > 301 <property name="sizePolicy" > 302 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 303 <horstretch>0</horstretch> 304 <verstretch>0</verstretch> 305 </sizepolicy> 306 </property> 307 <property name="whatsThis" > 308 <string>Defines an action performed by the host computer when a matching device is attached: give it up to the host OS (<i>Ignore</i>) or grab it for later usage by virtual machines (<i>Hold</i>).</string> 309 </property> 310 </widget> 311 </item> 312 </layout> 313 </item> 314 </layout> 119 <widget class="QWidget" native="1" name="mWtProperties" > 120 <layout class="QVBoxLayout" > 121 <property name="leftMargin" > 122 <number>0</number> 123 </property> 124 <property name="topMargin" > 125 <number>0</number> 126 </property> 127 <property name="rightMargin" > 128 <number>0</number> 129 </property> 130 <property name="bottomMargin" > 131 <number>0</number> 132 </property> 133 <item> 134 <layout class="QHBoxLayout" > 135 <item> 136 <widget class="QLabel" name="mLbName" > 137 <property name="text" > 138 <string>&Name</string> 139 </property> 140 <property name="buddy" > 141 <cstring>mLeName</cstring> 142 </property> 143 </widget> 144 </item> 145 <item> 146 <widget class="QLineEdit" name="mLeName" > 147 <property name="whatsThis" > 148 <string>Displays the filter name.</string> 149 </property> 150 </widget> 151 </item> 152 </layout> 153 </item> 154 <item> 155 <layout class="QGridLayout" > 156 <item row="0" column="0" > 157 <widget class="QLabel" name="mLbVendorID" > 158 <property name="text" > 159 <string>&Vendor ID</string> 160 </property> 161 <property name="buddy" > 162 <cstring>mLeVendorID</cstring> 163 </property> 164 </widget> 165 </item> 166 <item row="0" column="1" > 167 <widget class="QLineEdit" name="mLeVendorID" > 168 <property name="whatsThis" > 169 <string>Defines the vendor ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</string> 170 </property> 171 </widget> 172 </item> 173 <item row="0" column="2" > 174 <widget class="QLabel" name="mLbManufacturer" > 175 <property name="text" > 176 <string>&Manufacturer</string> 177 </property> 178 <property name="buddy" > 179 <cstring>mLeManufacturer</cstring> 180 </property> 181 </widget> 182 </item> 183 <item row="0" column="3" > 184 <widget class="QLineEdit" name="mLeManufacturer" > 185 <property name="whatsThis" > 186 <string>Defines the manufacturer filter as an <i>exact match</i> string. An empty string will match any value.</string> 187 </property> 188 </widget> 189 </item> 190 <item row="1" column="0" > 191 <widget class="QLabel" name="mLbProductID" > 192 <property name="text" > 193 <string>&Product ID</string> 194 </property> 195 <property name="buddy" > 196 <cstring>mLeProductID</cstring> 197 </property> 198 </widget> 199 </item> 200 <item row="1" column="1" > 201 <widget class="QLineEdit" name="mLeProductID" > 202 <property name="whatsThis" > 203 <string>Defines the product ID filter. The <i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a hexadecimal digit. An empty string will match any value.</string> 204 </property> 205 </widget> 206 </item> 207 <item row="1" column="2" > 208 <widget class="QLabel" name="mLbProduct" > 209 <property name="text" > 210 <string>Pro&duct</string> 211 </property> 212 <property name="buddy" > 213 <cstring>mLeProduct</cstring> 214 </property> 215 </widget> 216 </item> 217 <item row="1" column="3" > 218 <widget class="QLineEdit" name="mLeProduct" > 219 <property name="whatsThis" > 220 <string>Defines the product name filter as an <i>exact match</i> string. An empty string will match any value.</string> 221 </property> 222 </widget> 223 </item> 224 <item row="2" column="0" > 225 <widget class="QLabel" name="mLbRevision" > 226 <property name="text" > 227 <string>&Revision</string> 228 </property> 229 <property name="buddy" > 230 <cstring>mLeRevision</cstring> 231 </property> 232 </widget> 233 </item> 234 <item row="2" column="1" > 235 <widget class="QLineEdit" name="mLeRevision" > 236 <property name="whatsThis" > 237 <string>Defines the revision number filter. The <i>exact match</i> string format is <tt>IIFF</tt> where <tt>I</tt> is a decimal digit of the integer part and <tt>F</tt> is a decimal digit of the fractional part. An empty string will match any value.</string> 238 </property> 239 </widget> 240 </item> 241 <item row="2" column="2" > 242 <widget class="QLabel" name="mLbSerialNo" > 243 <property name="text" > 244 <string>&Serial No.</string> 245 </property> 246 <property name="buddy" > 247 <cstring>mLeSerialNo</cstring> 248 </property> 249 </widget> 250 </item> 251 <item row="2" column="3" > 252 <widget class="QLineEdit" name="mLeSerialNo" > 253 <property name="whatsThis" > 254 <string>Defines the serial number filter as an <i>exact match</i> string. An empty string will match any value.</string> 255 </property> 256 </widget> 257 </item> 258 <item row="3" column="0" > 259 <widget class="QLabel" name="mLbPort" > 260 <property name="text" > 261 <string>Por&t</string> 262 </property> 263 <property name="buddy" > 264 <cstring>mLePort</cstring> 265 </property> 266 </widget> 267 </item> 268 <item row="3" column="1" > 269 <widget class="QLineEdit" name="mLePort" > 270 <property name="whatsThis" > 271 <string>Defines the host USB port filter as an <i>exact match</i> string. An empty string will match any value.</string> 272 </property> 273 </widget> 274 </item> 275 <item row="3" column="2" > 276 <layout class="QVBoxLayout" > 277 <item> 278 <widget class="QLabel" name="mLbRemote" > 279 <property name="text" > 280 <string>R&emote</string> 281 </property> 282 <property name="buddy" > 283 <cstring>mCbRemote</cstring> 284 </property> 285 </widget> 286 </item> 287 <item> 288 <widget class="QLabel" name="mLbAction" > 289 <property name="text" > 290 <string>&Action</string> 291 </property> 292 <property name="buddy" > 293 <cstring>mCbAction</cstring> 294 </property> 295 </widget> 296 </item> 297 </layout> 298 </item> 299 <item row="3" column="3" > 300 <layout class="QVBoxLayout" > 301 <item> 302 <widget class="QComboBox" name="mCbRemote" > 303 <property name="sizePolicy" > 304 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 305 <horstretch>0</horstretch> 306 <verstretch>0</verstretch> 307 </sizepolicy> 308 </property> 309 <property name="whatsThis" > 310 <string>Defines whether this filter applies to USB devices attached locally to the host computer (<i>No</i>), to a VRDP client's computer (<i>Yes</i>), or both (<i>Any</i>).</string> 311 </property> 312 </widget> 313 </item> 314 <item> 315 <widget class="QComboBox" name="mCbAction" > 316 <property name="sizePolicy" > 317 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 318 <horstretch>0</horstretch> 319 <verstretch>0</verstretch> 320 </sizepolicy> 321 </property> 322 <property name="whatsThis" > 323 <string>Defines an action performed by the host computer when a matching device is attached: give it up to the host OS (<i>Ignore</i>) or grab it for later usage by virtual machines (<i>Hold</i>).</string> 324 </property> 325 </widget> 326 </item> 327 </layout> 328 </item> 329 </layout> 330 </item> 331 </layout> 332 </widget> 315 333 </item> 316 334 </layout> -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsVRDP.ui
r9654 r10167 38 38 </property> 39 39 <property name="bottomMargin" > 40 <number> 0</number>40 <number>5</number> 41 41 </property> 42 42 <item>
Note:
See TracChangeset
for help on using the changeset viewer.