//fstream preffile;
wxString fullprefpath;
- int accountnum = 0;
-
bool accountnamevalid, accountaddressvalid, accounttypevalid, accountportvalid,
accountsslvalid, accountusernamevalid, accountpasswordvalid,
accountdirprefixvalid, accountdirvalid, accountrefreshvalid = FALSE;
if (PosXValid == TRUE && PosYValid == TRUE && PosHValid == TRUE && PosWValid == TRUE){
- WindowPosition.SetX(PosX);
- WindowPosition.SetY(PosY);
- WindowPosition.SetHeight(PosH);
- WindowPosition.SetWidth(PosW);
+ WindowPosition.SetX((int)PosX);
+ WindowPosition.SetY((int)PosY);
+ WindowPosition.SetHeight((int)PosH);
+ WindowPosition.SetWidth((int)PosW);
} else {
bool AccSSL = FALSE;
int AccRef, AccPort = 0;
long itemindex = 0;
- long subitemindex = 0;
bool ContinueAcc = TRUE;
- bool ContinueProc = TRUE;
ContinueAcc = cfgfile->GetFirstGroup(accountname, itemindex);
while (ContinueAcc){
- cfgfile->SetPath(accountname);
- //ContinueProc = cfgfile->GetFirstEntry(EntryName, subitemindex);
- cfgfile->Read(wxT("type"), &EntryValue);
-
- if (EntryValue == wxT("Local")){
-
- // Get the account directory.
-
- cfgfile->Read(wxT("accountdir"), &AccDir);
-
- if (AccDir.Len() > 4){
-
- accountdirvalid = TRUE;
-
- } else {
-
- accountdirvalid = FALSE;
-
- }
-
- if (accountdirvalid == TRUE){
-
- accounts.AddAccount(accountname, wxT("Local"), wxT(""), 0,
- 0, wxT(""), wxT(""),
- wxT(""), AccDir, 0);
-
- }
-
- } else if (EntryValue == wxT("CardDAV")){
-
- 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;
- }
- 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, wxT("CardDAV"), AccAdr, AccPort,
- AccSSL, AccUsr, AccPass,
- AccPrefix, AccDir, AccRef);
-
- }
-
- // Clear up for the next account.
+ cfgfile->SetPath(accountname);
+ //ContinueProc = cfgfile->GetFirstEntry(EntryName, subitemindex);
+ cfgfile->Read(wxT("type"), &EntryValue);
+
+ if (EntryValue == wxT("Local")){
+
+ // Get the account directory.
+
+ cfgfile->Read(wxT("accountdir"), &AccDir);
+
+ if (AccDir.Len() > 4){
+
+ accountdirvalid = TRUE;
+
+ } else {
+
+ accountdirvalid = FALSE;
+
+ }
+
+ if (accountdirvalid == TRUE){
+
+ accounts.AddAccount(accountname, wxT("Local"), wxT(""), 0,
+ 0, wxT(""), wxT(""),
+ wxT(""), AccDir, 0);
+
+ }
+
+ } else if (EntryValue == wxT("CardDAV")){
+
+ 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;
+ }
+ 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, wxT("CardDAV"), AccAdr, AccPort,
+ AccSSL, AccUsr, AccPass,
+ AccPrefix, AccDir, AccRef);
+
+ }
+
+ // Clear up for the next account.
- accountnamevalid, accountaddressvalid, accounttypevalid, accountportvalid,
- accountsslvalid, accountusernamevalid, accountpasswordvalid,
- accountdirprefixvalid, accountdirvalid, accountrefreshvalid, accountssl,
- isvalidaccount, isvalidsection = FALSE;
- AccAdr.Clear();
- //AccPort.Clear();
- AccDir.Clear();
- AccUsr.Clear();
- AccPass.Clear();
- AccPrefix.Clear();
- accountname.Clear();
- accountaddress.Clear();
- accounttype.Clear();
- accountport = 0;
- accountrefresh = 0;
- accountusername.Clear();
- accountpassword.Clear();
- accountdirprefix.Clear();
- preaccountstage = TRUE;
+ accountnamevalid, accountaddressvalid, accounttypevalid, accountportvalid,
+ accountsslvalid, accountusernamevalid, accountpasswordvalid,
+ accountdirprefixvalid, accountdirvalid, accountrefreshvalid, accountssl,
+ isvalidaccount, isvalidsection = FALSE;
+
+ AccAdr.Clear();
+ AccDir.Clear();
+ AccUsr.Clear();
+ AccPass.Clear();
+ AccPrefix.Clear();
+ accountname.Clear();
+ accountaddress.Clear();
+ accounttype.Clear();
+ accountport = 0;
+ accountrefresh = 0;
+ accountusername.Clear();
+ accountpassword.Clear();
+ accountdirprefix.Clear();
+ preaccountstage = TRUE;
cfgfile->SetPath(wxT("/"));
- ContinueAcc = cfgfile->GetNextGroup(accountname, itemindex);
+ ContinueAcc = cfgfile->GetNextGroup(accountname, itemindex);
+
}
}