Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Move INSTALL, LICENSE, README, THANKS and TODO into root directory
[xestiaab/.git] / source / common / preferences.cpp
index 0a739e5..e965f48 100644 (file)
@@ -72,7 +72,7 @@ XABPreferences::XABPreferences(wxString PreferencesFilename){
     
        if (ValueInc == wxT("true")){
                
-               SaveWindowPos = TRUE;
+               SaveWindowPos = true;
                wxRect WindowPosition;
        
                long PosX, PosY, PosH, PosW = 0;
@@ -107,7 +107,18 @@ XABPreferences::XABPreferences(wxString PreferencesFilename){
        settingfile->Read(wxT("HideLocalAddressBooks"), &ValueInc);
     
        if (ValueInc == wxT("true")){
-               HideLocalABs = TRUE;
+               HideLocalABs = true;
+       }
+       
+       settingfile->Read(wxT("UseBackgroundContactColour"), &ValueInc);
+    
+       if (ValueInc == wxT("true")){
+               UseBackgroundContactColour = true;
+               wxString BackgroundContactColourRead;
+               settingfile->Read(wxT("BackgroundContactColour"), &BackgroundContactColourRead);
+               if (BackgroundContactColourRead.Mid(0, 1) == "#"){
+                       BackgroundContactColour.Set(BackgroundContactColourRead);
+               }
        }
     
        delete settingfile;
@@ -169,6 +180,9 @@ XABPreferences::XABPreferences(wxString PreferencesFilename){
                        if (AccSSLInc == wxT("true")){
                                AccSSL = TRUE;
                        }
+                       else {
+                               AccSSL = FALSE;
+                       }
                        accountusernamevalid = cfgfile->Read(wxT("username"), &AccUsr);
                        accountpasswordvalid = cfgfile->Read(wxT("password"), &AccPass);
                        accountdirprefixvalid = cfgfile->Read(wxT("prefix"), &AccPrefix);
@@ -192,6 +206,41 @@ XABPreferences::XABPreferences(wxString PreferencesFilename){
                                AccSSL, AccUsr, AccPass, 
                                AccPrefix, AccDir, AccRef);
             
+               } else {
+                       
+                       cfgfile->Read(wxT("accountdir"), &AccDir);
+                       accountaddressvalid = cfgfile->Read(wxT("address"), &AccAdr);
+                       accountportvalid = cfgfile->Read(wxT("port"), &AccPort);
+                       accountsslvalid = cfgfile->Read(wxT("ssl"), &AccSSLInc);
+                       if (AccSSLInc == wxT("true")){
+                               AccSSL = TRUE;
+                       }
+                       else {
+                               AccSSL = FALSE;
+                       }
+                       accountusernamevalid = cfgfile->Read(wxT("username"), &AccUsr);
+                       accountpasswordvalid = cfgfile->Read(wxT("password"), &AccPass);
+                       accountdirprefixvalid = cfgfile->Read(wxT("prefix"), &AccPrefix);
+                       accountrefreshvalid = cfgfile->Read(wxT("refresh"), &AccRef);
+            
+                       if (AccDir.Len() > 4){
+
+                               accountdirvalid = TRUE;
+            
+                       }
+                
+                       // Make sure it is not bigger than 65535 or less than 1.
+                       // If so, default to port 8008.
+                
+                       if (accountport < 1 || accountport > 65535){
+                               accountport = 8008;
+                               accountportvalid = TRUE;
+                       }
+            
+                       accounts.AddAccount(accountname, EntryValue, AccAdr, AccPort,
+                               AccSSL, AccUsr, AccPass, 
+                               AccPrefix, AccDir, AccRef);
+                       
                }
 
                // Clear up for the next account.
@@ -233,8 +282,9 @@ bool XABPreferences::GetBoolData(wxString SettingName){
 
        if (SettingName == wxT("SaveWindowPosition")) { return SaveWindowPos; }
        else if (SettingName == wxT("HideLocalAddressBooks")) { return HideLocalABs; }
+       else if (SettingName == wxT("UseBackgroundContactColour")) { return UseBackgroundContactColour; }
        
-       return FALSE;
+       return false;
 
 }
 
@@ -254,6 +304,18 @@ void XABPreferences::SetMainWindowData(wxRect WindowData){
 
 }
 
+wxColour XABPreferences::GetBackgroundContactColourData(){
+       
+       return BackgroundContactColour;
+       
+}
+
+void XABPreferences::SetBackgroundContactColourData(wxColour ColourData){
+       
+       BackgroundContactColour = ColourData;
+       
+}
+
 // XABPrefAccounts
 
 XABPrefAccounts::XABPrefAccounts(){
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy