]> git.lyx.org Git - features.git/commitdiff
* Dialog.cpp: whitespace
authorAbdelrazak Younes <younes@lyx.org>
Tue, 5 Feb 2008 10:53:31 +0000 (10:53 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Tue, 5 Feb 2008 10:53:31 +0000 (10:53 +0000)
* DialogView: remove cruft.

* GuiDialog: add cruft and don't depend on DialogView as GuiDialog is meant for extinction eventually.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22783 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/Dialog.cpp
src/frontends/qt4/DialogView.cpp
src/frontends/qt4/DialogView.h
src/frontends/qt4/GuiDialog.cpp
src/frontends/qt4/GuiDialog.h

index 205f6ddbfa00ffc491e76052af05c245d1f07ff1..44b4ca5935cac2b8c996233641493a1819170600 100644 (file)
@@ -48,6 +48,7 @@ string const & Dialog::name() const
        return name_;
 }
 
+
 bool Dialog::canApply() const
 {
        FuncRequest const fr(getLfun(), from_ascii(name_));
index 94afd20e0684d7c66c18e28cbea9035711c20f97..d0e1ab1f77b669973ea39a22738ae4915c4d8a75 100644 (file)
@@ -27,12 +27,6 @@ DialogView::DialogView(GuiView & lv, string const & name)
        : QDialog(&lv), Dialog(lv, name)
 {}
 
-
-void DialogView::setViewTitle(docstring const & title)
-{
-       setWindowTitle("LyX: " + toqstr(title));
-}
-
 } // namespace frontend
 } // namespace lyx
 
index 9036960305c23ce303ee0c6eb9b686cec5376df7..84747ad738ec744743cb1ddf0010b20fa20feaf1 100644 (file)
@@ -16,9 +16,6 @@
 
 #include <QDialog>
 
-class QCloseEvent;
-class QShowEvent;
-
 namespace lyx {
 namespace frontend {
 
@@ -40,9 +37,6 @@ public:
        virtual QWidget const * asQWidget() const { return this; }
 
 protected:
-       ///
-       void setViewTitle(docstring const & title);
-
        /// Dialog inherited methods
        //@{
        void applyView() {}
index a26690bdda3d1646a18862f1e948d4a5909e5cd0..ddf3c8ae3e58b75ba28733c3320abe57db47940d 100644 (file)
@@ -27,10 +27,16 @@ namespace lyx {
 namespace frontend {
 
 GuiDialog::GuiDialog(GuiView & lv, string const & name)
-       : DialogView(lv, name), is_closing_(false)
+       :  QDialog(&lv), Dialog(lv, name), is_closing_(false)
 {}
 
 
+void GuiDialog::setViewTitle(docstring const & title)
+{
+       setWindowTitle("LyX: " + toqstr(title));
+}
+
+
 void GuiDialog::setButtonsValid(bool valid)
 {
        bc().setValid(valid);
@@ -83,7 +89,7 @@ void GuiDialog::enableView(bool enable)
 {
        bc().setReadOnly(!enable);
        bc().setValid(enable);
-       DialogView::enableView(enable);
+       Dialog::enableView(enable);
 }
 
 
index 76889b5ccb527052edb8716a585cae3bc3bf2310..608e5962e962a716fb09ae520acd74af59add7c8 100644 (file)
 #ifndef GUIDIALOG_H
 #define GUIDIALOG_H
 
-#include "DialogView.h"
+#include "Dialog.h"
 #include "ButtonController.h"
 
 #include "insets/InsetCommandParams.h"
 
+#include <QDialog>
+
+class QCloseEvent;
+class QShowEvent;
+
 namespace lyx {
 namespace frontend {
 
-/** \c Dialog collects the different parts of a Model-Controller-View
- *  split of a generic dialog together.
- */
-class GuiDialog : public DialogView
+/// Base class for historical LyX dialogs.
+/** 
+  * \warning New dialogs should use the leaner classes \c DialogView or
+  * \c DockView depending on the intent. Eventally, old dialog should be
+  * converted to \c DialogView too.
+  */
+class GuiDialog : public QDialog, public Dialog
 {
        Q_OBJECT
 
@@ -33,6 +41,9 @@ public:
        /// container.
        explicit GuiDialog(GuiView & lv, std::string const & name);
 
+       virtual QWidget * asQWidget() { return this; }
+       virtual QWidget const * asQWidget() const { return this; }
+
 public Q_SLOTS:
        /** \name Buttons
         *  These methods are publicly accessible because they are invoked
@@ -48,6 +59,9 @@ public Q_SLOTS:
        void slotClose();
 
 public:
+       ///
+       void setViewTitle(docstring const & title);
+
        /** Check whether we may apply our data.
         *
         *  The buttons are disabled if not and (re-)enabled if yes.