Changeset 9751 in vbox
- Timestamp:
- Jun 17, 2008 10:07:14 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIWidgetValidator.h
r8170 r9751 45 45 bool isValid() const; 46 46 void rescan(); 47 48 void setCaption (const QString& aCaption) { mCaption = aCaption; } 49 QString caption() const { return mCaption; } 47 50 48 51 QString warningText() const; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsAudio.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsAudio.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 29 class VBoxVMSettingsAudio : public QWidget, public Ui::VBoxVMSettingsAudio 30 class VBoxVMSettingsAudio : public QIWithRetranslateUI<QWidget>, 31 public Ui::VBoxVMSettingsAudio 30 32 { 31 33 Q_OBJECT; … … 42 44 void putBackTo(); 43 45 46 protected: 47 48 void retranslateUi(); 49 44 50 private: 45 51 52 void prepareComboboxes(); 53 54 /* Private member vars */ 46 55 static VBoxVMSettingsAudio *mSettings; 47 56 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsCD.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsCD.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 30 31 class QIWidgetValidator; 31 32 32 class VBoxVMSettingsCD : public Q Widget,33 class VBoxVMSettingsCD : public QIWithRetranslateUI<QWidget>, 33 34 public Ui::VBoxVMSettingsCD 34 35 { … … 55 56 void cdChanged(); 56 57 58 protected: 59 60 void retranslateUi(); 61 57 62 private slots: 58 63 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsDlg.h
r9688 r9751 26 26 #include "VBoxVMSettingsDlg.gen.h" 27 27 #include "QIMainDialog.h" 28 #include "QIWithRetranslateUI.h" 28 29 #include "COMDefs.h" 29 30 … … 35 36 class QWidgetStack; 36 37 37 class VBoxVMSettingsDlg : public QI MainDialog,38 class VBoxVMSettingsDlg : public QIWithRetranslateUI<QIMainDialog>, 38 39 public Ui::VBoxVMSettingsDlg 39 40 { 40 Q_OBJECT 41 Q_OBJECT; 41 42 42 43 public: … … 47 48 void getFromMachine (const CMachine &aMachine); 48 49 COMResult putBackToMachine(); 50 51 protected: 52 53 void retranslateUi(); 49 54 50 55 private slots: … … 67 72 void updateMediaShortcuts(); 68 73 74 QString dialogTitle() const; 75 69 76 /* Common */ 70 77 CMachine mMachine; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsFD.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsFD.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 30 31 class QIWidgetValidator; 31 32 32 class VBoxVMSettingsFD : public Q Widget,33 class VBoxVMSettingsFD : public QIWithRetranslateUI<QWidget>, 33 34 public Ui::VBoxVMSettingsFD 34 35 { … … 55 56 void fdChanged(); 56 57 58 protected: 59 60 void retranslateUi(); 61 57 62 private slots: 58 63 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsGeneral.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsGeneral.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 30 31 class QIWidgetValidator; 31 32 32 class VBoxVMSettingsGeneral : public Q Widget,33 class VBoxVMSettingsGeneral : public QIWithRetranslateUI<QWidget>, 33 34 public Ui::VBoxVMSettingsGeneral 34 35 { … … 53 54 void tableChanged(); 54 55 56 protected: 57 58 void retranslateUi(); 59 55 60 private slots: 56 61 … … 71 76 private: 72 77 78 void adjustBootOrderTWSize (); 79 73 80 static VBoxVMSettingsGeneral *mSettings; 74 81 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsHD.h
r9729 r9751 26 26 #include "VBoxVMSettingsHD.gen.h" 27 27 #include "COMDefs.h" 28 #include "QIWithRetranslateUI.h" 28 29 #include "VBoxMediaComboBox.h" 29 30 … … 274 275 275 276 /** QWidget class reimplementation used as hard disks settings */ 276 class VBoxVMSettingsHD : public Q Widget,277 class VBoxVMSettingsHD : public QIWithRetranslateUI<QWidget>, 277 278 public Ui::VBoxVMSettingsHD 278 279 { … … 302 303 protected: 303 304 305 void retranslateUi(); 306 304 307 void getFrom(); 305 308 void putBackTo(); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsNetwork.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsNetwork.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 30 31 class QIWidgetValidator; 31 32 32 class VBoxVMSettingsNetwork : public Q Widget,33 class VBoxVMSettingsNetwork : public QIWithRetranslateUI<QWidget>, 33 34 public Ui::VBoxVMSettingsNetwork 34 35 { … … 37 38 public: 38 39 39 VBoxVMSettingsNetwork ();40 VBoxVMSettingsNetwork (QWidget *aParent = NULL); 40 41 41 42 static void getFromMachine (const CMachine &aMachine, … … 52 53 53 54 void setValidator (QIWidgetValidator *aValidator); 55 56 protected: 57 58 void retranslateUi(); 54 59 55 60 private slots: … … 70 75 71 76 private: 77 78 QString pageTitle() const; 79 void prepareComboboxes(); 72 80 73 81 static void prepareListNetworks(); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsParallel.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsParallel.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 29 30 class VBoxVMSettingsDlg; 30 31 31 class VBoxVMSettingsParallel : public Q Widget,32 class VBoxVMSettingsParallel : public QIWithRetranslateUI<QWidget>, 32 33 public Ui::VBoxVMSettingsParallel 33 34 { … … 36 37 public: 37 38 38 VBoxVMSettingsParallel ();39 VBoxVMSettingsParallel (QWidget *aParent = NULL); 39 40 40 41 static void getFromMachine (const CMachine &aMachine, … … 46 47 47 48 static bool revalidate (QString &aWarning, QString &aTitle); 49 50 protected: 51 52 void retranslateUi(); 48 53 49 54 private slots: … … 58 63 bool isUserDefined(); 59 64 65 QString pageTitle() const; 66 60 67 static QTabWidget *mTabWidget; 61 68 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsSerial.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsSerial.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 29 30 class VBoxVMSettingsDlg; 30 31 31 class VBoxVMSettingsSerial : public Q Widget,32 class VBoxVMSettingsSerial : public QIWithRetranslateUI<QWidget>, 32 33 public Ui::VBoxVMSettingsSerial 33 34 { 34 35 Q_OBJECT; 35 36 37 36 38 public: 37 38 VBoxVMSettingsSerial(); 39 VBoxVMSettingsSerial (QWidget* aParent = NULL); 39 40 40 41 static void getFromMachine (const CMachine &aMachine, … … 47 48 static bool revalidate (QString &aWarning, QString &aTitle); 48 49 50 protected: 51 52 void retranslateUi(); 53 49 54 private slots: 50 55 … … 54 59 55 60 private: 61 62 QString pageTitle() const; 56 63 57 64 void getFromPort (const CSerialPort &aPort); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsUSB.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsUSB.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 31 32 class VBoxUSBMenu; 32 33 33 class VBoxVMSettingsUSB : public Q Widget,34 class VBoxVMSettingsUSB : public QIWithRetranslateUI<QWidget>, 34 35 public Ui::VBoxVMSettingsUSB 35 36 { … … 58 59 void getFrom (const CMachine &aMachine); 59 60 void putBackTo(); 61 62 protected: 63 64 void retranslateUi(); 60 65 61 66 private slots: … … 91 96 bool mUSBFilterListModified; 92 97 QList<CUSBDeviceFilter> mFilters; 98 99 QString mUSBFilterName; 93 100 }; 94 101 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsVRDP.h
r9729 r9751 25 25 26 26 #include "VBoxVMSettingsVRDP.gen.h" 27 #include "QIWithRetranslateUI.h" 27 28 #include "COMDefs.h" 28 29 … … 30 31 class QIWidgetValidator; 31 32 32 class VBoxVMSettingsVRDP : public Q Widget,33 class VBoxVMSettingsVRDP : public QIWithRetranslateUI<QWidget>, 33 34 public Ui::VBoxVMSettingsVRDP 34 35 { … … 49 50 void putBackTo(); 50 51 52 protected: 53 54 void retranslateUi(); 55 51 56 private: 52 57 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsAudio.cpp
r9654 r9751 27 27 28 28 VBoxVMSettingsAudio::VBoxVMSettingsAudio (QWidget *aParent) 29 : Q Widget(aParent)29 : QIWithRetranslateUI<QWidget> (aParent) 30 30 { 31 31 /* Apply UI decorations */ 32 32 Ui::VBoxVMSettingsAudio::setupUi (this); 33 34 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 35 vboxGlobal().toString (KAudioDriverType_Null)); 36 #if defined Q_WS_WIN32 37 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 38 vboxGlobal().toString (KAudioDriverType_DirectSound)); 39 # ifdef VBOX_WITH_WINMM 40 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 41 vboxGlobal().toString (KAudioDriverType_WinMM)); 42 # endif 43 #elif defined Q_OS_LINUX 44 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 45 vboxGlobal().toString (KAudioDriverType_OSS)); 46 # ifdef VBOX_WITH_ALSA 47 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 48 vboxGlobal().toString (KAudioDriverType_ALSA)); 49 # endif 50 # ifdef VBOX_WITH_PULSE 51 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 52 vboxGlobal().toString (KAudioDriverType_Pulse)); 53 # endif 54 #elif defined Q_OS_MACX 55 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 56 vboxGlobal().toString (KAudioDriverType_CoreAudio)); 57 #endif 58 59 mCbAudioController->insertItem (mCbAudioController->count(), 60 vboxGlobal().toString (KAudioControllerType_AC97)); 61 mCbAudioController->insertItem (mCbAudioController->count(), 62 vboxGlobal().toString (KAudioControllerType_SB16)); 33 /* Applying language settings */ 34 retranslateUi(); 63 35 } 64 36 … … 99 71 } 100 72 73 74 void VBoxVMSettingsAudio::retranslateUi() 75 { 76 /* Translate uic generated strings */ 77 Ui::VBoxVMSettingsAudio::retranslateUi (this); 78 /* Fill the comboboxes */ 79 prepareComboboxes(); 80 } 81 82 void VBoxVMSettingsAudio::prepareComboboxes() 83 { 84 /* Save the current selected value */ 85 int currentDriver = mCbAudioDriver->currentIndex(); 86 /* Clear the driver box */ 87 mCbAudioDriver->clear(); 88 /* Refill them */ 89 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 90 vboxGlobal().toString (KAudioDriverType_Null)); 91 #if defined Q_WS_WIN32 92 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 93 vboxGlobal().toString (KAudioDriverType_DirectSound)); 94 # ifdef VBOX_WITH_WINMM 95 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 96 vboxGlobal().toString (KAudioDriverType_WinMM)); 97 # endif 98 #elif defined Q_OS_LINUX 99 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 100 vboxGlobal().toString (KAudioDriverType_OSS)); 101 # ifdef VBOX_WITH_ALSA 102 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 103 vboxGlobal().toString (KAudioDriverType_ALSA)); 104 # endif 105 # ifdef VBOX_WITH_PULSE 106 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 107 vboxGlobal().toString (KAudioDriverType_Pulse)); 108 # endif 109 #elif defined Q_OS_MACX 110 mCbAudioDriver->insertItem (mCbAudioDriver->count(), 111 vboxGlobal().toString (KAudioDriverType_CoreAudio)); 112 #endif 113 /* Set the old value */ 114 mCbAudioDriver->setCurrentIndex (currentDriver); 115 116 /* Save the current selected value */ 117 int currentController = mCbAudioController->currentIndex(); 118 /* Clear the controller box */ 119 mCbAudioController->clear(); 120 /* Refill them */ 121 mCbAudioController->insertItem (mCbAudioController->count(), 122 vboxGlobal().toString (KAudioControllerType_AC97)); 123 mCbAudioController->insertItem (mCbAudioController->count(), 124 vboxGlobal().toString (KAudioControllerType_SB16)); 125 /* Set the old value */ 126 mCbAudioController->setCurrentIndex (currentController); 127 } 128 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsCD.cpp
r9654 r9751 36 36 VBoxVMSettingsDlg *aDlg, 37 37 const QString &aPath) 38 : Q Widget(aParent)38 : QIWithRetranslateUI<QWidget> (aParent) 39 39 , mLastSelected (0) 40 40 { … … 64 64 65 65 mLastSelected = mRbHostCD; 66 /* Applying language settings */ 67 retranslateUi(); 66 68 } 67 69 … … 237 239 } 238 240 241 242 void VBoxVMSettingsCD::retranslateUi() 243 { 244 /* Translate uic generated strings */ 245 Ui::VBoxVMSettingsCD::retranslateUi (this); 246 } 247 248 239 249 void VBoxVMSettingsCD::onMediaChanged() 240 250 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp
r9688 r9751 91 91 const QString &aCategory, 92 92 const QString &aControl) 93 : QI MainDialog(aParent)93 : QIWithRetranslateUI<QIMainDialog> (aParent) 94 94 , mPolished (false) 95 95 , mAllowResetFirstRunFlag (false) … … 106 106 107 107 mWarnIconLabel = new VBoxWarnIconLabel(); 108 mWarnIconLabel->setWarningText (tr ("Invalid settings detected"));109 mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog."));110 mButtonBox->button (QDialogButtonBox::Cancel)->setWhatsThis (tr ("Cancels changes and closes the dialog."));111 mButtonBox->button (QDialogButtonBox::Help)->setWhatsThis (tr ("Displays the dialog help."));112 108 113 109 /* Setup warning icon */ … … 228 224 } 229 225 } 226 /* Applying language settings */ 227 retranslateUi(); 230 228 } 231 229 … … 234 232 mMachine = aMachine; 235 233 236 setWindowTitle ( aMachine.GetName() + tr (" - Settings"));234 setWindowTitle (dialogTitle()); 237 235 238 236 CVirtualBox vbox = vboxGlobal().virtualBox(); … … 286 284 } 287 285 288 289 286 COMResult VBoxVMSettingsDlg::putBackToMachine() 290 287 { … … 332 329 } 333 330 331 332 void VBoxVMSettingsDlg::retranslateUi() 333 { 334 /* Unfortunately retranslateUi clears the QTreeWidget to do the 335 * translation. So save the current selected index. */ 336 int ci = mPageStack->currentIndex(); 337 /* Translate uic generated strings */ 338 Ui::VBoxVMSettingsDlg::retranslateUi (this); 339 /* Set the old index */ 340 mTwSelector->setCurrentItem (mTwSelector->topLevelItem (ci)); 341 342 mWarnIconLabel->setWarningText (tr ("Invalid settings detected")); 343 mButtonBox->button (QDialogButtonBox::Ok)->setWhatsThis (tr ("Accepts (saves) changes and closes the dialog.")); 344 mButtonBox->button (QDialogButtonBox::Cancel)->setWhatsThis (tr ("Cancels changes and closes the dialog.")); 345 mButtonBox->button (QDialogButtonBox::Help)->setWhatsThis (tr ("Displays the dialog help.")); 346 347 setWindowTitle (dialogTitle()); 348 349 /* We have to make sure that the Serial & Network subpages are retranslated 350 * before they are revalidated. Cause: They do string comparing within 351 * vboxGlobal which is retranslated at that point already. */ 352 QEvent* event = new QEvent (QEvent::LanguageChange); 353 qApp->sendEvent (mPageSerial, event); 354 qApp->sendEvent (mPageNetwork, event); 355 356 /* Revalidate all pages to retranslate the warning messages also. */ 357 QList<QIWidgetValidator*> l = this->findChildren<QIWidgetValidator*>(); 358 foreach (QIWidgetValidator *wval, l) 359 if (!wval->isValid()) 360 revalidate (wval); 361 } 334 362 335 363 void VBoxVMSettingsDlg::enableOk (const QIWidgetValidator*) … … 405 433 QTreeWidgetItem *) 406 434 { 407 Assert (aItem); 408 int id = aItem->text (1).toInt(); 409 Assert (id >= 0); 410 mLbTitle->setText (::path (aItem)); 411 mPageStack->setCurrentIndex (id); 435 if (aItem) 436 { 437 int id = aItem->text (1).toInt(); 438 Assert (id >= 0); 439 mLbTitle->setText (::path (aItem)); 440 mPageStack->setCurrentIndex (id); 441 } 412 442 } 413 443 … … 556 586 } 557 587 588 QString VBoxVMSettingsDlg::dialogTitle() const 589 { 590 QString dialogTitle; 591 if (!mMachine.isNull()) 592 dialogTitle = tr ("%1 - Settings").arg (mMachine.GetName()); 593 return dialogTitle; 594 } 595 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsFD.cpp
r9654 r9751 36 36 VBoxVMSettingsDlg *aDlg, 37 37 const QString &aPath) 38 : Q Widget(aParent)38 : QIWithRetranslateUI<QWidget> (aParent) 39 39 , mLastSelected (0) 40 40 { … … 64 64 65 65 mLastSelected = mRbHostFD; 66 /* Applying language settings */ 67 retranslateUi(); 66 68 } 67 69 … … 233 235 } 234 236 237 238 void VBoxVMSettingsFD::retranslateUi() 239 { 240 /* Translate uic generated strings */ 241 Ui::VBoxVMSettingsFD::retranslateUi (this); 242 } 243 244 235 245 void VBoxVMSettingsFD::onMediaChanged() 236 246 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsGeneral.cpp
r9654 r9751 30 30 #include <QDir> 31 31 32 #define ITEM_TYPE_ROLE Qt::UserRole + 1 33 32 34 VBoxVMSettingsGeneral* VBoxVMSettingsGeneral::mSettings = 0; 33 35 … … 55 57 VBoxVMSettingsDlg *aDlg, 56 58 const QString &aPath) 57 : Q Widget(aParent)59 : QIWithRetranslateUI<QWidget> (aParent) 58 60 { 59 61 /* Apply UI decorations */ … … 119 121 mSlRam->setMinimum ((MinRAM / mSlRam->pageStep()) * mSlRam->pageStep()); 120 122 mSlRam->setMaximum (MaxRAM); 121 mLbRamMin->setText (tr ("<qt>%1 MB</qt>").arg (MinRAM));122 mLbRamMax->setText (tr ("<qt>%1 MB</qt>").arg (MaxRAM));123 123 /* Limit min/max. size of QLineEdit */ 124 124 mLeRam->setMaximumSize (mLeRam->fontMetrics().width ("99999"), … … 134 134 mSlVideo->setMinimum ((MinVRAM / mSlVideo->pageStep()) * mSlVideo->pageStep()); 135 135 mSlVideo->setMaximum (MaxVRAM); 136 mLbVideoMin->setText (tr ("<qt>%1 MB</qt>").arg (MinVRAM));137 mLbVideoMax->setText (tr ("<qt>%1 MB</qt>").arg (MaxVRAM));138 136 /* Limit min/max. size of QLineEdit */ 139 137 mLeVideo->setMaximumSize (mLeVideo->fontMetrics().width ("99999"), … … 144 142 145 143 /* Shared Clipboard mode */ 146 mCbClipboard->insertItem (mCbClipboard->count(), 147 vboxGlobal().toString (KClipboardMode_Disabled)); 148 mCbClipboard->insertItem (mCbClipboard->count(), 149 vboxGlobal().toString (KClipboardMode_HostToGuest)); 150 mCbClipboard->insertItem (mCbClipboard->count(), 151 vboxGlobal().toString (KClipboardMode_GuestToHost)); 152 mCbClipboard->insertItem (mCbClipboard->count(), 153 vboxGlobal().toString (KClipboardMode_Bidirectional)); 144 mCbClipboard->addItem (""); /* KClipboardMode_Disabled */ 145 mCbClipboard->addItem (""); /* KClipboardMode_HostToGuest */ 146 mCbClipboard->addItem (""); /* KClipboardMode_GuestToHost */ 147 mCbClipboard->addItem (""); /* KClipboardMode_Bidirectional */ 154 148 155 149 /* IDE Controller Type */ 156 mCbIDEController->insertItem (mCbIDEController->count(), 157 vboxGlobal().toString (KIDEControllerType_PIIX3)); 158 mCbIDEController->insertItem (mCbIDEController->count(), 159 vboxGlobal().toString (KIDEControllerType_PIIX4)); 150 mCbIDEController->addItem (""); /* KIDEControllerType_PIIX3 */ 151 mCbIDEController->addItem (""); /* KIDEControllerType_PIIX4 */ 160 152 161 153 qApp->installEventFilter (this); 154 /* Applying language settings */ 155 retranslateUi(); 162 156 } 163 157 … … 200 194 /* Boot-order */ 201 195 { 196 mTwBootOrder->clear(); 202 197 /* Load boot-items of current VM */ 203 198 QStringList uniqueList; 204 int minimumWidth = 0;205 199 for (int i = 1; i <= 4; ++ i) 206 200 { 207 KDeviceType type = aMachine.GetBootOrder (i);201 KDeviceType type = mMachine.GetBootOrder (i); 208 202 if (type != KDeviceType_Null) 209 203 { … … 211 205 QTreeWidgetItem *item = 212 206 new QTreeWidgetItem (mTwBootOrder, QStringList (name)); 207 QVariant vtype (type); 208 item->setData (0, ITEM_TYPE_ROLE, vtype); 213 209 item->setCheckState (0, Qt::Checked); 214 210 uniqueList << name; 215 216 QFontMetrics fm (item->font (0));217 int wid = fm.width (item->text (0));218 if (wid > minimumWidth) minimumWidth = wid;219 211 } 220 212 } … … 227 219 QTreeWidgetItem *item = 228 220 new QTreeWidgetItem (mTwBootOrder, QStringList (name)); 221 item->setData (0, ITEM_TYPE_ROLE, i); 229 222 item->setCheckState (0, Qt::Unchecked); 230 223 uniqueList << name; 231 232 QFontMetrics fm (item->font (0));233 int wid = fm.width (item->text (0));234 if (wid > minimumWidth) minimumWidth = wid;235 224 } 236 225 } 237 QFontMetrics fm (mTwBootOrder->topLevelItem (0)->font (0)); 238 int minimumHeight = fm.height(); 239 240 mTwBootOrder->setFixedWidth (minimumWidth + 241 28 /* check box */ + 242 4 /* viewport margin */); 243 mTwBootOrder->setFixedHeight (mTwBootOrder->topLevelItemCount() * 244 minimumHeight + 245 4 /* viewport margin */); 226 adjustBootOrderTWSize (); 246 227 } 247 228 … … 360 341 mCbSaveMounted->isChecked() ? "yes" : "no"); 361 342 } 343 344 345 void VBoxVMSettingsGeneral::retranslateUi() 346 { 347 /* Translate uic generated strings */ 348 Ui::VBoxVMSettingsGeneral::retranslateUi (this); 349 mTwBootOrder->header()->setResizeMode (QHeaderView::ResizeToContents); 350 mTwBootOrder->resizeColumnToContents (0); 351 mTwBootOrder->updateGeometry(); 352 353 CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties(); 354 mLbRamMin->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMinGuestRAM())); 355 mLbRamMax->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMaxGuestRAM())); 356 mLbVideoMin->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMinGuestVRAM())); 357 mLbVideoMax->setText (tr ("<qt>%1 MB</qt>").arg (sys.GetMaxGuestVRAM())); 358 359 /* Retranslate the boot order items */ 360 QTreeWidgetItemIterator it (mTwBootOrder); 361 while (*it) 362 { 363 QTreeWidgetItem *item = (*it); 364 item->setText (0, vboxGlobal().toString ( 365 static_cast<KDeviceType> (item->data (0, ITEM_TYPE_ROLE).toInt()))); 366 ++it; 367 } 368 /* Readjust the tree widget size */ 369 adjustBootOrderTWSize (); 370 371 /* Shared Clipboard mode */ 372 mCbClipboard->setItemText (0, vboxGlobal().toString (KClipboardMode_Disabled)); 373 mCbClipboard->setItemText (1, vboxGlobal().toString (KClipboardMode_HostToGuest)); 374 mCbClipboard->setItemText (2, vboxGlobal().toString (KClipboardMode_GuestToHost)); 375 mCbClipboard->setItemText (3, vboxGlobal().toString (KClipboardMode_Bidirectional)); 376 377 /* IDE Controller Type */ 378 mCbIDEController->setItemText (0, vboxGlobal().toString (KIDEControllerType_PIIX3)); 379 mCbIDEController->setItemText (1, vboxGlobal().toString (KIDEControllerType_PIIX4)); 380 } 381 362 382 363 383 void VBoxVMSettingsGeneral::valueChangedRAM (int aVal) … … 495 515 } 496 516 517 void VBoxVMSettingsGeneral::adjustBootOrderTWSize () 518 { 519 if (mTwBootOrder) 520 { 521 /* Calculate the optimal size of the tree widget & set it as fixed 522 * size. */ 523 mTwBootOrder->setFixedSize (static_cast<QAbstractItemView*> (mTwBootOrder)->sizeHintForColumn (0) + 2 * mTwBootOrder->frameWidth(), 524 static_cast<QAbstractItemView*> (mTwBootOrder)->sizeHintForRow (0) * mTwBootOrder->topLevelItemCount() + 2 * mTwBootOrder->frameWidth()); 525 } 526 } -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsHD.cpp
r9654 r9751 396 396 VBoxVMSettingsDlg *aDlg, 397 397 const QString &aPath) 398 : Q Widget(aParent)398 : QIWithRetranslateUI<QWidget> (aParent) 399 399 { 400 400 /* Apply UI decorations */ … … 448 448 mTwAts->addAction (mVdmAction); 449 449 450 mNewAction->setText (tr ("&Add Attachment"));451 mDelAction->setText (tr ("&Remove Attachment"));452 mVdmAction->setText (tr ("&Select Hard Disk"));453 454 450 mNewAction->setShortcut (QKeySequence ("Ins")); 455 451 mDelAction->setShortcut (QKeySequence ("Del")); 456 452 mVdmAction->setShortcut (QKeySequence ("Ctrl+Space")); 457 458 mNewAction->setToolTip (mNewAction->text().remove ('&') +459 QString (" (%1)").arg (mNewAction->shortcut().toString()));460 mDelAction->setToolTip (mDelAction->text().remove ('&') +461 QString (" (%1)").arg (mDelAction->shortcut().toString()));462 mVdmAction->setToolTip (mVdmAction->text().remove ('&') +463 QString (" (%1)").arg (mVdmAction->shortcut().toString()));464 465 mNewAction->setWhatsThis (tr ("Adds a new hard disk attachment."));466 mDelAction->setWhatsThis (tr ("Removes the highlighted hard disk attachment."));467 mVdmAction->setWhatsThis (tr ("Invokes the Virtual Disk Manager to select "468 "a hard disk to attach to the currently "469 "highlighted slot."));470 453 471 454 mNewAction->setIcon (VBoxGlobal::iconSet (":/vdm_add_16px.png", … … 507 490 setTabOrder (aDlg->mTwSelector, mCbSATA); 508 491 setTabOrder (mCbSATA, mTwAts); 492 /* Applying language settings */ 493 retranslateUi(); 509 494 } 510 495 … … 607 592 } 608 593 594 595 void VBoxVMSettingsHD::retranslateUi() 596 { 597 /* Translate uic generated strings */ 598 Ui::VBoxVMSettingsHD::retranslateUi (this); 599 600 mNewAction->setText (tr ("&Add Attachment")); 601 mDelAction->setText (tr ("&Remove Attachment")); 602 mVdmAction->setText (tr ("&Select Hard Disk")); 603 604 mNewAction->setToolTip (mNewAction->text().remove ('&') + 605 QString (" (%1)").arg (mNewAction->shortcut().toString())); 606 mDelAction->setToolTip (mDelAction->text().remove ('&') + 607 QString (" (%1)").arg (mDelAction->shortcut().toString())); 608 mVdmAction->setToolTip (mVdmAction->text().remove ('&') + 609 QString (" (%1)").arg (mVdmAction->shortcut().toString())); 610 611 mNewAction->setWhatsThis (tr ("Adds a new hard disk attachment.")); 612 mDelAction->setWhatsThis (tr ("Removes the highlighted hard disk attachment.")); 613 mVdmAction->setWhatsThis (tr ("Invokes the Virtual Disk Manager to select " 614 "a hard disk to attach to the currently " 615 "highlighted slot.")); 616 } 617 609 618 void VBoxVMSettingsHD::getFrom() 610 619 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsNetwork.cpp
r9654 r9751 55 55 // #endif 56 56 57 VBoxVMSettingsNetwork::VBoxVMSettingsNetwork() 58 : mValidator (0) 57 VBoxVMSettingsNetwork::VBoxVMSettingsNetwork(QWidget *aParent /* = NULL */) 58 : QIWithRetranslateUI<QWidget> (aParent) 59 , mValidator (0) 59 60 { 60 61 /* Apply UI decorations */ … … 84 85 #endif 85 86 86 /* Load initial values */ 87 88 mCbAType->insertItem (0, 89 vboxGlobal().toString (KNetworkAdapterType_Am79C970A)); 90 mCbAType->insertItem (1, 91 vboxGlobal().toString (KNetworkAdapterType_Am79C973)); 92 #ifdef VBOX_WITH_E1000 93 mCbAType->insertItem (2, 94 vboxGlobal().toString (KNetworkAdapterType_I82540EM)); 95 mCbAType->insertItem (3, 96 vboxGlobal().toString (KNetworkAdapterType_I82543GC)); 97 #endif 98 99 mCbNAType->insertItem (0, 100 vboxGlobal().toString (KNetworkAttachmentType_Null)); 101 mCbNAType->insertItem (1, 102 vboxGlobal().toString (KNetworkAttachmentType_NAT)); 103 #ifndef Q_WS_MAC /* Not yet on the Mac */ 104 mCbNAType->insertItem (2, 105 vboxGlobal().toString (KNetworkAttachmentType_HostInterface)); 106 mCbNAType->insertItem (3, 107 vboxGlobal().toString (KNetworkAttachmentType_Internal)); 108 #endif 87 /* Applying language settings */ 88 retranslateUi(); 109 89 } 110 90 … … 178 158 VBoxVMSettingsNetwork *page = new VBoxVMSettingsNetwork(); 179 159 160 /* Set the mAdapter member which is necessary for next pageTitle call. */ 161 page->mAdapter = adapter; 180 162 /* Setup validation */ 181 QString pageTitle = QString (tr ("Adapter %1", "network"))182 .arg (adapter.GetSlot());183 184 163 QIWidgetValidator *wval = 185 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page Title),164 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()), 186 165 aPage, aDlg); 187 166 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), … … 197 176 198 177 /* Attach Adapter's page to Tab Widget */ 199 mTwAdapters->addTab (page, page Title);178 mTwAdapters->addTab (page, page->pageTitle()); 200 179 } 201 180 … … 366 345 mValidator->revalidate(); 367 346 } 347 348 349 void VBoxVMSettingsNetwork::retranslateUi() 350 { 351 /* Translate uic generated strings */ 352 Ui::VBoxVMSettingsNetwork::retranslateUi (this); 353 354 mTwAdapters->setTabText (mTwAdapters->indexOf (this), pageTitle()); 355 356 prepareComboboxes(); 357 } 358 368 359 369 360 void VBoxVMSettingsNetwork::naTypeChanged (const QString &aString) … … 555 546 // #endif 556 547 548 QString VBoxVMSettingsNetwork::pageTitle() const 549 { 550 QString pageTitle; 551 if (!mAdapter.isNull()) 552 { 553 pageTitle = QString (tr ("Adapter %1", "network")) 554 .arg (mAdapter.GetSlot()); 555 } 556 return pageTitle; 557 } 558 559 void VBoxVMSettingsNetwork::prepareComboboxes() 560 { 561 /* Save the current selected value */ 562 int currentAdapter = mCbAType->currentIndex(); 563 /* Clear the driver box */ 564 mCbAType->clear(); 565 /* Refill them */ 566 mCbAType->insertItem (0, 567 vboxGlobal().toString (KNetworkAdapterType_Am79C970A)); 568 mCbAType->insertItem (1, 569 vboxGlobal().toString (KNetworkAdapterType_Am79C973)); 570 #ifdef VBOX_WITH_E1000 571 mCbAType->insertItem (2, 572 vboxGlobal().toString (KNetworkAdapterType_I82540EM)); 573 mCbAType->insertItem (3, 574 vboxGlobal().toString (KNetworkAdapterType_I82543GC)); 575 #endif 576 /* Set the old value */ 577 mCbAType->setCurrentIndex (currentAdapter); 578 579 /* Save the current selected value */ 580 int currentAttachment = mCbNAType->currentIndex(); 581 /* Clear the driver box */ 582 mCbNAType->clear(); 583 /* Refill them */ 584 mCbNAType->insertItem (0, 585 vboxGlobal().toString (KNetworkAttachmentType_Null)); 586 mCbNAType->insertItem (1, 587 vboxGlobal().toString (KNetworkAttachmentType_NAT)); 588 #ifndef Q_WS_MAC /* Not yet on the Mac */ 589 mCbNAType->insertItem (2, 590 vboxGlobal().toString (KNetworkAttachmentType_HostInterface)); 591 mCbNAType->insertItem (3, 592 vboxGlobal().toString (KNetworkAttachmentType_Internal)); 593 #endif 594 /* Set the old value */ 595 mCbNAType->setCurrentIndex (currentAttachment); 596 } 597 557 598 void VBoxVMSettingsNetwork::prepareListNetworks() 558 599 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsParallel.cpp
r9654 r9751 31 31 QTabWidget* VBoxVMSettingsParallel::mTabWidget = 0; 32 32 33 VBoxVMSettingsParallel::VBoxVMSettingsParallel() 33 VBoxVMSettingsParallel::VBoxVMSettingsParallel(QWidget* aParent /* = NULL */) 34 : QIWithRetranslateUI<QWidget> (aParent) 34 35 { 35 36 /* Apply UI decorations */ … … 48 49 49 50 /* Set initial values */ 51 /* Note: If you change one of the following don't forget retranslateUi. */ 50 52 mCbNumber->insertItem (0, vboxGlobal().toCOMPortName (0, 0)); 51 53 mCbNumber->insertItems (0, vboxGlobal().COMPortNames()); … … 56 58 connect (mCbNumber, SIGNAL (activated (const QString &)), 57 59 this, SLOT (mCbNumberActivated (const QString &))); 60 /* Applying language settings */ 61 retranslateUi(); 58 62 } 59 63 … … 80 84 VBoxVMSettingsParallel *page = new VBoxVMSettingsParallel(); 81 85 page->getFromPort (port); 82 QString pageTitle = QString (tr ("Port %1", "parallel ports")) 83 .arg (port.GetSlot()); 84 mTabWidget->addTab (page, pageTitle); 86 mTabWidget->addTab (page, page->pageTitle()); 85 87 86 88 /* Setup validation. */ 87 89 QIWidgetValidator *wval = 88 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page Title),90 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()), 89 91 aPage, mTabWidget); 90 92 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), … … 113 115 page->putBackToPort(); 114 116 } 115 }116 117 void VBoxVMSettingsParallel::mGbParallelToggled (bool aOn)118 {119 if (aOn)120 mCbNumberActivated (mCbNumber->currentText());121 }122 123 void VBoxVMSettingsParallel::mCbNumberActivated (const QString &aText)124 {125 ulong IRQ, IOBase;126 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase);127 128 mLeIRQ->setEnabled (!std);129 mLeIOPort->setEnabled (!std);130 if (std)131 {132 mLeIRQ->setText (QString::number (IRQ));133 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper());134 }135 }136 137 void VBoxVMSettingsParallel::getFromPort (const CParallelPort &aPort)138 {139 mPort = aPort;140 141 mGbParallel->setChecked (mPort.GetEnabled());142 ulong IRQ = mPort.GetIRQ();143 ulong IOBase = mPort.GetIOBase();144 mCbNumber->setCurrentIndex (mCbNumber->145 findText (vboxGlobal().toCOMPortName (IRQ, IOBase)));146 mLeIRQ->setText (QString::number (IRQ));147 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper());148 mLePath->setText (mPort.GetPath());149 150 /* Ensure everything is up-to-date */151 mGbParallelToggled (mGbParallel->isChecked());152 }153 154 void VBoxVMSettingsParallel::putBackToPort()155 {156 mPort.SetEnabled (mGbParallel->isChecked());157 mPort.SetIRQ (mLeIRQ->text().toULong (NULL, 0));158 mPort.SetIOBase (mLeIOPort->text().toULong (NULL, 0));159 mPort.SetPath (QDir::convertSeparators (mLePath->text()));160 }161 162 bool VBoxVMSettingsParallel::isUserDefined()163 {164 ulong a, b;165 return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b);166 117 } 167 118 … … 215 166 } 216 167 168 169 void VBoxVMSettingsParallel::retranslateUi() 170 { 171 /* Translate uic generated strings */ 172 Ui::VBoxVMSettingsParallel::retranslateUi (this); 173 174 mTabWidget->setTabText (mTabWidget->indexOf (this), pageTitle()); 175 176 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); 177 } 178 179 180 void VBoxVMSettingsParallel::mGbParallelToggled (bool aOn) 181 { 182 if (aOn) 183 mCbNumberActivated (mCbNumber->currentText()); 184 } 185 186 void VBoxVMSettingsParallel::mCbNumberActivated (const QString &aText) 187 { 188 ulong IRQ, IOBase; 189 bool std = vboxGlobal().toCOMPortNumbers (aText, IRQ, IOBase); 190 191 mLeIRQ->setEnabled (!std); 192 mLeIOPort->setEnabled (!std); 193 if (std) 194 { 195 mLeIRQ->setText (QString::number (IRQ)); 196 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 197 } 198 } 199 200 void VBoxVMSettingsParallel::getFromPort (const CParallelPort &aPort) 201 { 202 mPort = aPort; 203 204 mGbParallel->setChecked (mPort.GetEnabled()); 205 ulong IRQ = mPort.GetIRQ(); 206 ulong IOBase = mPort.GetIOBase(); 207 mCbNumber->setCurrentIndex (mCbNumber-> 208 findText (vboxGlobal().toCOMPortName (IRQ, IOBase))); 209 mLeIRQ->setText (QString::number (IRQ)); 210 mLeIOPort->setText ("0x" + QString::number (IOBase, 16).toUpper()); 211 mLePath->setText (mPort.GetPath()); 212 213 /* Ensure everything is up-to-date */ 214 mGbParallelToggled (mGbParallel->isChecked()); 215 } 216 217 void VBoxVMSettingsParallel::putBackToPort() 218 { 219 mPort.SetEnabled (mGbParallel->isChecked()); 220 mPort.SetIRQ (mLeIRQ->text().toULong (NULL, 0)); 221 mPort.SetIOBase (mLeIOPort->text().toULong (NULL, 0)); 222 mPort.SetPath (QDir::convertSeparators (mLePath->text())); 223 } 224 225 bool VBoxVMSettingsParallel::isUserDefined() 226 { 227 ulong a, b; 228 return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b); 229 } 230 231 QString VBoxVMSettingsParallel::pageTitle() const 232 { 233 QString pageTitle; 234 if (!mPort.isNull()) 235 pageTitle = QString (tr ("Port %1", "parallel ports")) 236 .arg (mPort.GetSlot()); 237 return pageTitle; 238 } 239 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsSerial.cpp
r9654 r9751 31 31 QTabWidget* VBoxVMSettingsSerial::mTabWidget = 0; 32 32 33 VBoxVMSettingsSerial::VBoxVMSettingsSerial() 33 VBoxVMSettingsSerial::VBoxVMSettingsSerial(QWidget* aParent /* = NULL */) 34 : QIWithRetranslateUI<QWidget> (aParent) 34 35 { 35 36 /* Apply UI decorations */ … … 48 49 49 50 /* Set initial values */ 51 /* Note: If you change one of the following don't forget retranslateUi. */ 50 52 mCbNumber->insertItem (0, vboxGlobal().toCOMPortName (0, 0)); 51 53 mCbNumber->insertItems (0, vboxGlobal().COMPortNames()); 52 mCbMode->insertItem (0, vboxGlobal().toString (KPortMode_HostDevice)); 53 mCbMode->insertItem (0, vboxGlobal().toString (KPortMode_HostPipe)); 54 mCbMode->insertItem (0, vboxGlobal().toString (KPortMode_Disconnected)); 54 55 mCbMode->addItem (""); /* KPortMode_Disconnected */ 56 mCbMode->addItem (""); /* KPortMode_HostPipe */ 57 mCbMode->addItem (""); /* KPortMode_HostDevice */ 55 58 56 59 /* Setup connections */ … … 61 64 connect (mCbMode, SIGNAL (activated (const QString &)), 62 65 this, SLOT (mCbModeActivated (const QString &))); 66 /* Applying language settings */ 67 retranslateUi(); 63 68 } 64 69 … … 85 90 VBoxVMSettingsSerial *page = new VBoxVMSettingsSerial(); 86 91 page->getFromPort (port); 87 QString pageTitle = QString (tr ("Port %1", "serial ports")) 88 .arg (port.GetSlot()); 89 mTabWidget->addTab (page, pageTitle); 92 mTabWidget->addTab (page, page->pageTitle()); 90 93 91 94 /* Setup validation. */ 92 95 QIWidgetValidator *wval = 93 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page Title),96 new QIWidgetValidator (QString ("%1: %2").arg (aPath, page->pageTitle()), 94 97 aPage, mTabWidget); 95 98 connect (wval, SIGNAL (validityChanged (const QIWidgetValidator *)), … … 150 153 mCbPipe->setEnabled (mode == KPortMode_HostPipe); 151 154 mLePath->setEnabled (mode != KPortMode_Disconnected); 155 } 156 157 QString VBoxVMSettingsSerial::pageTitle() const 158 { 159 QString pageTitle; 160 if (!mPort.isNull()) 161 { 162 pageTitle = QString (tr ("Port %1", "serial ports")) 163 .arg (mPort.GetSlot()); 164 } 165 return pageTitle; 152 166 } 153 167 … … 187 201 return !vboxGlobal().toCOMPortNumbers (mCbNumber->currentText(), a, b); 188 202 } 203 204 205 void VBoxVMSettingsSerial::retranslateUi() 206 { 207 /* Translate uic generated strings */ 208 Ui::VBoxVMSettingsSerial::retranslateUi (this); 209 210 mTabWidget->setTabText (mTabWidget->indexOf (this), pageTitle()); 211 212 mCbNumber->setItemText (mCbNumber->count() - 1, vboxGlobal().toCOMPortName (0, 0)); 213 214 mCbMode->setItemText (2, vboxGlobal().toString (KPortMode_HostDevice)); 215 mCbMode->setItemText (1, vboxGlobal().toString (KPortMode_HostPipe)); 216 mCbMode->setItemText (0, vboxGlobal().toString (KPortMode_Disconnected)); 217 } 218 189 219 190 220 bool VBoxVMSettingsSerial::revalidate (QString &aWarning, QString &aTitle) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsUSB.cpp
r9654 r9751 40 40 VBoxVMSettingsDlg *aDlg, 41 41 const QString &aPath) 42 : Q Widget(aParent)42 : QIWithRetranslateUI<QWidget> (aParent) 43 43 , mType (aType) 44 44 { … … 58 58 mMdnAction = new QAction (mTwFilters); 59 59 60 mNewAction->setText (tr ("&Add Empty Filter"));61 mAddAction->setText (tr ("A&dd Filter From Device"));62 mDelAction->setText (tr ("&Remove Filter"));63 mMupAction->setText (tr ("&Move Filter Up"));64 mMdnAction->setText (tr ("M&ove Filter Down"));65 66 60 mNewAction->setShortcut (QKeySequence ("Ins")); 67 61 mAddAction->setShortcut (QKeySequence ("Alt+Ins")); … … 69 63 mMupAction->setShortcut (QKeySequence ("Ctrl+Up")); 70 64 mMdnAction->setShortcut (QKeySequence ("Ctrl+Down")); 71 72 mNewAction->setToolTip (mNewAction->text().remove ('&') +73 QString (" (%1)").arg (mNewAction->shortcut().toString()));74 mAddAction->setToolTip (mAddAction->text().remove ('&') +75 QString (" (%1)").arg (mAddAction->shortcut().toString()));76 mDelAction->setToolTip (mDelAction->text().remove ('&') +77 QString (" (%1)").arg (mDelAction->shortcut().toString()));78 mMupAction->setToolTip (mMupAction->text().remove ('&') +79 QString (" (%1)").arg (mMupAction->shortcut().toString()));80 mMdnAction->setToolTip (mMdnAction->text().remove ('&') +81 QString (" (%1)").arg (mMdnAction->shortcut().toString()));82 83 mNewAction->setWhatsThis (tr ("Adds a new USB filter with all fields "84 "initially set to empty strings. Note "85 "that such a filter will match any "86 "attached USB device."));87 mAddAction->setWhatsThis (tr ("Adds a new USB filter with all fields "88 "set to the values of the selected USB "89 "device attached to the host PC."));90 mDelAction->setWhatsThis (tr ("Removes the selected USB filter."));91 mMupAction->setWhatsThis (tr ("Moves the selected USB filter up."));92 mMdnAction->setWhatsThis (tr ("Moves the selected USB filter down."));93 65 94 66 mNewAction->setIcon (VBoxGlobal::iconSet (":/usb_new_16px.png", … … 171 143 mTwFilters->header()->hide(); 172 144 173 mCbRemote-> insertItem (0, tr ("Any", "remote"));174 mCbRemote-> insertItem (1, tr ("Yes", "remote"));175 mCbRemote-> insertItem (2, tr ("No", "remote"));145 mCbRemote->addItem (""); /* Any */ 146 mCbRemote->addItem (""); /* Yes */ 147 mCbRemote->addItem (""); /* No */ 176 148 mLbRemote->setHidden (mType != MachineType); 177 149 mCbRemote->setHidden (mType != MachineType); 178 150 179 mCbAction->insertItem (0, 180 vboxGlobal().toString (KUSBDeviceFilterAction_Ignore)); 181 mCbAction->insertItem (1, 182 vboxGlobal().toString (KUSBDeviceFilterAction_Hold)); 151 mCbAction->insertItem (0, ""); /* KUSBDeviceFilterAction_Ignore */ 152 mCbAction->insertItem (1, ""); /* KUSBDeviceFilterAction_Hold */ 183 153 mLbAction->setHidden (mType != HostType); 184 154 mCbAction->setHidden (mType != HostType); … … 198 168 setTabOrder (mLePort, mCbRemote); 199 169 setTabOrder (mCbRemote, mCbAction); 170 /* Applying language settings */ 171 retranslateUi(); 200 172 } 201 173 … … 282 254 mUSBFilterListModified = false; 283 255 } 256 257 258 void VBoxVMSettingsUSB::retranslateUi() 259 { 260 /* Translate uic generated strings */ 261 Ui::VBoxVMSettingsUSB::retranslateUi (this); 262 263 mNewAction->setText (tr ("&Add Empty Filter")); 264 mAddAction->setText (tr ("A&dd Filter From Device")); 265 mDelAction->setText (tr ("&Remove Filter")); 266 mMupAction->setText (tr ("&Move Filter Up")); 267 mMdnAction->setText (tr ("M&ove Filter Down")); 268 269 mNewAction->setToolTip (mNewAction->text().remove ('&') + 270 QString (" (%1)").arg (mNewAction->shortcut().toString())); 271 mAddAction->setToolTip (mAddAction->text().remove ('&') + 272 QString (" (%1)").arg (mAddAction->shortcut().toString())); 273 mDelAction->setToolTip (mDelAction->text().remove ('&') + 274 QString (" (%1)").arg (mDelAction->shortcut().toString())); 275 mMupAction->setToolTip (mMupAction->text().remove ('&') + 276 QString (" (%1)").arg (mMupAction->shortcut().toString())); 277 mMdnAction->setToolTip (mMdnAction->text().remove ('&') + 278 QString (" (%1)").arg (mMdnAction->shortcut().toString())); 279 280 mNewAction->setWhatsThis (tr ("Adds a new USB filter with all fields " 281 "initially set to empty strings. Note " 282 "that such a filter will match any " 283 "attached USB device.")); 284 mAddAction->setWhatsThis (tr ("Adds a new USB filter with all fields " 285 "set to the values of the selected USB " 286 "device attached to the host PC.")); 287 mDelAction->setWhatsThis (tr ("Removes the selected USB filter.")); 288 mMupAction->setWhatsThis (tr ("Moves the selected USB filter up.")); 289 mMdnAction->setWhatsThis (tr ("Moves the selected USB filter down.")); 290 291 mCbRemote->setItemText (0, tr ("Any", "remote")); 292 mCbRemote->setItemText (1, tr ("Yes", "remote")); 293 mCbRemote->setItemText (2, tr ("No", "remote")); 294 295 mCbAction->setItemText (0, 296 vboxGlobal().toString (KUSBDeviceFilterAction_Ignore)); 297 mCbAction->setItemText (1, 298 vboxGlobal().toString (KUSBDeviceFilterAction_Hold)); 299 300 mUSBFilterName = tr ("New Filter %1", "usb"); 301 } 302 284 303 285 304 void VBoxVMSettingsUSB::usbAdapterToggled (bool aOn) … … 416 435 /* Search for the max available filter index */ 417 436 int maxFilterIndex = 0; 418 QString usbFilterName = tr ("New Filter %1", "usb"); 419 QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$")); 437 QRegExp regExp (QString ("^") + mUSBFilterName.arg ("([0-9]+)") + QString ("$")); 420 438 QTreeWidgetItemIterator iterator (mTwFilters); 421 439 while (*iterator) … … 431 449 /* Creating new usb filter */ 432 450 CUSBDeviceFilter filter = mMachine.GetUSBController() 433 .CreateDeviceFilter ( usbFilterName.arg (maxFilterIndex + 1));451 .CreateDeviceFilter (mUSBFilterName.arg (maxFilterIndex + 1)); 434 452 435 453 filter.SetActive (true); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsVRDP.cpp
r9654 r9751 33 33 VBoxVMSettingsDlg *aDlg, 34 34 const QString &aPath) 35 : Q Widget(aParent)35 : QIWithRetranslateUI<QWidget> (aParent) 36 36 { 37 37 /* Apply UI decorations */ … … 57 57 58 58 /* Setup dialog */ 59 mCbVRDPMethod->insertItem (0, 60 vboxGlobal().toString (KVRDPAuthType_Null));61 mCbVRDPMethod->insertItem ( 1,62 vboxGlobal().toString (KVRDPAuthType_External)); 63 mCbVRDPMethod->insertItem (2,64 vboxGlobal().toString (KVRDPAuthType_Guest));59 mCbVRDPMethod->insertItem (0, ""); /* KVRDPAuthType_Null */ 60 mCbVRDPMethod->insertItem (1, ""); /* KVRDPAuthType_External */ 61 mCbVRDPMethod->insertItem (2, ""); /* KVRDPAuthType_Guest */ 62 63 /* Applying language settings */ 64 retranslateUi(); 65 65 } 66 66 … … 128 128 } 129 129 130 131 void VBoxVMSettingsVRDP::retranslateUi() 132 { 133 /* Translate uic generated strings */ 134 Ui::VBoxVMSettingsVRDP::retranslateUi (this); 135 136 mCbVRDPMethod->setItemText (0, 137 vboxGlobal().toString (KVRDPAuthType_Null)); 138 mCbVRDPMethod->setItemText (1, 139 vboxGlobal().toString (KVRDPAuthType_External)); 140 mCbVRDPMethod->setItemText (2, 141 vboxGlobal().toString (KVRDPAuthType_Guest)); 142 } 143 -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsGeneral.ui
r9654 r9751 479 479 <enum>Qt::ScrollBarAlwaysOff</enum> 480 480 </property> 481 <property name="alternatingRowColors" > 482 <bool>true</bool> 483 </property> 481 484 <property name="rootIsDecorated" > 482 485 <bool>false</bool>
Note:
See TracChangeset
for help on using the changeset viewer.