fix build, thesaurus

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3400 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-01-16 23:56:25 +00:00
parent eaacc6c192
commit 21226de2b8
14 changed files with 84 additions and 316 deletions

View 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

View File

@ -65,38 +65,7 @@
#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"

View 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;
}

View 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

View 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 \

View File

@ -9,8 +9,6 @@
#ifndef QBIBITEMDIALOG_H
#define QBIBITEMDIALOG_H
#include <config.h>
#include "ui/QBibitemDialogBase.h"
class QBibitem;

View File

@ -9,6 +9,8 @@
#include <config.h>
#include <vector>
#include "gettext.h"
#include "support/lstrings.h"

View File

@ -9,7 +9,6 @@
#include <config.h>
#include <vector>
#include "LString.h"
#include "QExternalDialog.h"
#include "ControlExternal.h"
#include "QExternal.h"

View File

@ -53,8 +53,3 @@ void QThesaurus::replace()
{
controller().replace(dialog_->replaceED->text().latin1());
}
void QThesaurus::apply()
{
}

View 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

View 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();
}

View 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);

View File

@ -14,6 +14,7 @@
#endif
#include "Qt2BC.h"
#include "ButtonController.tmpl"
#include "debug.h"
#include <qbutton.h>

View File

@ -13,7 +13,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>478</width>
<width>466</width>
<height>442</height>
</rect>
</property>
@ -80,13 +80,6 @@
<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>
@ -106,175 +99,33 @@
</hbox>
</widget>
<widget>
<class>QTabWidget</class>
<class>QListView</class>
<column>
<property>
<name>text</name>
<string>Thesaurus entries</string>
</property>
<property>
<name>clickable</name>
<bool>true</bool>
</property>
<property>
<name>resizeable</name>
<bool>true</bool>
</property>
</column>
<property stdset="1">
<name>name</name>
<cstring>TabWidget2</cstring>
<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>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tab</cstring>
</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>
<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>
<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>
</widget>
<widget>
<class>QLayoutWidget</class>
@ -415,79 +266,25 @@
<slot>replaceClicked()</slot>
</connection>
<connection>
<sender>nounsLB</sender>
<signal>highlighted(const QString&amp;)</signal>
<sender>meaningsLV</sender>
<signal>currentChanged(QListViewItem*)</signal>
<receiver>QThesaurusDialogBase</receiver>
<slot>selectionChanged(const QString &amp;)</slot>
<slot>selectionChanged(QListViewItem *)</slot>
</connection>
<connection>
<sender>nounsLB</sender>
<signal>selected(const QString&amp;)</signal>
<sender>meaningsLV</sender>
<signal>doubleClicked(QListViewItem*)</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>
<receiver>QThesaurusDialogBase</receiver>
<slot>selectionClicked(const QString &amp;)</slot>
</connection>
<connection>
<sender>otherLB</sender>
<signal>highlighted(const QString&amp;)</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>