Changeset 9783 in vbox
- Timestamp:
- Jun 17, 2008 5:21:54 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 3 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r9665 r9783 404 404 VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxVMSettingsDlg.ui,$(VirtualBox_QT_UISRCS3)) 405 405 VirtualBox_QT_UISRCS4 += ui/VBoxVMSettingsDlg.ui 406 407 VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxGlobalSettingsGeneral.ui,$(VirtualBox_QT_UISRCS3)) 408 VirtualBox_QT_UISRCS4 += ui/VBoxGlobalSettingsGeneral.ui 409 410 VirtualBox_QT_UISRCS3 := $(filter-out ui/VBoxGlobalSettingsDlg.ui,$(VirtualBox_QT_UISRCS3)) 411 VirtualBox_QT_UISRCS4 += ui/VBoxGlobalSettingsDlg.ui 406 412 407 413 # … … 564 570 include/VBoxVMSettingsSF.h \ 565 571 include/VBoxVMSettingsVRDP.h \ 566 include/VBoxVMSettingsDlg.h 572 include/VBoxVMSettingsDlg.h \ 573 include/VBoxGlobalSettingsGeneral.h \ 574 include/VBoxGlobalSettingsDlg.h 567 575 568 576 # Sources containing local definitions of classes that use the Q_OBJECT macro … … 649 657 src/VBoxVMSettingsSF.cpp \ 650 658 src/VBoxVMSettingsVRDP.cpp \ 651 src/VBoxVMSettingsDlg.cpp 659 src/VBoxVMSettingsDlg.cpp \ 660 src/VBoxGlobalSettingsGeneral.cpp \ 661 src/VBoxGlobalSettingsDlg.cpp 652 662 653 663 ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(KBUILD_TARGET)),) # X11 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobalSettingsDlg.h
r9751 r9783 2 2 * 3 3 * VBox frontends: Qt4 GUI ("VirtualBox"): 4 * VBox VMSettingsDlg class declaration4 * VBoxGlobalSettingsDlg class declaration 5 5 */ 6 6 … … 21 21 */ 22 22 23 #ifndef __VBox VMSettingsDlg_h__24 #define __VBox VMSettingsDlg_h__23 #ifndef __VBoxGlobalSettingsDlg_h__ 24 #define __VBoxGlobalSettingsDlg_h__ 25 25 26 #include "VBox VMSettingsDlg.gen.h"26 #include "VBoxGlobalSettingsDlg.gen.h" 27 27 #include "QIMainDialog.h" 28 28 #include "QIWithRetranslateUI.h" 29 29 #include "COMDefs.h" 30 #include "VBoxGlobalSettings.h" 30 31 31 32 class QIWidgetValidator; … … 34 35 35 36 class QTimer; 36 class QWidgetStack;37 37 38 class VBox VMSettingsDlg : public QIWithRetranslateUI<QIMainDialog>,39 public Ui::VBoxVMSettingsDlg38 class VBoxGlobalSettingsDlg : public QIWithRetranslateUI<QIMainDialog>, 39 public Ui::VBoxGlobalSettingsDlg 40 40 { 41 41 Q_OBJECT; … … 43 43 public: 44 44 45 VBoxVMSettingsDlg (QWidget *aParent, const QString &aCategory, 46 const QString &aControl); 45 VBoxGlobalSettingsDlg (QWidget *aParent); 47 46 48 void getFromMachine (const CMachine &aMachine); 49 COMResult putBackToMachine(); 47 void getFrom (const CSystemProperties &aProps, 48 const VBoxGlobalSettings &aGs); 49 COMResult putBackTo (CSystemProperties &aProps, 50 VBoxGlobalSettings &aGs); 50 51 51 52 protected: … … 57 58 void enableOk (const QIWidgetValidator*); 58 59 void revalidate (QIWidgetValidator *aWval); 59 void onMediaEnumerationDone();60 60 void settingsGroupChanged (QTreeWidgetItem *aItem, QTreeWidgetItem *aPrev); 61 void updateWhatsThis (bool gotFocus = false); 62 void resetFirstRunFlag(); 61 void updateWhatsThis (bool aGotFocus = false); 63 62 void whatsThisCandidateDestroyed (QObject *aObj = NULL); 64 63 … … 72 71 void updateMediaShortcuts(); 73 72 74 QString dialogTitle() const;75 76 73 /* Common */ 77 CMachine mMachine;78 74 QString mWarnString; 79 75 VBoxWarnIconLabel *mWarnIconLabel; … … 81 77 /* Flags */ 82 78 bool mPolished; 83 bool mAllowResetFirstRunFlag;84 bool mResetFirstRunFlag;85 79 bool mValid; 86 80 … … 90 84 }; 91 85 92 #endif // __VBox VMSettingsDlg_h__86 #endif // __VBoxGlobalSettingsDlg_h__ 93 87 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobalSettingsDlg.cpp
r9751 r9783 30 30 *****************************************************************************/ 31 31 32 #include "QILabel.h" 33 34 #include <iprt/err.h> 35 #include <iprt/param.h> 36 #include <iprt/path.h> 37 //Added by qt3to4: 38 #include <QTranslator> 39 #include <QLabel> 40 #include <q3mimefactory.h> 41 #include <QEvent> 42 #include <QShowEvent> 43 #include <Q3WhatsThis> 44 45 /* defined in VBoxGlobal.cpp */ 46 extern const char *gVBoxLangSubDir; 47 extern const char *gVBoxLangFileBase; 48 extern const char *gVBoxLangFileExt; 49 extern const char *gVBoxLangIDRegExp; 50 extern const char *gVBoxBuiltInLangName; 32 #include "VBoxGlobalSettingsDlg.h" 33 #include "VBoxVMSettingsUtils.h" 34 35 #include "VBoxGlobalSettingsGeneral.h" 36 //#include "VBoxGlobalSettingsInput.h" 37 //#include "VBoxGlobalSettingsUSB.h" 38 //#include "VBoxGlobalSettingsLanguage.h" 39 40 #include "VBoxGlobal.h" 41 #include "VBoxProblemReporter.h" 42 #include "QIWidgetValidator.h" 43 44 #include <QTimer> 45 #include <QPushButton> 51 46 52 47 /** … … 54 49 * using the text of the first column of every item. 55 50 */ 56 static QString path (Q 3ListViewItem *li)51 static QString path (QTreeWidgetItem *aItem) 57 52 { 58 53 static QString sep = ": "; 59 54 QString p; 60 Q 3ListViewItem *cur = li;55 QTreeWidgetItem *cur = aItem; 61 56 while (cur) 62 57 { 63 58 if (!p.isNull()) 64 59 p = sep + p; 65 p = cur->text (0).simplif yWhiteSpace() + p;60 p = cur->text (0).simplified() + p; 66 61 cur = cur->parent(); 67 62 } … … 69 64 } 70 65 71 72 enum 73 { 74 // listView column numbers 75 listView_Category = 0, 76 listView_Id = 1, 77 listView_Link = 2, 78 }; 79 80 81 class USBListItem : public Q3CheckListItem 82 { 83 public: 84 85 USBListItem (Q3ListView *aParent, Q3ListViewItem *aAfter) 86 : Q3CheckListItem (aParent, aAfter, QString::null, CheckBox) 87 , mId (-1) {} 88 89 int mId; 90 }; 91 enum { lvUSBFilters_Name = 0 }; 92 93 94 class LanguageItem : public Q3ListViewItem 95 { 96 public: 97 98 enum { TypeId = 1001 }; 99 100 LanguageItem (Q3ListView *aParent, const QTranslator &aTranslator, 101 const QString &aId, bool aBuiltIn = false) 102 : Q3ListViewItem (aParent), mBuiltIn (aBuiltIn), mInvalid (false) 66 static QTreeWidgetItem* findItem (QTreeWidget *aView, 67 const QString &aMatch, int aColumn) 68 { 69 QList<QTreeWidgetItem*> list = 70 aView->findItems (aMatch, Qt::MatchExactly, aColumn); 71 72 return list.count() ? list [0] : 0; 73 } 74 75 // /* Language page */ 76 // /* Defined in VBoxGlobal.cpp */ 77 // extern const char *gVBoxLangSubDir; 78 // extern const char *gVBoxLangFileBase; 79 // extern const char *gVBoxLangFileExt; 80 // extern const char *gVBoxLangIDRegExp; 81 // extern const char *gVBoxBuiltInLangName; 82 // class LanguageItem : public Q3ListViewItem 83 // { 84 // public: 85 // 86 // enum { TypeId = 1001 }; 87 // 88 // LanguageItem (Q3ListView *aParent, const QTranslator &aTranslator, 89 // const QString &aId, bool aBuiltIn = false) 90 // : Q3ListViewItem (aParent), mBuiltIn (aBuiltIn), mInvalid (false) 91 // { 92 // Assert (!aId.isEmpty()); 93 // 94 // // QTranslatorMessage transMes; 95 // 96 // /* Note: context/source/comment arguments below must match strings 97 // * used in VBoxGlobal::languageName() and friends (the latter are the 98 // * source of information for the lupdate tool that generates 99 // * translation files) */ 100 // 101 // QString nativeLanguage = tratra (aTranslator, 102 // "@@@", "English", "Native language name"); 103 // QString nativeCountry = tratra (aTranslator, 104 // "@@@", "--", "Native language country name " 105 // "(empty if this language is for all countries)"); 106 // 107 // QString englishLanguage = tratra (aTranslator, 108 // "@@@", "English", "Language name, in English"); 109 // QString englishCountry = tratra (aTranslator, 110 // "@@@", "--", "Language country name, in English " 111 // "(empty if native country name is empty)"); 112 // 113 // QString translatorsName = tratra (aTranslator, 114 // "@@@", "Sun Microsystems, Inc.", "Comma-separated list of translators"); 115 // 116 // QString itemName = nativeLanguage; 117 // QString langName = englishLanguage; 118 // 119 // if (!aBuiltIn) 120 // { 121 // if (nativeCountry != "--") 122 // itemName += " (" + nativeCountry + ")"; 123 // 124 // if (englishCountry != "--") 125 // langName += " (" + englishCountry + ")"; 126 // 127 // if (itemName != langName) 128 // langName = itemName + " / " + langName; 129 // } 130 // else 131 // { 132 // itemName += VBoxGlobalSettingsDlg::tr (" (built-in)", "Language"); 133 // langName += VBoxGlobalSettingsDlg::tr (" (built-in)", "Language"); 134 // } 135 // 136 // setText (0, itemName); 137 // setText (1, aId); 138 // setText (2, langName); 139 // setText (3, translatorsName); 140 // } 141 // 142 // /* Constructs an item for an invalid language ID (i.e. when a language 143 // * file is missing or corrupt). */ 144 // LanguageItem (Q3ListView *aParent, const QString &aId) 145 // : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (true) 146 // { 147 // Assert (!aId.isEmpty()); 148 // 149 // setText (0, QString ("<%1>").arg (aId)); 150 // setText (1, aId); 151 // setText (2, VBoxGlobalSettingsDlg::tr ("<unavailable>", "Language")); 152 // setText (3, VBoxGlobalSettingsDlg::tr ("<unknown>", "Author(s)")); 153 // } 154 // 155 // /* Constructs an item for the default language ID (column 1 will be set 156 // * to QString::null) */ 157 // LanguageItem (Q3ListView *aParent) 158 // : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (false) 159 // { 160 // setText (0, VBoxGlobalSettingsDlg::tr ("Default", "Language")); 161 // setText (1, QString::null); 162 // /* empty strings of some reasonable length to prevent the info part 163 // * from being shrinked too much when the list wants to be wider */ 164 // setText (2, " "); 165 // setText (3, " "); 166 // } 167 // 168 // int rtti() const { return TypeId; } 169 // 170 // int compare (Q3ListViewItem *aItem, int aColumn, bool aAscending) const 171 // { 172 // QString thisId = text (1); 173 // QString thatId = aItem->text (1); 174 // if (thisId.isNull()) 175 // return -1; 176 // if (thatId.isNull()) 177 // return 1; 178 // if (mBuiltIn) 179 // return -1; 180 // if (aItem->rtti() == TypeId && ((LanguageItem *) aItem)->mBuiltIn) 181 // return 1; 182 // return Q3ListViewItem::compare (aItem, aColumn, aAscending); 183 // } 184 // 185 // void paintCell (QPainter *aPainter, const QColorGroup &aGroup, 186 // int aColumn, int aWidth, int aAlign) 187 // { 188 // QFont font = aPainter->font(); 189 // 190 // if (mInvalid) 191 // font.setItalic (true); 192 // /* mark the effectively active language */ 193 // if (text (1) == VBoxGlobal::languageId()) 194 // font.setBold (true); 195 // 196 // if (aPainter->font() != font) 197 // aPainter->setFont (font); 198 // 199 // Q3ListViewItem::paintCell (aPainter, aGroup, aColumn, aWidth, aAlign); 200 // 201 // if (mBuiltIn) 202 // { 203 // int y = height() - 1; 204 // aPainter->setPen (aGroup.mid()); 205 // aPainter->drawLine (0, y, aWidth - 1, y); 206 // } 207 // } 208 // 209 // int width (const QFontMetrics &aFM, const Q3ListView *aLV, int aC) const 210 // { 211 // QFont font = aLV->font(); 212 // 213 // if (mInvalid) 214 // font.setItalic (true); 215 // /* mark the effectively active language */ 216 // if (text (1) == VBoxGlobal::languageId()) 217 // font.setBold (true); 218 // 219 // QFontMetrics fm = aFM; 220 // if (aLV->font() != font) 221 // fm = QFontMetrics (font); 222 // 223 // return Q3ListViewItem::width (fm, aLV, aC); 224 // } 225 // 226 // void setup () 227 // { 228 // Q3ListViewItem::setup(); 229 // if (mBuiltIn) 230 // setHeight (height() + 1); 231 // } 232 // 233 // private: 234 // 235 // QString tratra (const QTranslator &aTranslator, const char *aCtxt, 236 // const char *aSrc, const char *aCmnt) 237 // { 238 // //#warning port me: check this 239 // QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt); 240 // // QString msg = aTranslator.findMessage (aCtxt, aSrc, aCmnt).translation(); 241 // /* return the source text if no translation is found */ 242 // if (msg.isEmpty()) 243 // msg = QString (aSrc); 244 // return msg; 245 // } 246 // 247 // bool mBuiltIn : 1; 248 // bool mInvalid : 1; 249 // }; 250 251 VBoxGlobalSettingsDlg::VBoxGlobalSettingsDlg (QWidget *aParent) 252 : QIWithRetranslateUI<QIMainDialog> (aParent) 253 , mPolished (false) 254 , mValid (true) 255 , mWhatsThisTimer (new QTimer (this)) 256 , mWhatsThisCandidate (NULL) 257 { 258 /* Apply UI decorations */ 259 Ui::VBoxGlobalSettingsDlg::setupUi (this); 260 261 #ifndef Q_WS_MAC 262 setWindowIcon (QIcon (":/global_settings_16px.png")); 263 #endif /* Q_WS_MAC */ 264 265 mWarnIconLabel = new VBoxWarnIconLabel(); 266 mWarnIconLabel->setVisible (false); 267 268 /* Setup warning icon */ 269 QIcon icon = vboxGlobal().standardIcon (QStyle::SP_MessageBoxWarning, this); 270 if (!icon.isNull()) 271 mWarnIconLabel->setWarningPixmap (icon.pixmap (16, 16)); 272 273 mButtonBox->addExtraWidget (mWarnIconLabel); 274 275 /* Page title font is derived from the system font */ 276 QFont f = font(); 277 f.setBold (true); 278 f.setPointSize (f.pointSize() + 2); 279 mLbTitle->setFont (f); 280 281 /* Setup the what's this label */ 282 qApp->installEventFilter (this); 283 mWhatsThisTimer->setSingleShot (true); 284 connect (mWhatsThisTimer, SIGNAL (timeout()), this, SLOT (updateWhatsThis())); 285 286 mLbWhatsThis->setFixedHeight (mLbWhatsThis->frameWidth() * 2 + 287 6 /* seems that RichText adds some margin */ + 288 mLbWhatsThis->fontMetrics().lineSpacing() * 4); 289 mLbWhatsThis->setMinimumWidth (mLbWhatsThis->frameWidth() * 2 + 290 6 /* seems that RichText adds some margin */ + 291 mLbWhatsThis->fontMetrics().width ('m') * 40); 292 293 /* Common connections */ 294 connect (mButtonBox, SIGNAL (accepted()), this, SLOT (accept())); 295 connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject())); 296 connect (mButtonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog())); 297 connect (mTwSelector, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)), 298 this, SLOT (settingsGroupChanged (QTreeWidgetItem *, QTreeWidgetItem*))); 299 300 // /* Keyboard page */ 301 // wvalKeyboard = new QIWidgetValidator (pagePath (pageKeyboard), pageKeyboard, this); 302 // connect (wvalKeyboard, SIGNAL (validityChanged (const QIWidgetValidator *)), 303 // this, SLOT (enableOk( const QIWidgetValidator *))); 304 305 // /* Language page */ 306 // lvLanguages->header()->hide(); 307 // lvLanguages->setSorting (0); 308 // 309 // char szNlsPath[RTPATH_MAX]; 310 // int rc = RTPathAppPrivateNoArch (szNlsPath, sizeof(szNlsPath)); 311 // AssertRC (rc); 312 // QString nlsPath = QString (szNlsPath) + gVBoxLangSubDir; 313 // QDir nlsDir (nlsPath); 314 // QStringList files = nlsDir.entryList (QString ("%1*%2") 315 // .arg (gVBoxLangFileBase, gVBoxLangFileExt), 316 // QDir::Files); 317 // QTranslator translator; 318 // /* add the default language */ 319 // new LanguageItem (lvLanguages); 320 // /* add the built-in language */ 321 // new LanguageItem (lvLanguages, translator, gVBoxBuiltInLangName, true /* built-in */); 322 // /* add all existing languages */ 323 // for (QStringList::Iterator it = files.begin(); it != files.end(); ++ it) 324 // { 325 // QString fileName = *it; 326 // QRegExp regExp (QString (gVBoxLangFileBase) + gVBoxLangIDRegExp); 327 // int pos = regExp.search (fileName); 328 // if (pos == -1) 329 // continue; 330 // 331 // bool loadOk = translator.load (fileName, nlsPath); 332 // if (!loadOk) 333 // continue; 334 // 335 // new LanguageItem (lvLanguages, translator, regExp.cap (1)); 336 // } 337 // lvLanguages->adjustColumn (0); 338 339 /* Hide unnecessary columns and header */ 340 mTwSelector->header()->hide(); 341 mTwSelector->hideColumn (listView_Id); 342 mTwSelector->hideColumn (listView_Link); 343 344 /* Adjust selector list */ 345 int minWid = 0; 346 for (int i = 0; i < mTwSelector->topLevelItemCount(); ++ i) 103 347 { 104 Assert (!aId.isEmpty()); 105 106 // QTranslatorMessage transMes; 107 108 /* Note: context/source/comment arguments below must match strings 109 * used in VBoxGlobal::languageName() and friends (the latter are the 110 * source of information for the lupdate tool that generates 111 * translation files) */ 112 113 QString nativeLanguage = tratra (aTranslator, 114 "@@@", "English", "Native language name"); 115 QString nativeCountry = tratra (aTranslator, 116 "@@@", "--", "Native language country name " 117 "(empty if this language is for all countries)"); 118 119 QString englishLanguage = tratra (aTranslator, 120 "@@@", "English", "Language name, in English"); 121 QString englishCountry = tratra (aTranslator, 122 "@@@", "--", "Language country name, in English " 123 "(empty if native country name is empty)"); 124 125 QString translatorsName = tratra (aTranslator, 126 "@@@", "Sun Microsystems, Inc.", "Comma-separated list of translators"); 127 128 QString itemName = nativeLanguage; 129 QString langName = englishLanguage; 130 131 if (!aBuiltIn) 132 { 133 if (nativeCountry != "--") 134 itemName += " (" + nativeCountry + ")"; 135 136 if (englishCountry != "--") 137 langName += " (" + englishCountry + ")"; 138 139 if (itemName != langName) 140 langName = itemName + " / " + langName; 141 } 142 else 143 { 144 itemName += VBoxGlobalSettingsDlg::tr (" (built-in)", "Language"); 145 langName += VBoxGlobalSettingsDlg::tr (" (built-in)", "Language"); 146 } 147 148 setText (0, itemName); 149 setText (1, aId); 150 setText (2, langName); 151 setText (3, translatorsName); 348 QTreeWidgetItem *item = mTwSelector->topLevelItem (i); 349 QFontMetrics fm (item->font (0)); 350 int wid = fm.width (item->text (0)) + 351 16 /* icon */ + 2 * 8 /* 2 margins */; 352 minWid = wid > minWid ? wid : minWid; 353 int hei = fm.height() > 16 ? 354 fm.height() /* text height */ : 355 16 /* icon */ + 2 * 2 /* 2 margins */; 356 item->setSizeHint (0, QSize (wid, hei)); 152 357 } 153 154 /* Constructs an item for an invalid language ID (i.e. when a language 155 * file is missing or corrupt). */ 156 LanguageItem (Q3ListView *aParent, const QString &aId) 157 : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (true) 158 { 159 Assert (!aId.isEmpty()); 160 161 setText (0, QString ("<%1>").arg (aId)); 162 setText (1, aId); 163 setText (2, VBoxGlobalSettingsDlg::tr ("<unavailable>", "Language")); 164 setText (3, VBoxGlobalSettingsDlg::tr ("<unknown>", "Author(s)")); 165 } 166 167 /* Constructs an item for the default language ID (column 1 will be set 168 * to QString::null) */ 169 LanguageItem (Q3ListView *aParent) 170 : Q3ListViewItem (aParent), mBuiltIn (false), mInvalid (false) 171 { 172 setText (0, VBoxGlobalSettingsDlg::tr ("Default", "Language")); 173 setText (1, QString::null); 174 /* empty strings of some reasonable length to prevent the info part 175 * from being shrinked too much when the list wants to be wider */ 176 setText (2, " "); 177 setText (3, " "); 178 } 179 180 int rtti() const { return TypeId; } 181 182 int compare (Q3ListViewItem *aItem, int aColumn, bool aAscending) const 183 { 184 QString thisId = text (1); 185 QString thatId = aItem->text (1); 186 if (thisId.isNull()) 187 return -1; 188 if (thatId.isNull()) 189 return 1; 190 if (mBuiltIn) 191 return -1; 192 if (aItem->rtti() == TypeId && ((LanguageItem *) aItem)->mBuiltIn) 193 return 1; 194 return Q3ListViewItem::compare (aItem, aColumn, aAscending); 195 } 196 197 void paintCell (QPainter *aPainter, const QColorGroup &aGroup, 198 int aColumn, int aWidth, int aAlign) 199 { 200 QFont font = aPainter->font(); 201 202 if (mInvalid) 203 font.setItalic (true); 204 /* mark the effectively active language */ 205 if (text (1) == VBoxGlobal::languageId()) 206 font.setBold (true); 207 208 if (aPainter->font() != font) 209 aPainter->setFont (font); 210 211 Q3ListViewItem::paintCell (aPainter, aGroup, aColumn, aWidth, aAlign); 212 213 if (mBuiltIn) 214 { 215 int y = height() - 1; 216 aPainter->setPen (aGroup.mid()); 217 aPainter->drawLine (0, y, aWidth - 1, y); 218 } 219 } 220 221 int width (const QFontMetrics &aFM, const Q3ListView *aLV, int aC) const 222 { 223 QFont font = aLV->font(); 224 225 if (mInvalid) 226 font.setItalic (true); 227 /* mark the effectively active language */ 228 if (text (1) == VBoxGlobal::languageId()) 229 font.setBold (true); 230 231 QFontMetrics fm = aFM; 232 if (aLV->font() != font) 233 fm = QFontMetrics (font); 234 235 return Q3ListViewItem::width (fm, aLV, aC); 236 } 237 238 void setup () 239 { 240 Q3ListViewItem::setup(); 241 if (mBuiltIn) 242 setHeight (height() + 1); 243 } 244 245 private: 246 247 QString tratra (const QTranslator &aTranslator, const char *aCtxt, 248 const char *aSrc, const char *aCmnt) 249 { 250 //#warning port me: check this 251 QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt); 252 // QString msg = aTranslator.findMessage (aCtxt, aSrc, aCmnt).translation(); 253 /* return the source text if no translation is found */ 254 if (msg.isEmpty()) 255 msg = QString (aSrc); 256 return msg; 257 } 258 259 bool mBuiltIn : 1; 260 bool mInvalid : 1; 261 }; 262 263 264 void VBoxGlobalSettingsDlg::init() 265 { 266 polished = false; 267 268 setIcon (QPixmap (":/global_settings_16px.png")); 269 270 /* all pages are initially valid */ 271 valid = true; 272 buttonOk->setEnabled (true); 273 //#warning port me 274 // warningSpacer->changeSize (0, 0, QSizePolicy::Expanding); 275 warningLabel->setHidden (true); 276 warningPixmap->setHidden (true); 277 278 /* disable unselecting items by clicking in the unused area of the list */ 279 new QIListViewSelectionPreserver (this, listView); 280 /* hide the header and internal columns */ 281 listView->header()->hide(); 282 listView->setColumnWidthMode (listView_Id, Q3ListView::Manual); 283 listView->setColumnWidthMode (listView_Link, Q3ListView::Manual); 284 listView->hideColumn (listView_Id); 285 listView->hideColumn (listView_Link); 286 /* sort by the id column (to have pages in the desired order) */ 287 listView->setSorting (listView_Id); 288 listView->sort(); 289 290 warningPixmap->setMaximumSize( 16, 16 ); 291 warningPixmap->setPixmap( QMessageBox::standardIcon( QMessageBox::Warning ) ); 292 293 /* page title font is derived from the system font */ 294 QFont f = font(); 295 f.setBold( true ); 296 f.setPointSize( f.pointSize() + 2 ); 297 titleLabel->setFont( f ); 298 299 /* setup the what's this label */ 300 QApplication::setGlobalMouseTracking (true); 301 qApp->installEventFilter (this); 302 whatsThisTimer = new QTimer (this); 303 connect (whatsThisTimer, SIGNAL (timeout()), this, SLOT (updateWhatsThis())); 304 whatsThisCandidate = NULL; 305 306 //#warning port me 307 whatsThisLabel = new QILabel (this); 308 // VBoxGlobalSettingsDlgLayout->addWidget (whatsThisLabel, 2, 1); 309 310 #ifndef DEBUG 311 /* Enforce rich text format to avoid jumping margins (margins of plain 312 * text labels seem to be smaller). We don't do it in the DEBUG builds to 313 * be able to immediately catch badly formatted text (i.e. text that 314 * contains HTML tags but doesn't start with <qt> so that Qt isn't able to 315 * recognize it as rich text and draws all tags as is instead of doing 316 * formatting). We want to catch this text because this is how it will look 317 * in the whatsthis balloon where we cannot enforce rich text. */ 318 // whatsThisLabel->setTextFormat (Qt::RichText); 319 #endif 320 321 // whatsThisLabel->setMaxHeightMode (true); 322 // whatsThisLabel->setFocusPolicy (Qt::NoFocus); 323 // whatsThisLabel->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Fixed); 324 // whatsThisLabel->setBackgroundMode (Qt::PaletteMidlight); 325 // whatsThisLabel->setFrameShape (QLabel::Box); 326 // whatsThisLabel->setFrameShadow (QLabel::Sunken); 327 // whatsThisLabel->setMargin (7); 328 // whatsThisLabel->setScaledContents (FALSE); 329 // whatsThisLabel->setAlignment (int (Qt::TextWordWrap | 330 // Qt::AlignJustify | 331 // Qt::AlignTop)); 332 // 333 // whatsThisLabel->setFixedHeight (whatsThisLabel->frameWidth() * 2 + 334 // 6 /* seems that RichText adds some margin */ + 335 // whatsThisLabel->fontMetrics().lineSpacing() * 4); 336 // whatsThisLabel->setMinimumWidth (whatsThisLabel->frameWidth() * 2 + 337 // 6 /* seems that RichText adds some margin */ + 338 // whatsThisLabel->fontMetrics().width ('m') * 40); 339 // 340 /* 341 * create and layout non-standard widgets 342 * ---------------------------------------------------------------------- 343 */ 344 345 hkeHostKey = new QIHotKeyEdit (grbKeyboard, "hkeHostKey"); 346 hkeHostKey->setSizePolicy (QSizePolicy (QSizePolicy::Preferred, QSizePolicy::Fixed)); 347 Q3WhatsThis::add (hkeHostKey, 348 tr ("Displays the key used as a Host Key in the VM window. Activate the " 349 "entry field and press a new Host Key. Note that alphanumeric, " 350 "cursor movement and editing keys cannot be used as a Host Key.")); 351 //#warning port me 352 // layoutHostKey->addWidget (hkeHostKey); 353 txHostKey->setBuddy (hkeHostKey); 354 setTabOrder (listView, hkeHostKey); 355 356 /* 357 * setup connections and set validation for pages 358 * ---------------------------------------------------------------------- 359 */ 360 361 /* General page */ 362 363 wvalGeneral = new QIWidgetValidator (pagePath (pageGeneral), pageGeneral, this); 364 connect (wvalGeneral, SIGNAL (validityChanged (const QIWidgetValidator *)), 365 this, SLOT (enableOk( const QIWidgetValidator *))); 366 367 /* Keyboard page */ 368 369 wvalKeyboard = new QIWidgetValidator (pagePath (pageKeyboard), pageKeyboard, this); 370 connect (wvalKeyboard, SIGNAL (validityChanged (const QIWidgetValidator *)), 371 this, SLOT (enableOk( const QIWidgetValidator *))); 372 373 /* USB page */ 374 375 lvUSBFilters->header()->hide(); 376 /* disable sorting */ 377 lvUSBFilters->setSorting (-1); 378 /* disable unselecting items by clicking in the unused area of the list */ 379 new QIListViewSelectionPreserver (this, lvUSBFilters); 380 wstUSBFilters = new Q3WidgetStack (grbUSBFilters, "wstUSBFilters"); 381 //#warning port me 382 // grbUSBFiltersLayout->addWidget (wstUSBFilters); 383 /* create a default (disabled) filter settings widget at index 0 */ 384 /* 385 VBoxUSBFilterSettings *settings = new VBoxUSBFilterSettings (wstUSBFilters); 386 settings->setup (VBoxUSBFilterSettings::HostType); 387 wstUSBFilters->addWidget (settings, 0); 388 lvUSBFilters_currentChanged (NULL); 389 */ 390 /* setup toolbutton icons */ 391 tbAddUSBFilter->setIconSet (VBoxGlobal::iconSet (":/usb_new_16px.png", 392 ":/usb_new_disabled_16px.png")); 393 tbAddUSBFilterFrom->setIconSet (VBoxGlobal::iconSet (":/usb_add_16px.png", 394 ":/usb_add_disabled_16px.png")); 395 tbRemoveUSBFilter->setIconSet (VBoxGlobal::iconSet (":/usb_remove_16px.png", 396 ":/usb_remove_disabled_16px.png")); 397 tbUSBFilterUp->setIconSet (VBoxGlobal::iconSet (":/usb_moveup_16px.png", 398 ":/usb_moveup_disabled_16px.png")); 399 tbUSBFilterDown->setIconSet (VBoxGlobal::iconSet (":/usb_movedown_16px.png", 400 ":/usb_movedown_disabled_16px.png")); 401 /* create menu of existing usb-devices */ 402 usbDevicesMenu = new VBoxUSBMenu (this); 403 connect (usbDevicesMenu, SIGNAL(activated(int)), this, SLOT(menuAddUSBFilterFrom_activated(int))); 404 mUSBFilterListModified = false; 405 406 /* 407 * set initial values 408 * ---------------------------------------------------------------------- 409 */ 410 411 /* General page */ 412 413 /* keyboard page */ 414 415 /* Language page */ 416 417 lvLanguages->header()->hide(); 418 lvLanguages->setSorting (0); 419 420 char szNlsPath[RTPATH_MAX]; 421 int rc = RTPathAppPrivateNoArch (szNlsPath, sizeof(szNlsPath)); 422 AssertRC (rc); 423 QString nlsPath = QString (szNlsPath) + gVBoxLangSubDir; 424 QDir nlsDir (nlsPath); 425 QStringList files = nlsDir.entryList (QString ("%1*%2") 426 .arg (gVBoxLangFileBase, gVBoxLangFileExt), 427 QDir::Files); 428 QTranslator translator; 429 /* add the default language */ 430 new LanguageItem (lvLanguages); 431 /* add the built-in language */ 432 new LanguageItem (lvLanguages, translator, gVBoxBuiltInLangName, true /* built-in */); 433 /* add all existing languages */ 434 for (QStringList::Iterator it = files.begin(); it != files.end(); ++ it) 435 { 436 QString fileName = *it; 437 QRegExp regExp (QString (gVBoxLangFileBase) + gVBoxLangIDRegExp); 438 int pos = regExp.search (fileName); 439 if (pos == -1) 440 continue; 441 442 bool loadOk = translator.load (fileName, nlsPath); 443 if (!loadOk) 444 continue; 445 446 new LanguageItem (lvLanguages, translator, regExp.cap (1)); 447 } 448 lvLanguages->adjustColumn (0); 449 450 /* 451 * update the Ok button state for pages with validation 452 * (validityChanged() connected to enableNext() will do the job) 453 */ 454 wvalGeneral->revalidate(); 455 wvalKeyboard->revalidate(); 358 mTwSelector->setFixedWidth (minWid); 359 360 /* Sort selector by the id column (to have pages in the desired order) */ 361 mTwSelector->sortItems (listView_Id, Qt::AscendingOrder); 362 363 /* Initially select the first settings page */ 364 mTwSelector->setCurrentItem (mTwSelector->topLevelItem (0)); 365 366 /* Applying language settings */ 367 retranslateUi(); 456 368 } 457 369 458 370 /** 459 * Re turns a path to the given page of this settings dialog. See ::path() for460 * details.371 * Reads global settings from the given VBoxGlobalSettings instance 372 * and from the given CSystemProperties object. 461 373 */ 462 QString VBoxGlobalSettingsDlg::pagePath (QWidget *aPage) 463 { 464 Q3ListViewItem *li = listView-> 465 findItem (QString::number (widgetStack->id (aPage)), 1); 466 return ::path (li); 467 } 468 469 bool VBoxGlobalSettingsDlg::event (QEvent *aEvent) 470 { 471 bool result = QWidget::event (aEvent); 472 if (aEvent->type() == QEvent::LanguageChange) 473 { 474 /* set the first item selected */ 475 listView->setSelected (listView->firstChild(), true); 476 listView_currentChanged (listView->firstChild()); 477 lvLanguages_currentChanged (lvLanguages->currentItem()); 478 mLanguageChanged = false; 479 fixLanguageChange(); 480 } 481 return result; 482 } 483 484 bool VBoxGlobalSettingsDlg::eventFilter (QObject *object, QEvent *event) 485 { 486 if (!object->isWidgetType()) 487 return QDialog::eventFilter (object, event); 488 489 QWidget *widget = static_cast <QWidget *> (object); 490 if (widget->topLevelWidget() != this) 491 return QDialog::eventFilter (object, event); 492 493 switch (event->type()) 494 { 495 case QEvent::Enter: 496 case QEvent::Leave: 497 { 498 if (event->type() == QEvent::Enter) 499 whatsThisCandidate = widget; 500 else 501 whatsThisCandidate = NULL; 502 whatsThisTimer->start (100, true /* sshot */); 503 break; 504 } 505 case QEvent::FocusIn: 506 { 507 updateWhatsThis (true /* gotFocus */); 508 break; 509 } 510 case QEvent::Show: 511 { 512 if (widget == pageLanguage) 513 lvLanguages->updateGeometry(); 514 break; 515 } 516 default: 517 break; 518 } 519 520 return QDialog::eventFilter (object, event); 521 } 522 523 void VBoxGlobalSettingsDlg::showEvent (QShowEvent *e) 524 { 525 QDialog::showEvent (e); 526 527 /* one may think that QWidget::polish() is the right place to do things 528 * below, but apparently, by the time when QWidget::polish() is called, 529 * the widget style & layout are not fully done, at least the minimum 530 * size hint is not properly calculated. Since this is sometimes necessary, 531 * we provide our own "polish" implementation. */ 532 533 if (polished) 534 return; 535 536 polished = true; 537 538 /* update geometry for the dynamically added usb-page to ensure proper 539 * sizeHint calculation by the Qt layout manager */ 540 wstUSBFilters->updateGeometry(); 541 /* let our toplevel widget calculate its sizeHint properly */ 542 QApplication::sendPostedEvents (0, 0); 543 544 /* resize to the miminum possible size */ 545 resize (minimumSize()); 546 547 VBoxGlobal::centerWidget (this, parentWidget()); 548 } 549 550 void VBoxGlobalSettingsDlg::listView_currentChanged (Q3ListViewItem *item) 551 { 552 Assert (item); 553 int id = item->text (1).toInt(); 554 Assert (id >= 0); 555 titleLabel->setText (::path (item)); 556 widgetStack->raiseWidget (id); 557 } 558 559 void VBoxGlobalSettingsDlg::enableOk (const QIWidgetValidator *wval) 560 { 561 Q_UNUSED (wval); 562 563 /* reset the warning text; interested parties will set it during 564 * validation */ 374 void VBoxGlobalSettingsDlg::getFrom (const CSystemProperties &aProps, 375 const VBoxGlobalSettings &aGs) 376 { 377 // /* Input Page */ 378 // hkeHostKey->setKey (gs.hostKey() ); 379 // chbAutoCapture->setChecked (gs.autoCapture()); 380 381 // /* USB Page */ 382 // #ifdef DEBUG_dmik 383 // CHost host = vboxGlobal().virtualBox().GetHost(); 384 // CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 385 // 386 // /* Show an error message (if there is any). 387 // * This message box may be suppressed if the user wishes so. */ 388 // if (!host.isReallyOk()) 389 // vboxProblem().cannotAccessUSB (host); 390 // 391 // if (coll.isNull()) 392 // { 393 // #endif 394 // /* disable the USB host filters category if the USB is 395 // * not available (i.e. in VirtualBox OSE) */ 396 // 397 // Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 398 // Assert (usbItem); 399 // usbItem->setVisible (false); 400 // 401 // /* disable validators if any */ 402 // pageUSB->setEnabled (false); 403 // 404 // #ifdef DEBUG_dmik 405 // } 406 // else 407 // { 408 // CHostUSBDeviceFilterEnumerator en = coll.Enumerate(); 409 // while (en.HasMore()) 410 // { 411 // CHostUSBDeviceFilter hostFilter = en.GetNext(); 412 // CUSBDeviceFilter filter = CUnknown (hostFilter); 413 // addUSBFilter (filter, false); 414 // } 415 // lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 416 // lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 417 // } 418 // #endif 419 420 // /* Language page */ 421 // QString langId = gs.languageId(); 422 // Q3ListViewItem *item = lvLanguages->findItem (langId, 1); 423 // if (!item) 424 // { 425 // /* add an item for an invalid language to represent it in the list */ 426 // item = new LanguageItem (lvLanguages, langId); 427 // lvLanguages->adjustColumn (0); 428 // } 429 // Assert (item); 430 // if (item) 431 // { 432 // lvLanguages->setCurrentItem (item); 433 // lvLanguages->setSelected (item, true); 434 // } 435 436 /* General Page */ 437 VBoxGlobalSettingsGeneral::getFrom (aProps, aGs, mPageGeneral); 438 439 /* Input Page */ 440 //VBoxGlobalSettingsInput::getFrom (aProps, aGs, mPageInput); 441 442 /* USB Page */ 443 //VBoxVMSettingsUSB::getFrom (aProps, aGs, mPageUSB, 444 // this, pagePath (mPageUSB)); 445 446 /* Language Page */ 447 //VBoxGlobalSettingsLanguage::getFrom (aProps, aGs, mPageLanguage); 448 } 449 450 /** 451 * Writes global settings to the given VBoxGlobalSettings instance 452 * and to the given CSystemProperties object. 453 */ 454 COMResult VBoxGlobalSettingsDlg::putBackTo (CSystemProperties &aProps, 455 VBoxGlobalSettings &aGs) 456 { 457 // /* Input Page */ 458 // gs.setHostKey (hkeHostKey->key()); 459 // gs.setAutoCapture (chbAutoCapture->isChecked()); 460 461 // /* USB Page */ 462 // /* 463 // * first, remove all old filters (only if the list is changed, 464 // * not only individual properties of filters) 465 // */ 466 // CHost host = vboxGlobal().virtualBox().GetHost(); 467 // if (mUSBFilterListModified) 468 // for (ulong cnt = host.GetUSBDeviceFilters().GetCount(); cnt; -- cnt) 469 // host.RemoveUSBDeviceFilter (0); 470 // 471 // /* then add all new filters */ 472 // for (Q3ListViewItem *item = lvUSBFilters->firstChild(); item; 473 // item = item->nextSibling()) 474 // { 475 // USBListItem *uli = static_cast<USBListItem*> (item); 476 // /* 477 // VBoxUSBFilterSettings *settings = 478 // static_cast <VBoxUSBFilterSettings *> 479 // (wstUSBFilters->widget (uli->mId)); 480 // Assert (settings); 481 // 482 // COMResult res = settings->putBackToFilter(); 483 // if (!res.isOk()) 484 // return; 485 // 486 // CUSBDeviceFilter filter = settings->filter(); 487 // filter.SetActive (uli->isOn()); 488 // 489 // CHostUSBDeviceFilter insertedFilter = CUnknown (filter); 490 // if (mUSBFilterListModified) 491 // host.InsertUSBDeviceFilter (host.GetUSBDeviceFilters().GetCount(), 492 // insertedFilter); 493 // */ 494 // } 495 // mUSBFilterListModified = false; 496 497 // /* Language Page */ 498 // Q3ListViewItem *selItem = lvLanguages->selectedItem(); 499 // Assert (selItem); 500 // if (mLanguageChanged && selItem) 501 // { 502 // gs.setLanguageId (selItem->text (1)); 503 // VBoxGlobal::loadLanguage (selItem->text (1)); 504 // } 505 506 /* General Page */ 507 VBoxGlobalSettingsGeneral::putBackTo (aProps, aGs); 508 509 /* Input Page */ 510 //VBoxGlobalSettingsInput::putBackTo (aProps, aGs); 511 512 /* USB Page */ 513 //VBoxVMSettingsUSB::putBackTo (aProps, aGs); 514 515 /* Language Page */ 516 //VBoxGlobalSettingsLanguage::putBackTo (aProps, aGs); 517 518 return COMResult(); 519 } 520 521 void VBoxGlobalSettingsDlg::retranslateUi() 522 { 523 /* Unfortunately retranslateUi clears the QTreeWidget to do the 524 * translation. So save the current selected index. */ 525 int ci = mPageStack->currentIndex(); 526 /* Translate uic generated strings */ 527 Ui::VBoxGlobalSettingsDlg::retranslateUi (this); 528 /* Set the old index */ 529 mTwSelector->setCurrentItem (mTwSelector->topLevelItem (ci)); 530 531 mWarnIconLabel->setWarningText (tr ("Invalid settings detected")); 532 mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog.")); 533 mButtonBox->button (QDialogButtonBox::Cancel)->setWhatsThis (tr ("Cancels changes and closes the dialog.")); 534 mButtonBox->button (QDialogButtonBox::Help)->setWhatsThis (tr ("Displays the dialog help.")); 535 536 /* Revalidate all pages to retranslate the warning messages also. */ 537 QList<QIWidgetValidator*> l = this->findChildren<QIWidgetValidator*>(); 538 foreach (QIWidgetValidator *wval, l) 539 if (!wval->isValid()) 540 revalidate (wval); 541 } 542 543 void VBoxGlobalSettingsDlg::enableOk (const QIWidgetValidator*) 544 { 565 545 setWarning (QString::null); 566 567 546 QString wvalWarning; 568 547 569 /* detect the overall validity */548 /* Detect the overall validity */ 570 549 bool newValid = true; 571 550 { 572 Q ObjectList l = this->queryList ("QIWidgetValidator");573 foreach (Q Object *obj, l)551 QList<QIWidgetValidator*> l = this->findChildren<QIWidgetValidator*>(); 552 foreach (QIWidgetValidator *wval, l) 574 553 { 575 QIWidgetValidator *wval = (QIWidgetValidator *) obj;576 554 newValid = wval->isValid(); 577 555 if (!newValid) … … 583 561 } 584 562 585 if ( warningString.isNull() && !wvalWarning.isNull())563 if (mWarnString.isNull() && !wvalWarning.isNull()) 586 564 { 587 /* try to set the generic error message when invalid but no specific565 /* Try to set the generic error message when invalid but no specific 588 566 * message is provided */ 589 567 setWarning (wvalWarning); 590 568 } 591 569 592 if ( valid != newValid)570 if (mValid != newValid) 593 571 { 594 valid = newValid; 595 buttonOk->setEnabled (valid); 596 /// @todo in VBoxVMSettingsDlg.ui.h, this is absent at all. Is it 597 /// really what we want? 598 #if 0 599 if (valid) 600 warningSpacer->changeSize (0, 0, QSizePolicy::Expanding); 601 else 602 warningSpacer->changeSize (0, 0); 603 #endif 604 warningLabel->setHidden (valid); 605 warningPixmap->setHidden (valid); 572 mValid = newValid; 573 mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (mValid); 574 mWarnIconLabel->setVisible (!mValid); 606 575 } 607 576 } 608 577 609 void VBoxGlobalSettingsDlg::revalidate (QIWidgetValidator * /*wval*/) 610 { 611 /* do individual validations for pages */ 612 613 /* currently nothing */ 614 } 615 616 /** 617 * Reads global settings from the given VBoxGlobalSettings instance 618 * and from the given CSystemProperties object. 619 */ 620 void VBoxGlobalSettingsDlg::getFrom (const CSystemProperties &props, 621 const VBoxGlobalSettings &gs) 622 { 623 /* default folders */ 624 625 leVDIFolder->setText (props.GetDefaultVDIFolder()); 626 leMachineFolder->setText (props.GetDefaultMachineFolder()); 627 628 /* vrdp lib path */ 629 leVRDPLib->setText (props.GetRemoteDisplayAuthLibrary()); 630 631 /* VT-x/AMD-V */ 632 chbVTX->setChecked (props.GetHWVirtExEnabled()); 633 634 /* proprietary GUI settings */ 635 636 hkeHostKey->setKey (gs.hostKey() ); 637 chbAutoCapture->setChecked (gs.autoCapture()); 638 639 /* usb filters page */ 640 641 #ifdef DEBUG_dmik 642 CHost host = vboxGlobal().virtualBox().GetHost(); 643 CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 644 645 /* Show an error message (if there is any). 646 * This message box may be suppressed if the user wishes so. */ 647 if (!host.isReallyOk()) 648 vboxProblem().cannotAccessUSB (host); 649 650 if (coll.isNull()) 578 void VBoxGlobalSettingsDlg::revalidate (QIWidgetValidator*) 579 { 580 /* Do individual validations for pages */ 581 } 582 583 void VBoxGlobalSettingsDlg::settingsGroupChanged (QTreeWidgetItem *aItem, 584 QTreeWidgetItem *) 585 { 586 if (aItem) 651 587 { 652 #endif 653 /* disable the USB host filters category if the USB is 654 * not available (i.e. in VirtualBox OSE) */ 655 656 Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 657 Assert (usbItem); 658 usbItem->setVisible (false); 659 660 /* disable validators if any */ 661 pageUSB->setEnabled (false); 662 663 #ifdef DEBUG_dmik 588 int id = aItem->text (1).toInt(); 589 Assert (id >= 0); 590 mLbTitle->setText (::path (aItem)); 591 mPageStack->setCurrentIndex (id); 592 } 593 } 594 595 void VBoxGlobalSettingsDlg::updateWhatsThis (bool aGotFocus /* = false */) 596 { 597 QString text; 598 599 QWidget *widget = 0; 600 if (!aGotFocus) 601 { 602 if (mWhatsThisCandidate && mWhatsThisCandidate != this) 603 widget = mWhatsThisCandidate; 664 604 } 665 605 else 666 606 { 667 CHostUSBDeviceFilterEnumerator en = coll.Enumerate(); 668 while (en.HasMore()) 669 { 670 CHostUSBDeviceFilter hostFilter = en.GetNext(); 671 CUSBDeviceFilter filter = CUnknown (hostFilter); 672 addUSBFilter (filter, false); 673 } 674 lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 675 lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 607 widget = QApplication::focusWidget(); 676 608 } 677 #endif 678 679 /* language properties */ 680 681 QString langId = gs.languageId(); 682 Q3ListViewItem *item = lvLanguages->findItem (langId, 1); 683 if (!item) 684 { 685 /* add an item for an invalid language to represent it in the list */ 686 item = new LanguageItem (lvLanguages, langId); 687 lvLanguages->adjustColumn (0); 688 } 689 Assert (item); 690 if (item) 691 { 692 lvLanguages->setCurrentItem (item); 693 lvLanguages->setSelected (item, true); 694 } 695 } 696 697 /** 698 * Writes global settings to the given VBoxGlobalSettings instance 699 * and to the given CSystemProperties object. 700 */ 701 void VBoxGlobalSettingsDlg::putBackTo (CSystemProperties &props, 702 VBoxGlobalSettings &gs) 703 { 704 /* default folders */ 705 706 if (leVDIFolder->isModified()) 707 props.SetDefaultVDIFolder (leVDIFolder->text()); 708 if (props.isOk() && leMachineFolder->isModified()) 709 props.SetDefaultMachineFolder (leMachineFolder->text()); 710 711 /* vrdp lib path */ 712 if (leVRDPLib->isModified()) 713 props.SetRemoteDisplayAuthLibrary (leVRDPLib->text()); 714 715 /* VT-x/AMD-V */ 716 props.SetHWVirtExEnabled (chbVTX->isChecked()); 717 718 if (!props.isOk()) 719 return; 720 721 /* proprietary GUI settings */ 722 723 gs.setHostKey (hkeHostKey->key()); 724 gs.setAutoCapture (chbAutoCapture->isChecked()); 725 726 /* usb filter page */ 727 728 /* 729 * first, remove all old filters (only if the list is changed, 730 * not only individual properties of filters) 731 */ 732 CHost host = vboxGlobal().virtualBox().GetHost(); 733 if (mUSBFilterListModified) 734 for (ulong cnt = host.GetUSBDeviceFilters().GetCount(); cnt; -- cnt) 735 host.RemoveUSBDeviceFilter (0); 736 737 /* then add all new filters */ 738 for (Q3ListViewItem *item = lvUSBFilters->firstChild(); item; 739 item = item->nextSibling()) 740 { 741 USBListItem *uli = static_cast <USBListItem *> (item); 742 //#warning port me 743 /* 744 VBoxUSBFilterSettings *settings = 745 static_cast <VBoxUSBFilterSettings *> 746 (wstUSBFilters->widget (uli->mId)); 747 Assert (settings); 748 749 COMResult res = settings->putBackToFilter(); 750 if (!res.isOk()) 751 return; 752 753 CUSBDeviceFilter filter = settings->filter(); 754 filter.SetActive (uli->isOn()); 755 756 CHostUSBDeviceFilter insertedFilter = CUnknown (filter); 757 if (mUSBFilterListModified) 758 host.InsertUSBDeviceFilter (host.GetUSBDeviceFilters().GetCount(), 759 insertedFilter); 760 */ 761 } 762 mUSBFilterListModified = false; 763 764 /* language properties */ 765 766 Q3ListViewItem *selItem = lvLanguages->selectedItem(); 767 Assert (selItem); 768 if (mLanguageChanged && selItem) 769 { 770 gs.setLanguageId (selItem->text (1)); 771 //#warning "port me: check if this is longer necessary (See the ChangeGUILanguageEvent)" 772 VBoxGlobal::loadLanguage (selItem->text (1)); 773 } 774 } 775 776 void VBoxGlobalSettingsDlg::updateWhatsThis (bool gotFocus /* = false */) 777 { 778 QString text; 779 780 QWidget *widget = NULL; 781 if (!gotFocus) 782 { 783 if (whatsThisCandidate != NULL && whatsThisCandidate != this) 784 widget = whatsThisCandidate; 785 } 786 else 787 { 788 //#warning port me 789 // widget = focusData()->focusWidget(); 790 } 791 /* if the given widget lacks the whats'this text, look at its parent */ 609 /* If the given widget lacks the whats'this text, look at its parent */ 792 610 while (widget && widget != this) 793 611 { 794 //#warning port me 795 // text = Q3WhatsThis::textFor (widget); 612 text = widget->whatsThis(); 796 613 if (!text.isEmpty()) 797 614 break; … … 799 616 } 800 617 801 if (text.isEmpty() && !warningString.isEmpty()) 802 text = warningString; 803 //#warning port me 804 // if (text.isEmpty()) 805 // text = Q3WhatsThis::textFor (this); 806 807 whatsThisLabel->setText (text); 808 } 809 810 void VBoxGlobalSettingsDlg::setWarning (const QString &warning) 811 { 812 warningString = warning; 813 if (!warning.isEmpty()) 814 warningString = QString ("<font color=red>%1</font>").arg (warning); 815 816 if (!warningString.isEmpty()) 817 whatsThisLabel->setText (warningString); 618 if (text.isEmpty() && !mWarnString.isEmpty()) 619 text = mWarnString; 620 if (text.isEmpty()) 621 text = whatsThis(); 622 623 mLbWhatsThis->setText (text); 624 } 625 626 void VBoxGlobalSettingsDlg::whatsThisCandidateDestroyed (QObject *aObj /*= NULL*/) 627 { 628 /* sanity */ 629 Assert (mWhatsThisCandidate == aObj); 630 631 if (mWhatsThisCandidate == aObj) 632 mWhatsThisCandidate = NULL; 633 } 634 635 bool VBoxGlobalSettingsDlg::eventFilter (QObject *aObject, QEvent *aEvent) 636 { 637 if (!aObject->isWidgetType()) 638 return QIMainDialog::eventFilter (aObject, aEvent); 639 640 QWidget *widget = static_cast<QWidget*> (aObject); 641 if (widget->topLevelWidget() != this) 642 return QIMainDialog::eventFilter (aObject, aEvent); 643 644 switch (aEvent->type()) 645 { 646 case QEvent::Enter: 647 case QEvent::Leave: 648 { 649 if (aEvent->type() == QEvent::Enter) 650 { 651 /* What if Qt sends Enter w/o Leave... */ 652 if (mWhatsThisCandidate) 653 disconnect (mWhatsThisCandidate, SIGNAL (destroyed (QObject *)), 654 this, SLOT (whatsThisCandidateDestroyed (QObject *))); 655 656 mWhatsThisCandidate = widget; 657 /* make sure we don't reference a deleted object after the 658 * timer is shot */ 659 connect (mWhatsThisCandidate, SIGNAL (destroyed (QObject *)), 660 this, SLOT (whatsThisCandidateDestroyed (QObject *))); 661 } 662 else 663 { 664 /* cleanup */ 665 if (mWhatsThisCandidate) 666 disconnect (mWhatsThisCandidate, SIGNAL (destroyed (QObject *)), 667 this, SLOT (whatsThisCandidateDestroyed (QObject *))); 668 mWhatsThisCandidate = NULL; 669 } 670 671 mWhatsThisTimer->start (100); 672 break; 673 } 674 case QEvent::FocusIn: 675 { 676 updateWhatsThis (true /* aGotFocus */); 677 break; 678 } 679 default: 680 break; 681 } 682 683 return QIMainDialog::eventFilter (aObject, aEvent); 684 } 685 686 void VBoxGlobalSettingsDlg::showEvent (QShowEvent *aEvent) 687 { 688 QIMainDialog::showEvent (aEvent); 689 690 /* One may think that QWidget::polish() is the right place to do things 691 * below, but apparently, by the time when QWidget::polish() is called, 692 * the widget style & layout are not fully done, at least the minimum 693 * size hint is not properly calculated. Since this is sometimes necessary, 694 * we provide our own "polish" implementation. */ 695 696 if (mPolished) 697 return; 698 699 mPolished = true; 700 701 /* Resize to the minimum possible size */ 702 resize (minimumSize()); 703 704 VBoxGlobal::centerWidget (this, parentWidget()); 705 } 706 707 /** 708 * Returns a path to the given page of this settings dialog. See ::path() for 709 * details. 710 */ 711 QString VBoxGlobalSettingsDlg::pagePath (QWidget *aPage) 712 { 713 QTreeWidgetItem *li = 714 findItem (mTwSelector, 715 QString ("%1") 716 .arg (mPageStack->indexOf (aPage), 2, 10, QChar ('0')), 717 1); 718 return ::path (li); 719 } 720 721 void VBoxGlobalSettingsDlg::setWarning (const QString &aWarning) 722 { 723 mWarnString = aWarning; 724 if (!aWarning.isEmpty()) 725 mWarnString = QString ("<font color=red>%1</font>").arg (aWarning); 726 727 if (!mWarnString.isEmpty()) 728 mLbWhatsThis->setText (mWarnString); 818 729 else 819 730 updateWhatsThis (true); 820 731 } 821 732 822 void VBoxGlobalSettingsDlg::tbResetFolder_clicked() 823 { 824 QToolButton *tb = qobject_cast <QToolButton *> (sender()); 825 Assert (tb); 826 827 QLineEdit *le = 0; 828 if (tb == tbResetVDIFolder) le = leVDIFolder; 829 else if (tb == tbResetMachineFolder) le = leMachineFolder; 830 else if (tb == tbResetVRDPLib) le = leVRDPLib; 831 Assert (le); 832 833 /* 834 * do this instead of le->setText (QString::null) to cause 835 * isModified() return true 836 */ 837 le->selectAll(); 838 le->del(); 839 } 840 841 void VBoxGlobalSettingsDlg::tbSelectFolder_clicked() 842 { 843 QToolButton *tb = qobject_cast <QToolButton *> (sender()); 844 Assert (tb); 845 846 QLineEdit *le = 0; 847 if (tb == tbSelectVDIFolder) le = leVDIFolder; 848 else if (tb == tbSelectMachineFolder) le = leMachineFolder; 849 else if (tb == tbSelectVRDPLib) le = leVRDPLib; 850 Assert (le); 851 852 QString initDir = VBoxGlobal::getFirstExistingDir (le->text()); 853 if (initDir.isNull()) 854 initDir = vboxGlobal().virtualBox().GetHomeFolder(); 855 856 QString path = le == leVRDPLib ? 857 VBoxGlobal::getOpenFileName (initDir, QString::null, this, QString::null) : 858 VBoxGlobal::getExistingDirectory (initDir, this); 859 if (path.isNull()) 860 return; 861 862 path = QDir::convertSeparators (path); 863 /* remove trailing slash if any */ 864 path.remove (QRegExp ("[\\\\/]$")); 865 866 /* 867 * do this instead of le->setText (path) to cause 868 * isModified() return true 869 */ 870 le->selectAll(); 871 le->insert (path); 872 } 873 874 // USB Filter stuff 875 //////////////////////////////////////////////////////////////////////////////// 876 877 void VBoxGlobalSettingsDlg::addUSBFilter (const CUSBDeviceFilter &aFilter, 878 bool aIsNew) 879 { 880 /* 881 Q3ListViewItem *currentItem = aIsNew 882 ? lvUSBFilters->currentItem() 883 : lvUSBFilters->lastItem(); 884 885 VBoxUSBFilterSettings *settings = new VBoxUSBFilterSettings (wstUSBFilters); 886 settings->setup (VBoxUSBFilterSettings::HostType); 887 settings->getFromFilter (aFilter); 888 889 USBListItem *item = new USBListItem (lvUSBFilters, currentItem); 890 item->setOn (aFilter.GetActive()); 891 item->setText (lvUSBFilters_Name, aFilter.GetName()); 892 893 item->mId = wstUSBFilters->addWidget (settings); 894 895 // fix the tab order so that main dialog's buttons are always the last 896 setTabOrder (settings->focusProxy(), buttonHelp); 897 setTabOrder (buttonHelp, buttonOk); 898 setTabOrder (buttonOk, buttonCancel); 899 900 if (aIsNew) 901 { 902 lvUSBFilters->setSelected (item, true); 903 lvUSBFilters_currentChanged (item); 904 settings->leUSBFilterName->setFocus(); 905 } 906 907 connect (settings->leUSBFilterName, SIGNAL (textChanged (const QString &)), 908 this, SLOT (lvUSBFilters_setCurrentText (const QString &))); 909 910 // setup validation 911 912 QIWidgetValidator *wval = 913 new QIWidgetValidator (pagePath (pageUSB), settings, settings); 914 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), 915 this, SLOT (enableOk (const QIWidgetValidator *))); 916 917 wval->revalidate(); 918 */ 919 } 920 921 void VBoxGlobalSettingsDlg::lvUSBFilters_currentChanged (Q3ListViewItem *item) 922 { 923 if (item && lvUSBFilters->selectedItem() != item) 924 lvUSBFilters->setSelected (item, true); 925 926 tbRemoveUSBFilter->setEnabled (!!item); 927 928 tbUSBFilterUp->setEnabled (!!item && item->itemAbove()); 929 tbUSBFilterDown->setEnabled (!!item && item->itemBelow()); 930 931 if (item) 932 { 933 USBListItem *uli = static_cast <USBListItem *> (item); 934 wstUSBFilters->raiseWidget (uli->mId); 935 } 936 else 937 { 938 /* raise the disabled widget */ 939 wstUSBFilters->raiseWidget (0); 940 } 941 } 942 943 void VBoxGlobalSettingsDlg::lvUSBFilters_setCurrentText (const QString &aText) 944 { 945 Q3ListViewItem *item = lvUSBFilters->currentItem(); 946 Assert (item); 947 948 item->setText (lvUSBFilters_Name, aText); 949 } 950 951 void VBoxGlobalSettingsDlg::tbAddUSBFilter_clicked() 952 { 953 /* search for the max available filter index */ 954 int maxFilterIndex = 0; 955 QString usbFilterName = tr ("New Filter %1", "usb"); 956 QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$")); 957 Q3ListViewItemIterator iterator (lvUSBFilters); 958 while (*iterator) 959 { 960 QString filterName = (*iterator)->text (lvUSBFilters_Name); 961 int pos = regExp.search (filterName); 962 if (pos != -1) 963 maxFilterIndex = regExp.cap (1).toInt() > maxFilterIndex ? 964 regExp.cap (1).toInt() : maxFilterIndex; 965 ++ iterator; 966 } 967 968 /* create a new usb filter */ 969 CHost host = vboxGlobal().virtualBox().GetHost(); 970 CHostUSBDeviceFilter hostFilter = host 971 .CreateUSBDeviceFilter (usbFilterName.arg (maxFilterIndex + 1)); 972 hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 973 974 CUSBDeviceFilter filter = CUnknown (hostFilter); 975 filter.SetActive (true); 976 addUSBFilter (filter, true); 977 978 mUSBFilterListModified = true; 979 } 980 981 void VBoxGlobalSettingsDlg::tbAddUSBFilterFrom_clicked() 982 { 983 usbDevicesMenu->exec (QCursor::pos()); 984 } 985 986 void VBoxGlobalSettingsDlg::menuAddUSBFilterFrom_activated (QAction *aAction) 987 { 988 CUSBDevice usb = usbDevicesMenu->getUSB (aAction); 989 990 // if null then some other item but a USB device is selected 991 if (usb.isNull()) 992 return; 993 994 CHost host = vboxGlobal().virtualBox().GetHost(); 995 CHostUSBDeviceFilter hostFilter = host 996 .CreateUSBDeviceFilter (vboxGlobal().details (usb)); 997 hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 998 999 CUSBDeviceFilter filter = CUnknown (hostFilter); 1000 filter.SetVendorId (QString().sprintf ("%04hX", usb.GetVendorId())); 1001 filter.SetProductId (QString().sprintf ("%04hX", usb.GetProductId())); 1002 filter.SetRevision (QString().sprintf ("%04hX", usb.GetRevision())); 1003 /* The port property depends on the host computer rather than on the USB 1004 * device itself; for this reason only a few people will want to use it in 1005 * the filter since the same device plugged into a different socket will 1006 * not match the filter in this case. */ 1007 #if 0 1008 /// @todo set it anyway if Alt is currently pressed 1009 filter.SetPort (QString().sprintf ("%04hX", usb.GetPort())); 1010 #endif 1011 filter.SetManufacturer (usb.GetManufacturer()); 1012 filter.SetProduct (usb.GetProduct()); 1013 filter.SetSerialNumber (usb.GetSerialNumber()); 1014 filter.SetRemote (usb.GetRemote() ? "yes" : "no"); 1015 1016 filter.SetActive (true); 1017 addUSBFilter (filter, true); 1018 1019 mUSBFilterListModified = true; 1020 } 1021 1022 void VBoxGlobalSettingsDlg::tbRemoveUSBFilter_clicked() 1023 { 1024 Q3ListViewItem *item = lvUSBFilters->currentItem(); 1025 Assert (item); 1026 1027 USBListItem *uli = static_cast <USBListItem *> (item); 1028 QWidget *settings = wstUSBFilters->widget (uli->mId); 1029 Assert (settings); 1030 wstUSBFilters->removeWidget (settings); 1031 delete settings; 1032 1033 delete item; 1034 1035 lvUSBFilters->setSelected (lvUSBFilters->currentItem(), true); 1036 mUSBFilterListModified = true; 1037 } 1038 1039 void VBoxGlobalSettingsDlg::tbUSBFilterUp_clicked() 1040 { 1041 Q3ListViewItem *item = lvUSBFilters->currentItem(); 1042 Assert (item); 1043 1044 Q3ListViewItem *itemAbove = item->itemAbove(); 1045 Assert (itemAbove); 1046 itemAbove = itemAbove->itemAbove(); 1047 1048 if (!itemAbove) 1049 item->itemAbove()->moveItem (item); 1050 else 1051 item->moveItem (itemAbove); 1052 1053 lvUSBFilters_currentChanged (item); 1054 mUSBFilterListModified = true; 1055 } 1056 1057 void VBoxGlobalSettingsDlg::tbUSBFilterDown_clicked() 1058 { 1059 Q3ListViewItem *item = lvUSBFilters->currentItem(); 1060 Assert (item); 1061 1062 Q3ListViewItem *itemBelow = item->itemBelow(); 1063 Assert (itemBelow); 1064 1065 item->moveItem (itemBelow); 1066 1067 lvUSBFilters_currentChanged (item); 1068 mUSBFilterListModified = true; 1069 } 1070 1071 void VBoxGlobalSettingsDlg::lvLanguages_currentChanged (Q3ListViewItem *aItem) 1072 { 1073 Assert (aItem); 1074 if (!aItem) return; 1075 1076 /* disable labels for the Default language item */ 1077 bool enabled = !aItem->text (1).isNull(); 1078 1079 tlLangName->setEnabled (enabled); 1080 tlAuthorName->setEnabled (enabled); 1081 tlLangData->setText (aItem->text (2)); 1082 tlAuthorData->setText (aItem->text (3)); 1083 1084 mLanguageChanged = true; 1085 } 1086 1087 void VBoxGlobalSettingsDlg::fixLanguageChange() 1088 { 1089 /* fix for usb page */ 1090 1091 #ifdef DEBUG_dmik 1092 CHost host = vboxGlobal().virtualBox().GetHost(); 1093 CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 1094 if (coll.isNull()) 1095 { 1096 #endif 1097 /* disable the USB host filters category if the USB is 1098 * not available (i.e. in VirtualBox OSE) */ 1099 1100 Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 1101 Assert (usbItem); 1102 usbItem->setVisible (false); 1103 1104 /* disable validators if any */ 1105 pageUSB->setEnabled (false); 1106 1107 #ifdef DEBUG_dmik 1108 } 1109 #endif 1110 } 733 // /* USB Page */ 734 // void VBoxGlobalSettingsDlg::addUSBFilter (const CUSBDeviceFilter &aFilter, 735 // bool aIsNew) 736 // { 737 // /* 738 // Q3ListViewItem *currentItem = aIsNew 739 // ? lvUSBFilters->currentItem() 740 // : lvUSBFilters->lastItem(); 741 // 742 // VBoxUSBFilterSettings *settings = new VBoxUSBFilterSettings (wstUSBFilters); 743 // settings->setup (VBoxUSBFilterSettings::HostType); 744 // settings->getFromFilter (aFilter); 745 // 746 // USBListItem *item = new USBListItem (lvUSBFilters, currentItem); 747 // item->setOn (aFilter.GetActive()); 748 // item->setText (lvUSBFilters_Name, aFilter.GetName()); 749 // 750 // item->mId = wstUSBFilters->addWidget (settings); 751 // 752 // // fix the tab order so that main dialog's buttons are always the last 753 // setTabOrder (settings->focusProxy(), buttonHelp); 754 // setTabOrder (buttonHelp, buttonOk); 755 // setTabOrder (buttonOk, buttonCancel); 756 // 757 // if (aIsNew) 758 // { 759 // lvUSBFilters->setSelected (item, true); 760 // lvUSBFilters_currentChanged (item); 761 // settings->leUSBFilterName->setFocus(); 762 // } 763 // 764 // connect (settings->leUSBFilterName, SIGNAL (textChanged (const QString &)), 765 // this, SLOT (lvUSBFilters_setCurrentText (const QString &))); 766 // 767 // // setup validation 768 // 769 // QIWidgetValidator *wval = 770 // new QIWidgetValidator (pagePath (pageUSB), settings, settings); 771 // connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), 772 // this, SLOT (enableOk (const QIWidgetValidator *))); 773 // 774 // wval->revalidate(); 775 // */ 776 // } 777 // 778 // void VBoxGlobalSettingsDlg::lvUSBFilters_currentChanged (Q3ListViewItem *item) 779 // { 780 // if (item && lvUSBFilters->selectedItem() != item) 781 // lvUSBFilters->setSelected (item, true); 782 // 783 // tbRemoveUSBFilter->setEnabled (!!item); 784 // 785 // tbUSBFilterUp->setEnabled (!!item && item->itemAbove()); 786 // tbUSBFilterDown->setEnabled (!!item && item->itemBelow()); 787 // 788 // if (item) 789 // { 790 // USBListItem *uli = static_cast <USBListItem *> (item); 791 // wstUSBFilters->raiseWidget (uli->mId); 792 // } 793 // else 794 // { 795 // /* raise the disabled widget */ 796 // wstUSBFilters->raiseWidget (0); 797 // } 798 // } 799 // 800 // void VBoxGlobalSettingsDlg::lvUSBFilters_setCurrentText (const QString &aText) 801 // { 802 // Q3ListViewItem *item = lvUSBFilters->currentItem(); 803 // Assert (item); 804 // 805 // item->setText (lvUSBFilters_Name, aText); 806 // } 807 // 808 // void VBoxGlobalSettingsDlg::tbAddUSBFilter_clicked() 809 // { 810 // /* search for the max available filter index */ 811 // int maxFilterIndex = 0; 812 // QString usbFilterName = tr ("New Filter %1", "usb"); 813 // QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$")); 814 // Q3ListViewItemIterator iterator (lvUSBFilters); 815 // while (*iterator) 816 // { 817 // QString filterName = (*iterator)->text (lvUSBFilters_Name); 818 // int pos = regExp.search (filterName); 819 // if (pos != -1) 820 // maxFilterIndex = regExp.cap (1).toInt() > maxFilterIndex ? 821 // regExp.cap (1).toInt() : maxFilterIndex; 822 // ++ iterator; 823 // } 824 // 825 // /* create a new usb filter */ 826 // CHost host = vboxGlobal().virtualBox().GetHost(); 827 // CHostUSBDeviceFilter hostFilter = host 828 // .CreateUSBDeviceFilter (usbFilterName.arg (maxFilterIndex + 1)); 829 // hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 830 // 831 // CUSBDeviceFilter filter = CUnknown (hostFilter); 832 // filter.SetActive (true); 833 // addUSBFilter (filter, true); 834 // 835 // mUSBFilterListModified = true; 836 // } 837 // 838 // void VBoxGlobalSettingsDlg::tbAddUSBFilterFrom_clicked() 839 // { 840 // usbDevicesMenu->exec (QCursor::pos()); 841 // } 842 // 843 // void VBoxGlobalSettingsDlg::menuAddUSBFilterFrom_activated (QAction *aAction) 844 // { 845 // CUSBDevice usb = usbDevicesMenu->getUSB (aAction); 846 // 847 // // if null then some other item but a USB device is selected 848 // if (usb.isNull()) 849 // return; 850 // 851 // CHost host = vboxGlobal().virtualBox().GetHost(); 852 // CHostUSBDeviceFilter hostFilter = host 853 // .CreateUSBDeviceFilter (vboxGlobal().details (usb)); 854 // hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 855 // 856 // CUSBDeviceFilter filter = CUnknown (hostFilter); 857 // filter.SetVendorId (QString().sprintf ("%04hX", usb.GetVendorId())); 858 // filter.SetProductId (QString().sprintf ("%04hX", usb.GetProductId())); 859 // filter.SetRevision (QString().sprintf ("%04hX", usb.GetRevision())); 860 // /* The port property depends on the host computer rather than on the USB 861 // * device itself; for this reason only a few people will want to use it in 862 // * the filter since the same device plugged into a different socket will 863 // * not match the filter in this case. */ 864 // #if 0 865 // /// @todo set it anyway if Alt is currently pressed 866 // filter.SetPort (QString().sprintf ("%04hX", usb.GetPort())); 867 // #endif 868 // filter.SetManufacturer (usb.GetManufacturer()); 869 // filter.SetProduct (usb.GetProduct()); 870 // filter.SetSerialNumber (usb.GetSerialNumber()); 871 // filter.SetRemote (usb.GetRemote() ? "yes" : "no"); 872 // 873 // filter.SetActive (true); 874 // addUSBFilter (filter, true); 875 // 876 // mUSBFilterListModified = true; 877 // } 878 // 879 // void VBoxGlobalSettingsDlg::tbRemoveUSBFilter_clicked() 880 // { 881 // Q3ListViewItem *item = lvUSBFilters->currentItem(); 882 // Assert (item); 883 // 884 // USBListItem *uli = static_cast <USBListItem *> (item); 885 // QWidget *settings = wstUSBFilters->widget (uli->mId); 886 // Assert (settings); 887 // wstUSBFilters->removeWidget (settings); 888 // delete settings; 889 // 890 // delete item; 891 // 892 // lvUSBFilters->setSelected (lvUSBFilters->currentItem(), true); 893 // mUSBFilterListModified = true; 894 // } 895 // 896 // void VBoxGlobalSettingsDlg::tbUSBFilterUp_clicked() 897 // { 898 // Q3ListViewItem *item = lvUSBFilters->currentItem(); 899 // Assert (item); 900 // 901 // Q3ListViewItem *itemAbove = item->itemAbove(); 902 // Assert (itemAbove); 903 // itemAbove = itemAbove->itemAbove(); 904 // 905 // if (!itemAbove) 906 // item->itemAbove()->moveItem (item); 907 // else 908 // item->moveItem (itemAbove); 909 // 910 // lvUSBFilters_currentChanged (item); 911 // mUSBFilterListModified = true; 912 // } 913 // 914 // void VBoxGlobalSettingsDlg::tbUSBFilterDown_clicked() 915 // { 916 // Q3ListViewItem *item = lvUSBFilters->currentItem(); 917 // Assert (item); 918 // 919 // Q3ListViewItem *itemBelow = item->itemBelow(); 920 // Assert (itemBelow); 921 // 922 // item->moveItem (itemBelow); 923 // 924 // lvUSBFilters_currentChanged (item); 925 // mUSBFilterListModified = true; 926 // } 927 928 // /* Language Page */ 929 // void VBoxGlobalSettingsDlg::lvLanguages_currentChanged (Q3ListViewItem *aItem) 930 // { 931 // Assert (aItem); 932 // if (!aItem) return; 933 // 934 // /* disable labels for the Default language item */ 935 // bool enabled = !aItem->text (1).isNull(); 936 // 937 // tlLangName->setEnabled (enabled); 938 // tlAuthorName->setEnabled (enabled); 939 // tlLangData->setText (aItem->text (2)); 940 // tlAuthorData->setText (aItem->text (3)); 941 // 942 // mLanguageChanged = true; 943 // } 944 // 945 // void VBoxGlobalSettingsDlg::fixLanguageChange() 946 // { 947 // /* fix for usb page */ 948 // 949 // #ifdef DEBUG_dmik 950 // CHost host = vboxGlobal().virtualBox().GetHost(); 951 // CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 952 // if (coll.isNull()) 953 // { 954 // #endif 955 // /* disable the USB host filters category if the USB is 956 // * not available (i.e. in VirtualBox OSE) */ 957 // 958 // Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 959 // Assert (usbItem); 960 // usbItem->setVisible (false); 961 // 962 // /* disable validators if any */ 963 // pageUSB->setEnabled (false); 964 // 965 // #ifdef DEBUG_dmik 966 // } 967 // #endif 968 // } 969 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r9729 r9783 46 46 #include <QStackedWidget> 47 47 #include <QDesktopWidget> 48 #include <QToolButton> 48 49 49 50 // VBoxVMDetailsView class … … 741 742 CSystemProperties props = vboxGlobal().virtualBox().GetSystemProperties(); 742 743 743 VBoxGlobalSettingsDlg dlg (this , "VBoxGlobalSettingsDlg");744 VBoxGlobalSettingsDlg dlg (this); 744 745 dlg.getFrom (props, settings); 745 746 -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxGlobalSettingsDlg.ui
r9495 r9783 1 <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> 2 <class>VBoxGlobalSettingsDlg</class> 3 <comment> 4 :mode=html:tabSize=4:indentSize=4:noTabs=true: 5 :folding=explicit:collapseFolds=1: 1 <ui version="4.0" > 2 <comment> 3 VBox frontends: Qt4 GUI ("VirtualBox"): 6 4 7 Copyright (C) 2006-2007Sun Microsystems, Inc.5 Copyright (C) 2008 Sun Microsystems, Inc. 8 6 9 10 11 12 13 14 15 7 This file is part of VirtualBox Open Source Edition (OSE), as 8 available from http://www.virtualbox.org. This file is free software; 9 you can redistribute it and/or modify it under the terms of the GNU 10 General Public License (GPL) as published by the Free Software 11 Foundation, in version 2 as it comes in the "COPYING" file of the 12 VirtualBox OSE distribution. VirtualBox OSE is distributed in the 13 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 14 17 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 18 Clara, CA 95054 USA or visit http://www.sun.com if you need 19 additional information or have any questions. 20 </comment> 21 <widget class="QDialog"> 22 <property name="name"> 23 <cstring>VBoxGlobalSettingsDlg</cstring> 15 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 16 Clara, CA 95054 USA or visit http://www.sun.com if you need 17 additional information or have any questions. 18 </comment> 19 <class>VBoxGlobalSettingsDlg</class> 20 <widget class="QMainWindow" name="VBoxGlobalSettingsDlg" > 21 <property name="geometry" > 22 <rect> 23 <x>0</x> 24 <y>0</y> 25 <width>526</width> 26 <height>424</height> 27 </rect> 28 </property> 29 <property name="windowTitle" > 30 <string>VirtualBox Preferences</string> 31 </property> 32 <widget class="QWidget" name="centralwidget" > 33 <layout class="QGridLayout" > 34 <property name="horizontalSpacing" > 35 <number>9</number> 24 36 </property> 25 <property name="geometry"> 26 <rect> 27 <x>0</x> 28 <y>0</y> 29 <width>580</width> 30 <height>370</height> 31 </rect> 37 <property name="verticalSpacing" > 38 <number>9</number> 32 39 </property> 33 <property name="caption"> 34 <string>VirtualBox Preferences</string> 35 </property> 36 <property name="sizeGripEnabled"> 37 <bool>true</bool> 38 </property> 39 <property name="whatsThis" stdset="0"> 40 <string><i>Select a settings category from the list on the left side and move the mouse over a settings item to get more information<i>.</string> 41 </property> 42 <grid> 43 <property name="name"> 44 <cstring>unnamed</cstring> 45 </property> 46 <property name="margin"> 47 <number>11</number> 48 </property> 49 <property name="spacing"> 50 <number>10</number> 51 </property> 52 <property name="resizeMode"> 53 <enum>Minimum</enum> 54 </property> 55 <widget class="QListView" row="0" column="0" rowspan="3" colspan="1"> 56 <column> 57 <property name="text"> 58 <string>Category</string> 59 </property> 60 <property name="clickable"> 61 <bool>false</bool> 62 </property> 63 <property name="resizable"> 64 <bool>true</bool> 65 </property> 66 </column> 67 <column> 68 <property name="text"> 69 <string>[id]</string> 70 </property> 71 <property name="clickable"> 72 <bool>false</bool> 73 </property> 74 <property name="resizable"> 75 <bool>false</bool> 76 </property> 77 </column> 78 <column> 79 <property name="text"> 80 <string>[link]</string> 81 </property> 82 <property name="clickable"> 83 <bool>false</bool> 84 </property> 85 <property name="resizable"> 86 <bool>false</bool> 87 </property> 88 </column> 89 <item> 90 <property name="text"> 91 <string> General </string> 92 </property> 93 <property name="text"> 94 <string>0</string> 95 </property> 96 <property name="text"> 97 <string>#general</string> 98 </property> 99 <property name="pixmap"> 100 <pixmap>:/machine_16px.png</pixmap> 101 </property> 102 <property name="pixmap"> 103 <pixmap></pixmap> 104 </property> 105 <property name="pixmap"> 106 <pixmap></pixmap> 107 </property> 108 </item> 109 <item> 110 <property name="text"> 111 <string> Input </string> 112 </property> 113 <property name="text"> 114 <string>1</string> 115 </property> 116 <property name="text"> 117 <string>#input</string> 118 </property> 119 <property name="pixmap"> 120 <pixmap>:/hostkey_16px.png</pixmap> 121 </property> 122 <property name="pixmap"> 123 <pixmap></pixmap> 124 </property> 125 <property name="pixmap"> 126 <pixmap></pixmap> 127 </property> 128 </item> 129 <item> 130 <property name="text"> 131 <string> USB </string> 132 </property> 133 <property name="text"> 134 <string>2</string> 135 </property> 136 <property name="text"> 137 <string>#usb</string> 138 </property> 139 <property name="pixmap"> 140 <pixmap>:/usb_16px.png</pixmap> 141 </property> 142 <property name="pixmap"> 143 <pixmap></pixmap> 144 </property> 145 <property name="pixmap"> 146 <pixmap></pixmap> 147 </property> 148 </item> 149 <item> 150 <property name="text"> 151 <string> Language </string> 152 </property> 153 <property name="text"> 154 <string>3</string> 155 </property> 156 <property name="text"> 157 <string>#language</string> 158 </property> 159 <property name="pixmap"> 160 <pixmap>:/site_16px.png</pixmap> 161 </property> 162 <property name="pixmap"> 163 <pixmap></pixmap> 164 </property> 165 <property name="pixmap"> 166 <pixmap></pixmap> 167 </property> 168 </item> 169 <property name="name"> 170 <cstring>listView</cstring> 171 </property> 172 <property name="sizePolicy"> 173 <sizepolicy> 174 <hsizetype>0</hsizetype> 175 <vsizetype>7</vsizetype> 176 <horstretch>0</horstretch> 177 <verstretch>0</verstretch> 178 </sizepolicy> 179 </property> 180 <property name="allColumnsShowFocus"> 181 <bool>true</bool> 182 </property> 183 <property name="itemMargin"> 184 <number>3</number> 185 </property> 186 </widget> 187 <widget class="QLabel" row="0" column="1"> 188 <property name="name"> 189 <cstring>titleLabel</cstring> 190 </property> 191 <property name="sizePolicy"> 192 <sizepolicy> 193 <hsizetype>5</hsizetype> 194 <vsizetype>0</vsizetype> 195 <horstretch>0</horstretch> 196 <verstretch>0</verstretch> 197 </sizepolicy> 198 </property> 199 <property name="backgroundMode"> 200 <enum>PaletteBase</enum> 201 </property> 202 <property name="font"> 203 <font> 204 <pointsize>11</pointsize> 205 <bold>1</bold> 206 </font> 207 </property> 208 <property name="frameShape"> 209 <enum>Box</enum> 210 </property> 211 <property name="frameShadow"> 212 <enum>Sunken</enum> 213 </property> 214 <property name="lineWidth"> 215 <number>1</number> 216 </property> 217 <property name="margin"> 218 <number>7</number> 219 </property> 220 <property name="text"> 221 <string></string> 222 </property> 223 <property name="buddy" stdset="0"> 224 <cstring></cstring> 225 </property> 226 </widget> 227 <widget class="QWidgetStack" row="1" column="1"> 228 <property name="name"> 229 <cstring>widgetStack</cstring> 230 </property> 231 <property name="sizePolicy"> 232 <sizepolicy> 233 <hsizetype>7</hsizetype> 234 <vsizetype>7</vsizetype> 235 <horstretch>0</horstretch> 236 <verstretch>0</verstretch> 237 </sizepolicy> 238 </property> 239 <widget class="QWidget"> 240 <property name="name"> 241 <cstring>pageGeneral</cstring> 242 </property> 243 <attribute name="id"> 244 <number>0</number> 245 </attribute> 246 <vbox> 247 <property name="name"> 248 <cstring>unnamed</cstring> 249 </property> 250 <property name="margin"> 251 <number>0</number> 252 </property> 253 <widget class="QGroupBox"> 254 <property name="name"> 255 <cstring>groupBox1</cstring> 256 </property> 257 <property name="sizePolicy"> 258 <sizepolicy> 259 <hsizetype>7</hsizetype> 260 <vsizetype>5</vsizetype> 261 <horstretch>0</horstretch> 262 <verstretch>0</verstretch> 263 </sizepolicy> 264 </property> 265 <property name="title"> 266 <string>Default &Folders</string> 267 </property> 268 <grid> 269 <property name="name"> 270 <cstring>unnamed</cstring> 271 </property> 272 <property name="spacing"> 273 <number>5</number> 274 </property> 275 <widget class="QLineEdit" row="0" column="1"> 276 <property name="name"> 277 <cstring>leVDIFolder</cstring> 278 </property> 279 <property name="frameShape"> 280 <enum>LineEditPanel</enum> 281 </property> 282 <property name="frameShadow"> 283 <enum>Sunken</enum> 284 </property> 285 <property name="whatsThis" stdset="0"> 286 <string>Displays the path to the default VDI folder. This folder is used, if not explicitly specified otherwise, when adding existing or creating new virtual hard disks.</string> 287 </property> 288 </widget> 289 <widget class="QLabel" row="1" column="0"> 290 <property name="name"> 291 <cstring>textLabel2_2</cstring> 292 </property> 293 <property name="text"> 294 <string>Machines</string> 295 </property> 296 </widget> 297 <widget class="QLabel" row="0" column="0"> 298 <property name="name"> 299 <cstring>textLabel1_2</cstring> 300 </property> 301 <property name="text"> 302 <string>VDI files</string> 303 </property> 304 </widget> 305 <widget class="QToolButton" row="1" column="3"> 306 <property name="name"> 307 <cstring>tbResetMachineFolder</cstring> 308 </property> 309 <property name="focusPolicy"> 310 <enum>TabFocus</enum> 311 </property> 312 <property name="text"> 313 <string></string> 314 </property> 315 <property name="iconSet"> 316 <iconset>:/eraser_16px.png</iconset> 317 </property> 318 <property name="autoRaise"> 319 <bool>true</bool> 320 </property> 321 <property name="whatsThis" stdset="0"> 322 <string>Resets the virtual machine folder path to the default value. The actual default path will be displayed after accepting the changes and opening this dialog again.</string> 323 </property> 324 </widget> 325 <widget class="QToolButton" row="0" column="3"> 326 <property name="name"> 327 <cstring>tbResetVDIFolder</cstring> 328 </property> 329 <property name="focusPolicy"> 330 <enum>TabFocus</enum> 331 </property> 332 <property name="text"> 333 <string></string> 334 </property> 335 <property name="iconSet"> 336 <iconset>:/eraser_16px.png</iconset> 337 </property> 338 <property name="autoRaise"> 339 <bool>true</bool> 340 </property> 341 <property name="whatsThis" stdset="0"> 342 <string>Resets the VDI folder path to the default value. The actual default path will be displayed after accepting the changes and opening this dialog again.</string> 343 </property> 344 </widget> 345 <widget class="QLineEdit" row="1" column="1"> 346 <property name="name"> 347 <cstring>leMachineFolder</cstring> 348 </property> 349 <property name="whatsThis" stdset="0"> 350 <string>Displays the path to the default virtual machine folder. This folder is used, if not explicitly specified otherwise, when creating new virtual machines.</string> 351 </property> 352 </widget> 353 <widget class="QToolButton" row="0" column="2"> 354 <property name="name"> 355 <cstring>tbSelectVDIFolder</cstring> 356 </property> 357 <property name="focusPolicy"> 358 <enum>TabFocus</enum> 359 </property> 360 <property name="text"> 361 <string></string> 362 </property> 363 <property name="iconSet"> 364 <iconset>:/select_file_16px.png</iconset> 365 </property> 366 <property name="textLabel"> 367 <string>Select</string> 368 </property> 369 <property name="autoRaise"> 370 <bool>true</bool> 371 </property> 372 <property name="whatsThis" stdset="0"> 373 <string>Opens a dialog to select the default VDI folder.</string> 374 </property> 375 </widget> 376 <widget class="QToolButton" row="1" column="2"> 377 <property name="name"> 378 <cstring>tbSelectMachineFolder</cstring> 379 </property> 380 <property name="focusPolicy"> 381 <enum>TabFocus</enum> 382 </property> 383 <property name="text"> 384 <string></string> 385 </property> 386 <property name="iconSet"> 387 <iconset>:/select_file_16px.png</iconset> 388 </property> 389 <property name="textLabel"> 390 <string>Select</string> 391 </property> 392 <property name="autoRaise"> 393 <bool>true</bool> 394 </property> 395 <property name="whatsThis" stdset="0"> 396 <string>Opens a dialog to select the default virtual machine folder.</string> 397 </property> 398 </widget> 399 </grid> 400 </widget> 401 <widget class="QGroupBox"> 402 <property name="name"> 403 <cstring>groupBox2</cstring> 404 </property> 405 <property name="title"> 406 <string>V&RDP Authentication Library</string> 407 </property> 408 <hbox> 409 <property name="name"> 410 <cstring>unnamed</cstring> 411 </property> 412 <property name="spacing"> 413 <number>5</number> 414 </property> 415 <widget class="QLineEdit"> 416 <property name="name"> 417 <cstring>leVRDPLib</cstring> 418 </property> 419 <property name="whatsThis" stdset="0"> 420 <string>Displays the path to the library that provides authentication for Remote Display (VRDP) clients.</string> 421 </property> 422 </widget> 423 <widget class="QToolButton"> 424 <property name="name"> 425 <cstring>tbSelectVRDPLib</cstring> 426 </property> 427 <property name="focusPolicy"> 428 <enum>TabFocus</enum> 429 </property> 430 <property name="text"> 431 <string></string> 432 </property> 433 <property name="iconSet"> 434 <iconset>:/select_file_16px.png</iconset> 435 </property> 436 <property name="autoRaise"> 437 <bool>true</bool> 438 </property> 439 <property name="whatsThis" stdset="0"> 440 <string>Opens a dialog to select the VRDP authentication library file.</string> 441 </property> 442 </widget> 443 <widget class="QToolButton"> 444 <property name="name"> 445 <cstring>tbResetVRDPLib</cstring> 446 </property> 447 <property name="focusPolicy"> 448 <enum>TabFocus</enum> 449 </property> 450 <property name="text"> 451 <string></string> 452 </property> 453 <property name="iconSet"> 454 <iconset>:/eraser_16px.png</iconset> 455 </property> 456 <property name="autoRaise"> 457 <bool>true</bool> 458 </property> 459 <property name="whatsThis" stdset="0"> 460 <string>Resets the authentication library file to the default value. The actual default library file will be displayed after accepting the changes and opening this dialog again.</string> 461 </property> 462 </widget> 463 </hbox> 464 </widget> 465 <widget class="QGroupBox"> 466 <property name="name"> 467 <cstring>groupBox3</cstring> 468 </property> 469 <property name="title"> 470 <string>&Extended Features</string> 471 </property> 472 <hbox> 473 <property name="name"> 474 <cstring>unnamed</cstring> 475 </property> 476 <widget class="QCheckBox"> 477 <property name="name"> 478 <cstring>chbVTX</cstring> 479 </property> 480 <property name="text"> 481 <string>Enable &VT-x/AMD-V</string> 482 </property> 483 <property name="whatsThis" stdset="0"> 484 <string>Defines whether virtual machines should try to make use of the host CPU's hardware virtualization extensions such as Intel VT-x and AMD-V by default or not.</string> 485 </property> 486 </widget> 487 </hbox>leVRDPLib 488 </widget> 489 <spacer> 490 <property name="name"> 491 <cstring>spacer4</cstring> 492 </property> 493 <property name="orientation"> 494 <enum>Vertical</enum> 495 </property> 496 <property name="sizeType"> 497 <enum>Expanding</enum> 498 </property> 499 <property name="sizeHint"> 500 <size> 501 <width>20</width> 502 <height>31</height> 503 </size> 504 </property> 505 </spacer> 506 </vbox> 507 </widget> 508 <widget class="QWidget"> 509 <property name="name"> 510 <cstring>pageKeyboard</cstring> 511 </property> 512 <attribute name="id"> 513 <number>1</number> 514 </attribute> 515 <vbox> 516 <property name="name"> 517 <cstring>unnamed</cstring> 518 </property> 519 <property name="margin"> 520 <number>0</number> 521 </property> 522 <widget class="QGroupBox"> 523 <property name="name"> 524 <cstring>grbKeyboard</cstring> 525 </property> 526 <property name="title"> 527 <string>&Keyboard</string> 528 </property> 529 <vbox> 530 <property name="name"> 531 <cstring>unnamed</cstring> 532 </property> 533 <widget class="QLayoutWidget"> 534 <property name="name"> 535 <cstring>layout47</cstring> 536 </property> 537 <hbox> 538 <property name="name"> 539 <cstring>unnamed</cstring> 540 </property> 541 <widget class="QLayoutWidget"> 542 <property name="name"> 543 <cstring>layoutHostKey</cstring> 544 </property> 545 <hbox> 546 <property name="name"> 547 <cstring>unnamed</cstring> 548 </property> 549 <widget class="QLabel"> 550 <property name="name"> 551 <cstring>txHostKey</cstring> 552 </property> 553 <property name="text"> 554 <string>&Host Key</string> 555 </property> 556 </widget> 557 </hbox> 558 </widget> 559 <spacer> 560 <property name="name"> 561 <cstring>spacer22</cstring> 562 </property> 563 <property name="orientation"> 564 <enum>Horizontal</enum> 565 </property> 566 <property name="sizeType"> 567 <enum>Expanding</enum> 568 </property> 569 <property name="sizeHint"> 570 <size> 571 <width>40</width> 572 <height>20</height> 573 </size> 574 </property> 575 </spacer> 576 </hbox> 577 </widget> 578 <widget class="QCheckBox"> 579 <property name="name"> 580 <cstring>chbAutoCapture</cstring> 581 </property> 582 <property name="text"> 583 <string>&Auto capture keyboard</string> 584 </property> 585 <property name="whatsThis" stdset="0"> 586 <string>When checked, the keyboard is automatically captured every time the VM window is activated. When the keyboard is captured, all keystrokes (including system ones like Alt-Tab) are directed to the VM.</string> 587 </property> 588 </widget> 589 </vbox> 590 </widget> 591 <spacer> 592 <property name="name"> 593 <cstring>spacer23</cstring> 594 </property> 595 <property name="orientation"> 596 <enum>Vertical</enum> 597 </property> 598 <property name="sizeType"> 599 <enum>Expanding</enum> 600 </property> 601 <property name="sizeHint"> 602 <size> 603 <width>20</width> 604 <height>40</height> 605 </size> 606 </property> 607 </spacer> 608 </vbox> 609 </widget> 610 <widget class="QWidget"> 611 <property name="name"> 612 <cstring>pageUSB</cstring> 613 </property> 614 <attribute name="id"> 615 <number>2</number> 616 </attribute> 617 <vbox> 618 <property name="name"> 619 <cstring>unnamed</cstring> 620 </property> 621 <property name="margin"> 622 <number>0</number> 623 </property> 624 <widget class="QGroupBox"> 625 <property name="name"> 626 <cstring>grbUSBFilters</cstring> 627 </property> 628 <property name="title"> 629 <string>&USB Device Filters</string> 630 </property> 631 <vbox> 632 <property name="name"> 633 <cstring>unnamed</cstring> 634 </property> 635 <widget class="QLayoutWidget"> 636 <property name="name"> 637 <cstring>layout148</cstring> 638 </property> 639 <hbox> 640 <property name="name"> 641 <cstring>unnamed</cstring> 642 </property> 643 <widget class="QListView"> 644 <column> 645 <property name="text"> 646 <string>[name]</string> 647 </property> 648 <property name="clickable"> 649 <bool>false</bool> 650 </property> 651 <property name="resizable"> 652 <bool>true</bool> 653 </property> 654 </column> 655 <property name="name"> 656 <cstring>lvUSBFilters</cstring> 657 </property> 658 <property name="whatsThis" stdset="0"> 659 <string>Lists all global USB filters. The checkbox to the left defines whether the particular filter is enabled or not.</string> 660 </property> 661 </widget> 662 <widget class="QLayoutWidget"> 663 <property name="name"> 664 <cstring>layout147</cstring> 665 </property> 666 <vbox> 667 <property name="name"> 668 <cstring>unnamed</cstring> 669 </property> 670 <property name="spacing"> 671 <number>0</number> 672 </property> 673 <widget class="QToolButton"> 674 <property name="name"> 675 <cstring>tbAddUSBFilter</cstring> 676 </property> 677 <property name="focusPolicy"> 678 <enum>TabFocus</enum> 679 </property> 680 <property name="text"> 681 <string></string> 682 </property> 683 <property name="accel"> 684 <string>Ins</string> 685 </property> 686 <property name="iconSet"> 687 <iconset></iconset> 688 </property> 689 <property name="textLabel"> 690 <string>Add Empty (Ins)</string> 691 </property> 692 <property name="autoRaise"> 693 <bool>true</bool> 694 </property> 695 <property name="whatsThis" stdset="0"> 696 <string>Adds a new USB filter with all fields initially set to empty strings. Note that such a filter will match any attached USB device.</string> 697 </property> 698 </widget> 699 <widget class="QToolButton"> 700 <property name="name"> 701 <cstring>tbAddUSBFilterFrom</cstring> 702 </property> 703 <property name="focusPolicy"> 704 <enum>TabFocus</enum> 705 </property> 706 <property name="text"> 707 <string></string> 708 </property> 709 <property name="accel"> 710 <string>Alt+Ins</string> 711 </property> 712 <property name="iconSet"> 713 <iconset></iconset> 714 </property> 715 <property name="textLabel"> 716 <string>Add From (Alt+Ins)</string> 717 </property> 718 <property name="autoRaise"> 719 <bool>true</bool> 720 </property> 721 <property name="whatsThis" stdset="0"> 722 <string>Adds a new USB filter with all fields set to the values of the selected USB device attached to the host PC.</string> 723 </property> 724 </widget> 725 <widget class="QToolButton"> 726 <property name="name"> 727 <cstring>tbRemoveUSBFilter</cstring> 728 </property> 729 <property name="focusPolicy"> 730 <enum>TabFocus</enum> 731 </property> 732 <property name="text"> 733 <string></string> 734 </property> 735 <property name="accel"> 736 <string>Del</string> 737 </property> 738 <property name="iconSet"> 739 <iconset></iconset> 740 </property> 741 <property name="textLabel"> 742 <string>Remove (Del)</string> 743 </property> 744 <property name="autoRaise"> 745 <bool>true</bool> 746 </property> 747 <property name="whatsThis" stdset="0"> 748 <string>Removes the selected USB filter.</string> 749 </property> 750 </widget> 751 <widget class="QToolButton"> 752 <property name="name"> 753 <cstring>tbUSBFilterUp</cstring> 754 </property> 755 <property name="focusPolicy"> 756 <enum>TabFocus</enum> 757 </property> 758 <property name="text"> 759 <string></string> 760 </property> 761 <property name="accel"> 762 <string>Ctrl+Up</string> 763 </property> 764 <property name="iconSet"> 765 <iconset></iconset> 766 </property> 767 <property name="textLabel"> 768 <string>Move Up (Ctrl+Up)</string> 769 </property> 770 <property name="autoRaise"> 771 <bool>true</bool> 772 </property> 773 <property name="whatsThis" stdset="0"> 774 <string>Moves the selected USB filter up.</string> 775 </property> 776 </widget> 777 <widget class="QToolButton"> 778 <property name="name"> 779 <cstring>tbUSBFilterDown</cstring> 780 </property> 781 <property name="focusPolicy"> 782 <enum>TabFocus</enum> 783 </property> 784 <property name="text"> 785 <string></string> 786 </property> 787 <property name="accel"> 788 <string>Ctrl+Down</string> 789 </property> 790 <property name="iconSet"> 791 <iconset></iconset> 792 </property> 793 <property name="textLabel"> 794 <string>Move Down (Ctrl+Down)</string> 795 </property> 796 <property name="autoRaise"> 797 <bool>true</bool> 798 </property> 799 <property name="whatsThis" stdset="0"> 800 <string>Moves the selected USB filter down.</string> 801 </property> 802 </widget> 803 <spacer> 804 <property name="name"> 805 <cstring>spacer106</cstring> 806 </property> 807 <property name="orientation"> 808 <enum>Vertical</enum> 809 </property> 810 <property name="sizeType"> 811 <enum>Expanding</enum> 812 </property> 813 <property name="sizeHint"> 814 <size> 815 <width>20</width> 816 <height>0</height> 817 </size> 818 </property> 819 </spacer> 820 </vbox> 821 </widget> 822 </hbox> 823 </widget> 824 </vbox> 825 </widget> 826 </vbox> 827 </widget> 828 <widget class="QWidget"> 829 <property name="name"> 830 <cstring>pageLanguage</cstring> 831 </property> 832 <attribute name="id"> 833 <number>3</number> 834 </attribute> 835 <vbox> 836 <property name="name"> 837 <cstring>unnamed</cstring> 838 </property> 839 <property name="margin"> 840 <number>0</number> 841 </property> 842 <property name="spacing"> 843 <number>0</number> 844 </property> 845 <widget class="QGroupBox"> 846 <property name="name"> 847 <cstring>gbInterface</cstring> 848 </property> 849 <property name="title"> 850 <string>&Interface Language</string> 851 </property> 852 <hbox> 853 <property name="name"> 854 <cstring>unnamed</cstring> 855 </property> 856 <property name="spacing"> 857 <number>10</number> 858 </property> 859 <widget class="QListView"> 860 <column> 861 <property name="text"> 862 <string>Language</string> 863 </property> 864 <property name="clickable"> 865 <bool>false</bool> 866 </property> 867 <property name="resizable"> 868 <bool>true</bool> 869 </property> 870 </column> 871 <property name="name"> 872 <cstring>lvLanguages</cstring> 873 </property> 874 <property name="sizePolicy"> 875 <sizepolicy> 876 <hsizetype>4</hsizetype> 877 <vsizetype>7</vsizetype> 878 <horstretch>0</horstretch> 879 <verstretch>0</verstretch> 880 </sizepolicy> 881 </property> 882 <property name="resizeMode"> 883 <enum>NoColumn</enum> 884 </property> 885 <property name="whatsThis" stdset="0"> 886 <string> 887 <qt>Lists all available user interface languages. The effective language is 888 written in <b>bold</b>. Select <i>Default</i> to reset 889 to the system default language.</qt> 890 </string> 891 </property> 892 </widget> 893 <widget class="QLayoutWidget"> 894 <property name="name"> 895 <cstring>layout7</cstring> 896 </property> 897 <vbox> 898 <property name="name"> 899 <cstring>unnamed</cstring> 900 </property> 901 <widget class="QLayoutWidget"> 902 <property name="name"> 903 <cstring>layout6</cstring> 904 </property> 905 <grid> 906 <property name="name"> 907 <cstring>unnamed</cstring> 908 </property> 909 <widget class="QLabel" row="1" column="1"> 910 <property name="name"> 911 <cstring>tlAuthorData</cstring> 912 </property> 913 <property name="sizePolicy"> 914 <sizepolicy> 915 <hsizetype>3</hsizetype> 916 <vsizetype>1</vsizetype> 917 <horstretch>0</horstretch> 918 <verstretch>0</verstretch> 919 </sizepolicy> 920 </property> 921 <property name="text"> 922 <string></string> 923 </property> 924 <property name="alignment"> 925 <set>WordBreak|AlignTop</set> 926 </property> 927 </widget> 928 <widget class="QLabel" row="1" column="0"> 929 <property name="name"> 930 <cstring>tlAuthorName</cstring> 931 </property> 932 <property name="sizePolicy"> 933 <sizepolicy> 934 <hsizetype>1</hsizetype> 935 <vsizetype>1</vsizetype> 936 <horstretch>0</horstretch> 937 <verstretch>0</verstretch> 938 </sizepolicy> 939 </property> 940 <property name="text"> 941 <string>Author(s):</string> 942 </property> 943 <property name="alignment"> 944 <set>AlignTop</set> 945 </property> 946 </widget> 947 <widget class="QLabel" row="0" column="0"> 948 <property name="name"> 949 <cstring>tlLangName</cstring> 950 </property> 951 <property name="sizePolicy"> 952 <sizepolicy> 953 <hsizetype>1</hsizetype> 954 <vsizetype>1</vsizetype> 955 <horstretch>0</horstretch> 956 <verstretch>0</verstretch> 957 </sizepolicy> 958 </property> 959 <property name="text"> 960 <string>Language:</string> 961 </property> 962 <property name="alignment"> 963 <set>AlignTop</set> 964 </property> 965 </widget> 966 <widget class="QLabel" row="0" column="1"> 967 <property name="name"> 968 <cstring>tlLangData</cstring> 969 </property> 970 <property name="sizePolicy"> 971 <sizepolicy> 972 <hsizetype>3</hsizetype> 973 <vsizetype>1</vsizetype> 974 <horstretch>0</horstretch> 975 <verstretch>0</verstretch> 976 </sizepolicy> 977 </property> 978 <property name="text"> 979 <string></string> 980 </property> 981 <property name="alignment"> 982 <set>WordBreak|AlignTop</set> 983 </property> 984 </widget> 985 </grid> 986 </widget> 987 <spacer> 988 <property name="name"> 989 <cstring>spacer7</cstring> 990 </property> 991 <property name="orientation"> 992 <enum>Vertical</enum> 993 </property> 994 <property name="sizeType"> 995 <enum>Expanding</enum> 996 </property> 997 <property name="sizeHint"> 998 <size> 999 <width>20</width> 1000 <height>0</height> 1001 </size> 1002 </property> 1003 </spacer> 1004 </vbox> 1005 </widget> 1006 <!--spacer> 1007 <property name="name"> 1008 <cstring>spacer8</cstring> 1009 </property> 1010 <property name="orientation"> 1011 <enum>Horizontal</enum> 1012 </property> 1013 <property name="sizeType"> 1014 <enum>Expanding</enum> 1015 </property> 1016 <property name="sizeHint"> 1017 <size> 1018 <width>0</width> 1019 <height>20</height> 1020 </size> 1021 </property> 1022 </spacer--> 1023 </hbox> 1024 </widget> 1025 </vbox> 1026 </widget> 1027 </widget> 1028 <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2"> 1029 <property name="name"> 1030 <cstring>layout57</cstring> 1031 </property> 1032 <hbox> 1033 <property name="name"> 1034 <cstring>unnamed</cstring> 1035 </property> 1036 <widget class="QPushButton"> 1037 <property name="name"> 1038 <cstring>buttonHelp</cstring> 1039 </property> 1040 <property name="sizePolicy"> 1041 <sizepolicy> 1042 <hsizetype>1</hsizetype> 1043 <vsizetype>0</vsizetype> 1044 <horstretch>0</horstretch> 1045 <verstretch>0</verstretch> 1046 </sizepolicy> 1047 </property> 1048 <property name="text"> 1049 <string>Help</string> 1050 </property> 1051 <property name="accel"> 1052 <string>F1</string> 1053 </property> 1054 <property name="autoDefault"> 1055 <bool>true</bool> 1056 </property> 1057 <property name="whatsThis" stdset="0"> 1058 <string>Displays the dialog help.</string> 1059 </property> 1060 </widget> 1061 <spacer> 1062 <property name="name"> 1063 <cstring>warningSpacer</cstring> 1064 </property> 1065 <property name="orientation"> 1066 <enum>Horizontal</enum> 1067 </property> 1068 <property name="sizeType"> 1069 <enum>Expanding</enum> 1070 </property> 1071 <property name="sizeHint"> 1072 <size> 1073 <width>16</width> 1074 <height>20</height> 1075 </size> 1076 </property> 1077 </spacer> 1078 <widget class="QLabel"> 1079 <property name="name"> 1080 <cstring>warningPixmap</cstring> 1081 </property> 1082 <property name="sizePolicy"> 1083 <sizepolicy> 1084 <hsizetype>0</hsizetype> 1085 <vsizetype>0</vsizetype> 1086 <horstretch>0</horstretch> 1087 <verstretch>0</verstretch> 1088 </sizepolicy> 1089 </property> 1090 <property name="scaledContents"> 1091 <bool>true</bool> 1092 </property> 1093 </widget> 1094 <widget class="QLabel"> 1095 <property name="name"> 1096 <cstring>warningLabel</cstring> 1097 </property> 1098 <property name="sizePolicy"> 1099 <sizepolicy> 1100 <hsizetype>7</hsizetype> 1101 <vsizetype>5</vsizetype> 1102 <horstretch>0</horstretch> 1103 <verstretch>0</verstretch> 1104 </sizepolicy> 1105 </property> 1106 <property name="text"> 1107 <string>Invalid settings detected</string> 1108 </property> 1109 <property name="alignment"> 1110 <set>AlignVCenter</set> 1111 </property> 1112 </widget> 1113 <spacer> 1114 <property name="name"> 1115 <cstring>spacer49</cstring> 1116 </property> 1117 <property name="orientation"> 1118 <enum>Horizontal</enum> 1119 </property> 1120 <property name="sizeType"> 1121 <enum>Expanding</enum> 1122 </property> 1123 <property name="sizeHint"> 1124 <size> 1125 <width>16</width> 1126 <height>20</height> 1127 </size> 1128 </property> 1129 </spacer> 1130 <widget class="QPushButton"> 1131 <property name="name"> 1132 <cstring>buttonOk</cstring> 1133 </property> 1134 <property name="text"> 1135 <string>&OK</string> 1136 </property> 1137 <property name="autoDefault"> 1138 <bool>true</bool> 1139 </property> 1140 <property name="default"> 1141 <bool>true</bool> 1142 </property> 1143 <property name="whatsThis" stdset="0"> 1144 <string>Accepts (saves) changes and closes the dialog.</string> 1145 </property> 1146 </widget> 1147 <widget class="QPushButton"> 1148 <property name="name"> 1149 <cstring>buttonCancel</cstring> 1150 </property> 1151 <property name="text"> 1152 <string>Cancel</string> 1153 </property> 1154 <property name="autoDefault"> 1155 <bool>true</bool> 1156 </property> 1157 <property name="whatsThis" stdset="0"> 1158 <string>Cancels changes and closes the dialog.</string> 1159 </property> 1160 </widget> 1161 </hbox> 1162 </widget> 1163 </grid> 1164 </widget> 1165 <connections> 1166 <connection> 1167 <sender>buttonOk</sender> 1168 <signal>clicked()</signal> 1169 <receiver>VBoxGlobalSettingsDlg</receiver> 1170 <slot>accept()</slot> 1171 </connection> 1172 <connection> 1173 <sender>buttonCancel</sender> 1174 <signal>clicked()</signal> 1175 <receiver>VBoxGlobalSettingsDlg</receiver> 1176 <slot>reject()</slot> 1177 </connection> 1178 <connection> 1179 <sender>listView</sender> 1180 <signal>currentChanged(QListViewItem*)</signal> 1181 <receiver>VBoxGlobalSettingsDlg</receiver> 1182 <slot>listView_currentChanged(QListViewItem*)</slot> 1183 </connection> 1184 <connection> 1185 <sender>tbResetVDIFolder</sender> 1186 <signal>clicked()</signal> 1187 <receiver>VBoxGlobalSettingsDlg</receiver> 1188 <slot>tbResetFolder_clicked()</slot> 1189 </connection> 1190 <connection> 1191 <sender>tbSelectVDIFolder</sender> 1192 <signal>clicked()</signal> 1193 <receiver>VBoxGlobalSettingsDlg</receiver> 1194 <slot>tbSelectFolder_clicked()</slot> 1195 </connection> 1196 <connection> 1197 <sender>tbResetMachineFolder</sender> 1198 <signal>clicked()</signal> 1199 <receiver>VBoxGlobalSettingsDlg</receiver> 1200 <slot>tbResetFolder_clicked()</slot> 1201 </connection> 1202 <connection> 1203 <sender>tbSelectMachineFolder</sender> 1204 <signal>clicked()</signal> 1205 <receiver>VBoxGlobalSettingsDlg</receiver> 1206 <slot>tbSelectFolder_clicked()</slot> 1207 </connection> 1208 <connection> 1209 <sender>tbResetVRDPLib</sender> 1210 <signal>clicked()</signal> 1211 <receiver>VBoxGlobalSettingsDlg</receiver> 1212 <slot>tbResetFolder_clicked()</slot> 1213 </connection> 1214 <connection> 1215 <sender>tbSelectVRDPLib</sender> 1216 <signal>clicked()</signal> 1217 <receiver>VBoxGlobalSettingsDlg</receiver> 1218 <slot>tbSelectFolder_clicked()</slot> 1219 </connection> 1220 <connection> 1221 <sender>lvUSBFilters</sender> 1222 <signal>currentChanged(QListViewItem*)</signal> 1223 <receiver>VBoxGlobalSettingsDlg</receiver> 1224 <slot>lvUSBFilters_currentChanged(QListViewItem*)</slot> 1225 </connection> 1226 <connection> 1227 <sender>tbAddUSBFilter</sender> 1228 <signal>clicked()</signal> 1229 <receiver>VBoxGlobalSettingsDlg</receiver> 1230 <slot>tbAddUSBFilter_clicked()</slot> 1231 </connection> 1232 <connection> 1233 <sender>tbAddUSBFilterFrom</sender> 1234 <signal>clicked()</signal> 1235 <receiver>VBoxGlobalSettingsDlg</receiver> 1236 <slot>tbAddUSBFilterFrom_clicked()</slot> 1237 </connection> 1238 <connection> 1239 <sender>tbRemoveUSBFilter</sender> 1240 <signal>clicked()</signal> 1241 <receiver>VBoxGlobalSettingsDlg</receiver> 1242 <slot>tbRemoveUSBFilter_clicked()</slot> 1243 </connection> 1244 <connection> 1245 <sender>tbUSBFilterUp</sender> 1246 <signal>clicked()</signal> 1247 <receiver>VBoxGlobalSettingsDlg</receiver> 1248 <slot>tbUSBFilterUp_clicked()</slot> 1249 </connection> 1250 <connection> 1251 <sender>tbUSBFilterDown</sender> 1252 <signal>clicked()</signal> 1253 <receiver>VBoxGlobalSettingsDlg</receiver> 1254 <slot>tbUSBFilterDown_clicked()</slot> 1255 </connection> 1256 <connection> 1257 <sender>lvLanguages</sender> 1258 <signal>currentChanged(QListViewItem*)</signal> 1259 <receiver>VBoxGlobalSettingsDlg</receiver> 1260 <slot>lvLanguages_currentChanged(QListViewItem*)</slot> 1261 </connection> 1262 <connection> 1263 <sender>buttonHelp</sender> 1264 <signal>clicked()</signal> 1265 <receiver>&vboxProblem()</receiver> 1266 <slot>showHelpHelpDialog()</slot> 1267 </connection> 1268 </connections> 1269 <tabstops> 1270 <tabstop>listView</tabstop> 1271 <tabstop>chbAutoCapture</tabstop> 1272 <tabstop>leVDIFolder</tabstop> 1273 <tabstop>tbSelectVDIFolder</tabstop> 1274 <tabstop>tbResetVDIFolder</tabstop> 1275 <tabstop>leMachineFolder</tabstop> 1276 <tabstop>tbSelectMachineFolder</tabstop> 1277 <tabstop>tbResetMachineFolder</tabstop> 1278 <tabstop>leVRDPLib</tabstop> 1279 <tabstop>tbSelectVRDPLib</tabstop> 1280 <tabstop>tbResetVRDPLib</tabstop> 1281 <tabstop>chbVTX</tabstop> 1282 <tabstop>lvUSBFilters</tabstop> 1283 <tabstop>tbAddUSBFilter</tabstop> 1284 <tabstop>tbAddUSBFilterFrom</tabstop> 1285 <tabstop>tbRemoveUSBFilter</tabstop> 1286 <tabstop>tbUSBFilterUp</tabstop> 1287 <tabstop>tbUSBFilterDown</tabstop> 1288 <tabstop>lvLanguages</tabstop> 1289 <tabstop>buttonHelp</tabstop> 1290 <tabstop>buttonOk</tabstop> 1291 <tabstop>buttonCancel</tabstop> 1292 </tabstops> 1293 <includes> 1294 <include location="global" impldecl="in implementation">qvalidator.h</include> 1295 <include location="global" impldecl="in implementation">qmessagebox.h</include> 1296 <include location="global" impldecl="in implementation">qfont.h</include> 1297 <include location="global" impldecl="in implementation">qpainter.h</include> 1298 <include location="global" impldecl="in implementation">qobjectlist.h</include> 1299 <include location="global" impldecl="in implementation">qfiledialog.h</include> 1300 <include location="global" impldecl="in implementation">qtimer.h</include> 1301 <include location="global" impldecl="in implementation">qeventloop.h</include> 1302 <include location="local" impldecl="in declaration">COMDefs.h</include> 1303 <include location="local" impldecl="in declaration">QIWidgetValidator.h</include> 1304 <include location="local" impldecl="in declaration">QIHotKeyEdit.h</include> 1305 <include location="local" impldecl="in declaration">VBoxGlobalSettings.h</include> 1306 <include location="local" impldecl="in implementation">VBoxUtils.h</include> 1307 <include location="local" impldecl="in implementation">VBoxGlobal.h</include> 1308 <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include> 1309 <include location="local" impldecl="in implementation">QILabel.h</include> 1310 </includes> 1311 <forwards> 1312 <forward>class VBoxUSBMenu</forward> 1313 <forward>class QILabel</forward> 1314 </forwards> 1315 <variables> 1316 <variable access="private">bool polished;</variable> 1317 <variable access="private">bool valid;</variable> 1318 <variable access="private">QTimer *whatsThisTimer;</variable> 1319 <variable access="private">QWidget *whatsThisCandidate;</variable> 1320 <variable access="private">QIHotKeyEdit *hkeHostKey;</variable> 1321 <variable access="private">QIWidgetValidator *wvalGeneral;</variable> 1322 <variable access="private">QIWidgetValidator *wvalKeyboard;</variable> 1323 <variable access="private">QString warningString;</variable> 1324 <variable access="private">QWidgetStack *wstUSBFilters;</variable> 1325 <variable access="private">bool mUSBFilterListModified;</variable> 1326 <variable access="private">VBoxUSBMenu *usbDevicesMenu;</variable> 1327 <variable access="private">bool mLanguageChanged;</variable> 1328 <variable access="private">QILabel *whatsThisLabel;</variable> 1329 </variables> 1330 <slots> 1331 <slot>listView_currentChanged( QListViewItem * item )</slot> 1332 <slot>enableOk( const QIWidgetValidator * wval )</slot> 1333 <slot>revalidate( QIWidgetValidator * )</slot> 1334 <slot>updateWhatsThis( bool gotFocus = false )</slot> 1335 <slot>tbResetFolder_clicked()</slot> 1336 <slot>tbSelectFolder_clicked()</slot> 1337 <slot>addUSBFilter( const CUSBDeviceFilter &, bool )</slot> 1338 <slot>lvUSBFilters_currentChanged( QListViewItem * )</slot> 1339 <slot>lvUSBFilters_setCurrentText( const QString & )</slot> 1340 <slot>tbAddUSBFilter_clicked()</slot> 1341 <slot>tbAddUSBFilterFrom_clicked()</slot> 1342 <slot>menuAddUSBFilterFrom_activated( QAction * )</slot> 1343 <slot>tbRemoveUSBFilter_clicked()</slot> 1344 <slot>tbUSBFilterUp_clicked()</slot> 1345 <slot>tbUSBFilterDown_clicked()</slot> 1346 <slot>lvLanguages_currentChanged( QListViewItem* )</slot> 1347 </slots> 1348 <functions> 1349 <function access="private">init()</function> 1350 <function access="private" returnType="QString">pagePath( QWidget * )</function> 1351 <function access="private" returnType="bool">event( QEvent * )</function> 1352 <function access="protected">showEvent( QShowEvent * )</function> 1353 <function>getFrom( const CSystemProperties & props, const VBoxGlobalSettings & gs )</function> 1354 <function>putBackTo( CSystemProperties & props, VBoxGlobalSettings & gs )</function> 1355 <function access="protected">setWarning( const QString & )</function> 1356 <function returnType="bool">eventFilter( QObject * watched, QEvent * e )</function> 1357 <function access="private">fixLanguageChange()</function> 1358 </functions> 1359 <pixmapinproject/> 1360 <layoutdefaults spacing="6" margin="11"/> 1361 </UI> 40 <item rowspan="3" row="0" column="0" > 41 <widget class="QTreeWidget" name="mTwSelector" > 42 <property name="sizePolicy" > 43 <sizepolicy vsizetype="Expanding" hsizetype="Minimum" > 44 <horstretch>0</horstretch> 45 <verstretch>0</verstretch> 46 </sizepolicy> 47 </property> 48 <property name="verticalScrollBarPolicy" > 49 <enum>Qt::ScrollBarAlwaysOff</enum> 50 </property> 51 <property name="horizontalScrollBarPolicy" > 52 <enum>Qt::ScrollBarAlwaysOff</enum> 53 </property> 54 <property name="rootIsDecorated" > 55 <bool>false</bool> 56 </property> 57 <property name="uniformRowHeights" > 58 <bool>true</bool> 59 </property> 60 <column> 61 <property name="text" > 62 <string>Category</string> 63 </property> 64 </column> 65 <column> 66 <property name="text" > 67 <string>[id]</string> 68 </property> 69 </column> 70 <column> 71 <property name="text" > 72 <string>[link]</string> 73 </property> 74 </column> 75 <item> 76 <property name="text" > 77 <string> General </string> 78 </property> 79 <property name="icon" > 80 <iconset resource="../VirtualBox.qrc" >:/machine_16px.png</iconset> 81 </property> 82 <property name="text" > 83 <string>00</string> 84 </property> 85 <property name="text" > 86 <string>#general</string> 87 </property> 88 </item> 89 <item> 90 <property name="text" > 91 <string> Input </string> 92 </property> 93 <property name="icon" > 94 <iconset resource="../VirtualBox.qrc" >:/diskim_16px.png</iconset> 95 </property> 96 <property name="text" > 97 <string>01</string> 98 </property> 99 <property name="text" > 100 <string>#input</string> 101 </property> 102 </item> 103 <item> 104 <property name="text" > 105 <string> USB </string> 106 </property> 107 <property name="icon" > 108 <iconset resource="../VirtualBox.qrc" >:/usb_16px.png</iconset> 109 </property> 110 <property name="text" > 111 <string>02</string> 112 </property> 113 <property name="text" > 114 <string>#usb</string> 115 </property> 116 </item> 117 <item> 118 <property name="text" > 119 <string> Language </string> 120 </property> 121 <property name="icon" > 122 <iconset resource="../VirtualBox.qrc" >:/vrdp_16px.png</iconset> 123 </property> 124 <property name="text" > 125 <string>03</string> 126 </property> 127 <property name="text" > 128 <string>#language</string> 129 </property> 130 </item> 131 </widget> 132 </item> 133 <item row="0" column="1" > 134 <widget class="QLabel" name="mLbTitle" > 135 <property name="sizePolicy" > 136 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 137 <horstretch>0</horstretch> 138 <verstretch>0</verstretch> 139 </sizepolicy> 140 </property> 141 <property name="palette" > 142 <palette> 143 <active> 144 <colorrole role="Window" > 145 <brush brushstyle="SolidPattern" > 146 <color alpha="255" > 147 <red>255</red> 148 <green>255</green> 149 <blue>255</blue> 150 </color> 151 </brush> 152 </colorrole> 153 </active> 154 <inactive> 155 <colorrole role="Window" > 156 <brush brushstyle="SolidPattern" > 157 <color alpha="255" > 158 <red>255</red> 159 <green>255</green> 160 <blue>255</blue> 161 </color> 162 </brush> 163 </colorrole> 164 </inactive> 165 <disabled> 166 <colorrole role="Window" > 167 <brush brushstyle="SolidPattern" > 168 <color alpha="255" > 169 <red>255</red> 170 <green>255</green> 171 <blue>255</blue> 172 </color> 173 </brush> 174 </colorrole> 175 </disabled> 176 </palette> 177 </property> 178 <property name="font" > 179 <font> 180 <family>Sans Serif</family> 181 <pointsize>11</pointsize> 182 <weight>75</weight> 183 <bold>true</bold> 184 </font> 185 </property> 186 <property name="autoFillBackground" > 187 <bool>true</bool> 188 </property> 189 <property name="frameShape" > 190 <enum>QFrame::Box</enum> 191 </property> 192 <property name="frameShadow" > 193 <enum>QFrame::Sunken</enum> 194 </property> 195 <property name="text" > 196 <string/> 197 </property> 198 <property name="margin" > 199 <number>7</number> 200 </property> 201 </widget> 202 </item> 203 <item row="1" column="1" > 204 <widget class="QStackedWidget" name="mPageStack" > 205 <property name="sizePolicy" > 206 <sizepolicy vsizetype="Expanding" hsizetype="Expanding" > 207 <horstretch>0</horstretch> 208 <verstretch>0</verstretch> 209 </sizepolicy> 210 </property> 211 <property name="currentIndex" > 212 <number>3</number> 213 </property> 214 <widget class="QWidget" name="mPageGeneral" /> 215 <widget class="QWidget" name="mPageInput" /> 216 <widget class="QWidget" name="mPageUSB" /> 217 <widget class="QWidget" name="mPageLanguage" /> 218 </widget> 219 </item> 220 <item row="2" column="1" > 221 <widget class="QLabel" name="mLbWhatsThis" > 222 <property name="frameShape" > 223 <enum>QFrame::Box</enum> 224 </property> 225 <property name="frameShadow" > 226 <enum>QFrame::Sunken</enum> 227 </property> 228 <property name="text" > 229 <string/> 230 </property> 231 <property name="alignment" > 232 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 233 </property> 234 <property name="wordWrap" > 235 <bool>true</bool> 236 </property> 237 <property name="margin" > 238 <number>7</number> 239 </property> 240 </widget> 241 </item> 242 <item row="3" column="0" colspan="2" > 243 <widget class="QIDialogButtonBox" name="mButtonBox" > 244 <property name="standardButtons" > 245 <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set> 246 </property> 247 </widget> 248 </item> 249 </layout> 250 </widget> 251 </widget> 252 <customwidgets> 253 <customwidget> 254 <class>QIDialogButtonBox</class> 255 <extends>QDialogButtonBox</extends> 256 <header>QIDialogButtonBox.h</header> 257 </customwidget> 258 </customwidgets> 259 <resources> 260 <include location="../VirtualBox.qrc" /> 261 </resources> 262 <connections/> 263 </ui>
Note:
See TracChangeset
for help on using the changeset viewer.