]> git.lyx.org Git - features.git/commitdiff
The QNote dialog
authorJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Jul 2003 12:48:24 +0000 (12:48 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Tue, 15 Jul 2003 12:48:24 +0000 (12:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7280 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
lib/CREDITS
lib/ChangeLog
po/POTFILES.in
src/frontends/qt2/ChangeLog
src/frontends/qt2/Dialogs.C
src/frontends/qt2/Makefile.am
src/frontends/qt2/Makefile.dialogs
src/frontends/qt2/QNote.C [new file with mode: 0644]
src/frontends/qt2/QNote.h [new file with mode: 0644]
src/frontends/qt2/QNoteDialog.C [new file with mode: 0644]
src/frontends/qt2/QNoteDialog.h [new file with mode: 0644]
src/frontends/qt2/ui/QNoteDialogBase.ui [new file with mode: 0644]

index 7ccb62639ec0a7b102377cb40fc96a774b15eba0..06919d4518e4c4d0267c496c71ab1eae8e9035c2 100644 (file)
    vertical spaces
 @bJürgen Spitzmüller
 @iE-mail: j.spitzmueller@gmx.de
-   Many improvements to xforms dialogs
+   Qt frontend, bugfixes
 @bBen Stanley
 @iE-mail: bds02@uow.edu.au
    fix bugs with error insets placement
index 5c7261b53872fa5fbbc55d86a4afcfbf7f6b02f3..34d3f2456be1cdc690e5206a2abfdc898d5b1b34 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-09  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * CREDITS: update.
+
 2003-07-10  John Levon  <levon@movementarian.org>
 
        * ui/classic.ui: fix toolbars to new scheme, fix space inserts
index 4d5e6015dc3c16966bb24ab6edaaa7a8af3fa7e0..38c15f31f800dabc7a03e231f49d192ce0a40131 100644 (file)
@@ -60,6 +60,7 @@ src/frontends/qt2/QMath.C
 src/frontends/qt2/QMathDialog.C
 src/frontends/qt2/QMathMatrixDialog.C
 src/frontends/qt2/QMinipage.C
+src/frontends/qt2/QNote.C
 src/frontends/qt2/QParagraph.C
 src/frontends/qt2/QPrefs.C
 src/frontends/qt2/QPrefsDialog.C
index 1f35ca7735b06a748cee0f41ff602e3308599653..8946df0dc3cd66a60bfc0a07ce060a220c62d0b1 100644 (file)
@@ -4,6 +4,15 @@
        sure that it is initialized to some reasonable value, so that the
        (ugly) Qt/Mac code can do its magic (conditionally on Q_WS_MAC).
 
+2003-07-09  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * ui/QNoteDialog.ui:
+       * QNoteDialog.[Ch]:
+       * QNote.[Ch]:
+       * Makefile.dialogs:
+       * Dialogs.C:
+       * Dialogs2.C: New Annotation (Note) dialog
+
 2003-07-11  André Pönitz  <poenitz@lyx.org>
 
        * Alert_pimpl.C:
index d42278dab83e4e7505fa7c5154949204f096ebfe..16109a910689c24a23503e4156c22c6f6d820ed5 100644 (file)
@@ -27,6 +27,7 @@
 #include "ControlLog.h"
 #include "ControlMath.h"
 #include "ControlMinipage.h"
+#include "ControlNote.h"
 #include "ControlParagraph.h"
 #include "ControlRef.h"
 #include "ControlShowFile.h"
@@ -57,6 +58,7 @@
 #include "QLog.h"
 #include "QMath.h"
 #include "QMinipage.h"
+#include "QNote.h"
 #include "QParagraph.h"
 #include "QRef.h"
 #include "QShowFile.h"
@@ -84,7 +86,7 @@ char const * const dialognames[] = { "aboutlyx", "bibitem", "bibtex", "changes",
 "character", "citation", "error", "errorlist", "ert", "external", "file",
 "float", "graphics", "include", "index", "label", "latexlog",
 "mathpanel", "mathdelimiter", "mathmatrix",
-"minipage", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
+"minipage", "note", "paragraph", "ref", "tabular", "tabularcreate", "texinfo",
 
 #ifdef HAVE_LIBAIKSAURUS
 "thesaurus",
@@ -207,6 +209,10 @@ Dialog * Dialogs::build(string const & name)
                dialog->setController(new ControlMinipage(*dialog));
                dialog->setView(new QMinipage(*dialog));
                dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
+       } else if (name == "note") {
+               dialog->setController(new ControlNote(*dialog));
+               dialog->setView(new QNote(*dialog));
+               dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
        } else if (name == "paragraph") {
                dialog->setController(new ControlParagraph(*dialog));
                dialog->setView(new QParagraph(*dialog));
index a4c269600d663713602b5ea0d3253b4acdba1275..d111884f7627d150c1f06086cf64b2eb79d65456 100644 (file)
@@ -47,6 +47,7 @@ libqt2_la_SOURCES = \
        QLyXKeySym.C QLyXKeySym.h \
        QMath.C QMath.h \
        QMinipage.C QMinipage.h \
+       QNote.C QNote.h \
        QParagraph.C QParagraph.h \
        QPrefs.C QPrefs.h \
        QPrint.C QPrint.h \
index bbbc547f75f915c6772b32d32b89889bb1d30671..50e400a9b5ec1f5023a2790fd9bec5536aaa855a 100644 (file)
@@ -33,6 +33,7 @@ UIFILES = \
        QMathDialogBase.ui \
        QMathMatrixDialogBase.ui \
        QMinipageDialogBase.ui \
+       QNoteDialogBase.ui \
        QParagraphDialogBase.ui \
        QPrefAsciiModule.ui \
        QPrefColorsModule.ui \
@@ -100,6 +101,7 @@ MOCFILES = \
        QMathDialog.C QMathDialog.h \
        QMathMatrixDialog.C QMathMatrixDialog.h \
        QMinipageDialog.C QMinipageDialog.h \
+       QNoteDialog.C QNoteDialog.h \
        QParagraphDialog.C QParagraphDialog.h \
        QPrefsDialog.C QPrefsDialog.h \
        QRefDialog.C QRefDialog.h \
diff --git a/src/frontends/qt2/QNote.C b/src/frontends/qt2/QNote.C
new file mode 100644 (file)
index 0000000..5fba9fa
--- /dev/null
@@ -0,0 +1,71 @@
+/**
+ * \file QNote.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Juergen Spitzmueller
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#include <config.h>
+
+#include "ControlNote.h"
+#include "qt_helpers.h"
+#include "insets/insetnote.h"
+
+#include <qradiobutton.h>
+#include <qpushbutton.h>
+
+#include "QNoteDialog.h"
+#include "QNote.h"
+#include "Qt2BC.h"
+
+
+typedef QController<ControlNote, QView<QNoteDialog> > base_class;
+
+
+QNote::QNote(Dialog & parent)
+       : base_class(parent, _("LyX: Annotation Settings"))
+{}
+
+
+void QNote::build_dialog()
+{
+       dialog_.reset(new QNoteDialog(this));
+
+       bcview().setOK(dialog_->okPB);
+       bcview().setCancel(dialog_->closePB);
+}
+
+
+void QNote::update_contents()
+{
+       QRadioButton * rb = 0;
+       string type(controller().params().type);
+
+       if (type == "Note")
+               rb = dialog_->noteRB;
+       else if (type == "Comment")
+               rb = dialog_->commentRB;
+       else if (type == "Greyedout")
+               rb = dialog_->greyedoutRB;
+
+       rb->setChecked(true);
+}
+
+
+void QNote::apply()
+{
+       string type;
+
+       if (dialog_->greyedoutRB->isChecked())
+               type = "Greyedout";
+       else if (dialog_->commentRB->isChecked())
+               type = "Comment";
+       else
+               type = "Note";
+
+       controller().params().type = type;
+}
+
diff --git a/src/frontends/qt2/QNote.h b/src/frontends/qt2/QNote.h
new file mode 100644 (file)
index 0000000..33ea418
--- /dev/null
@@ -0,0 +1,39 @@
+// -*- C++ -*-
+/**
+ * \file QNote.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Juergen Spitzmueller
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#ifndef QNOTE_H
+#define QNOTE_H
+
+#include "QDialogView.h"
+
+
+class ControlNote;
+class QNoteDialog;
+
+/** This class provides a QT implementation of the Note Dialog.
+ */
+class QNote : public QController<ControlNote, QView<QNoteDialog> >
+{
+public:
+       friend class QNoteDialog;
+
+       /// Constructor
+       QNote(Dialog &);
+private:
+       ///  Apply changes
+       virtual void apply();
+       /// Build the dialog
+       virtual void build_dialog();
+       /// Update dialog before showing it
+       virtual void update_contents();
+};
+
+#endif // QNOTE_H
diff --git a/src/frontends/qt2/QNoteDialog.C b/src/frontends/qt2/QNoteDialog.C
new file mode 100644 (file)
index 0000000..540688d
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * \file QNoteDialog.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Juergen Spitzmueller
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#include <config.h>
+
+
+#include "QNote.h"
+#include "QNoteDialog.h"
+
+#include <qpushbutton.h>
+
+
+QNoteDialog::QNoteDialog(QNote * form)
+       : QNoteDialogBase(0, 0, false, 0),
+       form_(form)
+{
+       connect(okPB, SIGNAL(clicked()),
+               form, SLOT(slotOK()));
+       connect(closePB, SIGNAL(clicked()),
+               form, SLOT(slotClose()));
+}
+
+
+void QNoteDialog::closeEvent(QCloseEvent * e)
+{
+       form_->slotWMHide();
+       e->accept();
+}
+
+
+void QNoteDialog::change_adaptor()
+{
+       form_->changed();
+}
diff --git a/src/frontends/qt2/QNoteDialog.h b/src/frontends/qt2/QNoteDialog.h
new file mode 100644 (file)
index 0000000..8ca4693
--- /dev/null
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+/**
+ * \file QNoteDialog.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Juergen Spitzmueller
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+#ifndef QNOTEDIALOG_H
+#define QNOTEDIALOG_H
+
+#include "ui/QNoteDialogBase.h"
+
+
+class QNote;
+
+class QNoteDialog : public QNoteDialogBase {
+       Q_OBJECT
+public:
+       QNoteDialog(QNote * form);
+protected slots:
+       virtual void change_adaptor();
+protected:
+       virtual void closeEvent(QCloseEvent * e);
+private:
+       QNote * form_;
+};
+
+#endif // QNOTEDIALOG_H
diff --git a/src/frontends/qt2/ui/QNoteDialogBase.ui b/src/frontends/qt2/ui/QNoteDialogBase.ui
new file mode 100644 (file)
index 0000000..fc9df74
--- /dev/null
@@ -0,0 +1,156 @@
+<!DOCTYPE UI><UI>
+<class>QNoteDialogBase</class>
+<include location="global">config.h</include>
+<include location="local">qt_helpers.h</include>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>QNoteDialogBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>188</width>
+            <height>146</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>Annotation Settings</string>
+    </property>
+    <property stdset="1">
+        <name>sizeGripEnabled</name>
+        <bool>true</bool>
+    </property>
+    <grid>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget row="1"  column="0" >
+            <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 row="1"  column="1" >
+            <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>
+        <widget row="0"  column="0"  rowspan="1"  colspan="2" >
+            <class>QButtonGroup</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>NoteBG</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Type</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>noteRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Note</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>LyX internal only</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QRadioButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>commentRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>C&amp;omment</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Export to LaTeX but don't print</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QRadioButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>greyedoutRB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Greyed out</string>
+                    </property>
+                    <property>
+                        <name>toolTip</name>
+                        <string>Print as grey text</string>
+                    </property>
+                </widget>
+            </vbox>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>noteRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QNoteDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <connection>
+        <sender>greyedoutRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QNoteDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <connection>
+        <sender>commentRB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QNoteDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <slot access="public">change_adaptor()</slot>
+</connections>
+</UI>