#include "SearchBarWidget.h"
#include <QDebug>
-
+#include "../../includes/DictDialog.h"
SearchBarWidget::SearchBarWidget(Backbone* backbone, QWidget *parent) :
void SearchBarWidget::historyNextToolButtonClicked() {
+ CommonDictInterface*p = backbone->getPlugins()[0];
+ p->dictDialog()->addNewDictionary(this);
}
void SearchBarWidget::historyPrevToolButtonClicked() {
connect(addButton, SIGNAL(clicked()),
this, SLOT(addDictionary()));
- dicitonaryFilePath = QString();
+ _dicitonaryFilePath = QString();
}
void XdxfLoadDialog::selectFile() {
NULL);
if (!fileName.isEmpty()) {
browseLabel->setText(tr("Dictionary file: ") + fileName);
- dicitonaryFilePath = fileName;
+ _dicitonaryFilePath = fileName;
}
}
void XdxfLoadDialog::addDictionary() {
- generateCache = cacheCheckBox->isChecked();
+ _generateCache = cacheCheckBox->isChecked();
accept();
}
+QString XdxfLoadDialog::dicitonaryFilePath() {
+ return _dicitonaryFilePath;
+}
+
+bool XdxfLoadDialog::generateCache() {
+ return _generateCache;
+}
+
Settings* XdxfLoadDialog::getSettings(QWidget *parent) {
XdxfLoadDialog loadDialog(parent);
Settings* settings = new Settings;
if(loadDialog.exec()==QDialog::Accepted) {
- settings->setValue("dictionaryFile", dicitonaryFilePath);
- if(generateCache) {
+ settings->setValue("dictionaryFile", loadDialog.dicitonaryFilePath());
+ if(loadDialog.generateCache()) {
settings->setValue("cache", "1");
}
else {
return NULL;
}
+
+
public:
explicit XdxfLoadDialog(QWidget *parent = 0);
static Settings* getSettings(QWidget *parent);
+ QString dicitonaryFilePath();
+ bool generateCache();
signals:
QVBoxLayout* verticalLayout;
QHBoxLayout* browseLayout;
QHBoxLayout* cacheLayout;
- static QString dicitonaryFilePath;
- static bool generateCache;
+ QString _dicitonaryFilePath;
+ bool _generateCache;
+
};
#endif // XDXFLOADDIALOG_H