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 {
|
||||
// if the dictionary is website dictionary and openinNewTab is enabled, emit a signal.
|
||||
if ( GlobalBroadcaster::instance()->getPreference()->openWebsiteInNewTab ) {
|
||||
if ( activeDict->getFeature() == Dictionary::WebSite ) {
|
||||
if ( ( activeDict->getFeatures() | Dictionary::WebSite ) == Dictionary::WebSite ) {
|
||||
//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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ signals:
|
|||
|
||||
void indexingDictionary( QString );
|
||||
|
||||
void websiteDictionary( QString );
|
||||
void websiteDictionary( QString, QString );
|
||||
};
|
||||
|
||||
#endif // GLOBAL_GLOBALBROADCASTER_H
|
||||
|
|
|
@ -35,7 +35,8 @@ enum Property {
|
|||
Author,
|
||||
Copyright,
|
||||
Description,
|
||||
Email
|
||||
Email,
|
||||
Url,
|
||||
};
|
||||
|
||||
DEF_EX( Ex, "Dictionary error", std::exception )
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
map< Property, string > getProperties() noexcept override
|
||||
{
|
||||
map< Property, string > properties;
|
||||
properties.insert( { Property::Url, urlTemplate_ } );
|
||||
properties.insert( { Property::Url, urlTemplate.toStdString() } );
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -4371,6 +4371,7 @@ void MainWindow::openWebsiteInNewTab( QString const & name, QString const & url
|
|||
|
||||
auto view = new QWebEngineView( this );
|
||||
view->load( QUrl( url ) );
|
||||
int index = cfg.preferences.newTabsOpenAfterCurrentOne ? ui.tabWidget->currentIndex() + 1 : ui.tabWidget->count();
|
||||
|
||||
ui.tabWidget->insertTab( index, view, escaped );
|
||||
mruList.append( dynamic_cast< QWidget * >( view ) );
|
||||
|
|
Loading…
Reference in a new issue