+ Add autoStart property to configuration (patch by Ars)

This commit is contained in:
Konstantin Isakov 2009-04-18 18:16:04 +00:00
parent a2af2ee6bb
commit 24bd7066c3
2 changed files with 17 additions and 6 deletions

View file

@ -46,6 +46,7 @@ Preferences::Preferences():
enableTrayIcon( true ),
startToTray( false ),
closeToTray( true ),
autoStart( false ),
enableScanPopup( true ),
startWithScanPopupOn( false ),
enableScanPopupModifiers( false ),
@ -102,6 +103,10 @@ Class load() throw( exError )
#endif
#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() )
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.startToTray = ( preferences.namedItem( "startToTray" ).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.startWithScanPopupOn = ( preferences.namedItem( "startWithScanPopupOn" ).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" ) );
preferences.appendChild( opt );
opt = dd.createElement( "autoStart" );
opt.appendChild( dd.createTextNode( c.preferences.autoStart ? "1":"0" ) );
preferences.appendChild( opt );
opt = dd.createElement( "enableScanPopup" );
opt.appendChild( dd.createTextNode( c.preferences.enableScanPopup ? "1":"0" ) );
preferences.appendChild( opt );

View file

@ -104,6 +104,7 @@ struct Preferences
bool enableTrayIcon;
bool startToTray;
bool closeToTray;
bool autoStart;
bool enableScanPopup;
bool startWithScanPopupOn;
bool enableScanPopupModifiers;