mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
improve:foundDictsPane refresh logic
This commit is contained in:
parent
29bd94b8a7
commit
13fdf08450
|
@ -2554,7 +2554,8 @@ void ArticleView::setActiveDictIds(ActiveDictIds ad) {
|
||||||
if (ad.word == currentWord) {
|
if (ad.word == currentWord) {
|
||||||
currentActiveDictIds << ad.dictIds;
|
currentActiveDictIds << ad.dictIds;
|
||||||
currentActiveDictIds.removeDuplicates();
|
currentActiveDictIds.removeDuplicates();
|
||||||
qDebug() << "current word:"<<currentWord<<"receivedd:"<<ad.word<<":" << ad.dictIds<<this;
|
emit updateFoundInDictsList();
|
||||||
|
qDebug() << "receive dicts:"<<ad.word<<":" << ad.dictIds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,6 +241,8 @@ signals:
|
||||||
|
|
||||||
/// Signals that the dictionaries pane was requested to be showed
|
/// Signals that the dictionaries pane was requested to be showed
|
||||||
void showDictsPane( );
|
void showDictsPane( );
|
||||||
|
/// Signals that the founded dictionaries ready to be showed
|
||||||
|
void updateFoundInDictsList( );
|
||||||
|
|
||||||
/// Emitted when an article becomes active,
|
/// Emitted when an article becomes active,
|
||||||
/// typically in response to user actions
|
/// typically in response to user actions
|
||||||
|
|
|
@ -1645,6 +1645,9 @@ ArticleView * MainWindow::createNewTab( bool switchToIt,
|
||||||
connect( view, SIGNAL( pageLoaded( ArticleView * ) ),
|
connect( view, SIGNAL( pageLoaded( ArticleView * ) ),
|
||||||
this, SLOT( pageLoaded( ArticleView * ) ) );
|
this, SLOT( pageLoaded( ArticleView * ) ) );
|
||||||
|
|
||||||
|
connect( view, SIGNAL( updateFoundInDictsList( ) ),
|
||||||
|
this, SLOT( updateFoundInDictsList() ) );
|
||||||
|
|
||||||
connect( view, SIGNAL( openLinkInNewTab( QUrl const &, QUrl const &, QString const &, ArticleView::Contexts const & ) ),
|
connect( view, SIGNAL( openLinkInNewTab( QUrl const &, QUrl const &, QString const &, ArticleView::Contexts const & ) ),
|
||||||
this, SLOT( openLinkInNewTab( QUrl const &, QUrl const &, QString const &, ArticleView::Contexts const & ) ) );
|
this, SLOT( openLinkInNewTab( QUrl const &, QUrl const &, QString const &, ArticleView::Contexts const & ) ) );
|
||||||
|
|
||||||
|
@ -1885,7 +1888,7 @@ void MainWindow::pageLoaded( ArticleView * view )
|
||||||
if ( cfg.preferences.pronounceOnLoadMain )
|
if ( cfg.preferences.pronounceOnLoadMain )
|
||||||
pronounce( view );
|
pronounce( view );
|
||||||
|
|
||||||
updateFoundInDictsList();
|
//updateFoundInDictsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::showStatusBarMessage( QString const & message, int timeout, QPixmap const & icon )
|
void MainWindow::showStatusBarMessage( QString const & message, int timeout, QPixmap const & icon )
|
||||||
|
|
|
@ -219,8 +219,6 @@ private:
|
||||||
|
|
||||||
void updatePronounceAvailability();
|
void updatePronounceAvailability();
|
||||||
|
|
||||||
void updateFoundInDictsList();
|
|
||||||
|
|
||||||
void updateBackForwardButtons();
|
void updateBackForwardButtons();
|
||||||
|
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
|
@ -287,7 +285,7 @@ private slots:
|
||||||
/// the timer. Does nothing otherwise.
|
/// the timer. Does nothing otherwise.
|
||||||
void prepareNewReleaseChecks();
|
void prepareNewReleaseChecks();
|
||||||
|
|
||||||
private slots:
|
void updateFoundInDictsList();
|
||||||
|
|
||||||
/// Does the new release check.
|
/// Does the new release check.
|
||||||
void checkForNewRelease();
|
void checkForNewRelease();
|
||||||
|
|
Loading…
Reference in a new issue