Copyright 2010 Comarch S.A.
*******************************************************************************/
Copyright 2010 Comarch S.A.
*******************************************************************************/
cacheToolTip = tr("Optimize for quicker searches (may take some time)");
accentsToolTip = tr("Strip accents (searching takes more time, but spelling doesn't have to be exact)");
cacheToolTip = tr("Optimize for quicker searches (may take some time)");
accentsToolTip = tr("Strip accents (searching takes more time, but spelling doesn't have to be exact)");
connect(cacheCheckBox, SIGNAL(toggled(bool)),
this, SLOT(setGenerateCache(bool)));
connect(cacheCheckBox, SIGNAL(toggled(bool)),
this, SLOT(setGenerateCache(bool)));
connect(accentsCheckBox, SIGNAL(toggled(bool)),
this, SLOT(setAccents(bool)));
#ifdef Q_WS_MAEMO_5
connect(accentsInfoToolButton, SIGNAL(clicked()),
this, SLOT(showAccentsInfo()));
connect(accentsCheckBox, SIGNAL(toggled(bool)),
this, SLOT(setAccents(bool)));
#ifdef Q_WS_MAEMO_5
connect(accentsInfoToolButton, SIGNAL(clicked()),
this, SLOT(showAccentsInfo()));
connect(cacheInfoToolButton, SIGNAL(clicked()),
this, SLOT(showCacheInfo()));
#endif
connect(cacheInfoToolButton, SIGNAL(clicked()),
this, SLOT(showCacheInfo()));
#endif
if(type == New) {
connect(browseButton, SIGNAL(clicked()),
this, SLOT(selectFile()));
if(type == New) {
connect(browseButton, SIGNAL(clicked()),
this, SLOT(selectFile()));
connect(downloadButton, SIGNAL(clicked()),
this, SLOT(downloadFile()));
connect(downloadButton, SIGNAL(clicked()),
this, SLOT(downloadFile()));
connect(&XdxfPlugin::dictDownloader, SIGNAL(fileDownloaded(QString)),
this, SLOT(fileDownloaded(QString)));
}
connect(confirmButton, SIGNAL(clicked()),
this, SLOT(accept()));
connect(&XdxfPlugin::dictDownloader, SIGNAL(fileDownloaded(QString)),
this, SLOT(fileDownloaded(QString)));
}
connect(confirmButton, SIGNAL(clicked()),
this, SLOT(accept()));
void XdxfDialog::fileDownloaded(QString name) {
infoLabel->setText(tr("Dictionary file: %1").arg(XdxfPlugin::dictDownloader.downloadedFile()));
_dictionaryFilePath = XdxfPlugin::dictDownloader.downloadedFile();
void XdxfDialog::fileDownloaded(QString name) {
infoLabel->setText(tr("Dictionary file: %1").arg(XdxfPlugin::dictDownloader.downloadedFile()));
_dictionaryFilePath = XdxfPlugin::dictDownloader.downloadedFile();
scrollArea = new QScrollArea;
scrollArea->setWidget(widget);
scrollArea->setWidgetResizable(true);
scrollArea = new QScrollArea;
scrollArea->setWidget(widget);
scrollArea->setWidgetResizable(true);
scrollArea->setLineWidth(0);
scrollArea->setMidLineWidth(0);
scrollArea->setFrameStyle(QFrame::NoFrame);
scrollArea->setLineWidth(0);
scrollArea->setMidLineWidth(0);
scrollArea->setFrameStyle(QFrame::NoFrame);
void XdxfDialog::selectFile() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Select dictionary file"),
void XdxfDialog::selectFile() {
QString fileName = QFileDialog::getOpenFileName(this,
tr("Select dictionary file"),
if (!fileName.isEmpty()) {
infoLabel->setText(tr("Dictionary file: %1").arg(fileName));
_dictionaryFilePath = fileName;
if (!fileName.isEmpty()) {
infoLabel->setText(tr("Dictionary file: %1").arg(fileName));
_dictionaryFilePath = fileName;
void XdxfDialog::saveSettings() {
_settings = new Settings;
if(plugin) {
foreach(QString key, plugin->settings()->keys())
_settings->setValue(key, plugin->settings()->value(key));
}
void XdxfDialog::saveSettings() {
_settings = new Settings;
if(plugin) {
foreach(QString key, plugin->settings()->keys())
_settings->setValue(key, plugin->settings()->value(key));
}
void XdxfDialog::accept() {
if(type == New && _dictionaryFilePath.isEmpty()) {
Q_EMIT notify(Notify::Warning, tr("File path is not set"));
void XdxfDialog::accept() {
if(type == New && _dictionaryFilePath.isEmpty()) {
Q_EMIT notify(Notify::Warning, tr("File path is not set"));
#ifdef Q_WS_MAEMO_5
void XdxfDialog::showCacheInfo() {
Q_EMIT notify(Notify::Warning, cacheToolTip);
}
#ifdef Q_WS_MAEMO_5
void XdxfDialog::showCacheInfo() {
Q_EMIT notify(Notify::Warning, cacheToolTip);
}
void XdxfDialog::showAccentsInfo() {
Q_EMIT notify(Notify::Warning, accentsToolTip);
}
void XdxfDialog::showAccentsInfo() {
Q_EMIT notify(Notify::Warning, accentsToolTip);
}