forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.7'
Change-Id: Ifec1f8dc20a18f432ec6ccf68153f31fff3f8b29
This commit is contained in:
@@ -216,6 +216,23 @@ void GerritDialog::refresh()
|
||||
m_ui->treeView->sortByColumn(-1);
|
||||
}
|
||||
|
||||
void GerritDialog::scheduleUpdateRemotes()
|
||||
{
|
||||
if (isVisible())
|
||||
updateRemotes();
|
||||
else
|
||||
m_shouldUpdateRemotes = true;
|
||||
}
|
||||
|
||||
void GerritDialog::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
if (m_shouldUpdateRemotes) {
|
||||
m_shouldUpdateRemotes = false;
|
||||
updateRemotes();
|
||||
}
|
||||
}
|
||||
|
||||
void GerritDialog::remoteChanged()
|
||||
{
|
||||
const GerritServer server = m_ui->remoteComboBox->currentServer();
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
void fetchStarted(const QSharedPointer<Gerrit::Internal::GerritChange> &change);
|
||||
void fetchFinished();
|
||||
void refresh();
|
||||
void scheduleUpdateRemotes();
|
||||
|
||||
signals:
|
||||
void fetchDisplay(const QSharedPointer<Gerrit::Internal::GerritChange> &);
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
void slotFetchCheckout();
|
||||
void remoteChanged();
|
||||
void updateRemotes(bool forceReload = false);
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
void manageProgressIndicator();
|
||||
|
||||
@@ -101,6 +103,7 @@ private:
|
||||
QString m_repository;
|
||||
bool m_fetchRunning = false;
|
||||
bool m_updatingRemotes = false;
|
||||
bool m_shouldUpdateRemotes = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -72,6 +72,7 @@ void GerritOptionsPage::apply()
|
||||
newParameters.setPortFlagBySshType();
|
||||
*m_parameters = newParameters;
|
||||
m_parameters->toSettings(Core::ICore::settings());
|
||||
emit settingsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ public:
|
||||
void apply() override;
|
||||
void finish() override;
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
const QSharedPointer<GerritParameters> &m_parameters;
|
||||
QPointer<GerritOptionsWidget> m_widget;
|
||||
|
||||
@@ -292,7 +292,12 @@ bool GerritPlugin::initialize(ActionContainer *ac)
|
||||
connect(pushAction, &QAction::triggered, this, [this]() { push(); });
|
||||
ac->addAction(m_pushToGerritCommand);
|
||||
|
||||
new GerritOptionsPage(m_parameters, this);
|
||||
auto options = new GerritOptionsPage(m_parameters, this);
|
||||
connect(options, &GerritOptionsPage::settingsChanged,
|
||||
this, [this] {
|
||||
if (m_dialog)
|
||||
m_dialog->scheduleUpdateRemotes();
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -340,8 +345,8 @@ void GerritPlugin::openView()
|
||||
{
|
||||
if (m_dialog.isNull()) {
|
||||
while (!m_parameters->isValid()) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Error"),
|
||||
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
|
||||
QMessageBox::warning(Core::ICore::dialogParent(), tr("Error"),
|
||||
tr("Invalid Gerrit configuration. Host, user and ssh binary are mandatory."));
|
||||
if (!ICore::showOptionsDialog("Gerrit"))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -323,6 +323,7 @@ bool GerritServer::resolveRoot()
|
||||
}
|
||||
break;
|
||||
default: // unknown error - fail
|
||||
authenticated = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,7 +1069,6 @@ bool GitPlugin::submitEditorAboutToClose()
|
||||
|
||||
// Go ahead!
|
||||
SubmitFileModel *model = qobject_cast<SubmitFileModel *>(editor->fileModel());
|
||||
bool closeEditor = true;
|
||||
CommitType commitType = editor->commitType();
|
||||
QString amendSHA1 = editor->amendSHA1();
|
||||
if (model->hasCheckedFiles() || !amendSHA1.isEmpty()) {
|
||||
@@ -1077,12 +1076,12 @@ bool GitPlugin::submitEditorAboutToClose()
|
||||
if (!DocumentManager::saveDocument(editorDocument))
|
||||
return false;
|
||||
|
||||
closeEditor = m_gitClient->addAndCommit(m_submitRepository, editor->panelData(),
|
||||
commitType, amendSHA1,
|
||||
m_commitMessageFileName, model);
|
||||
if (!m_gitClient->addAndCommit(m_submitRepository, editor->panelData(), commitType,
|
||||
amendSHA1, m_commitMessageFileName, model)) {
|
||||
editor->updateFileModel();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!closeEditor)
|
||||
return false;
|
||||
cleanCommitMessageFile();
|
||||
if (commitType == FixupCommit) {
|
||||
if (!m_gitClient->beginStashScope(m_submitRepository, "Rebase-fixup",
|
||||
|
||||
@@ -62,10 +62,10 @@ public:
|
||||
GitSubmitEditorPanelData panelData() const;
|
||||
CommitType commitType() const { return m_commitType; }
|
||||
QString amendSHA1() const;
|
||||
void updateFileModel() override;
|
||||
|
||||
protected:
|
||||
QByteArray fileContents() const override;
|
||||
void updateFileModel() override;
|
||||
void forceUpdateFileModel();
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user