added fix for selection of a dictionary with keyboard

This commit is contained in:
ars 2010-09-16 20:49:42 +02:00
parent dd92f5af25
commit 00476b0776
2 changed files with 13 additions and 6 deletions

View file

@ -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 );

View file

@ -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: