forked from qt-creator/qt-creator
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
namespace Internal {
|
||||
|
||||
class GitClient;
|
||||
class LocalBranchModel;
|
||||
class RemoteBranchModel;
|
||||
namespace Ui {
|
||||
class BranchDialog;
|
||||
}
|
||||
|
||||
/* 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);
|
||||
class GitClient;
|
||||
class LocalBranchModel;
|
||||
class RemoteBranchModel;
|
||||
|
||||
bool init(GitClient *client, const QString &workingDirectory, QString *errorMessage);
|
||||
/**
|
||||
* 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);
|
||||
|
||||
virtual ~BranchDialog();
|
||||
bool init(GitClient *client, const QString &workingDirectory, QString *errorMessage);
|
||||
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e);
|
||||
virtual ~BranchDialog();
|
||||
|
||||
private slots:
|
||||
void slotEnableButtons();
|
||||
void slotCheckoutSelectedBranch();
|
||||
void slotDeleteSelectedBranch();
|
||||
void slotLocalBranchActivated();
|
||||
void slotRemoteBranchActivated(const QModelIndex &);
|
||||
void slotCreateLocalBranch(const QString &branchName);
|
||||
protected:
|
||||
virtual void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
bool ask(const QString &title, const QString &what, bool defaultButton);
|
||||
void selectLocalBranch(const QString &b);
|
||||
private slots:
|
||||
void slotEnableButtons();
|
||||
void slotCheckoutSelectedBranch();
|
||||
void slotDeleteSelectedBranch();
|
||||
void slotLocalBranchActivated();
|
||||
void slotRemoteBranchActivated(const QModelIndex &);
|
||||
void slotCreateLocalBranch(const QString &branchName);
|
||||
|
||||
int selectedLocalBranchIndex() const;
|
||||
int selectedRemoteBranchIndex() const;
|
||||
private:
|
||||
bool ask(const QString &title, const QString &what, bool defaultButton);
|
||||
void selectLocalBranch(const QString &b);
|
||||
|
||||
GitClient *m_client;
|
||||
Ui::BranchDialog *m_ui;
|
||||
QPushButton *m_checkoutButton;
|
||||
QPushButton *m_deleteButton;
|
||||
int selectedLocalBranchIndex() const;
|
||||
int selectedRemoteBranchIndex() const;
|
||||
|
||||
LocalBranchModel *m_localModel;
|
||||
RemoteBranchModel *m_remoteModel;
|
||||
QString m_repoDirectory;
|
||||
};
|
||||
} // namespace Internal
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user