this->plugin = plugin;
this->type = type;
+
+ cacheToolTip = tr("Optimize for quicker searches (may take some time)");
+ accentsToolTip = tr("Strip accents (searching takes more time, but spelling don't have to be exact)");
+
initializeUI();
connect(cacheCheckBox, SIGNAL(toggled(bool)),
connect(accentsCheckBox, SIGNAL(toggled(bool)),
this, SLOT(setAccents(bool)));
- connect(accentsInfoToolButton, SIGNAL(clicked()),
- this, SLOT(showAccentsInfo()));
+ #ifdef Q_WS_MAEMO_5
+ connect(accentsInfoToolButton, SIGNAL(clicked()),
+ this, SLOT(showAccentsInfo()));
- connect(cacheInfoToolButton, SIGNAL(clicked()),
- this, SLOT(showCacheInfo()));
+ connect(cacheInfoToolButton, SIGNAL(clicked()),
+ this, SLOT(showCacheInfo()));
+ #endif
if(type == New) {
connect(browseButton, SIGNAL(clicked()),
this, SLOT(selectFile()));
-
- connect(addButton, SIGNAL(clicked()),
- this, SLOT(accept()));
- }
- else {
- connect(saveButton, SIGNAL(clicked()),
- this, SLOT(accept()));
}
+
+ connect(confirmButton, SIGNAL(clicked()),
+ this, SLOT(accept()));
+
}
widget = new QWidget;
widget->setLayout(mainVerticalLayout);
+ infoLabel = new QLabel;
+ infoLabel->setWordWrap(true);
+
if(type == New) {
setWindowTitle(tr("Add new XDXF dictionary"));
-
browseLayout = new QHBoxLayout;
browseButton = new QPushButton(tr("Browse"));
- browseLabel = new QLabel(tr("Dictionary file: not selected"));
+ infoLabel->setText(tr("Dictionary file: not selected"));
- browseLayout->addWidget(browseLabel, 0, Qt::AlignLeft);
+ browseLayout->addWidget(infoLabel, 0, Qt::AlignLeft);
browseLayout->addWidget(browseButton, 0, Qt::AlignRight);
mainVerticalLayout->addLayout(browseLayout);
else {
setWindowTitle(tr("XDXF Settings"));
-
- infoLabel = new QLabel;
-
infoLabel->setText(tr("Plugin: ") + plugin->type().toUpper() +"\n" +
tr("From: ") + plugin->langFrom() + "\n" +
tr("To: ") + plugin->langTo() + "\n" +
tr("Description: ") + plugin->name() + "\n" +
tr("License: ") + plugin->infoNote());
- infoLabel->setWordWrap(true);
mainVerticalLayout->addWidget(infoLabel);
}
- accentsCheckBox = new QCheckBox(tr("Strip accents"));
- accentsInfoToolButton = new QToolButton;
- accentsInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
-
accentsLayout = new QHBoxLayout;
- accentsLayout->addWidget(accentsCheckBox);
- accentsLayout->addWidget(accentsInfoToolButton);
-
-
- cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches"));
- cacheInfoToolButton = new QToolButton;
- cacheInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
+ accentsCheckBox = new QCheckBox(tr("Strip accents"));
+ accentsCheckBox->setToolTip(accentsToolTip);
+ accentsLayout->addWidget(accentsCheckBox);
+ #ifdef Q_WS_MAEMO_5
+ accentsInfoToolButton = new QToolButton;
+ accentsInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
+ accentsLayout->addWidget(accentsInfoToolButton);
+ #endif
cacheLayout = new QHBoxLayout;
+ cacheCheckBox = new QCheckBox(tr("Optimize for quicker searches"));
+ cacheCheckBox->setToolTip(cacheToolTip);
cacheLayout->addWidget(cacheCheckBox);
- cacheLayout->addWidget(cacheInfoToolButton);
+ #ifdef Q_WS_MAEMO_5
+ cacheInfoToolButton = new QToolButton;
+ cacheInfoToolButton->setIcon(QIcon::fromTheme("general_information"));
+ cacheLayout->addWidget(cacheInfoToolButton);
+ #endif
mainVerticalLayout->addLayout(cacheLayout);
mainVerticalLayout->addLayout(accentsLayout);
}
}
+ confirmButton = new QPushButton;
+ mainVerticalLayout->addWidget(confirmButton);
if(type == New) {
- addButton = new QPushButton(tr("Add"));
- mainVerticalLayout->addWidget(addButton);
+ confirmButton->setText(tr("Add"));
}
else {
- saveButton = new QPushButton(tr("Save settings"));
- mainVerticalLayout->addWidget(saveButton);
+ confirmButton->setText(tr("Save settings"));
}
scrollArea = new QScrollArea;
scrollArea->setWidget(widget);
scrollArea->setWidgetResizable(true);
- scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ #ifdef Q_WS_MAEMO_5
+ scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ #endif
layout = new QHBoxLayout;
layout->addWidget(scrollArea);
setLayout(layout);
+
+ #ifndef Q_WS_MAEMO_5
+ setMinimumSize(400,200);
+ #endif
}
NULL);
if (!fileName.isEmpty()) {
- browseLabel->setText(tr("Dictionary file: %1").arg(fileName));
+ infoLabel->setText(tr("Dictionary file: %1").arg(fileName));
_dictionaryFilePath = fileName;
}
}
return _settings;
}
-void XdxfDialog::showCacheInfo() {
- Q_EMIT notify(Notify::Warning, tr("Optimize for quicker searches (may take some time)"));
-}
+#ifdef Q_WS_MAEMO_5
+ void XdxfDialog::showCacheInfo() {
+ Q_EMIT notify(Notify::Warning, cacheToolTip);
+ }
-void XdxfDialog::showAccentsInfo() {
- Q_EMIT notify(Notify::Warning, tr("Strip accents (searching takes more "
- "time, but spelling don't have to be exact)"));
-}
+ void XdxfDialog::showAccentsInfo() {
+ Q_EMIT notify(Notify::Warning, accentsToolTip);
+ }
+#endif
public:
enum XdxfDialogType {New, Change};
- explicit XdxfDialog(XdxfPlugin* plugin = 0, XdxfDialogType type = New,
+ explicit XdxfDialog(XdxfPlugin* plugin = 0,
+ XdxfDialogType type = New,
QWidget *parent = 0);
Settings* getSettings();
void setGenerateCache(bool);
void setAccents(bool);
- void showCacheInfo();
- void showAccentsInfo();
+ #ifdef Q_WS_MAEMO_5
+ void showCacheInfo();
+ void showAccentsInfo();
+ #endif
private:
void initializeUI();
- QLabel* browseLabel;
+ QLabel* infoLabel;
QPushButton* browseButton;
QHBoxLayout* browseLayout;
- QLabel* infoLabel;
QCheckBox* cacheCheckBox;
QCheckBox* accentsCheckBox;
QHBoxLayout* cacheLayout;
QHBoxLayout* accentsLayout;
- QToolButton* cacheInfoToolButton;
- QToolButton* accentsInfoToolButton;
- QPushButton* saveButton;
- QPushButton* addButton;
+ QString cacheToolTip;
+ QString accentsToolTip;
+
+ #ifdef Q_WS_MAEMO_5
+ QToolButton* cacheInfoToolButton;
+ QToolButton* accentsInfoToolButton;
+ #endif
+
+
+ QPushButton* confirmButton;
QString _dictionaryFilePath;