Changeset 9056 in vbox for trunk/src/VBox
- Timestamp:
- May 22, 2008 1:56:00 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/QIDialogButtonBox.h
r8946 r9056 24 24 #define __QIDialogButtonBox_h__ 25 25 26 #include "QIWithRetranslateUI.h" 27 26 28 /* Qt includes */ 27 29 #include <QDialogButtonBox> 28 30 29 class QIDialogButtonBox: public Q DialogButtonBox31 class QIDialogButtonBox: public QIWithRetranslateUI<QDialogButtonBox> 30 32 { 31 33 public: 32 QIDialogButtonBox (QWidget *aParent = 0) :Q DialogButtonBox(aParent) {}33 QIDialogButtonBox (Qt::Orientation aOrientation, QWidget *aParent = 0) :Q DialogButtonBox (aOrientation, aParent) {}34 QIDialogButtonBox (QWidget *aParent = 0) :QIWithRetranslateUI<QDialogButtonBox> (aParent) {} 35 QIDialogButtonBox (Qt::Orientation aOrientation, QWidget *aParent = 0) :QIWithRetranslateUI<QDialogButtonBox> (aParent) { setOrientation (aOrientation); } 34 36 QIDialogButtonBox (StandardButtons aButtons, Qt::Orientation aOrientation = Qt::Horizontal, QWidget *aParent = 0); 35 37 … … 40 42 41 43 protected: 42 virtual void changeEvent (QEvent *aEvent); 44 43 45 void retranslateUi(); 44 46 }; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxCloseVMDlg.h
r8332 r9056 24 24 #define __VBoxCloseVMDlg_h__ 25 25 26 #include <VBoxCloseVMDlg.gen.h> 27 #include <QIDialog.h> 26 #include "VBoxCloseVMDlg.gen.h" 27 #include "QIWithRetranslateUI.h" 28 #include "QIDialog.h" 28 29 29 class VBoxCloseVMDlg : public QIDialog, public Ui::VBoxCloseVMDlg 30 class VBoxCloseVMDlg : public QIWithRetranslateUI2<QIDialog>, 31 public Ui::VBoxCloseVMDlg 30 32 { 31 Q_OBJECT 33 Q_OBJECT; 32 34 33 35 public: 34 36 35 37 VBoxCloseVMDlg (QWidget *aParent); 38 39 protected: 40 41 void retranslateUi(); 36 42 }; 37 43 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
r8946 r9056 25 25 26 26 #include "COMDefs.h" 27 #include "QIWithRetranslateUI.h" 27 28 28 29 /* Qt includes */ … … 54 55 class VBoxSwitchMenu; 55 56 56 class VBoxConsoleWnd : public Q MainWindow57 class VBoxConsoleWnd : public QIWithRetranslateUI2<QMainWindow> 57 58 { 58 Q_OBJECT 59 Q_OBJECT; 59 60 60 61 public: … … 97 98 #endif 98 99 99 virtual void changeEvent (QEvent *aEvent);100 100 void retranslateUi(); 101 101 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r8219 r9056 150 150 ShowWindowEventType, 151 151 #endif 152 ChangeGUILanguageEventType, 152 153 }; 153 154 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDownloaderWgt.h
r8946 r9056 25 25 26 26 #include "HappyHttp.h" 27 #include "QIWithRetranslateUI.h" 27 28 28 29 /* Qt includes */ … … 46 47 * into the VM console status bar. 47 48 */ 48 class VBoxDownloaderWgt : public Q Widget49 class VBoxDownloaderWgt : public QIWithRetranslateUI<QWidget> 49 50 { 50 Q_OBJECT 51 Q_OBJECT; 51 52 52 53 public: … … 59 60 60 61 protected: 61 virtual void changeEvent (QEvent *aEvent); 62 62 63 void retranslateUi(); 63 64 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
r8946 r9056 137 137 138 138 const bool mCanShow; 139 }; 140 141 class VBoxChangeGUILanguageEvent : public QEvent 142 { 143 public: 144 VBoxChangeGUILanguageEvent (QString aLangId) 145 : QEvent ((QEvent::Type) VBoxDefs::ChangeGUILanguageEventType) 146 , mLangId (aLangId) 147 {} 148 149 const QString mLangId; 139 150 }; 140 151 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSelectorWnd.h
r8946 r9056 26 26 #include "COMDefs.h" 27 27 28 #include "QIWithRetranslateUI.h" 28 29 #include "VBoxGlobal.h" 29 30 … … 44 45 class QUuid; 45 46 46 class VBoxSelectorWnd: public Q MainWindow47 class VBoxSelectorWnd: public QIWithRetranslateUI2<QMainWindow> 47 48 { 48 Q_OBJECT 49 Q_OBJECT; 49 50 50 51 public: … … 85 86 bool event (QEvent *e); 86 87 87 virtual void changeEvent (QEvent *aEvent);88 88 void retranslateUi(); 89 89 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSnapshotDetailsDlg.h
r8740 r9056 24 24 #define __VBoxSnapshotDetailsDlg_h__ 25 25 26 #include <VBoxSnapshotDetailsDlg.gen.h> 27 #include <COMDefs.h> 26 #include "VBoxSnapshotDetailsDlg.gen.h" 27 #include "QIWithRetranslateUI.h" 28 #include "COMDefs.h" 28 29 29 class VBoxSnapshotDetailsDlg : public QDialog, public Ui::VBoxSnapshotDetailsDlg 30 class VBoxSnapshotDetailsDlg : public QIWithRetranslateUI<QDialog>, 31 public Ui::VBoxSnapshotDetailsDlg 30 32 { 31 33 Q_OBJECT; … … 37 39 void getFromSnapshot (const CSnapshot &aSnapshot); 38 40 void putBackToSnapshot(); 41 42 protected: 43 44 void retranslateUi(); 39 45 40 46 private slots: -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxSnapshotsWgt.h
r8946 r9056 24 24 #define __VBoxSnapshotsWgt_h__ 25 25 26 #include <VBoxSnapshotsWgt.gen.h> 27 #include <VBoxGlobal.h> 26 #include "VBoxSnapshotsWgt.gen.h" 27 #include "VBoxGlobal.h" 28 #include "QIWithRetranslateUI.h" 29 30 /* Qt includes */ 28 31 #include <QUuid> 29 #include <COMDefs.h>30 32 31 33 class SnapshotWgtItem; … … 33 35 class QMenu; 34 36 35 class VBoxSnapshotsWgt : public QWidget, public Ui::VBoxSnapshotsWgt 37 class VBoxSnapshotsWgt : public QIWithRetranslateUI<QWidget>, 38 public Ui::VBoxSnapshotsWgt 36 39 { 37 40 Q_OBJECT; … … 43 46 void setMachine (const CMachine &aMachine); 44 47 48 protected: 45 49 46 virtual void changeEvent (QEvent *aEvent);47 50 void retranslateUi(); 48 51 -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMInformationDlg.h
r8946 r9056 24 24 #define __VBoxVMInformationDlg_h__ 25 25 26 #include <VBoxVMInformationDlg.gen.h> 27 #include <QIAbstractDialog.h> 28 #include <COMDefs.h> 26 #include "VBoxVMInformationDlg.gen.h" 27 #include "QIAbstractDialog.h" 28 #include "COMDefs.h" 29 #include "QIWithRetranslateUI.h" 29 30 30 31 class VBoxConsoleView; 31 32 class QTimer; 32 33 33 class VBoxVMInformationDlg : public QIAbstractDialog, public Ui::VBoxVMInformationDlg 34 class VBoxVMInformationDlg : public QIWithRetranslateUI2<QIAbstractDialog>, 35 public Ui::VBoxVMInformationDlg 34 36 { 35 Q_OBJECT 37 Q_OBJECT; 36 38 37 39 public: … … 51 53 protected: 52 54 53 virtual void changeEvent (QEvent *aEvent);54 55 void retranslateUi(); 55 56 -
trunk/src/VBox/Frontends/VirtualBox4/src/QIDialogButtonBox.cpp
r8946 r9056 28 28 29 29 QIDialogButtonBox::QIDialogButtonBox (StandardButtons aButtons, Qt::Orientation aOrientation, QWidget *aParent) 30 : Q DialogButtonBox (aButtons, aOrientation,aParent)30 : QIWithRetranslateUI<QDialogButtonBox> (aParent) 31 31 { 32 setOrientation (aOrientation); 33 setStandardButtons (aButtons); 34 32 35 retranslateUi(); 33 36 } … … 53 56 } 54 57 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 58 void QIDialogButtonBox::retranslateUi() 72 59 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxCloseVMDlg.cpp
r8741 r9056 28 28 29 29 VBoxCloseVMDlg::VBoxCloseVMDlg (QWidget *aParent) 30 : QI Dialog(aParent, Qt::Sheet)30 : QIWithRetranslateUI2<QIDialog> (aParent, Qt::Sheet) 31 31 { 32 32 /* Apply UI decorations */ 33 setupUi (this);33 Ui::VBoxCloseVMDlg::setupUi (this); 34 34 35 35 /* Set fixed size */ … … 40 40 } 41 41 42 void VBoxCloseVMDlg::retranslateUi() 43 { 44 /* Translate uic generated strings */ 45 Ui::VBoxCloseVMDlg::retranslateUi (this); 46 } 47 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
r9053 r9056 112 112 VBoxConsoleWnd (VBoxConsoleWnd **aSelf, QWidget* aParent, 113 113 Qt::WFlags aFlags) 114 : Q MainWindow(aParent, aFlags)114 : QIWithRetranslateUI2<QMainWindow> (aParent, aFlags) 115 115 , mMainMenu (0) 116 116 #ifdef VBOX_WITH_DEBUGGER_GUI … … 1458 1458 #endif 1459 1459 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 }1475 1476 1460 /** 1477 1461 * Sets the strings of the subwidgets using the current -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxDownloaderWgt.cpp
r8946 r9056 127 127 VBoxDownloaderWgt::VBoxDownloaderWgt (QStatusBar *aStatusBar, QAction *aAction, 128 128 const QString &aUrl, const QString &aTarget) 129 : Q Widget()129 : QIWithRetranslateUI<QWidget> () 130 130 , mUrl (aUrl), mTarget (aTarget) 131 131 , mStatusBar (aStatusBar), mAction (aAction) … … 172 172 /* Try to get the required file for the information */ 173 173 getFile(); 174 }175 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 174 } 191 175 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
r8946 r9056 280 280 QApplication::postEvent (&mGlobal, new VBoxCanShowRegDlgEvent (false)); 281 281 } 282 if (sKey == "GUI/LanguageID") 283 QApplication::postEvent (&mGlobal, new VBoxChangeGUILanguageEvent (sVal)); 282 284 283 285 mMutex.lock(); … … 4011 4013 return true; 4012 4014 } 4015 case VBoxDefs::ChangeGUILanguageEventType: 4016 { 4017 loadLanguage (static_cast<VBoxChangeGUILanguageEvent*> (e)->mLangId); 4018 return true; 4019 } 4013 4020 4014 4021 default: -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSelectorWnd.cpp
r8946 r9056 54 54 * and another one for inaccessibility errors. 55 55 */ 56 class VBoxVMDetailsView : public Q StackedWidget56 class VBoxVMDetailsView : public QIWithRetranslateUI<QStackedWidget> 57 57 { 58 58 Q_OBJECT; … … 88 88 protected: 89 89 90 virtual void changeEvent (QEvent *aEvent);91 90 void retranslateUi(); 92 91 … … 119 118 VBoxVMDetailsView::VBoxVMDetailsView (QWidget *aParent, 120 119 QAction *aRefreshAction /* = NULL */) 121 : Q StackedWidget(aParent)120 : QIWithRetranslateUI<QStackedWidget> (aParent) 122 121 , mErrBox (NULL), mErrLabel (NULL), mErrText (NULL) 123 122 , mRefreshButton (NULL) … … 184 183 185 184 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 185 } 203 186 … … 229 212 * Comments page widget to represent VM comments. 230 213 */ 231 class VBoxVMDescriptionPage : public Q Widget214 class VBoxVMDescriptionPage : public QIWithRetranslateUI<QWidget> 232 215 { 233 216 Q_OBJECT; … … 244 227 protected: 245 228 246 virtual void changeEvent (QEvent *aEvent);247 229 void retranslateUi(); 248 230 … … 262 244 263 245 VBoxVMDescriptionPage::VBoxVMDescriptionPage (VBoxSelectorWnd *aParent) 264 : Q Widget(aParent)246 : QIWithRetranslateUI<QWidget> (aParent) 265 247 , mItem (NULL), mParent (aParent) 266 248 , mBtnEdit (0), mBrowser (0), mLabel (0) … … 342 324 /* check initial machine and session states */ 343 325 updateState(); 344 }345 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 326 } 361 327 … … 421 387 VBoxSelectorWnd (VBoxSelectorWnd **aSelf, QWidget* aParent, 422 388 Qt::WFlags aFlags) 423 : Q MainWindow(aParent, aFlags)389 : QIWithRetranslateUI2<QMainWindow> (aParent, aFlags) 424 390 , doneInaccessibleWarningOnce (false) 425 391 { … … 1163 1129 } 1164 1130 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 }1180 1181 1131 /** 1182 1132 * Sets the strings of the subwidgets using the current -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSnapshotDetailsDlg.cpp
r8740 r9056 30 30 31 31 VBoxSnapshotDetailsDlg::VBoxSnapshotDetailsDlg (QWidget *aParent) 32 : Q Dialog(aParent)32 : QIWithRetranslateUI<QDialog> (aParent) 33 33 { 34 34 /* Apply UI decorations */ 35 setupUi (this);35 Ui::VBoxSnapshotDetailsDlg::setupUi (this); 36 36 37 37 /* Setup mTeSummary browser. */ … … 57 57 mTeDescription->setText (aSnapshot.GetDescription()); 58 58 59 /* Compose summary */ 60 mTeSummary->setText ( 61 vboxGlobal().detailsReport (machine, false /* isNewVM */, 62 false /* withLinks */)); 63 setWindowTitle (tr ("Details of %1 (%2)") 64 .arg (mSnapshot.GetName()).arg (machine.GetName())); 59 retranslateUi(); 65 60 } 66 61 … … 73 68 } 74 69 70 void VBoxSnapshotDetailsDlg::retranslateUi() 71 { 72 /* Translate uic generated strings */ 73 Ui::VBoxSnapshotDetailsDlg::retranslateUi (this); 74 75 if(mSnapshot.isNull()) 76 return; 77 78 CMachine machine = mSnapshot.GetMachine(); 79 80 setWindowTitle (tr ("Details of %1 (%2)") 81 .arg (mSnapshot.GetName()).arg (machine.GetName())); 82 83 /* Compose summary */ 84 mTeSummary->setText ( 85 vboxGlobal().detailsReport (machine, false /* isNewVM */, 86 false /* withLinks */)); 87 } 88 75 89 void VBoxSnapshotDetailsDlg::onNameChanged (const QString &aText) 76 90 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxSnapshotsWgt.cpp
r8946 r9056 244 244 245 245 VBoxSnapshotsWgt::VBoxSnapshotsWgt (QWidget *aParent) 246 : Q Widget(aParent)246 : QIWithRetranslateUI<QWidget> (aParent) 247 247 , mCurSnapshotItem (0) 248 248 , mContextMenu (new QMenu (this)) … … 665 665 } 666 666 667 void VBoxSnapshotsWgt::changeEvent (QEvent *aEvent)668 {669 QWidget::changeEvent (aEvent);670 switch (aEvent->type())671 {672 case QEvent::LanguageChange:673 {674 retranslateUi();675 aEvent->accept();676 break;677 }678 default:679 break;680 }681 }682 683 667 void VBoxSnapshotsWgt::retranslateUi() 684 668 { -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMInformationDlg.cpp
r8946 r9056 52 52 const CSession &aSession, 53 53 Qt::WindowFlags aFlags) 54 : QI AbstractDialog(aConsole, aFlags)54 : QIWithRetranslateUI2<QIAbstractDialog> (aConsole, aFlags) 55 55 , mIsPolished (false) 56 56 , mConsole (aConsole) … … 128 128 } 129 129 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 130 void VBoxVMInformationDlg::retranslateUi() 147 131 { 148 132 /* Translate uic generated strings */ 149 133 Ui::VBoxVMInformationDlg::retranslateUi (this); 134 135 updateDetails(); 150 136 151 137 AssertReturnVoid (!mSession.isNull());
Note:
See TracChangeset
for help on using the changeset viewer.