padding-bottom : 0px;
padding-right : 0px;
- -webkit-box-reflect : below 5px -webkit-gradient(linear, 0% 0%, 0% 120%, from(transparent), color-stop(0.3, transparent), to(white));
+ -webkit-box-reflect : below 5px -webkit-gradient(linear, 0% 0%, 0% 190%, from(transparent), color-stop(0.3, transparent), to(white));
}
div.dict {
#ifdef Q_WS_MAEMO_5
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(search(QString)));
+
+ connect(translationWidget, SIGNAL(notify(Notify::NotifyType, QString)),
+ this, SLOT(showNotification(Notify::NotifyType,QString)));
#else
connect(translationWidget, SIGNAL(search(QString)),
this, SLOT(searchExact(QString)));
#endif
-
}
void MainWindow::connectDictManager() {
QMaemo5InformationBox* mbox =
new QMaemo5InformationBox(parent);
- QLabel* infoLabel = new QLabel(text, mbox);
+ QLabel* infoLabel = new QLabel(text);
infoLabel->setAlignment(Qt::AlignCenter);
infoLabel->setWordWrap(true);
- infoLabel->setMargin(10);
mbox->setWidget(infoLabel);
case Notify::Error:
#ifdef Q_WS_MAEMO_5
mbox->setTimeout(QMaemo5InformationBox::NoTimeout);
+ ((QLabel*)mbox->widget())->setContentsMargins(5,15,5,15);
#else
mbox->setText(text);
mbox->setWindowTitle(tr("Error"));
copyButton = new QToolButton(this);
copyButton->setIcon(QIcon::fromTheme("general_notes"));
copyButton->setMinimumSize(copyButton->sizeHint());
- copyButton->setEnabled(false);
searchButton = new QToolButton(this);
searchButton->setIcon(QIcon::fromTheme("general_search"));
searchButton->setMinimumSize(searchButton->sizeHint());
- searchButton->setEnabled(false);
showButtonsButton = new QToolButton(this);
showButtonsButton->setIcon(QIcon::fromTheme("general_sent"));
this, SLOT(searchSelected()));
connect(copyButton, SIGNAL(clicked()),
- webkit, SLOT(copy()));
-
- connect(webkit, SIGNAL(copyAvailable(bool)),
- searchButton, SLOT(setEnabled(bool)));
-
- connect(webkit, SIGNAL(copyAvailable(bool)),
- copyButton, SLOT(setEnabled(bool)));
+ this, SLOT(copySelected()));
connect(selectAllButton, SIGNAL(clicked()),
webkit, SLOT(selectAll()));
}
void TranslationWidget::searchSelected() {
- #ifdef Q_WS_MAEMO_5
- hide();
- #endif
- Q_EMIT search(webkit->selectedText().toLower());
+ if(webkit->selectedText().isEmpty()) {
+ Q_EMIT notify(Notify::Warning, tr("No text is selected"));
+ }
+ else {
+ #ifdef Q_WS_MAEMO_5
+ hide();
+ #endif
+ Q_EMIT search(webkit->selectedText().toLower());
+ }
+}
+
+void TranslationWidget::copySelected() {
+ if(webkit->selectedText().isEmpty()) {
+ Q_EMIT notify(Notify::Warning, tr("No text is selected"));
+ }
+ else {
+ Q_EMIT notify(Notify::Info, tr("Copyied selected text"));
+ }
}
#ifdef Q_WS_MAEMO_5