mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt: add option about open website in seperate tab
This commit is contained in:
parent
39aef4c4de
commit
6edfd15962
|
@ -1082,6 +1082,10 @@ Class load()
|
|||
( preferences.namedItem( "removeInvalidIndexOnExit" ).toElement().text() == "1" );
|
||||
}
|
||||
|
||||
if ( !preferences.namedItem( "openWebsiteInNewTab" ).isNull() ) {
|
||||
c.preferences.openWebsiteInNewTab = ( preferences.namedItem( "openWebsiteInNewTab" ).toElement().text() == "1" );
|
||||
}
|
||||
|
||||
if ( !preferences.namedItem( "maxStringsInHistory" ).isNull() ) {
|
||||
c.preferences.maxStringsInHistory = preferences.namedItem( "maxStringsInHistory" ).toElement().text().toUInt();
|
||||
}
|
||||
|
@ -2111,6 +2115,10 @@ void save( Class const & c )
|
|||
opt.appendChild( dd.createTextNode( c.preferences.removeInvalidIndexOnExit ? "1" : "0" ) );
|
||||
preferences.appendChild( opt );
|
||||
|
||||
opt = dd.createElement( "openWebsiteInNewTab" );
|
||||
opt.appendChild( dd.createTextNode( c.preferences.openWebsiteInNewTab ? "1" : "0" ) );
|
||||
preferences.appendChild( opt );
|
||||
|
||||
opt = dd.createElement( "maxStringsInHistory" );
|
||||
opt.appendChild( dd.createTextNode( QString::number( c.preferences.maxStringsInHistory ) ) );
|
||||
preferences.appendChild( opt );
|
||||
|
|
|
@ -382,6 +382,7 @@ struct Preferences
|
|||
int maxNetworkCacheSize;
|
||||
bool clearNetworkCacheOnExit;
|
||||
bool removeInvalidIndexOnExit = false;
|
||||
bool openWebsiteInNewTab = false;
|
||||
|
||||
qreal zoomFactor;
|
||||
qreal helpZoomFactor;
|
||||
|
|
|
@ -336,6 +336,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
|
|||
|
||||
//Misc
|
||||
ui.removeInvalidIndexOnExit->setChecked( p.removeInvalidIndexOnExit );
|
||||
ui.openWebsiteInNewTab->setChecked( p.openWebsiteInNewTab );
|
||||
|
||||
// Add-on styles
|
||||
ui.addonStylesLabel->setVisible( ui.addonStyles->count() > 1 );
|
||||
|
@ -494,6 +495,7 @@ Config::Preferences Preferences::getPreferences()
|
|||
p.clearNetworkCacheOnExit = ui.clearNetworkCacheOnExit->isChecked();
|
||||
|
||||
p.removeInvalidIndexOnExit = ui.removeInvalidIndexOnExit->isChecked();
|
||||
p.openWebsiteInNewTab = ui.openWebsiteInNewTab->isChecked();
|
||||
|
||||
p.addonStyle = ui.addonStyles->getCurrentStyle();
|
||||
|
||||
|
|
|
@ -1916,6 +1916,13 @@ from Stardict, Babylon and GLS dictionaries</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="openWebsiteInNewTab">
|
||||
<property name="text">
|
||||
<string>Open website dictionary in seperate tab</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue