]> git.lyx.org Git - features.git/commitdiff
fix build, thesaurus
authorJohn Levon <levon@movementarian.org>
Wed, 16 Jan 2002 23:56:25 +0000 (23:56 +0000)
committerJohn Levon <levon@movementarian.org>
Wed, 16 Jan 2002 23:56:25 +0000 (23:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3400 a592a061-630c-0410-9148-cb99ea01b6c8

14 files changed:
src/frontends/qt2/ChangeLog
src/frontends/qt2/Dialogs.C
src/frontends/qt2/FileDialog_private.C
src/frontends/qt2/FileDialog_private.h
src/frontends/qt2/Makefile.am
src/frontends/qt2/QBibitemDialog.h
src/frontends/qt2/QCharacter.C
src/frontends/qt2/QExternal.C
src/frontends/qt2/QThesaurus.C
src/frontends/qt2/QThesaurus.h
src/frontends/qt2/QThesaurusDialog.C
src/frontends/qt2/QThesaurusDialog.h
src/frontends/qt2/Qt2BC.C
src/frontends/qt2/ui/QThesaurusDialog.ui

index ae87c2281695364501d278951fad347581c6a42b..1a0232dae5544767dab81e318f854ce4d62536ec 100644 (file)
@@ -1,3 +1,14 @@
+2002-01-15  John Levon  <moz@compsoc.man.ac.uk>
+
+       * Makefile.am: 
+       * FileDialog_private.h: fix compile
+
+       * QThesaurus.h:
+       * QThesaurus.C:
+       * QThesaurusDialog.h:
+       * QThesaurusDialog.C:
+       * ui/QThesaurusDialog.ui: new thesaurus code 
 2002-01-14  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * QMinipage.C (apply, update_contents): MinipageParams::width renamed
index ebd0e97b8563aa85c13146099dedbf76066f44f5..ec6f0b3fff478bacbde5edb4c1e934717bdc6dce 100644 (file)
 #include "buffer.h"
 #include "Qt2BC.h"
 
-// the controllers
-#include "controllers/ControlAboutlyx.h"
-#include "controllers/ControlBibitem.h"
-#include "controllers/ControlBibtex.h"
-#include "controllers/ControlCharacter.h"
-#include "controllers/ControlCitation.h"
-#include "controllers/ControlError.h"
-#include "controllers/ControlERT.h"
-#include "controllers/ControlExternal.h"
-#include "controllers/ControlGraphics.h"
-#include "controllers/ControlInclude.h"
-#include "controllers/ControlIndex.h"
-#include "controllers/ControlLog.h"
-#include "controllers/ControlMinipage.h"
-#include "controllers/ControlPreamble.h"
-#include "controllers/ControlPrint.h"
-#include "controllers/ControlRef.h"
-#include "controllers/ControlSearch.h"
-#include "controllers/ControlSpellchecker.h"
-#include "controllers/ControlTabularCreate.h"
-#include "controllers/ControlThesaurus.h"
-#include "controllers/ControlUrl.h"
-#include "controllers/ControlVCLog.h"
-#if 0
-#include "controllers/ControlToc.h"
-#endif
-
 // xforms stuff
-#include "controllers/ControlERT.h"
-#include "controllers/ControlFloat.h"
-#include "controllers/ControlShowFile.h"
-#include "controllers/ControlToc.h"
 #include "xforms/FormBrowser.h"
 #include "xforms/form_browser.h"
 #include "xforms/FormDocument.h"
index 0745fb6a3a491123d404d0ece70108d13e7b4c3a..553a20b1cdb4792bd573eea606dcc53d1210ad85 100644 (file)
@@ -33,7 +33,9 @@ void LyXFileDialog::done(int what)
        if (action_ == LFUN_SELECT_FILE_SYNC) {
                QDialog::done(what);
                return;
-       } else if (what == QDialog::Accepted)
+       } else if (what == QDialog::Accepted) {
                lv_->getLyXFunc()->dispatch(action_, selectedFile().data());
+       }
+       
        delete this;
 }
index 0f3fda5ee1dde5aae80f8548c508d37d5bdb9893..6463876336fd5d51fd50d42572f0553c54769b6c 100644 (file)
@@ -11,7 +11,7 @@
 #define FILEDIALOG_PRIVATE_H
 
 #include <config.h>
-
 #include <qfiledialog.h>
 
 #include "LString.h"
@@ -35,7 +35,7 @@ public slots:
 
 private:
        LyXView * lv_;
-       int action_;
+       kb_action action_;
 };
 
 #endif // FILEDIALOG_PRIVATE_H
index bd9e6b385cb1bc0d824c68204691825451360477..a6f1ad4034ab9e8985c59d9993335db78a20c6a8 100644 (file)
@@ -33,6 +33,7 @@ libqt2_la_LIBADD = \
        ../xforms/FormMathsDelim.lo \
        ../xforms/FormMathsMatrix.lo \
        ../xforms/FormMathsPanel.lo \
+       ../xforms/FormMathsStyle.lo \
        ../xforms/FormMathsSpace.lo \
        ../xforms/FormParagraph.lo \
        ../xforms/FormPreferences.lo \
@@ -58,6 +59,7 @@ libqt2_la_LIBADD = \
        ../xforms/form_maths_matrix.lo \
        ../xforms/form_maths_panel.lo \
        ../xforms/form_maths_space.lo \
+       ../xforms/form_maths_style.lo \
        ../xforms/form_paragraph.lo \
        ../xforms/input_validators.lo \
        ../xforms/xformsBC.lo \
index 282d32566878c433df6f66a59a5bc510d2fc0c92..169b8d70b0e94d4078e763e3e23a6ede599ac991 100644 (file)
@@ -9,8 +9,6 @@
 #ifndef QBIBITEMDIALOG_H
 #define QBIBITEMDIALOG_H
  
-#include <config.h>
 #include "ui/QBibitemDialogBase.h"
 
 class QBibitem;
index 5563535ef12e86c58c18a459c9c98e78e38647a5..83afefacd79be2fcdce6fd486ed5634730ab6e99 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <config.h>
 
+#include <vector>
+
 #include "gettext.h"
 #include "support/lstrings.h"
 
index 28c3c3158440d084cc40d305501a9b7dcf566877..28637a8bf59dce525182f119c1539193ee58b26d 100644 (file)
@@ -9,7 +9,6 @@
 #include <config.h>
 #include <vector> 
 
-#include "LString.h" 
 #include "QExternalDialog.h"
 #include "ControlExternal.h"
 #include "QExternal.h"
index 9b8107bc1d5a902a7314e5d7afc4876ce357838c..11cb78849cedc86e73a49dda7c10bdb92d25198e 100644 (file)
@@ -53,8 +53,3 @@ void QThesaurus::replace()
 {
        controller().replace(dialog_->replaceED->text().latin1());
 }
-
-
-void QThesaurus::apply()
-{
-}
index c4e4b24136bc50d2b7348b6844adb68ef9a4d42b..79b8ecee63c3abcee7cfb2920367fe2cab66f56c 100644 (file)
@@ -30,7 +30,7 @@ public:
        QThesaurus(ControlThesaurus &);
 private:
        /// Apply changes
-       virtual void apply();
+       virtual void apply() { };
        /// update
        virtual void update_contents();
        /// build the dialog
index d9553845a5cb2a6b4a01410c3baaf1c1200ae406..580272ad5f6c45a8b25baa9d2601409424468000 100644 (file)
@@ -16,9 +16,8 @@
 #include "Dialogs.h"
 #include "QThesaurus.h"
 
-#include <qwidget.h>
 #include <qpushbutton.h>
-#include <qlistbox.h>
+#include <qlistview.h>
 #include <qlineedit.h> 
 
 QThesaurusDialog::QThesaurusDialog(QThesaurus * form)
@@ -55,57 +54,49 @@ void QThesaurusDialog::replaceClicked()
 }
 
  
-void QThesaurusDialog::selectionChanged(const QString & str)
+void QThesaurusDialog::selectionChanged(QListViewItem * item)
 {
        if (form_->readOnly())
                return;
  
-       string const entry(str.latin1());
+       string const entry(item->text(0).latin1());
        replaceED->setText(entry.c_str());
        replacePB->setEnabled(true);
        form_->changed();
 }
 
  
-void QThesaurusDialog::selectionClicked(const QString & str)
+void QThesaurusDialog::selectionClicked(QListViewItem * item)
 {
-       selectionChanged(str);
-       entryED->setText(str);
+       entryED->setText(item->text(0));
+       selectionChanged(item);
        updateLists();
 }
 
  
 void QThesaurusDialog::updateLists()
 {
-       ControlThesaurus & control(form_->controller());
-       string const entry(entryED->text().latin1());
-
-       nounsLB->clear();
-       verbsLB->clear();
-       adjectivesLB->clear();
-       adverbsLB->clear();
-       otherLB->clear();
+       meaningsLV->clear();
  
        std::vector<string> matches;
 
-       matches = control.getNouns(entry);
-       for (std::vector<string>::const_iterator cit = matches.begin();
-               cit != matches.end(); ++cit)
-               nounsLB->insertItem(cit->c_str());
-       matches = control.getVerbs(entry);
-       for (std::vector<string>::const_iterator cit = matches.begin();
-               cit != matches.end(); ++cit)
-               verbsLB->insertItem(cit->c_str());
-       matches = control.getAdjectives(entry);
-       for (std::vector<string>::const_iterator cit = matches.begin();
-               cit != matches.end(); ++cit)
-               adjectivesLB->insertItem(cit->c_str());
-       matches = control.getAdverbs(entry);
-       for (std::vector<string>::const_iterator cit = matches.begin();
-               cit != matches.end(); ++cit)
-               adverbsLB->insertItem(cit->c_str());
-       matches = control.getOthers(entry);
-       for (std::vector<string>::const_iterator cit = matches.begin();
-               cit != matches.end(); ++cit)
-               otherLB->insertItem(cit->c_str());
+       meaningsLV->setUpdatesEnabled(false);
+       Thesaurus::Meanings meanings = form_->controller().getMeanings(entryED->text().latin1());
+       for (Thesaurus::Meanings::const_iterator cit = meanings.begin();
+               cit != meanings.end(); ++cit) {
+               QListViewItem * i = new QListViewItem(meaningsLV);
+               i->setText(0, cit->first.c_str());
+               i->setOpen(true);
+               for (std::vector<string>::const_iterator cit2 = cit->second.begin();
+                       cit2 != cit->second.end(); ++cit2) {
+                               QListViewItem * i2 = new QListViewItem(i);
+                               i2->setText(0, cit2->c_str());
+                               i2->setOpen(true);
+                       }
+       }
+       meaningsLV->setUpdatesEnabled(true);
+       meaningsLV->update();
 }
index 42b331942861a4991b81b51561d7f692e8f6272e..36e9bb7102db2580bb6d62f80071cea971d6fac7 100644 (file)
@@ -14,6 +14,7 @@
 #include "ui/QThesaurusDialogBase.h"
 
 class QThesaurus;
+class QListViewItem;
 
 class QThesaurusDialog : public QThesaurusDialogBase
 { Q_OBJECT
@@ -27,8 +28,8 @@ protected slots:
        virtual void change_adaptor();
        virtual void entryChanged();
        virtual void replaceClicked();
-       virtual void selectionChanged(const QString &);
-       virtual void selectionClicked(const QString &);
+       virtual void selectionChanged(QListViewItem *);
+       virtual void selectionClicked(QListViewItem *);
 
 protected:
        virtual void closeEvent(QCloseEvent * e);
index 485afdb6c9f6d1d4665d529198acd82710a18b9d..befb038f9f2d62e7707c49494483e4024df21f79 100644 (file)
@@ -14,6 +14,7 @@
 #endif
 
 #include "Qt2BC.h"
+#include "ButtonController.tmpl"
 #include "debug.h"
 
 #include <qbutton.h>
index 0f3b3e4cbc150d33e6046f4704315a364d96405a..1219e26b80700b1dde8970a3bab375b48849fdc7 100644 (file)
@@ -13,7 +13,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>478</width>
+            <width>466</width>
             <height>442</height>
         </rect>
     </property>
                         <name>name</name>
                         <cstring>Spacer2</cstring>
                     </property>
-                    <property stdset="1">
-                        <name>sizePolicy</name>
-                        <sizepolicy>
-                            <hsizetype>7</hsizetype>
-                            <vsizetype>1</vsizetype>
-                        </sizepolicy>
-                    </property>
                     <property stdset="1">
                         <name>orientation</name>
                         <enum>Horizontal</enum>
             </hbox>
         </widget>
         <widget>
-            <class>QTabWidget</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>TabWidget2</cstring>
-            </property>
-            <widget>
-                <class>QWidget</class>
-                <property stdset="1">
-                    <name>name</name>
-                    <cstring>tab</cstring>
+            <class>QListView</class>
+            <column>
+                <property>
+                    <name>text</name>
+                    <string>Thesaurus entries</string>
                 </property>
-                <attribute>
-                    <name>title</name>
-                    <string>&amp;Nouns</string>
-                </attribute>
-                <hbox>
-                    <property stdset="1">
-                        <name>margin</name>
-                        <number>11</number>
-                    </property>
-                    <property stdset="1">
-                        <name>spacing</name>
-                        <number>6</number>
-                    </property>
-                    <widget>
-                        <class>QListBox</class>
-                        <property stdset="1">
-                            <name>name</name>
-                            <cstring>nounsLB</cstring>
-                        </property>
-                        <property stdset="1">
-                            <name>columnMode</name>
-                            <enum>FitToHeight</enum>
-                        </property>
-                        <property>
-                            <name>toolTip</name>
-                            <string>Matching nouns</string>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
-            <widget>
-                <class>QWidget</class>
-                <property stdset="1">
-                    <name>name</name>
-                    <cstring>tab</cstring>
+                <property>
+                    <name>clickable</name>
+                    <bool>true</bool>
                 </property>
-                <attribute>
-                    <name>title</name>
-                    <string>&amp;Verbs</string>
-                </attribute>
-                <hbox>
-                    <property stdset="1">
-                        <name>margin</name>
-                        <number>11</number>
-                    </property>
-                    <property stdset="1">
-                        <name>spacing</name>
-                        <number>6</number>
-                    </property>
-                    <widget>
-                        <class>QListBox</class>
-                        <property stdset="1">
-                            <name>name</name>
-                            <cstring>verbsLB</cstring>
-                        </property>
-                        <property stdset="1">
-                            <name>columnMode</name>
-                            <enum>FitToHeight</enum>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
-            <widget>
-                <class>QWidget</class>
-                <property stdset="1">
-                    <name>name</name>
-                    <cstring>tab</cstring>
+                <property>
+                    <name>resizeable</name>
+                    <bool>true</bool>
                 </property>
-                <attribute>
-                    <name>title</name>
-                    <string>&amp;Adjectives</string>
-                </attribute>
-                <hbox>
-                    <property stdset="1">
-                        <name>margin</name>
-                        <number>11</number>
-                    </property>
-                    <property stdset="1">
-                        <name>spacing</name>
-                        <number>6</number>
-                    </property>
-                    <widget>
-                        <class>QListBox</class>
-                        <property stdset="1">
-                            <name>name</name>
-                            <cstring>adjectivesLB</cstring>
-                        </property>
-                        <property stdset="1">
-                            <name>columnMode</name>
-                            <enum>FitToHeight</enum>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
-            <widget>
-                <class>QWidget</class>
-                <property stdset="1">
-                    <name>name</name>
-                    <cstring>tab</cstring>
-                </property>
-                <attribute>
-                    <name>title</name>
-                    <string>A&amp;dverbs</string>
-                </attribute>
-                <hbox>
-                    <property stdset="1">
-                        <name>margin</name>
-                        <number>11</number>
-                    </property>
-                    <property stdset="1">
-                        <name>spacing</name>
-                        <number>6</number>
-                    </property>
-                    <widget>
-                        <class>QListBox</class>
-                        <property stdset="1">
-                            <name>name</name>
-                            <cstring>adverbsLB</cstring>
-                        </property>
-                        <property stdset="1">
-                            <name>columnMode</name>
-                            <enum>FitToHeight</enum>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
-            <widget>
-                <class>QWidget</class>
-                <property stdset="1">
-                    <name>name</name>
-                    <cstring>tab</cstring>
-                </property>
-                <attribute>
-                    <name>title</name>
-                    <string>&amp;Other</string>
-                </attribute>
-                <hbox>
-                    <property stdset="1">
-                        <name>margin</name>
-                        <number>11</number>
-                    </property>
-                    <property stdset="1">
-                        <name>spacing</name>
-                        <number>6</number>
-                    </property>
-                    <widget>
-                        <class>QListBox</class>
-                        <property stdset="1">
-                            <name>name</name>
-                            <cstring>otherLB</cstring>
-                        </property>
-                        <property stdset="1">
-                            <name>columnMode</name>
-                            <enum>FitToHeight</enum>
-                        </property>
-                    </widget>
-                </hbox>
-            </widget>
+            </column>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>meaningsLV</cstring>
+            </property>
+            <property stdset="1">
+                <name>allColumnsShowFocus</name>
+                <bool>true</bool>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Select a related word</string>
+            </property>
         </widget>
         <widget>
             <class>QLayoutWidget</class>
         <slot>replaceClicked()</slot>
     </connection>
     <connection>
-        <sender>nounsLB</sender>
-        <signal>highlighted(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionChanged(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>nounsLB</sender>
-        <signal>selected(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionClicked(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>verbsLB</sender>
-        <signal>selected(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionClicked(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>verbsLB</sender>
-        <signal>highlighted(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionChanged(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>adjectivesLB</sender>
-        <signal>selected(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionClicked(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>adjectivesLB</sender>
-        <signal>highlighted(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionChanged(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>adverbsLB</sender>
-        <signal>selected(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionClicked(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>adverbsLB</sender>
-        <signal>highlighted(const QString&amp;)</signal>
-        <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionChanged(const QString &amp;)</slot>
-    </connection>
-    <connection>
-        <sender>otherLB</sender>
-        <signal>selected(const QString&amp;)</signal>
+        <sender>meaningsLV</sender>
+        <signal>currentChanged(QListViewItem*)</signal>
         <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionClicked(const QString &amp;)</slot>
+        <slot>selectionChanged(QListViewItem *)</slot>
     </connection>
     <connection>
-        <sender>otherLB</sender>
-        <signal>highlighted(const QString&amp;)</signal>
+        <sender>meaningsLV</sender>
+        <signal>doubleClicked(QListViewItem*)</signal>
         <receiver>QThesaurusDialogBase</receiver>
-        <slot>selectionChanged(const QString &amp;)</slot>
+        <slot>selectionClicked(QListViewItem *)</slot>
     </connection>
     <slot access="public">change_adaptor()</slot>
     <slot access="public">entryChanged()</slot>
-    <slot access="public">selectionClicked(const QString &amp;)</slot>
     <slot access="public">replaceClicked()</slot>
-    <slot access="public">selectionChanged(const QString &amp;)</slot>
+    <slot access="public">selectionChanged(QListViewItem *)</slot>
+    <slot access="public">selectionClicked(QListViewItem *)</slot>
 </connections>
 <tabstops>
     <tabstop>entryED</tabstop>
-    <tabstop>TabWidget2</tabstop>
-    <tabstop>nounsLB</tabstop>
-    <tabstop>verbsLB</tabstop>
-    <tabstop>adjectivesLB</tabstop>
-    <tabstop>adverbsLB</tabstop>
-    <tabstop>otherLB</tabstop>
     <tabstop>replaceED</tabstop>
     <tabstop>replacePB</tabstop>
     <tabstop>closePB</tabstop>