From c920d104abea62f225e9308bd84f54e374336766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 9 Jan 2006 10:28:05 +0000 Subject: [PATCH] Make alert dialogs modular, thus preventing that they are hidden behind the main window (bug 1977) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@10717 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/Alert_pimpl.C | 16 +++++++++++++--- src/frontends/qt2/ChangeLog | 5 +++++ status.13x | 3 +++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt2/Alert_pimpl.C b/src/frontends/qt2/Alert_pimpl.C index 2684883c4d..1b040722ce 100644 --- a/src/frontends/qt2/Alert_pimpl.C +++ b/src/frontends/qt2/Alert_pimpl.C @@ -10,6 +10,7 @@ #include +#include #include #include #include @@ -31,21 +32,30 @@ using std::make_pair; void alert_pimpl(string const & s1, string const & s2, string const & s3) { - QMessageBox::warning(0, "LyX", + QWidget * const parent = qApp->focusWidget() ? + qApp->focusWidget() : qApp->mainWidget(); + + QMessageBox::warning(parent, "LyX", toqstr(s1 + '\n' + '\n' + s2 + '\n' + s3)); } bool askQuestion_pimpl(string const & s1, string const & s2, string const & s3) { - return !(QMessageBox::information(0, "LyX", toqstr(s1 + '\n' + s2 + '\n' + s3), + QWidget * const parent = qApp->focusWidget() ? + qApp->focusWidget() : qApp->mainWidget(); + + return !(QMessageBox::information(parent, "LyX", toqstr(s1 + '\n' + s2 + '\n' + s3), qt_("&Yes"), qt_("&No"), 0, 1)); } int askConfirmation_pimpl(string const & s1, string const & s2, string const & s3) { - return (QMessageBox::information(0, "LyX", toqstr(s1 + '\n' + s2 + '\n' + s3), + QWidget * const parent = qApp->focusWidget() ? + qApp->focusWidget() : qApp->mainWidget(); + + return (QMessageBox::information(parent, "LyX", toqstr(s1 + '\n' + s2 + '\n' + s3), qt_("&Yes"), qt_("&No"), qt_("&Cancel"), 0, 2)) + 1; } diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 267af46755..66acdf90e0 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2006-01-09 Jürgen Spitzmüller + + * Alert_pimpl.C: Make alert dialogs modular, thus preventing that + they are hidden behind the main window (bug 1977). + 2006-01-08 Jürgen Spitzmüller * ui/QRefDialogBase.ui: re-connect the refsLB->Selected signal diff --git a/status.13x b/status.13x index a80d047ab5..6b69534bf9 100644 --- a/status.13x +++ b/status.13x @@ -79,6 +79,9 @@ What's new - Enable Instant Preview to work if the path to the external GhostScript executable contains spaces. (bug 2193). +- The error/warning/confirmation dialogs aren't hidden behind the main + window anymore [Qt only] (bug 1977). + * Configuration/Installation: - Enable TeXFiles.sh to run when its path contains spaces.