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

Tomaz Canabrava tcanabrava at kde.org
Fri Jun 28 05:29:47 PDT 2013


On Fri, Jun 28, 2013 at 9:12 AM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> 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
>
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

good catch.


More information about the subsurface mailing list