connect(dictList, SIGNAL(itemChanged(QListWidgetItem*)),
this, SLOT(changed()));
+ #ifndef Q_WS_MAEMO_5
+ connect(dictList, SIGNAL(itemActivated(QListWidgetItem*)),
+ this, SLOT(saveChanges()));
+ connect(dictList, SIGNAL(itemActivated(QListWidgetItem*)),
+ this, SLOT(itemSelected(QListWidgetItem*)));
+ connect(dictList, SIGNAL(itemActivated(QListWidgetItem*)),
+ settingsButton, SIGNAL(clicked()));
+ #endif
+
refreshDictsList();
#ifndef Q_WS_MAEMO_5
void DictManagerWidget::itemSelected(QListWidgetItem *) {
removeDictButton->setEnabled(true);
settingsButton->setEnabled(true);
+ dictList->setFocus();
}
void DictManagerWidget::removeButtonClicked() {
hide();
}
#endif
+
+
+void DictManagerWidget::keyPressEvent(QKeyEvent *e) {
+ if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
+ switch (e->key()) {
+ case Qt::Key_Escape:
+ reject();
+ break;
+ default:
+ e->ignore();
+ return;
+ }
+ } else {
+ e->ignore();
+ }
+}
protected:
void showEvent(QShowEvent *e);
void hideEvent(QHideEvent *e);
+ void keyPressEvent(QKeyEvent *e);
Q_SIGNALS:
//! Emitted when hiding widget, it will save states of dictionaries
setMinimumHeight(300);
- connect(historyListWidget, SIGNAL(clicked(QModelIndex)),
+ connect(historyListWidget, SIGNAL(activated(QModelIndex)),
this, SLOT(itemClicked(QModelIndex)));
}
int HistoryListDialog::selectedRow() {
return _selectedRow;
}
+
+int HistoryListDialog::exec() {
+ historyListWidget->setFocus();
+ QDialog::exec();
+}
//! \returns row number of selected word
int selectedRow();
+public Q_SLOTS:
+ int exec();
+
private Q_SLOTS:
void itemClicked(QModelIndex);
setExactSearch(false);
}
}
+
+ wordListWidget->setFocus();
}
bool MainWindow::checkExactSearch(
#endif
Q_EMIT showTranslation(backbone->xmls());
+ wordListWidget->setFocus();
#ifdef Q_WS_MAEMO_5
notifyManager->screenChanged();
#endif
checkBoxesLabel = new QLabel(tr("Search in:"),this);
- searchInBookmarksCheckBox = new QCheckBox(tr("Bookmarks"),this);
- searchInDictionariesCheckBox = new QCheckBox(tr("Dictionaries"),this);
+ searchInBookmarksCheckBox = new QCheckBox(tr("Bookmarks"));
+ searchInDictionariesCheckBox = new QCheckBox(tr("Dictionaries"));
verticalLayout->addSpacing(20);
verticalLayout->addWidget(checkBoxesLabel);