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