+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
#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"
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;
}
#define FILEDIALOG_PRIVATE_H
#include <config.h>
-
+
#include <qfiledialog.h>
#include "LString.h"
private:
LyXView * lv_;
- int action_;
+ kb_action action_;
};
#endif // FILEDIALOG_PRIVATE_H
../xforms/FormMathsDelim.lo \
../xforms/FormMathsMatrix.lo \
../xforms/FormMathsPanel.lo \
+ ../xforms/FormMathsStyle.lo \
../xforms/FormMathsSpace.lo \
../xforms/FormParagraph.lo \
../xforms/FormPreferences.lo \
../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 \
#ifndef QBIBITEMDIALOG_H
#define QBIBITEMDIALOG_H
-#include <config.h>
-
#include "ui/QBibitemDialogBase.h"
class QBibitem;
#include <config.h>
+#include <vector>
+
#include "gettext.h"
#include "support/lstrings.h"
#include <config.h>
#include <vector>
-#include "LString.h"
#include "QExternalDialog.h"
#include "ControlExternal.h"
#include "QExternal.h"
{
controller().replace(dialog_->replaceED->text().latin1());
}
-
-
-void QThesaurus::apply()
-{
-}
QThesaurus(ControlThesaurus &);
private:
/// Apply changes
- virtual void apply();
+ virtual void apply() { };
/// update
virtual void update_contents();
/// build the dialog
#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)
}
-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();
}
#include "ui/QThesaurusDialogBase.h"
class QThesaurus;
+class QListViewItem;
class QThesaurusDialog : public QThesaurusDialogBase
{ Q_OBJECT
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);
#endif
#include "Qt2BC.h"
+#include "ButtonController.tmpl"
#include "debug.h"
#include <qbutton.h>
<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>&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>&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>&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&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>&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&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionChanged(const QString &)</slot>
- </connection>
- <connection>
- <sender>nounsLB</sender>
- <signal>selected(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionClicked(const QString &)</slot>
- </connection>
- <connection>
- <sender>verbsLB</sender>
- <signal>selected(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionClicked(const QString &)</slot>
- </connection>
- <connection>
- <sender>verbsLB</sender>
- <signal>highlighted(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionChanged(const QString &)</slot>
- </connection>
- <connection>
- <sender>adjectivesLB</sender>
- <signal>selected(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionClicked(const QString &)</slot>
- </connection>
- <connection>
- <sender>adjectivesLB</sender>
- <signal>highlighted(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionChanged(const QString &)</slot>
- </connection>
- <connection>
- <sender>adverbsLB</sender>
- <signal>selected(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionClicked(const QString &)</slot>
- </connection>
- <connection>
- <sender>adverbsLB</sender>
- <signal>highlighted(const QString&)</signal>
- <receiver>QThesaurusDialogBase</receiver>
- <slot>selectionChanged(const QString &)</slot>
- </connection>
- <connection>
- <sender>otherLB</sender>
- <signal>selected(const QString&)</signal>
+ <sender>meaningsLV</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
<receiver>QThesaurusDialogBase</receiver>
- <slot>selectionClicked(const QString &)</slot>
+ <slot>selectionChanged(QListViewItem *)</slot>
</connection>
<connection>
- <sender>otherLB</sender>
- <signal>highlighted(const QString&)</signal>
+ <sender>meaningsLV</sender>
+ <signal>doubleClicked(QListViewItem*)</signal>
<receiver>QThesaurusDialogBase</receiver>
- <slot>selectionChanged(const QString &)</slot>
+ <slot>selectionClicked(QListViewItem *)</slot>
</connection>
<slot access="public">change_adaptor()</slot>
<slot access="public">entryChanged()</slot>
- <slot access="public">selectionClicked(const QString &)</slot>
<slot access="public">replaceClicked()</slot>
- <slot access="public">selectionChanged(const QString &)</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>