mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
Refactor show dictionary info in "Groups" tab
This commit is contained in:
parent
5ca8279045
commit
7e7adaf7c0
|
@ -48,7 +48,7 @@ EditDictionaries::EditDictionaries( QWidget * parent, Config::Class & cfg_,
|
|||
connect( &sources, SIGNAL( rescan() ), this, SLOT( rescanSources() ) );
|
||||
|
||||
connect( groups.get(), SIGNAL( showDictionaryInfo( QString const & ) ),
|
||||
this, SLOT( showDictionaryInfo(QString const & ) ) );
|
||||
this, SIGNAL( showDictionaryInfo(QString const & ) ) );
|
||||
}
|
||||
|
||||
void EditDictionaries::editGroup( unsigned id )
|
||||
|
@ -236,17 +236,3 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
|
|||
origCfg.inactiveDictionaries = orderAndProps->getCurrentInactiveDictionaries();
|
||||
}
|
||||
}
|
||||
|
||||
void EditDictionaries::showDictionaryInfo( QString const & dictId )
|
||||
{
|
||||
unsigned n;
|
||||
for( n = 0; n < dictionaries.size(); n++ )
|
||||
if( dictId.compare( QString::fromUtf8( dictionaries[ n ]->getId().c_str() ) ) == 0 )
|
||||
break;
|
||||
if( n < dictionaries.size() )
|
||||
{
|
||||
DictInfo infoMsg( cfg, this );
|
||||
infoMsg.showInfo( dictionaries[ n ] );
|
||||
infoMsg.exec();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ private slots:
|
|||
|
||||
void rescanSources();
|
||||
|
||||
signals:
|
||||
|
||||
void showDictionaryInfo( QString const & dictId );
|
||||
|
||||
private:
|
||||
|
|
|
@ -1707,6 +1707,9 @@ void MainWindow::editDictionaries( unsigned editDictionaryGroup )
|
|||
Config::Class newCfg = cfg;
|
||||
EditDictionaries dicts( this, newCfg, dictionaries, groupInstances, dictNetMgr );
|
||||
|
||||
connect( &dicts, SIGNAL( showDictionaryInfo( QString const & ) ),
|
||||
this, SLOT( showDictionaryInfo( QString const & ) ) );
|
||||
|
||||
if ( editDictionaryGroup != Instances::Group::NoGroupId )
|
||||
dicts.editGroup( editDictionaryGroup );
|
||||
|
||||
|
|
Loading…
Reference in a new issue