mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
parent
1580220aa3
commit
70d31a8f4b
|
@ -177,8 +177,6 @@ ArticleView::ArticleView( QWidget * parent,
|
|||
|
||||
connect( webview->page(), &QWebEnginePage::titleChanged, this, &ArticleView::handleTitleChanged );
|
||||
|
||||
connect( webview->page(), &QWebEnginePage::urlChanged, this, &ArticleView::handleUrlChanged );
|
||||
|
||||
connect( webview, &QWidget::customContextMenuRequested, this, &ArticleView::contextMenuRequested );
|
||||
|
||||
connect( webview->page(), &QWebEnginePage::linkHovered, this, &ArticleView::linkHovered );
|
||||
|
@ -486,24 +484,6 @@ void ArticleView::handleTitleChanged( QString const & title )
|
|||
emit titleChanged( this, title );
|
||||
}
|
||||
|
||||
void ArticleView::handleUrlChanged( QUrl const & url )
|
||||
{
|
||||
QIcon icon;
|
||||
|
||||
if ( unsigned group = getGroup( url ) ) {
|
||||
// Find the group's instance corresponding to the fragment value
|
||||
for ( auto const & g : groups ) {
|
||||
if ( g.id == group ) {
|
||||
// Found it
|
||||
icon = g.makeIcon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
emit iconChanged( this, icon );
|
||||
}
|
||||
|
||||
unsigned ArticleView::getGroup( QUrl const & url )
|
||||
{
|
||||
if ( url.scheme() == "gdlookup" && Utils::Url::hasQueryItem( url, "group" ) )
|
||||
|
|
|
@ -261,8 +261,6 @@ public:
|
|||
|
||||
signals:
|
||||
|
||||
void iconChanged( ArticleView *, QIcon const & icon );
|
||||
|
||||
void titleChanged( ArticleView *, QString const & title );
|
||||
|
||||
void pageLoaded( ArticleView * );
|
||||
|
@ -338,7 +336,6 @@ private slots:
|
|||
void inspectElement();
|
||||
void loadFinished( bool ok );
|
||||
void handleTitleChanged( QString const & title );
|
||||
void handleUrlChanged( QUrl const & url );
|
||||
void attachWebChannelToHtml();
|
||||
|
||||
void linkHovered( const QString & link );
|
||||
|
|
|
@ -1760,8 +1760,6 @@ ArticleView * MainWindow::createNewTab( bool switchToIt, QString const & name )
|
|||
|
||||
connect( view, &ArticleView::titleChanged, this, &MainWindow::titleChanged );
|
||||
|
||||
connect( view, &ArticleView::iconChanged, this, &MainWindow::iconChanged );
|
||||
|
||||
connect( view, &ArticleView::pageLoaded, this, &MainWindow::pageLoaded );
|
||||
|
||||
connect( view, &ArticleView::updateFoundInDictsList, this, &MainWindow::updateFoundInDictsList );
|
||||
|
@ -2297,6 +2295,10 @@ void MainWindow::currentGroupChanged( int )
|
|||
|
||||
if ( igrp ) {
|
||||
GlobalBroadcaster::instance()->currentGroupId = grg_id;
|
||||
ui.tabWidget->setTabIcon( ui.tabWidget->currentIndex(), igrp->makeIcon() );
|
||||
}
|
||||
else {
|
||||
ui.tabWidget->setTabIcon( ui.tabWidget->currentIndex(), QIcon() );
|
||||
}
|
||||
|
||||
updateDictionaryBar();
|
||||
|
|
Loading…
Reference in a new issue