]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DialogView.h
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / DialogView.h
index 919024dc55dc480f2a29adc8cf6bbab7e7294744..d3125c6f8e94298e00e78d9898fada42b4a76114 100644 (file)
@@ -21,9 +21,6 @@
 namespace lyx {
 namespace frontend {
 
-/** \c Dialog collects the different parts of a Model-Controller-View
- *  split of a generic dialog together.
- */
 class DialogView : public QDialog, public Dialog
 {
 public:
@@ -39,11 +36,12 @@ public:
        virtual QWidget const * asQWidget() const { return this; }
 
 protected:
-       /// Dialog inherited methods
+       /// \name Dialog inherited methods
        //@{
        void applyView() {}
        bool initialiseParams(std::string const & /*data*/) { return true; }
        void clearParams() {}
+       bool needBufferOpen() const { return isBufferDependent(); }
        //@}
        /// Any dialog that overrides this method should make sure to call it.
        void closeEvent(QCloseEvent * ev)
@@ -52,6 +50,15 @@ protected:
                Dialog::disconnect();
                ev->accept();
        }
+       /// Any dialog that overrides this method should make sure to call it.
+       void hideEvent(QHideEvent * ev)
+       {
+               if (!ev->spontaneous()) {
+                       clearParams();
+                       Dialog::disconnect();
+                       ev->accept();
+               }
+       }
 };
 
 } // namespace frontend