diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-08-24 18:32:38 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-08-25 11:31:42 +0200 |
commit | db6b703d391838c481fd090065f6d329edcd4efa (patch) | |
tree | c17b58ca1f9e0f0beaa3b1b5c89d0e85bdaedaf7 /include | |
parent | 69cfafef7a28aad7a013bb440e15e23e59ea628c (diff) |
Allow non-modal Dialogs during FileImport/Load
When opening a file that triggers Dialogs (e.g. cannot
read/repair/FileType) the Frame from which it was
initialized gets blocked. This irritates quite some
people. Changed this to a non-modal Dialog so that
the user can continue to work with all opened docs,
open new ones, close and print/PDF/export these.
Change-Id: I048d3de3369527cec20d26396b87439254764b8a
Reviewed-on: https://gerrit.libreoffice.org/41534
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/dialog.hxx | 16 | ||||
-rw-r--r-- | include/vcl/msgbox.hxx | 5 | ||||
-rw-r--r-- | include/vcl/svapp.hxx | 6 |
3 files changed, 23 insertions, 4 deletions
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index 49737fdc6057..2730467e4cab 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -34,7 +34,17 @@ class VclButtonBox; class VCL_DLLPUBLIC Dialog : public SystemWindow { public: - enum class InitFlag { Default, NoParent }; + enum class InitFlag + { + /** Use given parent or get a default one using GetDefaultParent(...) */ + Default, + + /** Suppress Parent so that Parent is not blocked (kind of modal mode) */ + NoParent, + + /** Suppress Parent (no modal, see above) and additionally center on default parent */ + NoParentCentered + }; private: VclPtr<Dialog> mpPrevExecuteDlg; @@ -84,6 +94,9 @@ public: virtual ~Dialog() override; virtual void dispose() override; + // get the default parent for a dialog as is done in standard initialization + static vcl::Window* GetDefaultParent(WinBits nStyle); + virtual bool EventNotify( NotifyEvent& rNEvt ) override; virtual void StateChanged( StateChangedType nStateChange ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; @@ -130,6 +143,7 @@ public: void EndDialog( long nResult = 0 ); static void EndAllDialogs( vcl::Window const * pParent ); + static bool AreDialogsOpen(); void GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, sal_Int32& rRightBorder, sal_Int32& rBottomBorder ) const; diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx index 8504c6c25ad9..7c377170566c 100644 --- a/include/vcl/msgbox.hxx +++ b/include/vcl/msgbox.hxx @@ -69,10 +69,9 @@ protected: SAL_DLLPRIVATE void ImplPosControls(); public: - MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, - const OUString& rTitle, const OUString& rMessage ); MessBox( vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits n, - const OUString& rTitle, const OUString& rMessage ); + const OUString& rTitle, const OUString& rMessage, + Dialog::InitFlag eInitFlag = Dialog::InitFlag::NoParentCentered); virtual ~MessBox() override; virtual void dispose() override; diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d5b81b2a20a4..7bdb4daccfb6 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1387,6 +1387,12 @@ public: // For vclbootstrapprotector: static void setDeInitHook(Link<LinkParamNone*,void> const & hook); + // for delayed shutdown: set using SetShutdownDelayed, then + // trigger using TriggerShutdownDelayed which may actually shutdown + // when SetShutdownDelayed is set + static void SetShutdownDelayed(); + static void TriggerShutdownDelayed(); + private: DECL_STATIC_LINK( Application, PostEventHandler, void*, void ); }; |