mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Full-text search: A little refactoring of dialog
This commit is contained in:
parent
c32c610665
commit
052e43e2c3
|
@ -134,6 +134,9 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent,
|
|||
if( cfg.preferences.fts.dialogGeometry.size() > 0 )
|
||||
restoreGeometry( cfg.preferences.fts.dialogGeometry );
|
||||
|
||||
setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint );
|
||||
|
||||
setWindowTitle( tr( "Full-text search" ) );
|
||||
|
||||
setNewIndexingName( ftsIdx.nowIndexingName() );
|
||||
|
@ -186,6 +189,8 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent,
|
|||
connect( ui.headwordsView, SIGNAL( clicked( QModelIndex ) ),
|
||||
this, SLOT( itemClicked( QModelIndex ) ) );
|
||||
|
||||
connect( this, SIGNAL( finished( int ) ), this, SLOT( saveData() ) );
|
||||
|
||||
connect( ui.OKButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
|
||||
connect( ui.cancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||
|
||||
|
@ -198,7 +203,6 @@ FullTextSearchDialog::FullTextSearchDialog( QWidget * parent,
|
|||
|
||||
FullTextSearchDialog::~FullTextSearchDialog()
|
||||
{
|
||||
saveData();
|
||||
if( delegate )
|
||||
delete delegate;
|
||||
}
|
||||
|
@ -395,7 +399,10 @@ void FullTextSearchDialog::reject()
|
|||
if( !searchReqs.empty() )
|
||||
stopSearch();
|
||||
else
|
||||
{
|
||||
saveData();
|
||||
emit closeDialog();
|
||||
}
|
||||
}
|
||||
|
||||
void FullTextSearchDialog::itemClicked( const QModelIndex & idx )
|
||||
|
|
|
@ -3992,7 +3992,7 @@ void MainWindow::showFullTextSearchDialog()
|
|||
connect( ftsDlg, SIGNAL( showTranslationFor( QString, QStringList, QRegExp ) ),
|
||||
this, SLOT( showTranslationFor( QString, QStringList, QRegExp ) ) );
|
||||
connect( ftsDlg, SIGNAL( closeDialog() ),
|
||||
this, SLOT( closeFullTextSearchDialog() ) );
|
||||
this, SLOT( closeFullTextSearchDialog() ), Qt::QueuedConnection );
|
||||
connect( &configEvents, SIGNAL( mutedDictionariesChanged() ),
|
||||
ftsDlg, SLOT( updateDictionaries() ) );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue