xmlpatterns \
webkit \
dbus
-
maemo5:QT += maemo5
TARGET = mdictionary
TEMPLATE = app
icon64 \
bookmarks \
service
-
target.path = $$BINDIR
maemo5 {
desktop.path = $$DATADIR/applications/hildon
}
desktop.files += ../../../data/other/$${TARGET}.desktop
icon64.files += ../../../data/icons/64x64/$${TARGET}.png
-
bookmarks.path = $$LIBDIR
bookmarks.files += ../../../data/icons/16x16/staron.png
-
service.path = $$DATADIR/dbus-1/services
service.files += ../../../data/other/com.comarch.mdictionary.service
}
searchSelectedAction = new QAction(tr("Search"), this);
copySelectedAction = new QAction(tr("Copy"), this);
selectAllAction = new QAction(tr("Select All"), this);
+ setAcceptDrops(false);
+
+ #ifdef Q_WS_MAEMO_5
+ installEventFilter(this);
+ property("kineticScroller").value<QAbstractKineticScroller*>()->
+ setEnabled(true);
+ #endif
+
connect(searchSelectedAction, SIGNAL(triggered()),
this, SIGNAL(search()));
connect(page(), SIGNAL(selectionChanged()), this, SLOT(selection()));
}
+
+bool TranslationTextEdit::eventFilter(QObject *, QEvent *e)
+{
+ switch (e->type()) {
+ case QEvent::MouseButtonPress:
+ if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
+ mousePressed = true;
+ break;
+ case QEvent::MouseButtonRelease:
+ if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
+ mousePressed = false;
+ break;
+ case QEvent::MouseMove:
+ if (mousePressed)
+ return true;
+ break;
+ default:
+ break;
+ }
+ return false;
+}
+
+
void TranslationTextEdit::contextMenuEvent(QContextMenuEvent *e) {
QMenu *menu = new QMenu;
if(selectedText().isEmpty())
#include <QTextEdit>
#include <QAction>
#include <QWebView>
+#include <QEvent>
+
class TranslationWidget;
class TranslationTextEdit : public QWebView
QAction* copySelectedAction;
QAction* selectAllAction;
TranslationWidget* realParent;
+ bool mousePressed;
+ bool eventFilter(QObject *, QEvent *);
};
+ trans + tr("\n </ar>");
trans=XslConversion(trans);
- QString head = "<html><head><link rel=\"stylesheet\" type=\"text/css\" " ;
+ QString head = "<html><head>";
+ head += "<link rel=\"stylesheet\" type=\"text/css\" " ;
head += "href=\"" + QDir::homePath() + "/.mdictionary/style.css";
- head += "\" /></head>";
+ head += "\" /></head><body ondragstart=\"return false\">";
trans = head + trans;
- trans+= "</html>";
+ trans+= "</body></html>";
trans.replace("$STAR$", "/usr/lib/mdictionary/staron.png");
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
- <body>
<table border="1" width="100%">
<xsl:for-each select="ar/dict">
<xsl:apply-templates/>
</xsl:for-each>
</table>
- </body>
</xsl:template>
<xsl:template match="info">