<xsl:if test="@bookmark = 'true'">
<img src="$STAR$" width="16" height="16"/>
</xsl:if>
- <xsl:value-of select="."/> <img src="{$path}" height="16"/>
+ <xsl:value-of select="."/> <br/> <img src="{$path}" height="16"/>
</th>
</tr>
</xsl:template>
usr/lib/mdictionary/plugins/libgoogle.so
-usr/share/mdictionary/drawing.png
+usr/share/mdictionary/google.png
doc.depends = doxygen_doc
-
+htmldocs_install.depends = doc
QMAKE_EXTRA_TARGETS += doxygen_doc
connect(page(), SIGNAL(selectionChanged()), this, SLOT(selection()));
}
+void TranslationTextEdit::wheelEvent(QWheelEvent *e) {
+ if(e->modifiers() & Qt::ControlModifier) {
+ if(e->delta()>0) {
+ zoomIn();
+ }
+ else {
+ zoomOut();
+ }
+ }
+}
-bool TranslationTextEdit::eventFilter(QObject *, QEvent *e)
-{
+bool TranslationTextEdit::eventFilter(QObject *, QEvent *e) {
switch (e->type()) {
case QEvent::MouseButtonPress:
if (static_cast<QMouseEvent *>(e)->button() == Qt::LeftButton)
case QEvent::MouseMove:
if (mousePressed)
return true;
- break;
default:
break;
}
protected:
void contextMenuEvent(QContextMenuEvent *);
+ void wheelEvent(QWheelEvent *);
private:
QAction* searchSelectedAction;
_settings->setValue("type","google");
_settings->setValue("connection_accepted","true");
_dictDialog = new GoogleDictDialog(this,this);
- _icon = QIcon(":/icons/drawing.png");
+ _icon = QIcon("/usr/share/mdictionary/google.png");
stopped = false;
languages=initLanguages();
_langFrom=languages.key(pluginSettings->value("lang_from"));
}
- setMinimumHeight(370);
- #ifdef Q_WS_MAEMO_5
+ #ifdef Q_WS_MAEMO_5
+ setMinimumHeight(370);
changeLangButton=new QPushButton(
QIcon::fromTheme("general_refresh"), "");
#else
langFromLabel = new QLabel(tr("From:"));
langToLabel = new QLabel(tr(" To: "));
- connectInfoLabel = new QLabel(tr("Google plugin makes use of Internet "
- "connection, so it may cost You."));
- connectInfoLabel->setWordWrap(true);
setWindowTitle(tr("Google Settings"));
verticalLayout = new QVBoxLayout;
verticalLayout->addWidget(infoLabel);
+ #ifdef Q_WS_MAEMO_5
+ connectInfoLabel = new QLabel(tr("Google plugin makes use of Internet "
+ "connection, so it may cost You."));
+ connectInfoLabel->setWordWrap(true);
+
+ verticalLayout->addWidget(connectInfoLabel);
+ #endif
+
langFromComboBox = new QComboBox;
langToComboBox = new QComboBox;
langFromComboBox->setCurrentIndex(actualLangFrom);
-
- setWindowTitle(tr("Google Settings"));
- verticalLayout->addWidget(connectInfoLabel);
-
langFromLayout->addWidget(langFromLabel);
langFromLayout->addWidget(langFromComboBox);
langToLayout->addWidget(langToLabel);
QString result("");
if(!googlePlugin)
return result;
- result="<dict> <info path=\"/usr/share/mdictionary/drawing.png\" ";
+ result="<dict> <info path=\"/usr/share/mdictionary/google.png\" ";
if(isBookmark())
result+="bookmark=\"true\" >";
else
dict_google_en.ts
RESOURCES += \
- icons.qrc
+ google.qrc
unix {
INSTALLS += plugin-icon
plugin-icon.path = $$DATA_DIR
- plugin-icon.files += drawing.png
+ plugin-icon.files += google.png
}
check.commands = echo 'No check here'
QMAKE_EXTRA_TARGETS += check
--- /dev/null
+<RCC>
+ <qresource prefix="/">
+ <file>translations/dict_google_en.qm</file>
+ <file>translations/dict_google_pl.qm</file>
+ </qresource>
+</RCC>
+++ /dev/null
-<RCC>
- <qresource prefix="/icons">
- <file>drawing.png</file>
- </qresource>
- <qresource prefix="/">
- <file>translations/dict_google_en.qm</file>
- <file>translations/dict_google_pl.qm</file>
- </qresource>
-</RCC>
setWindowTitle(tr("Add new XDXF dictionary"));
- browseLayout = new QVBoxLayout;
+
+
+ browseLayout = new QHBoxLayout;
browseButton = new QPushButton(tr("Browse"));
browseLabel = new QLabel(tr("Dictionary file: not selected"));
- //browseLabel->setWordWrap(true);
- browseLabel->setMargin(5);
+ //browseLabel->setMargin(5);
browseLayout->addWidget(browseLabel, 0, Qt::AlignLeft);
- browseLayout->addWidget(browseButton);
+ browseLayout->addWidget(browseButton, 0, Qt::AlignRight);
verticalLayout->addLayout(browseLayout);
cacheLayout = new QHBoxLayout;
verticalLayout->addLayout(cacheLayout);
- accentsCheckBox = new QCheckBox(tr("Strip accents \n(searching takes more "
+ accentsCheckBox = new QCheckBox(tr("Strip accents (searching takes more "
"time, but spelling don't have to be exact)"));
verticalLayout->addWidget(accentsCheckBox);
void XdxfLoadDialog::selectFile() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Select dictionary file"),
- "",
+ _dicitonaryFilePath,
tr("XDXF Files (*.xdxf)"),
NULL,
NULL);
QCheckBox* cacheCheckBox;
QCheckBox* accentsCheckBox;
QVBoxLayout* verticalLayout;
- QVBoxLayout* browseLayout;
+ QHBoxLayout* browseLayout;
QHBoxLayout* cacheLayout;
QString _dicitonaryFilePath;
bool _generateCache;
/*! \file XdxfSettingsDialog.cpp
*/
-//Created by Mateusz Półrola
+
#include "XdxfSettingsDialog.h"
#include <QDebug>
QDialog(parent)
{
this->plugin = plugin;
- verticalLayout = new QVBoxLayout();
- setLayout(verticalLayout);
+
+ verticalLayout = new QVBoxLayout;
+
+ QWidget* w = new QWidget;
+ w->setLayout(verticalLayout);
setWindowTitle(tr("XDXF Settings"));
infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" +
tr("From: ") + plugin->langFrom() + "\n" +
tr("To: ") + plugin->langTo() + "\n" +
- tr("Description: ") + plugin->name());
-
- verticalLayout->addWidget(infoLabel);
-
- browseLayout = new QHBoxLayout();
- verticalLayout->addLayout(browseLayout);
-
- browseButton = new QPushButton(tr("Browse"));
- browseLabel = new QLabel(tr("Dictionary file: ") +
- plugin->settings()->value("path"));
+ tr("Description: ") + plugin->name() + "\n" +
+ tr("License: ") + plugin->infoNote());
+ infoLabel->setWordWrap(true);
- browseLayout->addWidget(browseLabel);
- browseLayout->addWidget(browseButton,0, Qt::AlignRight);
+ verticalLayout->addWidget(infoLabel);
- cacheLayout = new QHBoxLayout();
- verticalLayout->insertLayout(-1,cacheLayout,0);
- accentsCheckBox = new QCheckBox(tr("Strip accents \n(searching takes more time, "
- "but spelling don't have to be exact)"));
- verticalLayout->addWidget(accentsCheckBox);
+ accentsCheckBox = new QCheckBox(tr("Strip accents"));
+ /*(searching takes more time, "
+ "but spelling don't have to be exact)*/
if(plugin->settings()->value("strip_accents") == "true")
accentsCheckBox->setChecked(true);
else
accentsCheckBox->setChecked(false);
- cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches (may take some time)"),this);
+ cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches"));
+/*(may take some time)*/
if(plugin->settings()->value("cached") == "true") {
cacheCheckBox->setChecked(true);
accentsCheckBox->setChecked(true);
_generateCache = false;
}
+ accentsToolButton = new QToolButton;
+ cacheToolButton = new QToolButton;
+
+ accentsToolButton->setIcon(QIcon::fromTheme("general_information"));
+ cacheToolButton->setIcon(QIcon::fromTheme("general_information"));
+
+ cacheLayout = new QHBoxLayout;
+ accentsLayout = new QHBoxLayout;
+
+ accentsLayout->addWidget(accentsCheckBox);
+ accentsLayout->addWidget(accentsToolButton);
+
cacheLayout->addWidget(cacheCheckBox);
+ cacheLayout->addWidget(cacheToolButton);
+
+ verticalLayout->addLayout(cacheLayout);
+ verticalLayout->addLayout(accentsLayout);
+
+
saveButton = new QPushButton(tr("Save settings"));
verticalLayout->addWidget(saveButton);
- setModal(true);
+ scrollArea = new QScrollArea;
+ scrollArea->setWidget(w);
+
+
+ QHBoxLayout* layout = new QHBoxLayout();
+
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ scrollArea->setWidgetResizable(true);
+ layout->addWidget(scrollArea);
+ setLayout(layout);
- connect(browseButton, SIGNAL(clicked()),
- this, SLOT(selectFile()));
+
+
+ setModal(true);
connect(saveButton, SIGNAL(clicked()),
this, SLOT(accept()));
lastAccents = state;
}
-
void XdxfSettingsDialog::setGenerateCache(bool generate) {
_generateCache = generate;
return _generateCache;
}
-void XdxfSettingsDialog::selectFile() {
- QString fileName = QFileDialog::getOpenFileName(this,
- tr("Select dictionary file"),
- "",
- tr("XDXF Files (*.xdxf)"),
- NULL,
- NULL);
- if (!fileName.isEmpty()) {
- browseLabel->setText(tr("Dictionary file: ") + fileName);
- _dicitonaryFilePath = fileName;
- }
-}
-
QString XdxfSettingsDialog::dicitonaryFilePath() {
return _dicitonaryFilePath;
}
bool generateCache();
private Q_SLOTS:
- void selectFile();
void setGenerateCache(bool);
void setAccents(bool);
private:
QLabel* infoLabel;
QPushButton* saveButton;
- QPushButton* browseButton;
- QLabel* browseLabel;
+
+
QCheckBox* cacheCheckBox;
QCheckBox* accentsCheckBox;
- QVBoxLayout* verticalLayout;
- QHBoxLayout* browseLayout;
+
QHBoxLayout* cacheLayout;
+ QHBoxLayout* accentsLayout;
+
+ QToolButton* cacheToolButton;
+ QToolButton* accentsToolButton;
+
+ QVBoxLayout* verticalLayout;
+
QString _dicitonaryFilePath;
bool _generateCache;
XdxfPlugin* plugin;
bool lastAccents;
+ QScrollArea* scrollArea;
+
};
#endif // XDXFSETTINGSDIALOG_H
<RCC>
- <qresource prefix="/icons">
- <file>xdxf.png</file>
- </qresource>
<qresource prefix="/">
<file>translations/dict_xdxf_en.qm</file>
<file>translations/dict_xdxf_pl.qm</file>
cachingDialog = new XdxfCachingDialog(this);
_settings->setValue("type","xdxf");
- _icon = QIcon(":/icons/xdxf.png");
+ _icon = QIcon("/usr/share/mdictionary/xdxf.png");
_wordsCount = -1;
stopped = false;