From: Steve Brokenshire Date: Wed, 25 Jan 2017 22:02:44 +0000 (+0000) Subject: camelCase: Converted code in forms directories X-Git-Tag: release-0.02~12 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=66ebed13414439cd56161faa2abcff7744ab4588;p=xestiacalendar%2F.git camelCase: Converted code in forms directories --- diff --git a/source/forms/about/frmAbout.cpp b/source/forms/about/frmAbout.cpp index ede290a..6cc1d50 100644 --- a/source/forms/about/frmAbout.cpp +++ b/source/forms/about/frmAbout.cpp @@ -38,25 +38,25 @@ void frmAbout::SetupAboutWindow() // Setup the about window to display information about // Xestia Address Book. - wxString VersionLabel, BuildLabel, CopyrightLabel; + wxString versionLabel, buildLabel, copyrightLabel; wxMemoryInputStream istream(bigimgs_aboutimage_png, sizeof(bigimgs_aboutimage_png)); wxImage bigimgs_aboutimage_png(istream, wxBITMAP_TYPE_PNG); - wxBitmap AboutScreen(bigimgs_aboutimage_png, -1); - bmpLogo->SetBitmap(AboutScreen); + wxBitmap aboutScreen(bigimgs_aboutimage_png, -1); + bmpLogo->SetBitmap(aboutScreen); - VersionLabel.Append(wxT("Version ")); - VersionLabel.Append(wxT(XSDCAL_VERSION)); + versionLabel.Append(wxT("Version ")); + versionLabel.Append(wxT(XSDCAL_VERSION)); - BuildLabel.Append(wxT("Built on ")); - BuildLabel.Append(wxT(__DATE__)); - BuildLabel.Append(wxT(" at ")); - BuildLabel.Append(wxT(__TIME__)); - BuildLabel.Append(wxT(".")); + buildLabel.Append(wxT("Built on ")); + buildLabel.Append(wxT(__DATE__)); + buildLabel.Append(wxT(" at ")); + buildLabel.Append(wxT(__TIME__)); + buildLabel.Append(wxT(".")); - CopyrightLabel.Append(XSDCAL_COPYRIGHT); + copyrightLabel.Append(XSDCAL_COPYRIGHT); - lblVersion->SetLabel(VersionLabel); - lblCompileTime->SetLabel(BuildLabel); - lblCopyright->SetLabel(CopyrightLabel); + lblVersion->SetLabel(versionLabel); + lblCompileTime->SetLabel(buildLabel); + lblCopyright->SetLabel(copyrightLabel); } \ No newline at end of file diff --git a/source/forms/editaccount/frmEditAccount.cpp b/source/forms/editaccount/frmEditAccount.cpp index cc88900..f667918 100644 --- a/source/forms/editaccount/frmEditAccount.cpp +++ b/source/forms/editaccount/frmEditAccount.cpp @@ -40,9 +40,9 @@ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) if (CheckBlacklist(txtAddress->GetValue())){ - int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this); + int messageBoxResult = wxMessageBox(_("The server with the address given does not support the CardDAV protocol properly and shouldn't be used.\n\nData loss is very likely.\n\nDo you still want to continue using this server?"), _("Server warning"), wxYES_NO, this); - if (MessageBoxResult == wxNO){ + if (messageBoxResult == wxNO){ return; } @@ -51,119 +51,119 @@ void frmEditAccount::UpdateSettings( wxCommandEvent& event ) // Update the settings for the account. long itemindex = 0; - bool ContinueAcc = TRUE; - wxString AccountName; + bool continueAcc = TRUE; + wxString accountName; // Look for the account - while (ContinueAcc){ + while (continueAcc){ - if (AccountName == AccName){ + if (accountName == accName){ // Update the settings for the account. - cfgfile->RenameGroup(AccountName, txtAccountName->GetValue()); + cfgFile->RenameGroup(accountName, txtAccountName->GetValue()); - cfgfile->SetPath(txtAccountName->GetValue()); + cfgFile->SetPath(txtAccountName->GetValue()); //txtAccountName->SetValue(AccountName); - cfgfile->DeleteEntry(wxT("address"), FALSE); - cfgfile->Write(wxT("address"), txtAddress->GetValue()); + cfgFile->DeleteEntry(wxT("address"), FALSE); + cfgFile->Write(wxT("address"), txtAddress->GetValue()); - cfgfile->DeleteEntry(wxT("port"), FALSE); - cfgfile->Write(wxT("port"), txtPort->GetValue()); + cfgFile->DeleteEntry(wxT("port"), FALSE); + cfgFile->Write(wxT("port"), txtPort->GetValue()); - cfgfile->DeleteEntry(wxT("username"), FALSE); - cfgfile->Write(wxT("username"), txtUsername->GetValue()); + cfgFile->DeleteEntry(wxT("username"), FALSE); + cfgFile->Write(wxT("username"), txtUsername->GetValue()); - cfgfile->DeleteEntry(wxT("password"), FALSE); - cfgfile->Write(wxT("password"), txtPassword->GetValue()); + cfgFile->DeleteEntry(wxT("password"), FALSE); + cfgFile->Write(wxT("password"), txtPassword->GetValue()); - cfgfile->DeleteEntry(wxT("prefix"), FALSE); - cfgfile->Write(wxT("prefix"), txtPrefix->GetValue()); + cfgFile->DeleteEntry(wxT("prefix"), FALSE); + cfgFile->Write(wxT("prefix"), txtPrefix->GetValue()); - cfgfile->DeleteEntry(wxT("ssl"), FALSE); + cfgFile->DeleteEntry(wxT("ssl"), FALSE); if (chkSSL->GetValue() == TRUE){ - cfgfile->Write(wxT("ssl"), wxT("true")); + cfgFile->Write(wxT("ssl"), wxT("true")); } else { - cfgfile->Write(wxT("ssl"), wxT("false")); + cfgFile->Write(wxT("ssl"), wxT("false")); } - cfgfile->DeleteEntry(wxT("refresh"), FALSE); - cfgfile->Write(wxT("refresh"), txtRefresh->GetValue()); + cfgFile->DeleteEntry(wxT("refresh"), FALSE); + cfgFile->Write(wxT("refresh"), txtRefresh->GetValue()); break; } - cfgfile->SetPath(wxT("/")); - ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex); + cfgFile->SetPath(wxT("/")); + continueAcc = cfgFile->GetNextGroup(accountName, itemIndex); } // Set the dialog result to true and close the window. - DialogResult = true; + dialogResult = true; this->Close(); } -void frmEditAccount::LoadSettings( wxString AccNameIn ){ +void frmEditAccount::LoadSettings( wxString accNameIn ){ // Get the data from the accounts settings file and // fill in the account fields. - AccName = AccNameIn; - long itemindex = 0; - bool ContinueAcc = TRUE; - wxString AccountName; - wxString AccountData; + accName = accNameIn; + long itemIndex = 0; + bool continueAcc = TRUE; + wxString accountName; + wxString accountData; - ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex); + continueAcc = cfgFile->GetFirstGroup(accountName, itemIndex); - while (ContinueAcc){ + while (continueAcc){ - if (AccountName == AccName){ + if (accountName == accName){ - cfgfile->SetPath(AccountName); - txtAccountName->SetValue(AccountName); + cfgFile->SetPath(accountName); + txtAccountName->SetValue(accountName); - cfgfile->Read("address", &AccountData); - txtAddress->SetValue(AccountData); + cfgFile->Read("address", &accountData); + txtAddress->SetValue(accountData); - cfgfile->Read("port", &AccountData); - txtPort->SetValue(AccountData); + cfgFile->Read("port", &accountData); + txtPort->SetValue(accountData); - cfgfile->Read("username", &AccountData); - txtUsername->SetValue(AccountData); + cfgFile->Read("username", &accountData); + txtUsername->SetValue(accountData); - cfgfile->Read("password", &AccountData); - txtPassword->SetValue(AccountData); + cfgFile->Read("password", &accountData); + txtPassword->SetValue(accountData); - cfgfile->Read("prefix", &AccountData); - txtPrefix->SetValue(AccountData); + cfgFile->Read("prefix", &accountData); + txtPrefix->SetValue(accountData); - cfgfile->Read("ssl", &AccountData); - if (AccountData == wxT("true")){ + cfgFile->Read("ssl", &accountData); + if (accountData == wxT("true")){ chkSSL->SetValue(TRUE); } - cfgfile->Read("refresh", &AccountData); - txtRefresh->SetValue(AccountData); + cfgFile->Read("refresh", &accountData); + txtRefresh->SetValue(accountData); break; } - cfgfile->SetPath(wxT("/")); - ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex); + cfgFile->SetPath(wxT("/")); + continueAcc = cfgFile->GetNextGroup(accountName, itemIndex); } @@ -172,7 +172,7 @@ void frmEditAccount::LoadSettings( wxString AccNameIn ){ void frmEditAccount::CloseWindow( wxCommandEvent& event ) { - DialogResult = false; + dialogResult = false; this->Close(); } @@ -181,14 +181,14 @@ bool frmEditAccount::GetDialogResult(){ // Get the result of the dialog. - return DialogResult; + return dialogResult; } -void frmEditAccount::LoadPointers( wxFileConfig* cfgin ){ +void frmEditAccount::LoadPointers( wxFileConfig* cfgIn ){ // Setup the account configuration file pointer. - cfgfile = cfgin; + cfgFile = cfgIn; } \ No newline at end of file diff --git a/source/forms/editaccount/frmEditAccount.h b/source/forms/editaccount/frmEditAccount.h index 6a1b557..ce36be0 100644 --- a/source/forms/editaccount/frmEditAccount.h +++ b/source/forms/editaccount/frmEditAccount.h @@ -37,9 +37,9 @@ Subclass of frmEditAccountADT, which is generated by wxFormBuilder. class frmEditAccount : public frmEditAccountADT { private: - wxFileConfig *cfgfile; - wxString AccName; - bool DialogResult = false; + wxFileConfig *cfgFile; + wxString accName; + bool dialogResult = false; protected: // Handlers for frmEditAccountADT events. void DetectAddressBook( wxCommandEvent& event ); @@ -48,8 +48,8 @@ class frmEditAccount : public frmEditAccountADT public: /** Constructor */ frmEditAccount( wxWindow* parent ); - void LoadPointers( wxFileConfig* cfgin ); - void LoadSettings( wxString AccNameIn ); + void LoadPointers( wxFileConfig* cfgIn ); + void LoadSettings( wxString accNameIn ); bool GetDialogResult(); //// end generated class members diff --git a/source/forms/newaccount/frmNewAccount.cpp b/source/forms/newaccount/frmNewAccount.cpp index 77348e7..e3823db 100644 --- a/source/forms/newaccount/frmNewAccount.cpp +++ b/source/forms/newaccount/frmNewAccount.cpp @@ -47,17 +47,17 @@ void frmNewAccount::ProcessPrevious( wxCommandEvent& event ) void frmNewAccount::ProcessNext( wxCommandEvent& event ) { - PageSeek++; + pageSeek++; - if (PageSeek == 1){ - PageSeek++; + if (pageSeek == 1){ + pageSeek++; } - if (PageSeek == 1){ + if (pageSeek == 1){ // Skip this page. - } else if (PageSeek == 2){ + } else if (pageSeek == 2){ // Finish screen. @@ -69,7 +69,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) btnNext->Disable(); btnNext->SetLabel(_("Finish")); - if (txtAccountName->IsEmpty() && PageSeek == 2){ + if (txtAccountName->IsEmpty() && pageSeek == 2){ btnNext->Disable(); @@ -79,19 +79,19 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - } else if (PageSeek == 3){ + } else if (pageSeek == 3){ // Finished. - wxString XestiaCALPrefDirectory; - wxString XestiaCALDirectory; - wxString AccountSettingsFile; + wxString xestiaCALPrefDirectory; + wxString xestiaCALDirectory; + wxString accountSettingsFile; //wxFile ASFile; srand(time(0)); - int RandomNumber = rand() % 32767; - wxString RandomNumberSuffix = wxString::Format(wxT("%i"), RandomNumber); - bool DirectoryCreated = FALSE; + int randomNumber = rand() % 32767; + wxString randomNumberSuffix = wxString::Format(wxT("%i"), randomNumber); + bool directoryCreated = FALSE; #if defined(__HAIKU__) @@ -99,34 +99,34 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) #elif defined(__WIN32__) - XestiaCALPrefDirectory = GetUserPrefDir(); - XestiaCALDirectory = GetUserDir(); + xestiaCALPrefDirectory = GetUserPrefDir(); + xestiaCALDirectory = GetUserDir(); - AccountSettingsFile = XestiaCALPrefDirectory + wxT("accounts"); + accountSettingsFile = xestiaCALPrefDirectory + wxT("accounts"); // Open the file for writing. - wxFileConfig *cfgfile = new wxFileConfig("", "", AccountSettingsFile); + wxFileConfig *cfgFile = new wxFileConfig("", "", accountSettingsFile); // Check if account name already exists and return an error message // if this is the case. - wxString AccountName; - long itemindex = 0; - bool ContinueAcc; - ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex); + wxString accountName; + long itemIndex = 0; + bool continueAcc; + continueAcc = cfgFile->GetFirstGroup(accountName, itemIndex); - while (ContinueAcc){ + while (continueAcc){ - if (txtAccountName->GetValue() == AccountName){ + if (txtAccountName->GetValue() == accountName){ wxMessageBox(_("The selected account name is already used, please use another account name."), _("Account name already used"), wxICON_ERROR); return; } - cfgfile->SetPath(wxT("/")); - ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex); + cfgFile->SetPath(wxT("/")); + continueAcc = cfgFile->GetNextGroup(accountName, itemIndex); } @@ -134,17 +134,17 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) // Create the account directory. - wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix; + wxString directoryName = txtAccountName->GetValue().Mid(0, 30) + randomNumberSuffix; - if (wxMkdir(XestiaCALDirectory + wxT("\\accounts\\") + DirectoryName + wxT(".local"), 0740) == TRUE){ + if (wxMkdir(xestiaCALDirectory + wxT("\\accounts\\") + directoryName + wxT(".local"), 0740) == TRUE){ - DirectoryCreated = TRUE; + directoryCreated = TRUE; } - if (DirectoryCreated == TRUE){ + if (directoryCreated == TRUE){ - WriteAccountDetails(cfgfile, wxT("Local"), DirectoryName); + WriteAccountDetails(cfgfile, wxT("Local"), directoryName); } else { @@ -155,41 +155,41 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - delete cfgfile; - cfgfile = NULL; + delete cfgFile; + cfgFile = NULL; - *ReloadAccountConfig = TRUE; + *reloadAccountConfig = TRUE; #else - XestiaCALPrefDirectory = GetUserPrefDir(); - XestiaCALDirectory = GetUserDir(); + xestiaCALPrefDirectory = GetUserPrefDir(); + xestiaCALDirectory = GetUserDir(); - AccountSettingsFile = XestiaCALPrefDirectory + wxT("accounts"); + accountSettingsFile = xestiaCALPrefDirectory + wxT("accounts"); // Open the file for writing. - wxFileConfig *cfgfile = new wxFileConfig("", "", AccountSettingsFile); + wxFileConfig *cfgFile = new wxFileConfig("", "", accountSettingsFile); // Check if account name already exists and return an error message // if this is the case. - wxString AccountName; - long itemindex = 0; - bool ContinueAcc; - ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex); + wxString accountName; + long itemIndex = 0; + bool continueAcc; + continueAcc = cfgfile->GetFirstGroup(accountName, itemIndex); - while (ContinueAcc){ + while (continueAcc){ - if (txtAccountName->GetValue() == AccountName){ + if (txtAccountName->GetValue() == accountName){ wxMessageBox(_("The selected account name is already used, please use another account name."), _("Account name already used"), wxICON_ERROR); return; } - cfgfile->SetPath(wxT("/")); - ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex); + cfgFile->SetPath(wxT("/")); + continueAcc = cfgfile->GetNextGroup(accountName, itemIndex); } @@ -197,17 +197,17 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) // Create the account directory. - wxString DirectoryName = txtAccountName->GetValue().Mid(0, 30) + RandomNumberSuffix; + wxString directoryName = txtAccountName->GetValue().Mid(0, 30) + randomNumberSuffix; - if (wxMkdir(XestiaCALDirectory + wxT("/accounts/") + DirectoryName + wxT(".Local"), 0740) == TRUE){ + if (wxMkdir(XestiaCALDirectory + wxT("/accounts/") + directoryName + wxT(".Local"), 0740) == TRUE){ - DirectoryCreated = TRUE; + directoryCreated = TRUE; } - if (DirectoryCreated == TRUE){ + if (directoryCreated == TRUE){ - WriteAccountDetails(cfgfile, wxT("Local"), DirectoryName); + WriteAccountDetails(cfgfile, wxT("Local"), directoryName); } else { @@ -221,7 +221,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) delete cfgfile; cfgfile = NULL; - *ReloadAccountConfig = true; + *reloadAccountConfig = true; #endif @@ -236,7 +236,7 @@ void frmNewAccount::CloseWindow( wxCommandEvent& event ) // Close the window. - *ReloadAccountConfig = FALSE; + *reloadAccountConfig = FALSE; this->Close(); } @@ -245,7 +245,7 @@ void frmNewAccount::SetupPointers(bool *ReloadAccountInc, CalendarDataStorage *d // Setup the pointers for the new account window. - ReloadAccountConfig = ReloadAccountInc; + reloadAccountConfig = ReloadAccountInc; } @@ -254,9 +254,9 @@ void frmNewAccount::CheckAccountName( wxCommandEvent& event ) // Check that the account name is valid. - wxString CheckAccName = txtAccountName->GetValue(); + wxString checkAccName = txtAccountName->GetValue(); - if ((txtAccountName->IsEmpty() && PageSeek == 2) || CheckAccName.Len() < 4){ + if ((txtAccountName->IsEmpty() && pageSeek == 2) || checkAccName.Len() < 4){ btnNext->Disable(); @@ -268,29 +268,29 @@ void frmNewAccount::CheckAccountName( wxCommandEvent& event ) } -void frmNewAccount::WriteAccountDetails(wxFileConfig *cfgfilein, wxString AccountType, wxString DirectoryName){ +void frmNewAccount::WriteAccountDetails(wxFileConfig *cfgFileIn, wxString accountType, wxString directoryName){ // Write the new account details. - cfgfilein->SetPath(txtAccountName->GetValue()); - cfgfilein->Write(wxT("address"), txtServerAddress->GetValue()); - cfgfilein->Write(wxT("port"), txtServerPort->GetValue()); - cfgfilein->Write(wxT("username"), txtUsername->GetValue()); - cfgfilein->Write(wxT("password"), txtPassword->GetValue()); - cfgfilein->Write(wxT("prefix"), ServerPrefix); - cfgfilein->Write(wxT("accountdir"), DirectoryName); + cfgFileIn->SetPath(txtAccountName->GetValue()); + cfgFileIn->Write(wxT("address"), txtServerAddress->GetValue()); + cfgFileIn->Write(wxT("port"), txtServerPort->GetValue()); + cfgFileIn->Write(wxT("username"), txtUsername->GetValue()); + cfgFileIn->Write(wxT("password"), txtPassword->GetValue()); + cfgFileIn->Write(wxT("prefix"), serverPrefix); + cfgFileIn->Write(wxT("accountdir"), directoryName); if (chkUseSSL->GetValue() == TRUE){ - cfgfilein->Write(wxT("ssl"), wxT("true")); + cfgFileIn->Write(wxT("ssl"), wxT("true")); } else { - cfgfilein->Write(wxT("ssl"), wxT("false")); + cfgFileIn->Write(wxT("ssl"), wxT("false")); } - cfgfilein->Write(wxT("refresh"), wxT("1800")); - cfgfilein->Write(wxT("type"), AccountType); + cfgFileIn->Write(wxT("refresh"), wxT("1800")); + cfgFileIn->Write(wxT("type"), accountType); } \ No newline at end of file diff --git a/source/forms/newaccount/frmNewAccount.h b/source/forms/newaccount/frmNewAccount.h index 6c03227..6cd24e0 100644 --- a/source/forms/newaccount/frmNewAccount.h +++ b/source/forms/newaccount/frmNewAccount.h @@ -40,9 +40,9 @@ Subclass of frmNewAccountADT, which is generated by wxFormBuilder. class frmNewAccount : public frmNewAccountADT { private: - int PageSeek = 0; - wxString ServerPrefix; - bool *ReloadAccountConfig = NULL; + int pageSeek = 0; + wxString serverPrefix; + bool *reloadAccountConfig = NULL; protected: // Handlers for frmNewAccountADT events. void UpdateRequirements( wxCommandEvent& event ); @@ -50,11 +50,11 @@ class frmNewAccount : public frmNewAccountADT void ProcessPrevious( wxCommandEvent& event ); void ProcessNext( wxCommandEvent& event ); void CloseWindow( wxCommandEvent& event ); - void WriteAccountDetails( wxFileConfig *cfgfilein, wxString AccountType, wxString DirectoryName ); + void WriteAccountDetails( wxFileConfig *cfgFileIn, wxString accountType, wxString directoryName ); public: /** Constructor */ frmNewAccount( wxWindow* parent ); - void SetupPointers(bool *ReloadAccountInc, CalendarDataStorage *dataStorage); + void SetupPointers(bool *reloadAccountInc, CalendarDataStorage *dataStorage); //// end generated class members }; diff --git a/source/forms/preferences/frmPreferences.cpp b/source/forms/preferences/frmPreferences.cpp index 312ae26..b7c629b 100644 --- a/source/forms/preferences/frmPreferences.cpp +++ b/source/forms/preferences/frmPreferences.cpp @@ -27,17 +27,17 @@ frmPreferencesADT( parent ) wxMemoryInputStream cstream(icons_accunsupported_png, sizeof(icons_accunsupported_png)); wxImage icons_acclocal_png(bstream, wxBITMAP_TYPE_PNG); - wxBitmap AccNIcon(icons_acclocal_png, -1); + wxBitmap accNIcon(icons_acclocal_png, -1); wxIcon wxIAccNIcon; - wxIAccNIcon.CopyFromBitmap(AccNIcon); + wxIAccNIcon.CopyFromBitmap(accNIcon); wxImage icons_accunsupported_png(cstream, wxBITMAP_TYPE_PNG); - wxBitmap AccUIcon(icons_accunsupported_png, -1); + wxBitmap accUIcon(icons_accunsupported_png, -1); wxIcon wxIAccUIcon; - wxIAccUIcon.CopyFromBitmap(AccUIcon); + wxIAccUIcon.CopyFromBitmap(accUIcon); - AccountID = AccImgList->Add(wxIAccNIcon); - AccountUnsupportedID = AccImgList->Add(wxIAccUIcon); + accountID = accImgList->Add(wxIAccNIcon); + accountUnsupportedID = accImgList->Add(wxIAccUIcon); NbtPreferences->RemovePage(1); btnAccountAdd->Show(false); @@ -50,22 +50,22 @@ void frmPreferences::LoadPreferences( wxInitDialogEvent& event ) // Setup the preferences filename string. Default is the // *nix systems one (/home/$USER/.xestiacal/preferences) - preffilename = GetUserPrefDir(); + prefFilename = GetUserPrefDir(); - preferences = new XCALPreferences(preffilename); + preferences = new XCALPreferences(prefFilename); // Setup the General Tab. - bool SaveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition")); - bool HideLocalABs = preferences->GetBoolData(wxT("HideLocalCalendars")); + bool saveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition")); + bool hideLocalABs = preferences->GetBoolData(wxT("HideLocalCalendars")); - if (SaveWindowPos == TRUE){ + if (saveWindowPos == TRUE){ chkSaveWindowPosition->SetValue(TRUE); } - if (HideLocalABs == TRUE){ + if (hideLocalABs == TRUE){ chkHideLocal->SetValue(TRUE); @@ -90,8 +90,8 @@ frmPreferences::~frmPreferences(){ // Destory the preferences window. - delete AccImgList; - AccImgList = NULL; + delete accImgList; + accImgList = NULL; } @@ -99,12 +99,12 @@ void frmPreferences::ReloadAccounts(){ // Reload the accounts in the accounts list. - if (FirstLoad == FALSE){ + if (firstLoad == FALSE){ delete preferences; preferences = NULL; - preferences = new XCALPreferences(preffilename); + preferences = new XCALPreferences(prefFilename); } else { - FirstLoad = FALSE; + firstLoad = FALSE; } wxListItem accountscol0, accountscol1, accountscol2, accountscol3; @@ -114,7 +114,7 @@ void frmPreferences::ReloadAccounts(){ accountscol0.SetId(0); accountscol0.SetWidth(24); lstAccounts->InsertColumn(0,accountscol0); - lstAccounts->SetImageList(AccImgList, wxIMAGE_LIST_SMALL); + lstAccounts->SetImageList(accImgList, wxIMAGE_LIST_SMALL); accountscol1.SetId(1); accountscol1.SetText(_("Name")); @@ -126,7 +126,7 @@ void frmPreferences::ReloadAccounts(){ accountscol2.SetWidth(96); lstAccounts->InsertColumn(2,accountscol2); - wxString AccType; + wxString accType; for (int i = 0; i < preferences->accounts.GetCount() ; i++){ @@ -141,11 +141,11 @@ void frmPreferences::ReloadAccounts(){ if (preferences->accounts.GetAccountType(i) == wxT("Local")){ - col0.SetImage(AccountID); + col0.SetImage(accountID); } else { - col0.SetImage(AccountUnsupportedID); + col0.SetImage(accountUnsupportedID); } @@ -192,11 +192,11 @@ void frmPreferences::ModifyAccount( wxCommandEvent& event ) // with the settings. long lstAccountsIndex = -1; - wxString AccFilename = GetAccountsFile(); - wxString AccName; - wxString AccType; + wxString accFilename = GetAccountsFile(); + wxString accName; + wxString accType; - wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename); + wxFileConfig *cfgFile = new wxFileConfig("", "", accFilename); // Get the account name. @@ -206,38 +206,38 @@ void frmPreferences::ModifyAccount( wxCommandEvent& event ) // Check that the account type is a supported account type. - AccType = preferences->accounts.GetAccountType((int)lstAccountsIndex); + accType = preferences->accounts.GetAccountType((int)lstAccountsIndex); - if (AccType != "CardDAV" && AccType != "carddav" && - AccType != "Local" && AccType != "local"){ + if (accType != "CardDAV" && AccType != "carddav" && + accType != "Local" && AccType != "local"){ wxMessageBox(_("Cannot modify the selected account settings as the account type is unsupported."), _("Unsupported account type"), wxICON_ERROR); return; } - AccName = preferences->accounts.GetAccountName((int)lstAccountsIndex); + accName = preferences->accounts.GetAccountName((int)lstAccountsIndex); frmEditAccount *frameEditAccount = new frmEditAccount ( this ); - frameEditAccount->LoadPointers(cfgfile); - frameEditAccount->LoadSettings(AccName); + frameEditAccount->LoadPointers(cfgFile); + frameEditAccount->LoadSettings(accName); frameEditAccount->ShowModal(); - bool DialogResult = frameEditAccount->GetDialogResult(); + bool dialogResult = frameEditAccount->GetDialogResult(); delete frameEditAccount; frameEditAccount = NULL; - delete cfgfile; - cfgfile = NULL; + delete cfgFile; + cfgFile = NULL; - if (DialogResult == false){ + if (dialogResult == false){ return; } // Reload the account list in the preferences window. ReloadAccounts(); - *ReloadAccountConfig = TRUE; + *reloadAccountConfig = TRUE; btnAccountModify->Enable(FALSE); btnAccountDelete->Enable(FALSE); @@ -261,45 +261,45 @@ void frmPreferences::DeleteAccount( wxCommandEvent& event ) wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - bool ContinueAcc = TRUE; - wxString AccountDir; - wxString AccountType; - wxString AccountDirFull; - wxString AccountDirDelFull; - wxString AccountName; - wxString AccName; - long itemindex = 0; + bool continueAcc = TRUE; + wxString accountDir; + wxString accountType; + wxString accountDirFull; + wxString accountDirDelFull; + wxString accountName; + wxString accName; + long itemIndex = 0; - wxString AccFilename = GetAccountsFile(); + wxString accFilename = GetAccountsFile(); - wxFileConfig *cfgfile = new wxFileConfig("", "", AccFilename); + wxFileConfig *cfgFile = new wxFileConfig("", "", accFilename); - AccName = preferences->accounts.GetAccountName((int)lstAccounts->GetItemData(lstAccountsIndex)); + accName = preferences->accounts.GetAccountName((int)lstAccounts->GetItemData(lstAccountsIndex)); // Get the account directory name and account type.. - ContinueAcc = cfgfile->GetFirstGroup(AccountName, itemindex); + continueAcc = cfgFile->GetFirstGroup(accountName, itemIndex); - while (ContinueAcc){ + while (continueAcc){ - if (AccountName == AccName){ + if (accountName == accName){ - cfgfile->SetPath(AccountName); + cfgFile->SetPath(accountName); - cfgfile->Read("accountdir", &AccountDir); - cfgfile->Read("type", &AccountType); + cfgFile->Read("accountdir", &accountDir); + cfgFile->Read("type", &accountType); break; } - cfgfile->SetPath(wxT("/")); - ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex); + cfgFile->SetPath(wxT("/")); + continueAcc = cfgFile->GetNextGroup(accountName, itemIndex); } - AccountDirFull.Append(AccountDir); - AccountDirFull.Append(wxT(".")); + accountDirFull.Append(accountDir); + accountDirFull.Append(wxT(".")); /*if (AccountType == wxT("CalDAV")){ @@ -307,9 +307,9 @@ void frmPreferences::DeleteAccount( wxCommandEvent& event ) } else */ - if (AccountType == wxT("Local")){ + if (accountType == wxT("Local")){ - AccountDirFull.Append(wxT("Local")); + accountDirFull.Append(wxT("Local")); }/*else { @@ -321,25 +321,25 @@ void frmPreferences::DeleteAccount( wxCommandEvent& event ) // Delete the directory that contains the account information. - if (!AccountDirFull.IsEmpty()){ + if (!accountDirFull.IsEmpty()){ - AccountDirDelFull.Append(wxString::FromUTF8(getenv("HOME"))); - AccountDirDelFull.Append(wxT("/.xestiacal/accounts/")); - AccountDirDelFull.Append(AccountDirFull); + accountDirDelFull.Append(wxString::FromUTF8(getenv("HOME"))); + accountDirDelFull.Append(wxT("/.xestiacal/accounts/")); + accountDirDelFull.Append(accountDirFull); - wxRmDir(AccountDirDelFull); + wxRmDir(accountDirDelFull); } // Delete the account from the configuration file. - cfgfile->SetPath(wxT("/")); - cfgfile->DeleteGroup(AccountName); - cfgfile->Flush(); + cfgFile->SetPath(wxT("/")); + cfgFile->DeleteGroup(accountName); + cfgFile->Flush(); // Set flag for reloading accounts on window closure. - *ReloadAccountConfig = TRUE; + *reloadAccountConfig = TRUE; } @@ -353,21 +353,21 @@ void frmPreferences::SavePreferences( wxCommandEvent& event ) // Load up the preferences file. - wxString SetFilename = GetSettingsFile(); + wxString setFilename = GetSettingsFile(); - wxFileConfig *cfgfile = new wxFileConfig("", "", SetFilename); + wxFileConfig *cfgFile = new wxFileConfig("", "", setFilename); // Update the settings file. - cfgfile->DeleteEntry(wxT("SaveWindowPosition")); - cfgfile->DeleteEntry(wxT("WindowPositionX")); - cfgfile->DeleteEntry(wxT("WindowPositionY")); - cfgfile->DeleteEntry(wxT("WindowPositionHeight")); - cfgfile->DeleteEntry(wxT("WindowPositionWidth")); + cfgFile->DeleteEntry(wxT("SaveWindowPosition")); + cfgFile->DeleteEntry(wxT("WindowPositionX")); + cfgFile->DeleteEntry(wxT("WindowPositionY")); + cfgFile->DeleteEntry(wxT("WindowPositionHeight")); + cfgFile->DeleteEntry(wxT("WindowPositionWidth")); if (chkSaveWindowPosition->GetValue() == TRUE){ - cfgfile->Write(wxT("SaveWindowPosition"), wxT("true")); + cfgFile->Write(wxT("SaveWindowPosition"), wxT("true")); // Get parent window details. @@ -377,33 +377,33 @@ void frmPreferences::SavePreferences( wxCommandEvent& event ) wxRect frmMainPos = frmMainPtr->GetRect(); - cfgfile->Write(wxT("WindowPositionX"), frmMainPos.GetX()); - cfgfile->Write(wxT("WindowPositionY"), frmMainPos.GetY()); - cfgfile->Write(wxT("WindowPositionHeight"), frmMainPos.GetHeight()); - cfgfile->Write(wxT("WindowPositionWidth"), frmMainPos.GetWidth()); + cfgFile->Write(wxT("WindowPositionX"), frmMainPos.GetX()); + cfgFile->Write(wxT("WindowPositionY"), frmMainPos.GetY()); + cfgFile->Write(wxT("WindowPositionHeight"), frmMainPos.GetHeight()); + cfgFile->Write(wxT("WindowPositionWidth"), frmMainPos.GetWidth()); } else { - cfgfile->Write(wxT("SaveWindowPosition"), wxT("false")); + cfgFile->Write(wxT("SaveWindowPosition"), wxT("false")); } - cfgfile->DeleteEntry(wxT("HideLocalCalendars")); + cfgFile->DeleteEntry(wxT("HideLocalCalendars")); if (chkHideLocal->GetValue() == TRUE){ - cfgfile->Write(wxT("HideLocalCalendars"), wxT("true")); - *ReloadAccountConfig = TRUE; + cfgFile->Write(wxT("HideLocalCalendars"), wxT("true")); + *reloadAccountConfig = TRUE; } else { - cfgfile->Write(wxT("HideLocalCalendars"), wxT("false")); - *ReloadAccountConfig = TRUE; + cfgFile->Write(wxT("HideLocalCalendars"), wxT("false")); + *reloadAccountConfig = TRUE; } - delete cfgfile; - cfgfile = NULL; + delete cfgFile; + cfgFile = NULL; this->Close(); @@ -418,10 +418,10 @@ void frmPreferences::CloseWindow( wxCommandEvent& event ) } -void frmPreferences::SetupPointers(bool *ReloadAccountInc){ +void frmPreferences::SetupPointers(bool *reloadAccountInc){ // Setup the pointers for the preferences form. - ReloadAccountConfig = ReloadAccountInc; + reloadAccountConfig = reloadAccountInc; } \ No newline at end of file diff --git a/source/forms/preferences/frmPreferences.h b/source/forms/preferences/frmPreferences.h index 2b8ebbf..a5eec97 100644 --- a/source/forms/preferences/frmPreferences.h +++ b/source/forms/preferences/frmPreferences.h @@ -45,14 +45,14 @@ class frmPreferences : public frmPreferencesADT { private: void ReloadAccounts(); - wxImageList *AccImgList = new wxImageList(16,16,true,wxIMAGE_LIST_SMALL); - int AccountID = 0; - int AccountNetID = 0; - int AccountUnsupportedID = 0; + wxImageList *accImgList = new wxImageList(16,16,true,wxIMAGE_LIST_SMALL); + int accountID = 0; + int accountNetID = 0; + int accountUnsupportedID = 0; XCALPreferences *preferences; - wxString preffilename; - bool FirstLoad = TRUE; - bool *ReloadAccountConfig; + wxString prefFilename; + bool firstLoad = TRUE; + bool *reloadAccountConfig; protected: // Handlers for frmPreferencesADT events. void LoadPreferences( wxInitDialogEvent& event ); @@ -67,7 +67,7 @@ class frmPreferences : public frmPreferencesADT /** Constructor */ frmPreferences( wxWindow* parent ); ~frmPreferences(); - void SetupPointers( bool *ReloadAccountInc ); + void SetupPointers( bool *reloadAccountInc ); //// end generated class members }; diff --git a/source/forms/update/frmUpdate.cpp b/source/forms/update/frmUpdate.cpp index 213ac33..bb46cd1 100644 --- a/source/forms/update/frmUpdate.cpp +++ b/source/forms/update/frmUpdate.cpp @@ -22,9 +22,9 @@ size_t WritebackFuncUpdate(char *ptr, size_t size, size_t nmemb, wxString *strea // Write back function for getting version information. - wxString Data; + wxString data; //wxString *PageInput; - Data = wxString::FromUTF8((char *)ptr); + data = wxString::FromUTF8((char *)ptr); stream->Append(Data); @@ -47,54 +47,55 @@ void frmUpdate::FetchData() CURL *conn; conn = curl_easy_init(); - CURLcode conncode; + CURLcode connCode; - wxString PageData; - wxString PageHeader; + wxString pageData; + wxString pageHeader; - wxString UpdateAddress = wxT("http://update.xestia.co.uk/xestiacalendar/"); - UpdateAddress.Append(XSDCAL_SOURCE); + wxString updateAddress = wxT("http://update.xestia.co.uk/xestiacalendar/"); + updateAddress.Append(XSDCAL_SOURCE); - curl_easy_setopt(conn, CURLOPT_URL, (const char*)UpdateAddress.mb_str(wxConvUTF8)); + curl_easy_setopt(conn, CURLOPT_URL, (const char*)updateAddress.mb_str(wxConvUTF8)); curl_easy_setopt(conn, CURLOPT_NOPROGRESS, 0); curl_easy_setopt(conn, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_easy_setopt(conn, CURLOPT_TIMEOUT, 3); curl_easy_setopt(conn, CURLOPT_FAILONERROR, TRUE); curl_easy_setopt(conn, CURLOPT_USERAGENT, XSDCAL_USERAGENT); curl_easy_setopt(conn, CURLOPT_WRITEFUNCTION, WritebackFuncUpdate); - curl_easy_setopt(conn, CURLOPT_WRITEDATA, &PageData); - curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &PageHeader); + curl_easy_setopt(conn, CURLOPT_WRITEDATA, &pageData); + curl_easy_setopt(conn, CURLOPT_WRITEHEADER, &pageHeader); curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(conn, CURLOPT_NOPROGRESS, 1); - conncode = (curl_easy_perform(conn)); + connCode = (curl_easy_perform(conn)); // Split the data received. - PageData.Trim(); + pageData.Trim(); - wxString SupportCode = PageData.Left(1); - wxString VersionCode = PageData.Mid(1, wxString::npos); - wxString RunningVer = wxString::Format(wxT("%s"), XSDCAL_VERSION); - double VersionCodeDouble; - double CurrentVerDouble; + wxString supportCode = pageData.Left(1); + wxString versionCode = pageData.Mid(1, wxString::npos); + wxString runningVer = wxString::Format(wxT("%s"), XSDCAL_VERSION); + + double availableVersion; + double currentVersion; // Setup the running version. - lblRunningVer->SetLabel(RunningVer); + lblRunningVer->SetLabel(runningVer); // Setup the build type. - wxString BuildType = wxT(XSDCAL_SOURCE); - lblBuildType->SetLabel(BuildType); + wxString buildType = wxT(XSDCAL_SOURCE); + lblBuildType->SetLabel(buildType); - if (conncode != CURLE_OK){ + if (connCode != CURLE_OK){ - lblAvailableVer->SetLabel(wxT("Unable to determine.")); + lblAvailableVer->SetLabel(_("Unable to determine.")); curl_easy_cleanup(conn); curl_global_cleanup(); - lblUpdateMessage->SetLabel(wxT("An error has occurred. The error message is: ") + wxString::Format(wxT("%s"), curl_easy_strerror(conncode))); + lblUpdateMessage->SetLabel(_("An error has occurred. The error message is: ") + wxString::Format(wxT("%s"), curl_easy_strerror(connCode))); return; @@ -106,17 +107,17 @@ void frmUpdate::FetchData() // Setup the avaiable version. - RunningVer.ToDouble(&CurrentVerDouble); + runningVer.ToDouble(¤tVersion); - if (VersionCode.ToDouble(&VersionCodeDouble)){ + if (versionCode.ToDouble(&availableVersion)){ - lblAvailableVer->SetLabel(VersionCode); + lblAvailableVer->SetLabel(versionCode); } else { - lblAvailableVer->SetLabel(wxT("Unable to determine.")); + lblAvailableVer->SetLabel(_("Unable to determine.")); - lblUpdateMessage->SetLabel(wxT("Cannot determine the available version at this time. Please retry in a while.")); + lblUpdateMessage->SetLabel(_("Cannot determine the available version at this time. Please retry in a while.")); return; @@ -129,13 +130,13 @@ void frmUpdate::FetchData() // Write message about getting the update // from Xestia Gelforn. - if (CurrentVerDouble >= VersionCodeDouble){ + if (currentVersion >= availableVersion){ - lblUpdateMessage->SetLabel(wxT("Xestia Calendar is up to date.\n\nFor a small yearly cost, prebuilt packages and support is available from Xestia PREMIUM (https://premium.xestia.co.uk).")); + lblUpdateMessage->SetLabel(_("Xestia Calendar is up to date.\n\nFor a small yearly cost, prebuilt packages and support is available from Xestia PREMIUM (https://premium.xestia.co.uk).")); } else { - lblUpdateMessage->SetLabel(wxT("An updated version of Xestia Calendar is available from Xestia Gelforn (https://gelforn.xestia.co.uk/).\n\nFor a small yearly cost, prebuilt packages and support is available from Xestia PREMIUM (https://premium.xestia.co.uk).")); + lblUpdateMessage->SetLabel(_("An updated version of Xestia Calendar is available from Xestia Gelforn (https://gelforn.xestia.co.uk/).\n\nFor a small yearly cost, prebuilt packages and support is available from Xestia PREMIUM (https://premium.xestia.co.uk).")); } @@ -145,37 +146,37 @@ void frmUpdate::FetchData() // Display message based on type returned. - if (CurrentVerDouble >= VersionCodeDouble){ + if (currentVersion >= availableVersion){ - wxString UpdateMessage = wxT("Xestia Calendar is up to date.\n\n"); + wxString updateMessage = _("Xestia Calendar is up to date.\n\n"); - if (SupportCode == wxT("U")){ + if (supportCode == wxT("U")){ - UpdateMessage.Append(wxT("An updated version of Xestia Calendar is available from Xestia PREMIUM (https://premium.xestia.co.uk) but will require your operating system to be updated.")); + updateMessage.Append(_("An updated version of Xestia Calendar is available from Xestia PREMIUM (https://premium.xestia.co.uk) but will require your operating system to be updated.")); - } else if (SupportCode == wxT("X")){ + } else if (supportCode == wxT("X")){ - UpdateMessage.Append(wxT("Xestia Calendar is no longer supported on the operating system you are using. Please visit the Xestia PREMIUM website (https://premium.xestia.co.uk) for a list of supported operating systems.")); + updateMessage.Append(_("Xestia Calendar is no longer supported on the operating system you are using. Please visit the Xestia PREMIUM website (https://premium.xestia.co.uk) for a list of supported operating systems.")); } - lblUpdateMessage->SetLabel(UpdateMessage); + lblUpdateMessage->SetLabel(updateMessage); } - if (SupportCode == wxT("S")){ + if (supportCode == wxT("S")){ - lblUpdateMessage->SetLabel(wxT("An updated version of Xestia Calendar for your system is available from Xestia PREMIUM (https://premium.xestia.co.uk)")); + lblUpdateMessage->SetLabel(_("An updated version of Xestia Calendar for your system is available from Xestia PREMIUM (https://premium.xestia.co.uk)")); - } else if (SupportCode == wxT("U")){ + } else if (supportCode == wxT("U")){ - lblUpdateMessage->SetLabel(wxT("An updated version of Xestia Calendar is available from Xestia PREMIUM (https://premium.xestia.co.uk) but will require your operating system to be updated.")); + lblUpdateMessage->SetLabel(_("An updated version of Xestia Calendar is available from Xestia PREMIUM (https://premium.xestia.co.uk) but will require your operating system to be updated.")); - } else if (SupportCode == wxT("X")){ + } else if (supportCode == wxT("X")){ - lblUpdateMessage->SetLabel(wxT("Xestia Calendar is no longer supported on the operating system you are using. Please visit the Xestia PREMIUM website (https://premium.xestia.co.uk) for a list of supported operating systems.")); + lblUpdateMessage->SetLabel(_("Xestia Calendar is no longer supported on the operating system you are using. Please visit the Xestia PREMIUM website (https://premium.xestia.co.uk) for a list of supported operating systems.")); }