]> git.lyx.org Git - lyx.git/commitdiff
forgot cvs add ...
authorJohn Levon <levon@movementarian.org>
Sun, 26 Aug 2001 19:19:27 +0000 (19:19 +0000)
committerJohn Levon <levon@movementarian.org>
Sun, 26 Aug 2001 19:19:27 +0000 (19:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2593 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/QERT.C [new file with mode: 0644]
src/frontends/qt2/QERT.h [new file with mode: 0644]
src/frontends/qt2/QERTDialog.C [new file with mode: 0644]
src/frontends/qt2/QERTDialog.h [new file with mode: 0644]
src/frontends/qt2/ui/QERTDialog.ui [new file with mode: 0644]

diff --git a/src/frontends/qt2/QERT.C b/src/frontends/qt2/QERT.C
new file mode 100644 (file)
index 0000000..4b56c82
--- /dev/null
@@ -0,0 +1,59 @@
+/**
+ * \file QERT.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include <config.h>
+
+#include "QERTDialog.h"
+#include "ControlERT.h"
+#include "QERT.h"
+#include "Qt2BC.h"
+#include "gettext.h"
+
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+
+typedef Qt2CB<ControlERT, Qt2DB<QERTDialog> > base_class;
+QERT::QERT(ControlERT & c)
+       : base_class(c, _("LaTeX ERT"))
+{
+}
+
+
+void QERT::build_dialog()
+{
+       dialog_.reset(new QERTDialog(this));
+
+       bc().setOK(dialog_->okPB);
+       bc().setCancel(dialog_->closePB);
+}
+
+void QERT::apply()
+{
+       if (dialog_->openRB->isChecked())
+               controller().params().status = InsetERT::Open;
+       else if (dialog_->inlineRB->isChecked())
+               controller().params().status = InsetERT::Inlined;
+       else
+               controller().params().status = InsetERT::Collapsed;
+}
+
+void QERT::update_contents()
+{
+       QRadioButton * rb;
+       switch (controller().params().status) {
+               case InsetERT::Open: rb = dialog_->openRB; break;
+               case InsetERT::Inlined: rb = dialog_->inlineRB; break;
+               case InsetERT::Collapsed: rb = dialog_->collapsedRB; break;
+       } 
+                
+       rb->setChecked(true);
+}
diff --git a/src/frontends/qt2/QERT.h b/src/frontends/qt2/QERT.h
new file mode 100644 (file)
index 0000000..5c42aff
--- /dev/null
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+/**
+ * \file QERT.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QERT_H
+#define QERT_H
+
+#include "Qt2Base.h"
+
+class ControlERT;
+class QERTDialog;
+
+class QERT :
+       public Qt2CB<ControlERT, Qt2DB<QERTDialog> > 
+{
+       friend class QERTDialog;
+public: 
+       QERT(ControlERT &);
+
+private: 
+       /// Apply changes
+       virtual void apply();
+       /// update
+       virtual void update_contents();
+       /// build the dialog
+       virtual void build_dialog();
+};
+
+#endif // QERT_H
diff --git a/src/frontends/qt2/QERTDialog.C b/src/frontends/qt2/QERTDialog.C
new file mode 100644 (file)
index 0000000..a273203
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ * \file QERTDialog.C
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#include "QERTDialog.h"
+#include "Dialogs.h"
+#include "QERT.h"
+
+#include <qpushbutton.h>
+
+QERTDialog::QERTDialog(QERT * form)
+       : QERTDialogBase(0, 0, false, 0),
+       form_(form)
+{
+       connect(okPB, SIGNAL(clicked()),
+               form, SLOT(slotOK()));
+       connect(closePB, SIGNAL(clicked()),
+               form, SLOT(slotClose()));
+}
+
+void QERTDialog::closeEvent(QCloseEvent * e)
+{
+       form_->slotWMHide();
+       e->accept();
+}
diff --git a/src/frontends/qt2/QERTDialog.h b/src/frontends/qt2/QERTDialog.h
new file mode 100644 (file)
index 0000000..7373a24
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ * \file QERTDialog.h
+ * Copyright 2001 the LyX Team
+ * Read the file COPYING
+ *
+ * \author John Levon <moz@compsoc.man.ac.uk>
+ */
+
+#ifndef QERTDIALOG_H
+#define QERTDIALOG_H
+#include <config.h>
+#include "ui/QERTDialogBase.h"
+#include "QERT.h"
+
+class QERTDialog : public QERTDialogBase
+{ Q_OBJECT
+
+public:
+       QERTDialog(QERT * form);
+
+protected slots:
+       void change_adaptor() {
+               form_->changed();
+       }
+protected:
+       virtual void closeEvent(QCloseEvent * e);
+
+private:
+       QERT * form_;
+};
+
+#endif // QERTDIALOG_H
diff --git a/src/frontends/qt2/ui/QERTDialog.ui b/src/frontends/qt2/ui/QERTDialog.ui
new file mode 100644 (file)
index 0000000..22387f4
--- /dev/null
@@ -0,0 +1,188 @@
+<!DOCTYPE UI><UI>
+<class>QERTDialogBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>QERTDialogBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>197</width>
+            <height>158</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>ERT inset display</string>
+    </property>
+    <vbox>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget>
+            <class>QButtonGroup</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>ertBG</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>ERT inset display</string>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QRadioButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>inlineRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Inline</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Show ERT inline</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QRadioButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>collapsedRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Collapsed</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Show ERT button only</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QRadioButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>openRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Open</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Show ERT contents</string>
+                    </property>
+                </widget>
+            </vbox>
+        </widget>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout2</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer3</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>okPB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>OK</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>closePB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Close</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
+</widget>
+<connections>
+    <connection>
+        <sender>inlineRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QERTDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <connection>
+        <sender>collapsedRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QERTDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <connection>
+        <sender>openRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QERTDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <slot access="public">change_adaptor()</slot>
+</connections>
+</UI>