Commit 4e16705a authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

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
parent 70d56494
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment