mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +00:00
+ Add autoStart property to configuration (patch by Ars)
This commit is contained in:
parent
a2af2ee6bb
commit
24bd7066c3
|
@ -46,6 +46,7 @@ Preferences::Preferences():
|
||||||
enableTrayIcon( true ),
|
enableTrayIcon( true ),
|
||||||
startToTray( false ),
|
startToTray( false ),
|
||||||
closeToTray( true ),
|
closeToTray( true ),
|
||||||
|
autoStart( false ),
|
||||||
enableScanPopup( true ),
|
enableScanPopup( true ),
|
||||||
startWithScanPopupOn( false ),
|
startWithScanPopupOn( false ),
|
||||||
enableScanPopupModifiers( false ),
|
enableScanPopupModifiers( false ),
|
||||||
|
@ -102,6 +103,10 @@ Class load() throw( exError )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
|
|
||||||
|
// #### "C:/Program Files" is bad! will not work for German Windows etc.
|
||||||
|
// #### should be replaced to system path
|
||||||
|
|
||||||
if ( QDir( "C:/Program Files/StarDict/dic" ).exists() )
|
if ( QDir( "C:/Program Files/StarDict/dic" ).exists() )
|
||||||
c.paths.push_back( Path( "C:/Program Files/StarDict/dic", true ) );
|
c.paths.push_back( Path( "C:/Program Files/StarDict/dic", true ) );
|
||||||
|
|
||||||
|
@ -250,6 +255,7 @@ Class load() throw( exError )
|
||||||
c.preferences.enableTrayIcon = ( preferences.namedItem( "enableTrayIcon" ).toElement().text() == "1" );
|
c.preferences.enableTrayIcon = ( preferences.namedItem( "enableTrayIcon" ).toElement().text() == "1" );
|
||||||
c.preferences.startToTray = ( preferences.namedItem( "startToTray" ).toElement().text() == "1" );
|
c.preferences.startToTray = ( preferences.namedItem( "startToTray" ).toElement().text() == "1" );
|
||||||
c.preferences.closeToTray = ( preferences.namedItem( "closeToTray" ).toElement().text() == "1" );
|
c.preferences.closeToTray = ( preferences.namedItem( "closeToTray" ).toElement().text() == "1" );
|
||||||
|
c.preferences.autoStart = ( preferences.namedItem( "autoStart" ).toElement().text() == "1" );
|
||||||
c.preferences.enableScanPopup = ( preferences.namedItem( "enableScanPopup" ).toElement().text() == "1" );
|
c.preferences.enableScanPopup = ( preferences.namedItem( "enableScanPopup" ).toElement().text() == "1" );
|
||||||
c.preferences.startWithScanPopupOn = ( preferences.namedItem( "startWithScanPopupOn" ).toElement().text() == "1" );
|
c.preferences.startWithScanPopupOn = ( preferences.namedItem( "startWithScanPopupOn" ).toElement().text() == "1" );
|
||||||
c.preferences.enableScanPopupModifiers = ( preferences.namedItem( "enableScanPopupModifiers" ).toElement().text() == "1" );
|
c.preferences.enableScanPopupModifiers = ( preferences.namedItem( "enableScanPopupModifiers" ).toElement().text() == "1" );
|
||||||
|
@ -479,6 +485,10 @@ void save( Class const & c ) throw( exError )
|
||||||
opt.appendChild( dd.createTextNode( c.preferences.closeToTray ? "1":"0" ) );
|
opt.appendChild( dd.createTextNode( c.preferences.closeToTray ? "1":"0" ) );
|
||||||
preferences.appendChild( opt );
|
preferences.appendChild( opt );
|
||||||
|
|
||||||
|
opt = dd.createElement( "autoStart" );
|
||||||
|
opt.appendChild( dd.createTextNode( c.preferences.autoStart ? "1":"0" ) );
|
||||||
|
preferences.appendChild( opt );
|
||||||
|
|
||||||
opt = dd.createElement( "enableScanPopup" );
|
opt = dd.createElement( "enableScanPopup" );
|
||||||
opt.appendChild( dd.createTextNode( c.preferences.enableScanPopup ? "1":"0" ) );
|
opt.appendChild( dd.createTextNode( c.preferences.enableScanPopup ? "1":"0" ) );
|
||||||
preferences.appendChild( opt );
|
preferences.appendChild( opt );
|
||||||
|
|
|
@ -104,6 +104,7 @@ struct Preferences
|
||||||
bool enableTrayIcon;
|
bool enableTrayIcon;
|
||||||
bool startToTray;
|
bool startToTray;
|
||||||
bool closeToTray;
|
bool closeToTray;
|
||||||
|
bool autoStart;
|
||||||
bool enableScanPopup;
|
bool enableScanPopup;
|
||||||
bool startWithScanPopupOn;
|
bool startWithScanPopupOn;
|
||||||
bool enableScanPopupModifiers;
|
bool enableScanPopupModifiers;
|
||||||
|
|
Loading…
Reference in a new issue