mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
1
This commit is contained in:
parent
c00239a1b1
commit
ab214cfb05
|
@ -515,9 +515,14 @@ void ArticleRequest::altSearchFinished()
|
||||||
try {
|
try {
|
||||||
// if the dictionary is website dictionary and openinNewTab is enabled, emit a signal.
|
// if the dictionary is website dictionary and openinNewTab is enabled, emit a signal.
|
||||||
if ( GlobalBroadcaster::instance()->getPreference()->openWebsiteInNewTab ) {
|
if ( GlobalBroadcaster::instance()->getPreference()->openWebsiteInNewTab ) {
|
||||||
if ( activeDict->getFeature() == Dictionary::WebSite ) {
|
if ( ( activeDict->getFeatures() | Dictionary::WebSite ) == Dictionary::WebSite ) {
|
||||||
//todo ,replace the word with actual url
|
//todo ,replace the word with actual url
|
||||||
emit GlobalBroadcaster::instance() -> websiteDictionary( word, url );
|
string url = activeDict->getProperties()[ Dictionary::Property::Url ];
|
||||||
|
if ( url.empty() ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
emit GlobalBroadcaster::instance()
|
||||||
|
-> websiteDictionary( QString::fromStdString( activeDict->getName() ), QString::fromStdString( url ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ signals:
|
||||||
|
|
||||||
void indexingDictionary( QString );
|
void indexingDictionary( QString );
|
||||||
|
|
||||||
void websiteDictionary( QString );
|
void websiteDictionary( QString, QString );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // GLOBAL_GLOBALBROADCASTER_H
|
#endif // GLOBAL_GLOBALBROADCASTER_H
|
||||||
|
|
|
@ -35,7 +35,8 @@ enum Property {
|
||||||
Author,
|
Author,
|
||||||
Copyright,
|
Copyright,
|
||||||
Description,
|
Description,
|
||||||
Email
|
Email,
|
||||||
|
Url,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEF_EX( Ex, "Dictionary error", std::exception )
|
DEF_EX( Ex, "Dictionary error", std::exception )
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
map< Property, string > getProperties() noexcept override
|
map< Property, string > getProperties() noexcept override
|
||||||
{
|
{
|
||||||
map< Property, string > properties;
|
map< Property, string > properties;
|
||||||
properties.insert( { Property::Url, urlTemplate_ } );
|
properties.insert( { Property::Url, urlTemplate.toStdString() } );
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4371,6 +4371,7 @@ void MainWindow::openWebsiteInNewTab( QString const & name, QString const & url
|
||||||
|
|
||||||
auto view = new QWebEngineView( this );
|
auto view = new QWebEngineView( this );
|
||||||
view->load( QUrl( url ) );
|
view->load( QUrl( url ) );
|
||||||
|
int index = cfg.preferences.newTabsOpenAfterCurrentOne ? ui.tabWidget->currentIndex() + 1 : ui.tabWidget->count();
|
||||||
|
|
||||||
ui.tabWidget->insertTab( index, view, escaped );
|
ui.tabWidget->insertTab( index, view, escaped );
|
||||||
mruList.append( dynamic_cast< QWidget * >( view ) );
|
mruList.append( dynamic_cast< QWidget * >( view ) );
|
||||||
|
|
Loading…
Reference in a new issue