forked from qt-creator/qt-creator
Port to new connect api
Change-Id: Ifa29f380789c28cefda5dfdf497df42163fb2f94 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
committed by
Laurent Montel
parent
478914a9ce
commit
250cc0640b
@@ -114,7 +114,7 @@ BranchAddDialog::BranchAddDialog(const QStringList &localBranches, bool addBranc
|
||||
m_ui->setupUi(this);
|
||||
setWindowTitle(addBranch ? tr("Add Branch") : tr("Rename Branch"));
|
||||
m_ui->branchNameEdit->setValidator(new BranchNameValidator(localBranches, this));
|
||||
connect(m_ui->branchNameEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtonStatus()));
|
||||
connect(m_ui->branchNameEdit, &QLineEdit::textChanged, this, &BranchAddDialog::updateButtonStatus);
|
||||
}
|
||||
|
||||
BranchAddDialog::~BranchAddDialog()
|
||||
|
||||
@@ -55,7 +55,8 @@ BranchCheckoutDialog::BranchCheckoutDialog(QWidget *parent,
|
||||
foundNoLocalChanges();
|
||||
}
|
||||
|
||||
connect(m_ui->moveChangesRadioButton, SIGNAL(toggled(bool)), this, SLOT(updatePopStashCheckBox(bool)));
|
||||
connect(m_ui->moveChangesRadioButton, &QRadioButton::toggled,
|
||||
this, &BranchCheckoutDialog::updatePopStashCheckBox);
|
||||
}
|
||||
|
||||
BranchCheckoutDialog::~BranchCheckoutDialog()
|
||||
|
||||
@@ -66,15 +66,24 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
|
||||
m_ui->changeNumberEdit->setFocus();
|
||||
m_ui->changeNumberEdit->selectAll();
|
||||
|
||||
connect(m_ui->changeNumberEdit, SIGNAL(textChanged(QString)), this, SLOT(changeTextChanged(QString)));
|
||||
connect(m_ui->workingDirectoryEdit, SIGNAL(textChanged(QString)), this, SLOT(recalculateDetails()));
|
||||
connect(m_ui->workingDirectoryEdit, SIGNAL(textChanged(QString)), this, SLOT(recalculateCompletion()));
|
||||
connect(m_ui->selectDirectoryButton, SIGNAL(clicked()), this, SLOT(chooseWorkingDirectory()));
|
||||
connect(m_ui->selectFromHistoryButton, SIGNAL(clicked()), this, SLOT(selectCommitFromRecentHistory()));
|
||||
connect(m_ui->showButton, SIGNAL(clicked()), this, SLOT(acceptShow()));
|
||||
connect(m_ui->cherryPickButton, SIGNAL(clicked()), this, SLOT(acceptCherryPick()));
|
||||
connect(m_ui->revertButton, SIGNAL(clicked()), this, SLOT(acceptRevert()));
|
||||
connect(m_ui->checkoutButton, SIGNAL(clicked()), this, SLOT(acceptCheckout()));
|
||||
connect(m_ui->changeNumberEdit, &Utils::CompletingLineEdit::textChanged,
|
||||
this, &ChangeSelectionDialog::changeTextChanged);
|
||||
connect(m_ui->workingDirectoryEdit, &QLineEdit::textChanged,
|
||||
this, &ChangeSelectionDialog::recalculateDetails);
|
||||
connect(m_ui->workingDirectoryEdit, &QLineEdit::textChanged,
|
||||
this, &ChangeSelectionDialog::recalculateCompletion);
|
||||
connect(m_ui->selectDirectoryButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::chooseWorkingDirectory);
|
||||
connect(m_ui->selectFromHistoryButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::selectCommitFromRecentHistory);
|
||||
connect(m_ui->showButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::acceptShow);
|
||||
connect(m_ui->cherryPickButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::acceptCherryPick);
|
||||
connect(m_ui->revertButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::acceptRevert);
|
||||
connect(m_ui->checkoutButton, &QPushButton::clicked,
|
||||
this, &ChangeSelectionDialog::acceptCheckout);
|
||||
|
||||
if (id == "Git.Revert")
|
||||
m_ui->revertButton->setDefault(true);
|
||||
@@ -258,7 +267,8 @@ void ChangeSelectionDialog::recalculateDetails()
|
||||
m_process->setWorkingDirectory(workingDir);
|
||||
m_process->setProcessEnvironment(m_gitEnvironment);
|
||||
|
||||
connect(m_process, SIGNAL(finished(int)), this, SLOT(setDetails(int)));
|
||||
connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||
this, &ChangeSelectionDialog::setDetails);
|
||||
|
||||
m_process->start(m_gitExecutable.toString(), args);
|
||||
m_process->closeWriteChannel();
|
||||
|
||||
@@ -302,11 +302,11 @@ void GitEditorWidget::addDiffActions(QMenu *menu, const DiffChunk &chunk)
|
||||
|
||||
QAction *stageAction = menu->addAction(tr("Stage Chunk..."));
|
||||
stageAction->setData(qVariantFromValue(chunk));
|
||||
connect(stageAction, SIGNAL(triggered()), this, SLOT(stageDiffChunk()));
|
||||
connect(stageAction, &QAction::triggered, this, &GitEditorWidget::stageDiffChunk);
|
||||
|
||||
QAction *unstageAction = menu->addAction(tr("Unstage Chunk..."));
|
||||
unstageAction->setData(qVariantFromValue(chunk));
|
||||
connect(unstageAction, SIGNAL(triggered()), this, SLOT(unstageDiffChunk()));
|
||||
connect(unstageAction, &QAction::triggered, this, &GitEditorWidget::unstageDiffChunk);
|
||||
}
|
||||
|
||||
bool GitEditorWidget::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
|
||||
@@ -58,10 +58,10 @@ GitSubmitEditorWidget::GitSubmitEditorWidget() :
|
||||
|
||||
m_emailValidator = new QRegExpValidator(QRegExp(QLatin1String("[^@ ]+@[^@ ]+\\.[a-zA-Z]+")), this);
|
||||
|
||||
connect(m_gitSubmitPanelUi.authorLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(authorInformationChanged()));
|
||||
connect(m_gitSubmitPanelUi.emailLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(authorInformationChanged()));
|
||||
connect(m_gitSubmitPanelUi.authorLineEdit, &QLineEdit::textChanged,
|
||||
this, &GitSubmitEditorWidget::authorInformationChanged);
|
||||
connect(m_gitSubmitPanelUi.emailLineEdit, &QLineEdit::textChanged,
|
||||
this, &GitSubmitEditorWidget::authorInformationChanged);
|
||||
}
|
||||
|
||||
void GitSubmitEditorWidget::setPanelInfo(const GitSubmitEditorPanelInfo &info)
|
||||
@@ -99,7 +99,8 @@ void GitSubmitEditorWidget::initialize(CommitType commitType,
|
||||
logChangeGroupBox->setLayout(logChangeLayout);
|
||||
m_logChangeWidget = new LogChangeWidget;
|
||||
m_logChangeWidget->init(repository);
|
||||
connect(m_logChangeWidget, SIGNAL(activated(QString)), this, SIGNAL(show(QString)));
|
||||
connect(m_logChangeWidget, &LogChangeWidget::activated,
|
||||
this, &GitSubmitEditorWidget::show);
|
||||
logChangeLayout->addWidget(m_logChangeWidget);
|
||||
insertTopWidget(logChangeGroupBox);
|
||||
m_gitSubmitPanelUi.editGroup->hide();
|
||||
|
||||
@@ -98,11 +98,16 @@ RemoteDialog::RemoteDialog(QWidget *parent) :
|
||||
m_ui->remoteView->setModel(m_remoteModel);
|
||||
new Utils::HeaderViewStretcher(m_ui->remoteView->header(), 1);
|
||||
|
||||
connect(m_ui->addButton, SIGNAL(clicked()), this, SLOT(addRemote()));
|
||||
connect(m_ui->fetchButton, SIGNAL(clicked()), this, SLOT(fetchFromRemote()));
|
||||
connect(m_ui->pushButton, SIGNAL(clicked()), this, SLOT(pushToRemote()));
|
||||
connect(m_ui->removeButton, SIGNAL(clicked()), this, SLOT(removeRemote()));
|
||||
connect(m_ui->refreshButton, SIGNAL(clicked()), this, SLOT(refreshRemotes()));
|
||||
connect(m_ui->addButton, &QPushButton::clicked,
|
||||
this, &RemoteDialog::addRemote);
|
||||
connect(m_ui->fetchButton, &QPushButton::clicked,
|
||||
this, &RemoteDialog::fetchFromRemote);
|
||||
connect(m_ui->pushButton, &QPushButton::clicked,
|
||||
this, &RemoteDialog::pushToRemote);
|
||||
connect(m_ui->removeButton, &QPushButton::clicked,
|
||||
this, &RemoteDialog::removeRemote);
|
||||
connect(m_ui->refreshButton, &QPushButton::clicked,
|
||||
this, &RemoteDialog::refreshRemotes);
|
||||
|
||||
connect(m_ui->remoteView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(updateButtonState()));
|
||||
|
||||
@@ -120,17 +120,23 @@ StashDialog::StashDialog(QWidget *parent) :
|
||||
ui->filterLineEdit->setFiltering(true);
|
||||
// Buttons
|
||||
ui->buttonBox->addButton(m_showCurrentButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_showCurrentButton, SIGNAL(clicked()), this, SLOT(showCurrent()));
|
||||
connect(m_showCurrentButton, &QPushButton::clicked,
|
||||
this, &StashDialog::showCurrent);
|
||||
ui->buttonBox->addButton(m_refreshButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_refreshButton, SIGNAL(clicked()), this, SLOT(forceRefresh()));
|
||||
connect(m_refreshButton, &QPushButton::clicked,
|
||||
this, &StashDialog::forceRefresh);
|
||||
ui->buttonBox->addButton(m_restoreCurrentButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_restoreCurrentButton, SIGNAL(clicked()), this, SLOT(restoreCurrent()));
|
||||
connect(m_restoreCurrentButton, &QPushButton::clicked,
|
||||
this, &StashDialog::restoreCurrent);
|
||||
ui->buttonBox->addButton(m_restoreCurrentInBranchButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_restoreCurrentInBranchButton, SIGNAL(clicked()), this, SLOT(restoreCurrentInBranch()));
|
||||
connect(m_restoreCurrentInBranchButton, &QPushButton::clicked,
|
||||
this, &StashDialog::restoreCurrentInBranch);
|
||||
ui->buttonBox->addButton(m_deleteSelectionButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_deleteSelectionButton, SIGNAL(clicked()), this, SLOT(deleteSelection()));
|
||||
connect(m_deleteSelectionButton, &QPushButton::clicked,
|
||||
this, &StashDialog::deleteSelection);
|
||||
ui->buttonBox->addButton(m_deleteAllButton, QDialogButtonBox::ActionRole);
|
||||
connect(m_deleteAllButton, SIGNAL(clicked()), this, SLOT(deleteAll()));
|
||||
connect(m_deleteAllButton, &QPushButton::clicked,
|
||||
this, &StashDialog::deleteAll);
|
||||
// Models
|
||||
m_proxyModel->setSourceModel(m_model);
|
||||
m_proxyModel->setFilterKeyColumn(-1);
|
||||
@@ -140,12 +146,14 @@ StashDialog::StashDialog(QWidget *parent) :
|
||||
ui->stashView->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
ui->stashView->setAllColumnsShowFocus(true);
|
||||
ui->stashView->setUniformRowHeights(true);
|
||||
connect(ui->filterLineEdit, SIGNAL(filterChanged(QString)), m_proxyModel, SLOT(setFilterFixedString(QString)));
|
||||
connect(ui->filterLineEdit, &Utils::FancyLineEdit::filterChanged,
|
||||
m_proxyModel, &QSortFilterProxyModel::setFilterFixedString);
|
||||
connect(ui->stashView->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)),
|
||||
this, SLOT(enableButtons()));
|
||||
connect(ui->stashView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||
this, SLOT(enableButtons()));
|
||||
connect(ui->stashView, SIGNAL(activated(QModelIndex)), this, SLOT(showCurrent()));
|
||||
connect(ui->stashView, &Utils::TreeView::activated,
|
||||
this, &StashDialog::showCurrent);
|
||||
ui->stashView->setFocus();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user