From 34f75be3227ab2fdf12ed106bfa45aa9ddd9d9a4 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Fri, 24 Jun 2016 11:00:59 +0200 Subject: [PATCH] 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 --- src/plugins/git/gitclient.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 56da73f67f2..6722d74a57f 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -987,9 +988,14 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory, if (localBranches.contains(ref)) return arguments; - if (QMessageBox::question(ICore::mainWindow(), tr("Create Local Branch"), - tr("Would you like to create a local branch?"), - QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) { + if (Utils::CheckableMessageBox::doNotAskAgainQuestion( + ICore::mainWindow() /*parent*/, + 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; }