From 00f6b3796a60aa5d34b185b607e6f35274be4ed5 Mon Sep 17 00:00:00 2001 From: Daniel Kettle Date: Tue, 24 Mar 2020 13:24:45 -0700 Subject: [PATCH 1/2] Add Mac .DS_Store folder pref file to gitignore, fix tab focus on end of doc msgbox Signed-off-by: Daniel Kettle --- .gitignore | 1 + src/mainimpl.cpp | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 63698fb9..3d183f1c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ qgit.pro.* qgit.qbs.* src/release .qmake.stash +.DS_Store diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp index 4fd40c0c..978dd2ec 100644 --- a/src/mainimpl.cpp +++ b/src/mainimpl.cpp @@ -282,7 +282,7 @@ void MainImpl::ActExternalDiff_activated() { if (!QGit::startProcess(externalDiff, args)) { QString text("Cannot start external viewer: "); text.append(args[0]); - QMessageBox::warning(this, "Error - QGit", text); + QMessageBox::warning(this, "Error - QGit", text); delete externalDiff; } } @@ -2109,9 +2109,21 @@ void MainImpl::ActFindNext_activated() { textToFind + "\" not found!", QMessageBox::Ok, 0); return; } - if (QMessageBox::question(this, "Find text - QGit", "End of document " - "reached\n\nDo you want to continue from beginning?", QMessageBox::Yes, - QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) + QMessageBox msgBox; + msgBox.setWindowTitle("Find text - QGit"); + msgBox.setIcon(QMessageBox::Question); + msgBox.setText(tr("End of document reached.")); + msgBox.setInformativeText(tr("Do you want to continue from beginning?\n")); + msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + msgBox.setDefaultButton(QMessageBox::No); + msgBox.setBaseSize(QSize(400, 160)); + QList bList = msgBox.buttons(); + for (int i=0; isetFocusPolicy(Qt::StrongFocus); + } + int ret = msgBox.exec(); + if (ret == QMessageBox::No) return; endOfDocument = true; From 396d8f9bc4ebfa9cdcecbe13ed172c1661730372 Mon Sep 17 00:00:00 2001 From: Daniel Kettle Date: Tue, 21 Jul 2020 21:55:03 -0700 Subject: [PATCH 2/2] Set the parent of QMessageBox --- src/mainimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp index 978dd2ec..edfdcb5e 100644 --- a/src/mainimpl.cpp +++ b/src/mainimpl.cpp @@ -2109,7 +2109,7 @@ void MainImpl::ActFindNext_activated() { textToFind + "\" not found!", QMessageBox::Ok, 0); return; } - QMessageBox msgBox; + QMessageBox msgBox(this); msgBox.setWindowTitle("Find text - QGit"); msgBox.setIcon(QMessageBox::Question); msgBox.setText(tr("End of document reached."));