X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fgui%2FDictManagerWidget.cpp;fp=src%2Fmdictionary%2Fgui%2FDictManagerWidget.cpp;h=1e5a73ed73c0b204c3132665d3600ebc2c0d5d70;hb=ebd4c2c97364e18aae17e790155b8f4060981c37;hp=86459b71ac738d926cc7c82e7ddf61664d670fa0;hpb=08e403fb8f97d1352819f64d81eeda2c65148a40;p=mdictionary diff --git a/src/mdictionary/gui/DictManagerWidget.cpp b/src/mdictionary/gui/DictManagerWidget.cpp index 86459b7..1e5a73e 100644 --- a/src/mdictionary/gui/DictManagerWidget.cpp +++ b/src/mdictionary/gui/DictManagerWidget.cpp @@ -133,6 +133,8 @@ void DictManagerWidget::initalizeUI() { connect(rootObject, SIGNAL(itemActivated(int)), this, SLOT(settingsButtonClicked())); + connect(this, SIGNAL(setFocusOnQML()), rootObject, SLOT(setFocus())); + #endif #ifdef Q_WS_MAEMO_5 @@ -164,6 +166,7 @@ void DictManagerWidget::refreshDictsList() { model->clear(); model->setDictionaries(dicts); } + setFocusOnElement(); #endif @@ -257,11 +260,9 @@ void DictManagerWidget::hideEvent(QHideEvent *e) { void DictManagerWidget::addNewDictButtonClicked() { #ifndef Q_WS_MAEMO_5 - qDebug()<<"1 "<<_changed; if(!_changed || QMessageBox::question(this, tr("Save"), tr("Do you want to save changes?"), QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) { - qDebug()<<"2"; _save = true; saveChanges(); _save = false; @@ -335,10 +336,14 @@ void DictManagerWidget::changed() { #ifndef Q_WS_MAEMO_5 - void DictManagerWidget::save() { - _save = true; - hide(); - } +void DictManagerWidget::save() { + _save = true; + hide(); +} + +void DictManagerWidget::setFocusOnElement(){ + Q_EMIT setFocusOnQML(); +} #endif