From 00476b07768b51ce7f5490f0af8ef700c6af4da2 Mon Sep 17 00:00:00 2001 From: ars Date: Thu, 16 Sep 2010 20:49:42 +0200 Subject: [PATCH] added fix for selection of a dictionary with keyboard --- orderandprops.cc | 15 +++++++++++---- orderandprops.hh | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/orderandprops.cc b/orderandprops.cc index a4eb0058..3d8e641f 100644 --- a/orderandprops.cc +++ b/orderandprops.cc @@ -31,6 +31,12 @@ OrderAndProps::OrderAndProps( QWidget * parent, ui.inactiveDictionaries->populate( inactive.dictionaries, allDictionaries ); disableDictionaryDescription(); + + connect(ui.dictionaryOrder->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), + this, SLOT(dictionaryChanged(QModelIndex,QModelIndex))); + + connect(ui.inactiveDictionaries->selectionModel(), SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), + this, SLOT(inactiveChanged(QModelIndex,QModelIndex))); } Config::Group OrderAndProps::getCurrentDictionaryOrder() const @@ -51,16 +57,17 @@ Config::Group OrderAndProps::getCurrentInactiveDictionaries() const return g.makeConfigGroup(); } -void OrderAndProps::on_dictionaryOrder_clicked( QModelIndex const & idx ) +void OrderAndProps::dictionaryChanged( const QModelIndex & current, const QModelIndex & ) { - describeDictionary( ui.dictionaryOrder, idx ); + describeDictionary( ui.dictionaryOrder, current ); } -void OrderAndProps::on_inactiveDictionaries_clicked( QModelIndex const & idx ) +void OrderAndProps::inactiveChanged( const QModelIndex & current, const QModelIndex & ) { - describeDictionary( ui.inactiveDictionaries, idx ); + describeDictionary( ui.inactiveDictionaries, current ); } + void OrderAndProps::disableDictionaryDescription() { ui.dictionaryInformation->setEnabled( false ); diff --git a/orderandprops.hh b/orderandprops.hh index f0e5471e..4c894aa8 100644 --- a/orderandprops.hh +++ b/orderandprops.hh @@ -22,8 +22,8 @@ public: private slots: - void on_dictionaryOrder_clicked( QModelIndex const & ); - void on_inactiveDictionaries_clicked( QModelIndex const & ); + void dictionaryChanged( const QModelIndex & current, const QModelIndex & ); + void inactiveChanged( const QModelIndex & current, const QModelIndex & ); private: