_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();
_settings->setValue("connection_accepted","false");
}
+
bool GooglePlugin::isConnectionAccept() const {
if(_settings->value("connection_accepted")=="true")
return true;
}
- uint GooglePlugin::hash() const {
- return _hash;
- }
-
-
- void GooglePlugin::setHash(uint _hash) {
- this->_hash=_hash;
- }
-
-
Settings* GooglePlugin::settings() {
- /* Settings *returnSettings=new Settings;
- QStringList list = _settings->keys();
- foreach(QString key, list)
- returnSettings->setValue(key,_settings->value(key));
- return returnSettings;
- */
return _settings;
}
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);
if(!_dicitonaryFilePath.isEmpty()) {
accept();
}
- else {
- reject();
- }
}
QString XdxfLoadDialog::dicitonaryFilePath() {
//! Returns if user wants to cache dictionary
bool generateCache();
- signals:
-
- public slots:
-
private Q_SLOTS:
void selectFile();
void addDictionary();
QCheckBox* cacheCheckBox;
QCheckBox* accentsCheckBox;
QVBoxLayout* verticalLayout;
- QVBoxLayout* browseLayout;
+ QHBoxLayout* browseLayout;
QHBoxLayout* cacheLayout;
QString _dicitonaryFilePath;
bool _generateCache;
Q_OBJECT
public:
explicit XdxfSettingsDialog(XdxfPlugin* plugin, QWidget *parent = 0);
-
+ //! \returns settings of a given plugin
static Settings* getSettings(XdxfPlugin* plugin, QWidget *parent);
- //! Returns dictionary file path chosen by user
+ //! \returns dictionary file path chosen by user
QString dicitonaryFilePath();
- //! Returns if user wants to cache dictionary
+ //! \returns if user wants to cache dictionary
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
cachingDialog = new XdxfCachingDialog(this);
_settings->setValue("type","xdxf");
- _icon = QIcon(":/icons/xdxf.png");
+ _icon = QIcon("/usr/share/mdictionary/xdxf.png");
_wordsCount = -1;
stopped = false;
QString XdxfPlugin::infoNote() const {
- return _infoNote;
+ return _infoNote;
}
if(ok) { /*add key word to list*/
translations.insert(new TranslationXdxf(
cur.value(0).toString().toLower(),
- _infoNote, this));
+ _dictionaryInfo, this));
i++;
}
}
}
if(ok) { /*add key word to list*/
translations<<(new TranslationXdxf(readKey.toLower(),
- _infoNote,this));
+ _dictionaryInfo,this));
i++;
}
if(i>=limit && limit!=0)
}
- void XdxfPlugin::setHash(uint _hash) {
- this->_hash=_hash;
- }
-
-
- uint XdxfPlugin::hash() const {
- return _hash;
- }
-
-
Settings* XdxfPlugin::settings() {
- /*
- Settings *returnSettings=new Settings;
- QStringList list = _settings->keys();
- foreach(QString key, list)
- returnSettings->setValue(key,_settings->value(key));
- return returnSettings;
- */
return _settings;
}
if(reader.name()=="description")
_infoNote=reader.readElementText();
- QString initialPath = "/usr/share/mdictionary/xdxf.png";
-
- _infoNote=" path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-"
+ _dictionaryInfo= _name + " [" + _langFrom + "-"
+ _langTo + "]";
+
dictionaryFile.close();
if(okFormat)
return true;