Commit 34f75be3 authored by David Schulz's avatar David Schulz Committed by David Schulz

Git: Add a do not ask again checkbox to the pre checkout message box.

Makes it possible to not query the user on every checkout if he wants to
create a local branch.

Change-Id: I22d8ef03fb98648cafb3f11a008bb24c291cb807
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 1a68968c
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <coreplugin/iversioncontrol.h> #include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h> #include <coreplugin/vcsmanager.h>
#include <utils/checkablemessagebox.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -987,9 +988,14 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory, ...@@ -987,9 +988,14 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
if (localBranches.contains(ref)) if (localBranches.contains(ref))
return arguments; return arguments;
if (QMessageBox::question(ICore::mainWindow(), tr("Create Local Branch"), if (Utils::CheckableMessageBox::doNotAskAgainQuestion(
tr("Would you like to create a local branch?"), ICore::mainWindow() /*parent*/,
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { tr("Create Local Branch") /*title*/,
tr("Would you like to create a local branch?") /*message*/,
ICore::settings(), "Git.CreateLocalBranchOnCheckout" /*setting*/,
QDialogButtonBox::Yes | QDialogButtonBox::No /*buttons*/,
QDialogButtonBox::No /*default button*/,
QDialogButtonBox::No /*button to save*/) == QMessageBox::No) {
return arguments; return arguments;
} }
......
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