From 4e16705a27f5e1193ab9263be8ff24e1df92457e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com> Date: Tue, 17 Mar 2009 14:34:27 +0100 Subject: [PATCH] Added changeEvent calls where appropriate Need to call into the superclass in order not to lose functionality. Was missing in the wizard, hence the many missing occurrences. Reviewed-by: Friedemann Kleint --- src/libs/utils/filewizardpage.cpp | 1 + src/libs/utils/projectintropage.cpp | 1 + src/libs/utils/submiteditorwidget.cpp | 1 + src/plugins/coreplugin/mainwindow.cpp | 1 + src/plugins/git/branchdialog.cpp | 1 + src/plugins/git/branchdialog.h | 110 +++++++++--------- .../projectexplorer/buildstepspage.cpp | 1 + .../projectexplorer/projectwizardpage.cpp | 1 + .../projectexplorer/removefiledialog.cpp | 1 + 9 files changed, 65 insertions(+), 53 deletions(-) diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp index cceb06ece3a..59f1bbc56ba 100644 --- a/src/libs/utils/filewizardpage.cpp +++ b/src/libs/utils/filewizardpage.cpp @@ -88,6 +88,7 @@ void FileWizardPage::setName(const QString &name) void FileWizardPage::changeEvent(QEvent *e) { + QWizardPage::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index c10d6e07a8e..085cafe7bf0 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -113,6 +113,7 @@ void ProjectIntroPage::setDescription(const QString &description) void ProjectIntroPage::changeEvent(QEvent *e) { + QWizardPage::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); diff --git a/src/libs/utils/submiteditorwidget.cpp b/src/libs/utils/submiteditorwidget.cpp index 1f27b463ece..a047682b815 100644 --- a/src/libs/utils/submiteditorwidget.cpp +++ b/src/libs/utils/submiteditorwidget.cpp @@ -366,6 +366,7 @@ bool SubmitEditorWidget::hasCheckedFiles() const void SubmitEditorWidget::changeEvent(QEvent *e) { + QWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_d->m_ui.retranslateUi(this); diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index 5e2914df46d..822636d5359 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -986,6 +986,7 @@ void MainWindow::removeContextObject(IContext *context) void MainWindow::changeEvent(QEvent *e) { + QMainWindow::changeEvent(e); if (e->type() == QEvent::ActivationChange) { if (isActiveWindow()) { if (debugMainWindow) diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index 5a1aa5d00d6..f348ac01881 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -258,6 +258,7 @@ void BranchDialog::slotRemoteBranchActivated(const QModelIndex &i) void BranchDialog::changeEvent(QEvent *e) { + QDialog::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); diff --git a/src/plugins/git/branchdialog.h b/src/plugins/git/branchdialog.h index 5656c9e5c67..dcad691d604 100644 --- a/src/plugins/git/branchdialog.h +++ b/src/plugins/git/branchdialog.h @@ -3,64 +3,68 @@ #include <QtGui/QDialog> - QT_BEGIN_NAMESPACE class QPushButton; class QModelIndex; QT_END_NAMESPACE namespace Git { - namespace Internal { - namespace Ui { - class BranchDialog; - } - - class GitClient; - class LocalBranchModel; - class RemoteBranchModel; - - /* Branch dialog: Display a list of local branches at the top - * and remote branches below. Offers to checkout/delete local - * branches. - * TODO: Add new branch (optionally tracking a remote one). - * How to find out that a local branch is a tracking one? */ - class BranchDialog : public QDialog { - Q_OBJECT - Q_DISABLE_COPY(BranchDialog) - public: - explicit BranchDialog(QWidget *parent = 0); - - bool init(GitClient *client, const QString &workingDirectory, QString *errorMessage); - - virtual ~BranchDialog(); - - protected: - virtual void changeEvent(QEvent *e); - - private slots: - void slotEnableButtons(); - void slotCheckoutSelectedBranch(); - void slotDeleteSelectedBranch(); - void slotLocalBranchActivated(); - void slotRemoteBranchActivated(const QModelIndex &); - void slotCreateLocalBranch(const QString &branchName); - - private: - bool ask(const QString &title, const QString &what, bool defaultButton); - void selectLocalBranch(const QString &b); - - int selectedLocalBranchIndex() const; - int selectedRemoteBranchIndex() const; - - GitClient *m_client; - Ui::BranchDialog *m_ui; - QPushButton *m_checkoutButton; - QPushButton *m_deleteButton; - - LocalBranchModel *m_localModel; - RemoteBranchModel *m_remoteModel; - QString m_repoDirectory; - }; - } // namespace Internal +namespace Internal { + +namespace Ui { +class BranchDialog; +} + +class GitClient; +class LocalBranchModel; +class RemoteBranchModel; + +/** + * Branch dialog. Displays a list of local branches at the top and remote + * branches below. Offers to checkout/delete local branches. + * + * TODO: Add new branch (optionally tracking a remote one). + * How to find out that a local branch is a tracking one? + */ +class BranchDialog : public QDialog { + Q_OBJECT + Q_DISABLE_COPY(BranchDialog) +public: + explicit BranchDialog(QWidget *parent = 0); + + bool init(GitClient *client, const QString &workingDirectory, QString *errorMessage); + + virtual ~BranchDialog(); + +protected: + virtual void changeEvent(QEvent *e); + +private slots: + void slotEnableButtons(); + void slotCheckoutSelectedBranch(); + void slotDeleteSelectedBranch(); + void slotLocalBranchActivated(); + void slotRemoteBranchActivated(const QModelIndex &); + void slotCreateLocalBranch(const QString &branchName); + +private: + bool ask(const QString &title, const QString &what, bool defaultButton); + void selectLocalBranch(const QString &b); + + int selectedLocalBranchIndex() const; + int selectedRemoteBranchIndex() const; + + GitClient *m_client; + Ui::BranchDialog *m_ui; + QPushButton *m_checkoutButton; + QPushButton *m_deleteButton; + + LocalBranchModel *m_localModel; + RemoteBranchModel *m_remoteModel; + QString m_repoDirectory; +}; + +} // namespace Internal } // namespace Git + #endif // BRANCHDIALOG_H diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp index 16c2a2d4152..bcb8945f621 100644 --- a/src/plugins/projectexplorer/buildstepspage.cpp +++ b/src/plugins/projectexplorer/buildstepspage.cpp @@ -236,6 +236,7 @@ void BuildStepsPage::downBuildStep() void BuildStepsPage::changeEvent(QEvent *e) { + BuildStepConfigWidget::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 36eaab884bc..2c294e89881 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -95,6 +95,7 @@ void ProjectWizardPage::setAddToVersionControlEnabled(bool b) void ProjectWizardPage::changeEvent(QEvent *e) { + QWizardPage::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); diff --git a/src/plugins/projectexplorer/removefiledialog.cpp b/src/plugins/projectexplorer/removefiledialog.cpp index 8e6964aa9c8..20e7eb8333d 100644 --- a/src/plugins/projectexplorer/removefiledialog.cpp +++ b/src/plugins/projectexplorer/removefiledialog.cpp @@ -55,6 +55,7 @@ bool RemoveFileDialog::isDeleteFileChecked() const void RemoveFileDialog::changeEvent(QEvent *e) { + QDialog::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: m_ui->retranslateUi(this); -- GitLab