Changeset 8946 in vbox for trunk/src/VBox/Frontends/VirtualBox4
- Timestamp:
- May 20, 2008 9:51:01 AM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIDialogButtonBox.h
r8740 r8946 39 39 void setStandardButtons (StandardButtons aButtons); 40 40 41 private: 42 void initHelpButton(); 41 protected: 42 virtual void changeEvent (QEvent *aEvent); 43 void retranslateUi(); 43 44 }; 44 45 -
trunk/src/VBox/Frontends/VirtualBox4/include/QIHotKeyEdit.h
r8170 r8946 68 68 69 69 #if defined (Q_WS_PM) || defined (Q_WS_X11) 70 static void languageChange_qt3();70 static void retranslateUi(); 71 71 #endif 72 72 static QString keyName (int aKeyVal); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
r8600 r8946 96 96 bool x11Event (XEvent *event); 97 97 #endif 98 99 virtual void changeEvent (QEvent *aEvent); 100 void retranslateUi(); 101 98 102 #ifdef VBOX_WITH_DEBUGGER_GUI 99 103 bool dbgCreated(); … … 121 125 }; 122 126 123 void languageChange();124 125 127 void updateAppearanceOf (int element); 126 128 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDownloaderWgt.h
r8155 r8946 55 55 const QString &aUrl, const QString &aTarget); 56 56 57 void languageChange();58 57 59 58 bool isCheckingPresence() { return mIsChecking; } 59 60 protected: 61 virtual void changeEvent (QEvent *aEvent); 62 void retranslateUi(); 60 63 61 64 private slots: -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r8915 r8946 488 488 QString languageTranslators() const; 489 489 490 void languageChange();490 void retranslateUi(); 491 491 492 492 /** @internal made public for internal purposes */ -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r8159 r8946 85 85 bool event (QEvent *e); 86 86 87 protected slots: 88 89 private: 90 91 void languageChange(); 87 virtual void changeEvent (QEvent *aEvent); 88 void retranslateUi(); 92 89 93 90 private slots: -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSnapshotsWgt.h
r8742 r8946 43 43 void setMachine (const CMachine &aMachine); 44 44 45 46 virtual void changeEvent (QEvent *aEvent); 47 void retranslateUi(); 48 45 49 private slots: 46 50 … … 62 66 63 67 private: 64 65 bool event (QEvent *aEvent);66 void languageChange();67 68 68 69 void refreshAll (bool aKeepSelected = true); -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h
r8790 r8946 47 47 VBoxVMInformationDlg (VBoxConsoleView *aConsole, const CSession &aSession, 48 48 Qt::WindowFlags aFlags); 49 ~VBoxVMInformationDlg();49 ~VBoxVMInformationDlg(); 50 50 51 51 protected: 52 52 53 virtual void languageChange(); 53 virtual void changeEvent (QEvent *aEvent); 54 void retranslateUi(); 54 55 55 56 virtual bool event (QEvent *aEvent); -
trunk/src/VBox/Frontends/VirtualBox4/src/QIDialogButtonBox.cpp
r8740 r8946 25 25 /* Qt includes */ 26 26 #include <QPushButton> 27 #include <QEvent> 27 28 28 29 QIDialogButtonBox::QIDialogButtonBox (StandardButtons aButtons, Qt::Orientation aOrientation, QWidget *aParent) 29 30 : QDialogButtonBox (aButtons, aOrientation, aParent) 30 31 { 31 initHelpButton();32 retranslateUi(); 32 33 } 33 34 … … 35 36 { 36 37 QPushButton *btn = QDialogButtonBox::addButton (aText, aRole); 37 initHelpButton();38 retranslateUi(); 38 39 return btn; 39 40 } … … 42 43 { 43 44 QPushButton *btn = QDialogButtonBox::addButton (aButton); 44 initHelpButton();45 retranslateUi(); 45 46 return btn; 46 47 } … … 49 50 { 50 51 QDialogButtonBox::setStandardButtons (aButtons); 51 initHelpButton();52 retranslateUi(); 52 53 } 53 54 54 void QIDialogButtonBox::initHelpButton() 55 void QIDialogButtonBox::changeEvent (QEvent *aEvent) 56 { 57 QDialogButtonBox::changeEvent (aEvent); 58 switch (aEvent->type()) 59 { 60 case QEvent::LanguageChange: 61 { 62 retranslateUi(); 63 aEvent->accept(); 64 break; 65 } 66 default: 67 break; 68 } 69 } 70 71 void QIDialogButtonBox::retranslateUi() 55 72 { 56 73 QPushButton *btn = button (QDialogButtonBox::Help); 57 74 if (btn) 58 75 { 59 if (btn->text() == tr ("Help")) 60 btn->setText (tr ("&Help")); 76 btn->setText (tr ("&Help")); 61 77 if (btn->shortcut().isEmpty()) 62 78 btn->setShortcut (QKeySequence (tr ("F1"))); 63 79 } 64 80 } 65 -
trunk/src/VBox/Frontends/VirtualBox4/src/QIHotKeyEdit.cpp
r8170 r8946 214 214 // QSize (w + m, h + m) 215 215 // .expandedTo(QApplication::globalStrut()))); 216 QSize(10,10);216 return QSize(10,10); 217 217 } 218 218 … … 286 286 * keys to human readable key names. 287 287 */ 288 /* static */ 289 void QIHotKeyEdit::languageChange_qt3() 290 { 291 /* Note: strings for the same key must match strings in languageChange() 288 void QIHotKeyEdit::retranslateUi() 289 { 290 /* Note: strings for the same key must match strings in retranslateUi() 292 291 * versions for all platforms, to keep translators happy. */ 293 292 … … 341 340 * readable key names. 342 341 */ 343 /* static */ 344 void QIHotKeyEdit::languageChange_qt3() 345 { 346 /* Note: strings for the same key must match strings in languageChange() 342 void QIHotKeyEdit::retranslateUi() 343 { 344 /* Note: strings for the same key must match strings in retranslateUi() 347 345 * versions for all platforms, to keep translators happy. */ 348 346 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r8918 r8946 481 481 ///////////////////////////////////////////////////////////////////////// 482 482 483 languageChange();483 retranslateUi(); 484 484 485 485 setWindowTitle (caption_prefix); … … 1458 1458 #endif 1459 1459 1460 // 1461 // Private members 1462 ///////////////////////////////////////////////////////////////////////////// 1460 void VBoxConsoleWnd::changeEvent (QEvent *aEvent) 1461 { 1462 QMainWindow::changeEvent (aEvent); 1463 switch (aEvent->type()) 1464 { 1465 case QEvent::LanguageChange: 1466 { 1467 retranslateUi(); 1468 aEvent->accept(); 1469 break; 1470 } 1471 default: 1472 break; 1473 } 1474 } 1463 1475 1464 1476 /** … … 1466 1478 * language. 1467 1479 */ 1468 void VBoxConsoleWnd:: languageChange()1480 void VBoxConsoleWnd::retranslateUi() 1469 1481 { 1470 1482 #ifdef VBOX_OSE … … 1646 1658 } 1647 1659 1660 // 1661 // Private members 1662 ///////////////////////////////////////////////////////////////////////////// 1648 1663 1649 1664 void VBoxConsoleWnd::updateAppearanceOf (int element) -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDownloaderWgt.cpp
r8865 r8946 167 167 mConn->setcallbacks (OnBegin, OnData, OnComplete, this); 168 168 169 languageChange();169 retranslateUi(); 170 170 mStatusBar->addWidget (this, 1); 171 171 … … 174 174 } 175 175 176 void VBoxDownloaderWgt::languageChange() 176 void VBoxDownloaderWgt::changeEvent (QEvent *aEvent) 177 { 178 QWidget::changeEvent (aEvent); 179 switch (aEvent->type()) 180 { 181 case QEvent::LanguageChange: 182 { 183 retranslateUi(); 184 aEvent->accept(); 185 break; 186 } 187 default: 188 break; 189 } 190 } 191 192 void VBoxDownloaderWgt::retranslateUi() 177 193 { 178 194 mCancelButton->setText (tr ("Cancel")); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r8920 r8946 2421 2421 * currently installed translations tables. 2422 2422 */ 2423 void VBoxGlobal:: languageChange()2423 void VBoxGlobal::retranslateUi() 2424 2424 { 2425 2425 machineStates [KMachineState_PoweredOff] = tr ("Powered Off", "MachineState"); … … 2578 2578 * updated when the language is changed. */ 2579 2579 #warning port me 2580 QIHotKeyEdit:: languageChange_qt3();2580 QIHotKeyEdit::retranslateUi(); 2581 2581 #endif 2582 2582 } … … 4033 4033 /* call this only once per every language change (see 4034 4034 * QApplication::installTranslator() for details) */ 4035 languageChange();4035 retranslateUi(); 4036 4036 } 4037 4037 } … … 4188 4188 loadLanguage (languageId); 4189 4189 4190 languageChange();4190 retranslateUi(); 4191 4191 4192 4192 /* process command line */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r8907 r8946 56 56 class VBoxVMDetailsView : public QStackedWidget 57 57 { 58 Q_OBJECT 58 Q_OBJECT; 59 59 60 60 public: … … 62 62 VBoxVMDetailsView (QWidget *aParent, 63 63 QAction *aRefreshAction = NULL); 64 65 void languageChange();66 64 67 65 void setDetailsText (const QString &aText) … … 87 85 88 86 void linkClicked (const QString &aURL); 87 88 protected: 89 90 virtual void changeEvent (QEvent *aEvent); 91 void retranslateUi(); 89 92 90 93 private slots: … … 180 183 addWidget (mErrBox); 181 184 182 languageChange(); 183 } 184 185 void VBoxVMDetailsView::languageChange() 185 retranslateUi(); 186 } 187 188 void VBoxVMDetailsView::changeEvent (QEvent *aEvent) 189 { 190 QStackedWidget::changeEvent (aEvent); 191 switch (aEvent->type()) 192 { 193 case QEvent::LanguageChange: 194 { 195 retranslateUi(); 196 aEvent->accept(); 197 break; 198 } 199 default: 200 break; 201 } 202 } 203 204 void VBoxVMDetailsView::retranslateUi() 186 205 { 187 206 if (mErrLabel) … … 212 231 class VBoxVMDescriptionPage : public QWidget 213 232 { 214 Q_OBJECT 233 Q_OBJECT; 215 234 216 235 public: … … 221 240 void setMachineItem (VBoxVMItem *aItem); 222 241 223 void languageChange();224 242 void updateState(); 243 244 protected: 245 246 virtual void changeEvent (QEvent *aEvent); 247 void retranslateUi(); 225 248 226 249 private slots: … … 289 312 290 313 /* apply language settings */ 291 languageChange();314 retranslateUi(); 292 315 293 316 updateState(); … … 321 344 } 322 345 323 void VBoxVMDescriptionPage::languageChange() 346 void VBoxVMDescriptionPage::changeEvent (QEvent *aEvent) 347 { 348 QWidget::changeEvent (aEvent); 349 switch (aEvent->type()) 350 { 351 case QEvent::LanguageChange: 352 { 353 retranslateUi(); 354 aEvent->accept(); 355 break; 356 } 357 default: 358 break; 359 } 360 } 361 362 void VBoxVMDescriptionPage::retranslateUi() 324 363 { 325 364 mLabel->setText (tr ("No description. Press the Edit button below to add it.")); … … 587 626 mHelpMenu->addAction (helpResetMessagesAction); 588 627 589 languageChange();628 retranslateUi(); 590 629 591 630 /* restore the position of the window */ … … 1116 1155 break; 1117 1156 } 1118 case QEvent::LanguageChange:1119 {1120 languageChange();1121 break;1122 }1123 1157 1124 1158 default: … … 1129 1163 } 1130 1164 1131 // Private members 1132 ///////////////////////////////////////////////////////////////////////////// 1165 void VBoxSelectorWnd::changeEvent (QEvent *aEvent) 1166 { 1167 QMainWindow::changeEvent (aEvent); 1168 switch (aEvent->type()) 1169 { 1170 case QEvent::LanguageChange: 1171 { 1172 retranslateUi(); 1173 aEvent->accept(); 1174 break; 1175 } 1176 default: 1177 break; 1178 } 1179 } 1133 1180 1134 1181 /** … … 1136 1183 * language. 1137 1184 */ 1138 void VBoxSelectorWnd:: languageChange()1185 void VBoxSelectorWnd::retranslateUi() 1139 1186 { 1140 1187 #ifdef VBOX_OSE … … 1231 1278 mVMMenu->setTitle (tr ("&Machine")); 1232 1279 mHelpMenu->setTitle (tr ("&Help")); 1233 1234 vmDetailsView->languageChange(); 1235 vmDescriptionPage->languageChange(); 1236 } 1280 } 1281 1282 1283 // Private members 1284 ///////////////////////////////////////////////////////////////////////////// 1237 1285 1238 1286 // -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSnapshotsWgt.cpp
r8742 r8946 258 258 { 259 259 /* Apply UI decorations */ 260 setupUi (this);260 Ui::VBoxSnapshotsWgt::setupUi (this); 261 261 262 262 mTreeWidget->header()->hide(); … … 332 332 this, SLOT (snapshotChanged (const VBoxSnapshotEvent&))); 333 333 334 languageChange();334 retranslateUi(); 335 335 } 336 336 … … 665 665 } 666 666 667 668 bool VBoxSnapshotsWgt::event (QEvent *aEvent) 669 { 667 void VBoxSnapshotsWgt::changeEvent (QEvent *aEvent) 668 { 669 QWidget::changeEvent (aEvent); 670 670 switch (aEvent->type()) 671 671 { 672 672 case QEvent::LanguageChange: 673 673 { 674 languageChange(); 674 retranslateUi(); 675 aEvent->accept(); 675 676 break; 676 677 } 677 678 default: 678 default: 679 679 break; 680 680 } 681 682 return QWidget::event (aEvent); 683 } 684 685 void VBoxSnapshotsWgt::languageChange() 686 { 681 } 682 683 void VBoxSnapshotsWgt::retranslateUi() 684 { 685 /* Translate uic generated strings */ 686 Ui::VBoxSnapshotsWgt::retranslateUi (this); 687 687 688 mDiscardSnapshotAction->setText ("&Discard Snapshot"); 688 689 mTakeSnapshotAction->setText ("Take &Snapshot"); -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r8918 r8946 59 59 { 60 60 /* Apply UI decorations */ 61 setupUi (this);61 Ui::VBoxVMInformationDlg::setupUi (this); 62 62 63 63 /* Initialize parent defaults */ … … 88 88 89 89 /* Loading language constants */ 90 languageChange();90 retranslateUi(); 91 91 92 92 /* Details page update */ … … 128 128 } 129 129 130 131 void VBoxVMInformationDlg::languageChange() 132 { 130 void VBoxVMInformationDlg::changeEvent (QEvent *aEvent) 131 { 132 QIAbstractDialog::changeEvent (aEvent); 133 switch (aEvent->type()) 134 { 135 case QEvent::LanguageChange: 136 { 137 retranslateUi(); 138 aEvent->accept(); 139 break; 140 } 141 default: 142 break; 143 } 144 } 145 146 void VBoxVMInformationDlg::retranslateUi() 147 { 148 /* Translate uic generated strings */ 149 Ui::VBoxVMInformationDlg::retranslateUi (this); 150 133 151 AssertReturnVoid (!mSession.isNull()); 134 152 CMachine machine = mSession.GetMachine();
Note:
See TracChangeset
for help on using the changeset viewer.