aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/git
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2018-12-02 22:07:22 +0200
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2018-12-03 09:56:07 +0200
commit7096649fc267e3b12989f723d4e5cb7ae7b7c958 (patch)
tree3e689cae9d803037fa744c0655389486cb6b05b1 /src/plugins/git
parentc9a48ad5b1e1eae4d9162ea0158b18ac1ed592e7 (diff)
parentf0226d9644e7936cc12109448490047ae52bc320 (diff)
Merge remote-tracking branch 'origin/4.8'
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/gerrit/gerritplugin.cpp8
-rw-r--r--src/plugins/git/gerrit/gerritserver.cpp2
-rw-r--r--src/plugins/git/gitclient.cpp18
-rw-r--r--src/plugins/git/gitplugin.cpp10
4 files changed, 19 insertions, 19 deletions
diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp
index 036505dc99..3cc82f5c45 100644
--- a/src/plugins/git/gerrit/gerritplugin.cpp
+++ b/src/plugins/git/gerrit/gerritplugin.cpp
@@ -317,11 +317,11 @@ void GerritPlugin::addToLocator(CommandLocator *locator)
void GerritPlugin::push(const QString &topLevel)
{
// QScopedPointer is required to delete the dialog when leaving the function
- GerritPushDialog dialog(topLevel, m_reviewers, m_parameters, ICore::mainWindow());
+ GerritPushDialog dialog(topLevel, m_reviewers, m_parameters, ICore::dialogParent());
const QString initErrorMessage = dialog.initErrorMessage();
if (!initErrorMessage.isEmpty()) {
- QMessageBox::warning(ICore::mainWindow(), tr("Initialization Failed"), initErrorMessage);
+ QMessageBox::warning(ICore::dialogParent(), tr("Initialization Failed"), initErrorMessage);
return;
}
@@ -348,7 +348,7 @@ void GerritPlugin::openView()
if (!ICore::showOptionsDialog("Gerrit"))
return;
}
- GerritDialog *gd = new GerritDialog(m_parameters, m_server, currentRepository(), ICore::mainWindow());
+ GerritDialog *gd = new GerritDialog(m_parameters, m_server, currentRepository(), ICore::dialogParent());
gd->setModal(false);
connect(gd, &GerritDialog::fetchDisplay, this,
[this](const QSharedPointer<GerritChange> &change) { fetch(change, FetchDisplay); });
@@ -431,7 +431,7 @@ void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode)
if (!verifiedRepository) {
QMessageBox::StandardButton answer = QMessageBox::question(
- ICore::mainWindow(), tr("Remote Not Verified"),
+ ICore::dialogParent(), tr("Remote Not Verified"),
tr("Change host %1\nand project %2\n\nwere not verified among remotes"
" in %3. Select different folder?")
.arg(m_server->host,
diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp
index e9dee45565..9e85606c76 100644
--- a/src/plugins/git/gerrit/gerritserver.cpp
+++ b/src/plugins/git/gerrit/gerritserver.cpp
@@ -301,7 +301,7 @@ bool GerritServer::resolveRoot()
return setupAuthentication();
case CertificateError:
if (QMessageBox::question(
- Core::ICore::mainWindow(),
+ Core::ICore::dialogParent(),
QCoreApplication::translate(
"Gerrit::Internal::GerritDialog", "Certificate Error"),
QCoreApplication::translate(
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index f06acb8555..e5b63feb22 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -1144,7 +1144,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
return arguments;
if (Utils::CheckableMessageBox::doNotAskAgainQuestion(
- ICore::mainWindow() /*parent*/,
+ ICore::dialogParent() /*parent*/,
tr("Create Local Branch") /*title*/,
tr("Would you like to create a local branch?") /*message*/,
ICore::settings(), "Git.CreateLocalBranchOnCheckout" /*setting*/,
@@ -1181,7 +1181,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
}
}
- BranchAddDialog branchAddDialog(localBranches, true, ICore::mainWindow());
+ BranchAddDialog branchAddDialog(localBranches, true, ICore::dialogParent());
branchAddDialog.setTrackedBranchName(remoteBranch, true);
if (branchAddDialog.exec() != QDialog::Accepted)
@@ -1207,7 +1207,7 @@ void GitClient::reset(const QString &workingDirectory, const QString &argument,
if (argument == "--hard") {
if (gitStatus(workingDirectory, StatusMode(NoUntracked | NoSubmodules)) != StatusUnchanged) {
if (QMessageBox::question(
- Core::ICore::mainWindow(), tr("Reset"),
+ Core::ICore::dialogParent(), tr("Reset"),
tr("All changes in working directory will be discarded. Are you sure?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) == QMessageBox::No) {
@@ -1660,7 +1660,7 @@ QString GitClient::synchronousStash(const QString &workingDirectory, const QStri
message = creatorStashMessage(messageKeyword);
do {
if ((flags & StashPromptDescription)) {
- if (!inputText(ICore::mainWindow(),
+ if (!inputText(ICore::dialogParent(),
tr("Stash Description"), tr("Description:"), &message))
break;
}
@@ -2058,7 +2058,7 @@ void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool p
if (!updateNeeded)
return;
- if (prompt && QMessageBox::question(ICore::mainWindow(), tr("Submodules Found"),
+ if (prompt && QMessageBox::question(ICore::dialogParent(), tr("Submodules Found"),
tr("Would you like to update submodules?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) {
return;
@@ -2226,7 +2226,7 @@ void GitClient::continuePreviousGitCommand(const QString &workingDirectory,
}
QMessageBox msgBox(QMessageBox::Question, msgBoxTitle, msgBoxText,
- QMessageBox::NoButton, ICore::mainWindow());
+ QMessageBox::NoButton, ICore::dialogParent());
if (hasChanges || isRebase)
msgBox.addButton(hasChanges ? buttonName : tr("Skip"), QMessageBox::AcceptRole);
msgBox.addButton(QMessageBox::Abort);
@@ -2808,7 +2808,7 @@ GitClient::RevertResult GitClient::revertI(QStringList files,
// Ask to revert (to do: Handle lists with a selection dialog)
const QMessageBox::StandardButton answer
- = QMessageBox::question(ICore::mainWindow(),
+ = QMessageBox::question(ICore::dialogParent(),
tr("Revert"),
tr("The file has been changed. Do you want to revert it?"),
QMessageBox::Yes | QMessageBox::No,
@@ -2950,7 +2950,7 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
message = tr("Conflicts detected.");
}
QMessageBox mergeOrAbort(QMessageBox::Question, tr("Conflicts Detected"), message,
- QMessageBox::NoButton, ICore::mainWindow());
+ QMessageBox::NoButton, ICore::dialogParent());
QPushButton *mergeToolButton = mergeOrAbort.addButton(tr("Run &Merge Tool"),
QMessageBox::AcceptRole);
const QString mergeTool = readConfigValue(workingDir, "merge.tool");
@@ -3304,7 +3304,7 @@ void GitClient::StashInfo::stashPrompt(const QString &command, const QString &st
QMessageBox msgBox(QMessageBox::Question, tr("Uncommitted Changes Found"),
tr("What would you like to do with local changes in:") + "\n\n"
+ QDir::toNativeSeparators(m_workingDir) + '\"',
- QMessageBox::NoButton, ICore::mainWindow());
+ QMessageBox::NoButton, ICore::dialogParent());
msgBox.setDetailedText(statusOutput);
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index eee8f57c14..924f1da5e2 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -797,7 +797,7 @@ void GitPlugin::resetRepository()
QTC_ASSERT(state.hasTopLevel(), return);
QString topLevel = state.topLevel();
- LogChangeDialog dialog(true, ICore::mainWindow());
+ LogChangeDialog dialog(true, ICore::dialogParent());
ResetItemDelegate delegate(dialog.widget());
dialog.setWindowTitle(tr("Undo Changes to %1").arg(QDir::toNativeSeparators(topLevel)));
if (dialog.runDialog(topLevel, QString(), LogChangeWidget::IncludeRemotes))
@@ -822,7 +822,7 @@ void GitPlugin::startRebase()
const QString topLevel = state.topLevel();
if (topLevel.isEmpty() || !m_gitClient->canRebase(topLevel))
return;
- LogChangeDialog dialog(false, ICore::mainWindow());
+ LogChangeDialog dialog(false, ICore::dialogParent());
RebaseItemDelegate delegate(dialog.widget());
dialog.setWindowTitle(tr("Interactive Rebase"));
if (!dialog.runDialog(topLevel))
@@ -836,7 +836,7 @@ void GitPlugin::startChangeRelatedAction(const Id &id)
const VcsBasePluginState state = currentState();
ChangeSelectionDialog dialog(state.hasTopLevel() ? state.topLevel() : PathChooser::homePath(),
- id, ICore::mainWindow());
+ id, ICore::dialogParent());
int result = dialog.exec();
@@ -1234,7 +1234,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file)
// Prompt for file
if (file.isEmpty()) {
const QString filter = tr("Patches (*.patch *.diff)");
- file = QFileDialog::getOpenFileName(ICore::mainWindow(), tr("Choose Patch"), QString(), filter);
+ file = QFileDialog::getOpenFileName(ICore::dialogParent(), tr("Choose Patch"), QString(), filter);
if (file.isEmpty()) {
m_gitClient->endStashScope(workingDirectory);
return;
@@ -1302,7 +1302,7 @@ template <class NonModalDialog>
dialog->show();
dialog->raise();
} else {
- dialog = new NonModalDialog(ICore::mainWindow());
+ dialog = new NonModalDialog(ICore::dialogParent());
dialog->refresh(topLevel, true);
dialog->show();
}