mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 16:04:06 +00:00
Merge 15b918eb6a
into c7d0feb2e8
This commit is contained in:
commit
b0de4e1d5d
|
@ -201,6 +201,7 @@ Preferences::Preferences():
|
|||
doubleClickTranslates( true ),
|
||||
selectWordBySingleClick( false ),
|
||||
autoScrollToTargetArticle( true ),
|
||||
targetArticleAtFirst( false ),
|
||||
escKeyHidesMainWindow( false ),
|
||||
alwaysOnTop( false ),
|
||||
searchInDock( false ),
|
||||
|
@ -929,6 +930,11 @@ Class load()
|
|||
( 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() ) {
|
||||
c.preferences.escKeyHidesMainWindow =
|
||||
( preferences.namedItem( "escKeyHidesMainWindow" ).toElement().text() == "1" );
|
||||
|
@ -1866,6 +1872,10 @@ void save( Class const & c )
|
|||
opt.appendChild( dd.createTextNode( c.preferences.autoScrollToTargetArticle ? "1" : "0" ) );
|
||||
preferences.appendChild( opt );
|
||||
|
||||
opt = dd.createElement( "targetArticleAtFirst" );
|
||||
opt.appendChild( dd.createTextNode( c.preferences.targetArticleAtFirst ? "1" : "0" ) );
|
||||
preferences.appendChild( opt );
|
||||
|
||||
opt = dd.createElement( "escKeyHidesMainWindow" );
|
||||
opt.appendChild( dd.createTextNode( c.preferences.escKeyHidesMainWindow ? "1" : "0" ) );
|
||||
preferences.appendChild( opt );
|
||||
|
|
|
@ -356,6 +356,7 @@ struct Preferences
|
|||
bool doubleClickTranslates;
|
||||
bool selectWordBySingleClick;
|
||||
bool autoScrollToTargetArticle;
|
||||
bool targetArticleAtFirst;
|
||||
bool escKeyHidesMainWindow;
|
||||
bool alwaysOnTop;
|
||||
|
||||
|
|
|
@ -185,6 +185,7 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
|
|||
ui.doubleClickTranslates->setChecked( p.doubleClickTranslates );
|
||||
ui.selectBySingleClick->setChecked( p.selectWordBySingleClick );
|
||||
ui.autoScrollToTargetArticle->setChecked( p.autoScrollToTargetArticle );
|
||||
ui.targetArticleAtFirst->setChecked( p.targetArticleAtFirst );
|
||||
ui.escKeyHidesMainWindow->setChecked( p.escKeyHidesMainWindow );
|
||||
|
||||
ui.darkMode->addItem( tr( "On" ), QVariant::fromValue( Config::Dark::On ) );
|
||||
|
@ -441,6 +442,7 @@ Config::Preferences Preferences::getPreferences()
|
|||
p.doubleClickTranslates = ui.doubleClickTranslates->isChecked();
|
||||
p.selectWordBySingleClick = ui.selectBySingleClick->isChecked();
|
||||
p.autoScrollToTargetArticle = ui.autoScrollToTargetArticle->isChecked();
|
||||
p.targetArticleAtFirst = ui.targetArticleAtFirst->isChecked();
|
||||
p.escKeyHidesMainWindow = ui.escKeyHidesMainWindow->isChecked();
|
||||
|
||||
p.darkMode = ui.darkMode->currentData().value< Config::Dark >();
|
||||
|
|
|
@ -169,6 +169,16 @@ however, the article from the topmost dictionary is shown.</string>
|
|||
</property>
|
||||
</widget>
|
||||
</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">
|
||||
<widget class="QGroupBox" name="enableTrayIcon">
|
||||
<property name="toolTip">
|
||||
|
|
Loading…
Reference in a new issue