mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Merge 15b918eb6a
into 0c42c300e1
This commit is contained in:
commit
0dc58685ac
|
@ -149,6 +149,7 @@ Preferences::Preferences():
|
||||||
doubleClickTranslates( true ),
|
doubleClickTranslates( true ),
|
||||||
selectWordBySingleClick( false ),
|
selectWordBySingleClick( false ),
|
||||||
autoScrollToTargetArticle( true ),
|
autoScrollToTargetArticle( true ),
|
||||||
|
targetArticleAtFirst( false ),
|
||||||
escKeyHidesMainWindow( false ),
|
escKeyHidesMainWindow( false ),
|
||||||
alwaysOnTop( false ),
|
alwaysOnTop( false ),
|
||||||
searchInDock( false ),
|
searchInDock( false ),
|
||||||
|
@ -877,6 +878,11 @@ Class load()
|
||||||
( preferences.namedItem( "autoScrollToTargetArticle" ).toElement().text() == "1" );
|
( preferences.namedItem( "autoScrollToTargetArticle" ).toElement().text() == "1" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !preferences.namedItem( "targetArticleAtFirst" ).isNull() ) {
|
||||||
|
c.preferences.targetArticleAtFirst =
|
||||||
|
( preferences.namedItem( "targetArticleAtFirst" ).toElement().text() == "1" );
|
||||||
|
}
|
||||||
|
|
||||||
if ( !preferences.namedItem( "escKeyHidesMainWindow" ).isNull() ) {
|
if ( !preferences.namedItem( "escKeyHidesMainWindow" ).isNull() ) {
|
||||||
c.preferences.escKeyHidesMainWindow =
|
c.preferences.escKeyHidesMainWindow =
|
||||||
( preferences.namedItem( "escKeyHidesMainWindow" ).toElement().text() == "1" );
|
( preferences.namedItem( "escKeyHidesMainWindow" ).toElement().text() == "1" );
|
||||||
|
@ -1814,6 +1820,10 @@ void save( Class const & c )
|
||||||
opt.appendChild( dd.createTextNode( c.preferences.autoScrollToTargetArticle ? "1" : "0" ) );
|
opt.appendChild( dd.createTextNode( c.preferences.autoScrollToTargetArticle ? "1" : "0" ) );
|
||||||
preferences.appendChild( opt );
|
preferences.appendChild( opt );
|
||||||
|
|
||||||
|
opt = dd.createElement( "targetArticleAtFirst" );
|
||||||
|
opt.appendChild( dd.createTextNode( c.preferences.targetArticleAtFirst ? "1" : "0" ) );
|
||||||
|
preferences.appendChild( opt );
|
||||||
|
|
||||||
opt = dd.createElement( "escKeyHidesMainWindow" );
|
opt = dd.createElement( "escKeyHidesMainWindow" );
|
||||||
opt.appendChild( dd.createTextNode( c.preferences.escKeyHidesMainWindow ? "1" : "0" ) );
|
opt.appendChild( dd.createTextNode( c.preferences.escKeyHidesMainWindow ? "1" : "0" ) );
|
||||||
preferences.appendChild( opt );
|
preferences.appendChild( opt );
|
||||||
|
|
|
@ -297,6 +297,7 @@ struct Preferences
|
||||||
bool doubleClickTranslates;
|
bool doubleClickTranslates;
|
||||||
bool selectWordBySingleClick;
|
bool selectWordBySingleClick;
|
||||||
bool autoScrollToTargetArticle;
|
bool autoScrollToTargetArticle;
|
||||||
|
bool targetArticleAtFirst;
|
||||||
bool escKeyHidesMainWindow;
|
bool escKeyHidesMainWindow;
|
||||||
bool alwaysOnTop;
|
bool alwaysOnTop;
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
|
||||||
ui.doubleClickTranslates->setChecked( p.doubleClickTranslates );
|
ui.doubleClickTranslates->setChecked( p.doubleClickTranslates );
|
||||||
ui.selectBySingleClick->setChecked( p.selectWordBySingleClick );
|
ui.selectBySingleClick->setChecked( p.selectWordBySingleClick );
|
||||||
ui.autoScrollToTargetArticle->setChecked( p.autoScrollToTargetArticle );
|
ui.autoScrollToTargetArticle->setChecked( p.autoScrollToTargetArticle );
|
||||||
|
ui.targetArticleAtFirst->setChecked( p.targetArticleAtFirst );
|
||||||
ui.escKeyHidesMainWindow->setChecked( p.escKeyHidesMainWindow );
|
ui.escKeyHidesMainWindow->setChecked( p.escKeyHidesMainWindow );
|
||||||
|
|
||||||
ui.darkMode->addItem( tr( "On" ), QVariant::fromValue( Config::Dark::On ) );
|
ui.darkMode->addItem( tr( "On" ), QVariant::fromValue( Config::Dark::On ) );
|
||||||
|
@ -441,6 +442,7 @@ Config::Preferences Preferences::getPreferences()
|
||||||
p.doubleClickTranslates = ui.doubleClickTranslates->isChecked();
|
p.doubleClickTranslates = ui.doubleClickTranslates->isChecked();
|
||||||
p.selectWordBySingleClick = ui.selectBySingleClick->isChecked();
|
p.selectWordBySingleClick = ui.selectBySingleClick->isChecked();
|
||||||
p.autoScrollToTargetArticle = ui.autoScrollToTargetArticle->isChecked();
|
p.autoScrollToTargetArticle = ui.autoScrollToTargetArticle->isChecked();
|
||||||
|
p.targetArticleAtFirst = ui.targetArticleAtFirst->isChecked();
|
||||||
p.escKeyHidesMainWindow = ui.escKeyHidesMainWindow->isChecked();
|
p.escKeyHidesMainWindow = ui.escKeyHidesMainWindow->isChecked();
|
||||||
|
|
||||||
p.darkMode = ui.darkMode->currentData().value< Config::Dark >();
|
p.darkMode = ui.darkMode->currentData().value< Config::Dark >();
|
||||||
|
|
|
@ -169,6 +169,16 @@ however, the article from the topmost dictionary is shown.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QCheckBox" name="targetArticleAtFirst">
|
||||||
|
<property name="text">
|
||||||
|
<string>Place the target article at the first place.</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="enableTrayIcon">
|
<widget class="QGroupBox" name="enableTrayIcon">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
|
Loading…
Reference in a new issue