[PATCH 2/3] A couple of dialog modality considerations

Lubomir I. Ivanov neolit123 at gmail.com
Fri Jun 28 05:12:09 PDT 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

While most dialogs can be open and the main application window
can still be accessed, certain should possibly be modal
in these terms.

This patch proposes the download from webservice and DC dialogs
to lock the main application window until they are closed, with
the consideration of preventing eventual unexpected behavior
in the divelist if both dialogs are active at the same time.

To solve that QtDialog::exec() is used instead of
QtWidget::show().

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
 qt-ui/downloadfromdivecomputer.cpp | 2 +-
 qt-ui/subsurfacewebservices.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index ba079e6..65e7a16 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -66,7 +66,7 @@ DownloadFromDCWidget::DownloadFromDCWidget(QWidget* parent, Qt::WindowFlags f) :
 void DownloadFromDCWidget::runDialog()
 {
 	ui->progressBar->hide();
-	show();
+	exec();
 }
 
 void DownloadFromDCWidget::stoppedDownloading()
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 76e730b..cdf8ee6 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -139,7 +139,7 @@ void SubsurfaceWebServices::setStatusText(int status)
 
 void SubsurfaceWebServices::runDialog()
 {
-	show();
+	exec();
 }
 
 /* requires that there is a <download> or <error> tag under the <root> tag */
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list