summaryrefslogtreecommitdiff
path: root/noncore/apps/dictionary
Side-by-side diff
Diffstat (limited to 'noncore/apps/dictionary') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dictionary/dictionary.pro14
-rw-r--r--noncore/apps/dictionary/dicttool.cpp59
-rw-r--r--noncore/apps/dictionary/dicttool.h46
-rw-r--r--noncore/apps/dictionary/dicttoolbase.ui412
-rw-r--r--noncore/apps/dictionary/main.cpp31
5 files changed, 562 insertions, 0 deletions
diff --git a/noncore/apps/dictionary/dictionary.pro b/noncore/apps/dictionary/dictionary.pro
new file mode 100644
index 0000000..e829e68
--- a/dev/null
+++ b/noncore/apps/dictionary/dictionary.pro
@@ -0,0 +1,14 @@
+TEMPLATE = app
+CONFIG += qt warn_on release
+DESTDIR = ../bin
+
+HEADERS = dicttool.h
+SOURCES = dicttool.cpp main.cpp
+
+INTERFACES = dicttoolbase.ui
+
+INCLUDEPATH += $(QPEDIR)/include
+DEPENDPATH += $(QPEDIR)/include
+LIBS += -lqpe
+
+TARGET = dictionary
diff --git a/noncore/apps/dictionary/dicttool.cpp b/noncore/apps/dictionary/dicttool.cpp
new file mode 100644
index 0000000..a0f2f9d
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttool.cpp
@@ -0,0 +1,59 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "dicttool.h"
+#include "global.h"
+#include <qstringlist.h>
+#include <qlineedit.h>
+
+DictTool::DictTool( QWidget* parent, const char* name, bool modal, WFlags fl )
+ : DictToolBase( parent, name, modal, fl )
+{
+}
+
+DictTool::~DictTool()
+{
+}
+
+void DictTool::setDictionary(int d)
+{
+ dict = (DictType)d;
+}
+
+void DictTool::setPattern(const QString& s)
+{
+ qWarning( "DictTool::setPattern(const QString&) not yet implemented!" );
+}
+
+void DictTool::setPickboardSet(const QString& s)
+{
+ QStringList sets = QStringList::split(" ",s);
+ qWarning( "DictTool::setPickboardSet(const QString&) not yet implemented!" );
+}
+
+void DictTool::addWord()
+{
+ Global::addWords(word->text());
+}
+
+void DictTool::removeWord()
+{
+ qWarning( "DictTool::removeWord() not yet implemented!" );
+}
+
diff --git a/noncore/apps/dictionary/dicttool.h b/noncore/apps/dictionary/dicttool.h
new file mode 100644
index 0000000..702b772
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttool.h
@@ -0,0 +1,46 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef DICTTOOL_H
+#define DICTTOOL_H
+#include "dicttoolbase.h"
+
+class DictTool : public DictToolBase
+{
+ Q_OBJECT
+
+public:
+ DictTool( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~DictTool();
+
+public slots:
+ void setDictionary(int);
+ void setPattern(const QString&);
+ void setPickboardSet(const QString&);
+
+private slots:
+ void addWord();
+ void removeWord();
+
+private:
+ enum DictType { All, Local, System };
+ DictType dict;
+};
+
+#endif // DICTTOOL_H
diff --git a/noncore/apps/dictionary/dicttoolbase.ui b/noncore/apps/dictionary/dicttoolbase.ui
new file mode 100644
index 0000000..25ef00e
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttoolbase.ui
@@ -0,0 +1,412 @@
+<!DOCTYPE UI><UI>
+<class>DictToolBase</class><comment>*********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+*********************************************************************</comment>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>dicttoolbase</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>258</width>
+ <height>375</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>MyDialog1</string>
+ </property>
+ <property stdset="1">
+ <name>sizeGripEnabled</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>5</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>2</number>
+ </property>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>All dictionaries</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>Personal dictionary</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>System dictionary (English)</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>dictionary_choice</cstring>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Selects the dictionary to manipulate.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tabWidget</cstring>
+ </property>
+ <property>
+ <name>layoutMargin</name>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Widget4</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Search</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>5</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox3</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Pattern</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>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>pattern</cstring>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Enter your search pattern here. You may use &lt;big&gt;&lt;tt&gt;?&lt;/tt&gt;&lt;/big&gt; to represent any one letter, &lt;big&gt;&lt;tt&gt;*&lt;/tt&gt;&lt;/big&gt; to represent zero or more arbitrary letters, or &lt;big&gt;&lt;tt&gt;[&lt;i&gt;abc&lt;/i&gt;]&lt;/tt&gt;&lt;/big&gt; to represent any one of the letters &lt;big&gt;&lt;tt&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/tt&gt;&lt;/big&gt;.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox4</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Matches</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>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>output</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Widget5</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Pickboard</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>5</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Letter sets</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>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>sets</cstring>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Enter sets of letters here, seperated by spaces in the same way as the sets of letters appear at the bottom of the Pickboard. The list below will show the largest sets of words that could be typed ambiguously. This information helps you tune the letter sets for your dictionary.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox2</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Longest ambiguities</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>QListBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>ambiguities</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>Edit words</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>word</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>add</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Add</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>remove</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Remove</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>readonly_message</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>This dictionary is read-only.</string>
+ </property>
+ <property stdset="1">
+ <name>alignment</name>
+ <set>AlignCenter</set>
+ </property>
+ <property>
+ <name>hAlign</name>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer1</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</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>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>pattern</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>dicttoolbase</receiver>
+ <slot>setPattern(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>dictionary_choice</sender>
+ <signal>activated(int)</signal>
+ <receiver>dicttoolbase</receiver>
+ <slot>setDictionary(int)</slot>
+ </connection>
+ <connection>
+ <sender>sets</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>dicttoolbase</receiver>
+ <slot>setPickboardSet(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>add</sender>
+ <signal>clicked()</signal>
+ <receiver>dicttoolbase</receiver>
+ <slot>addWord()</slot>
+ </connection>
+ <connection>
+ <sender>remove</sender>
+ <signal>clicked()</signal>
+ <receiver>dicttoolbase</receiver>
+ <slot>removeWord()</slot>
+ </connection>
+ <slot access="protected">addWord()</slot>
+ <slot access="protected">removeWord()</slot>
+ <slot access="public">setDictionary(int)</slot>
+ <slot access="public">setPattern(const QString&amp;)</slot>
+ <slot access="public">setPickboardSet(const QString&amp;)</slot>
+</connections>
+</UI>
diff --git a/noncore/apps/dictionary/main.cpp b/noncore/apps/dictionary/main.cpp
new file mode 100644
index 0000000..7e9d8c1
--- a/dev/null
+++ b/noncore/apps/dictionary/main.cpp
@@ -0,0 +1,31 @@
+/**********************************************************************
+** Copyright (C) 2000 Trolltech AS. All rights reserved.
+**
+** This file is part of Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include <qpeapplication.h>
+#include "dicttool.h"
+
+main(int argc, char** argv)
+{
+ QPEApplication a(argc,argv);
+
+ DictTool m;
+ a.showMainWidget(&m);
+
+ return a.exec();
+}