--- /dev/null
+#ifndef DOWNLOADDICT_H
+#define DOWNLOADDICT_H
+
+#include <QRegExp>
+
+class DownloadDict
+{
+public:
+ DownloadDict(QString html);
+ QString fromLang() {return _from;};
+ QString toLang() {return _to;};
+ QString title() {return _title;}
+ QString size() {return _size;}
+ QString link() {return _link;}
+
+private:
+ QString _from, _to, _title, _link, _size;
+};
+
+
+DownloadDict::DownloadDict(QString html) {
+ QRegExp reg("<td.*>(.*)</td>");
+ reg.setMinimal(true);
+ int pos = 0;
+ QStringList tmp;
+ while ((pos = reg.indexIn(html, pos)) != -1) {
+ tmp << reg.cap(1);
+ pos += reg.matchedLength();
+ }
+ _from = tmp.at(6);
+ _to = tmp.at(7);
+ _title = tmp.at(1);
+ _size = tmp.at(3);
+ QRegExp lreg("href=\"(.*)\"");
+ lreg.setMinimal(true);
+ lreg.indexIn(tmp.at(2));
+ _link = lreg.capturedTexts().at(1);
+
+
+}
+
+#endif // DOWNLOADDICT_H
TARGET = xdxf
-
include(../plugin.pri)
-
QT = core \
gui \
xml \
sql
-
maemo5:QT += maemo5
-
-SOURCES += \
- xdxfplugin.cpp \
+SOURCES += xdxfplugin.cpp \
TranslationXdxf.cpp \
XdxfDictDialog.cpp \
XdxfCachingDialog.cpp \
XdxfDialog.cpp
-
-
-HEADERS += \
- xdxfplugin.h \
+HEADERS += xdxfplugin.h \
TranslationXdxf.h \
../../include/DictDialog.h \
XdxfDictDialog.h \
../../include/settings.h \
../../include/CommonDictInterface.h \
XdxfCachingDialog.h \
- XdxfDialog.h
-
-RESOURCES += \
- xdxf.qrc
-
+ XdxfDialog.h \
+ ../DownloadDict.h \
+ DownloadDict.h
+RESOURCES += xdxf.qrc
TRANSLATIONS += pl_PL.ts \
- en_US.ts
-
-unix {
- INSTALLS += dicts plugin-icon
-
- dicts.path = $$PLUGINS_DIR
- dicts.files += ../../../data/dicts/eng-us.xdxf
- dicts.files += ../../../data/dicts/eng-thai.xdxf
-
- plugin-icon.path = $$DATA_DIR
- plugin-icon.files += xdxf.png
+ en_US.ts
+unix {
+ INSTALLS += dicts \
+ plugin-icon
+ dicts.path = $$PLUGINS_DIR
+ dicts.files += ../../../data/dicts/eng-us.xdxf
+ dicts.files += ../../../data/dicts/eng-thai.xdxf
+ plugin-icon.path = $$DATA_DIR
+ plugin-icon.files += xdxf.png
}
-
-check.commands = echo 'No check here'
+check.commands = echo \
+ 'No check here'
QMAKE_EXTRA_TARGETS += check
#include "xdxfplugin.h"
#include <QDebug>
#include "../../include/Notify.h"
+#include "DownloadDict.h"
XdxfPlugin::XdxfPlugin(QObject *parent) : CommonDictInterface(parent),
_langFrom(""), _langTo(""),_name(""), _infoNote("") {
+
+ //DownloadDict a("<tr><td><img src=\"buf/comn_sdict05_bulg_comp/icon16.png\" alt=\"icon\" /></td><td align=\"center\">English-Bulgarian computer dictionary</td><td align=\"center\"><a href=\"http://downloads.sourceforge.net/xdxf/comn_sdict05_bulg_comp.tar.bz2\" target=\"_blank\">comn_sdict05_bulg_comp.tar.bz2</a></td><td align=\"right\">13,889</td><td align=\"right\">55,094</td><td align=\"right\">523</td><td align=\"center\">English</td><td align=\"center\">Bulgarian</td><td align=\"center\"><a href=\"http://xdxf.revdanica.com/\">Common XDXF</a></td><td align=\"center\">2006-04-23 23:34:40</td></tr>");
+
+
_settings = new Settings();
_dictDialog = new XdxfDictDialog(this, this);