]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/DialogView.cpp
Use <cstdint> instead of <boost/cstdint.hpp>
[lyx.git] / src / frontends / qt4 / DialogView.cpp
index d0e1ab1f77b669973ea39a22738ae4915c4d8a75..9b114ec507df9966338e7dfd52a9e3f9a5f55aef 100644 (file)
@@ -1,9 +1,10 @@
+// -*- C++ -*-
 /**
  * \file DialogView.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming
+ * \author Abdelrazak Younes
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "DialogView.h"
 
-#include "GuiView.h"
-#include "qt_helpers.h"
-
-#include <QCloseEvent>
-#include <QShowEvent>
-
-using namespace std;
 
 namespace lyx {
 namespace frontend {
 
-DialogView::DialogView(GuiView & lv, string const & name)
-       : QDialog(&lv), Dialog(lv, name)
-{}
+DialogView::DialogView(GuiView & lv, QString const & name, QString const & title)
+       : QDialog(&lv), Dialog(lv, name, "LyX: " + title)
+{
+       connect(&lv, SIGNAL(bufferViewChanged()),
+               this, SLOT(onBufferViewChanged()));
+
+       // remove question marks from Windows dialogs
+       setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
+}
+
+
+void DialogView::closeEvent(QCloseEvent * ev)
+{
+       clearParams();
+       Dialog::disconnect();
+       ev->accept();
+}
+
+
+void DialogView::hideEvent(QHideEvent * ev)
+{
+       if (!ev->spontaneous()) {
+               clearParams();
+               Dialog::disconnect();
+               ev->accept();
+       }
+}
 
 } // namespace frontend
 } // namespace lyx
 
-#include "DialogView_moc.cpp"
+#include "moc_DialogView.cpp"