wxMemoryInputStream astream(icons_accinet_png, sizeof(icons_accinet_png));
wxMemoryInputStream bstream(icons_acclocal_png, sizeof(icons_acclocal_png));
wxMemoryInputStream astream(icons_accinet_png, sizeof(icons_accinet_png));
wxMemoryInputStream bstream(icons_acclocal_png, sizeof(icons_acclocal_png));
- btnAccountModify->Enable(TRUE);
- btnAccountDelete->Enable(TRUE);
+
+ // Enable the account buttons.
+
+ btnAccountModify->Enable(TRUE);
+ btnAccountDelete->Enable(TRUE);
+
- btnAccountModify->Enable(FALSE);
- btnAccountDelete->Enable(FALSE);
+
+ // Disable the account buttons.
+
+ btnAccountModify->Enable(FALSE);
+ btnAccountDelete->Enable(FALSE);
+
- // Get the settings for the account, setup the form for
- // editing the account and then display the window
- // with the settings.
+ // Get the settings for the account, setup the form for
+ // editing the account and then display the window
+ // with the settings.
- lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex,
- wxLIST_NEXT_ALL,
- wxLIST_STATE_SELECTED);
+ lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex,
+ wxLIST_NEXT_ALL,
+ wxLIST_STATE_SELECTED);
- frmEditAccount *frameEditAccount = new frmEditAccount ( this );
- frameEditAccount->LoadPointers(cfgfile);
- frameEditAccount->LoadSettings(AccName);
- frameEditAccount->ShowModal();
+ frmEditAccount *frameEditAccount = new frmEditAccount ( this );
+ frameEditAccount->LoadPointers(cfgfile);
+ frameEditAccount->LoadSettings(AccName);
+ frameEditAccount->ShowModal();
- long lstAccountsIndex = -1;
- wxMessageDialog dlgdel(this, wxT("Are you sure you want to delete this account?\r\n\r\nAll data that is stored locally will be removed."), wxT("Delete account"), wxYES_NO | wxICON_EXCLAMATION);
+ long lstAccountsIndex = -1;
+ wxMessageDialog dlgdel(this, wxT("Are you sure you want to delete this account?\r\n\r\nAll data that is stored locally will be removed."), wxT("Delete account"), wxYES_NO | wxICON_EXCLAMATION);
- if (dlgdel.ShowModal() == wxID_YES){
- // Remove the selected item from the accounts list
- // and mark in the accounts list as deleted (Don't write to
- // accounts file).
-
- lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex,
- wxLIST_NEXT_ALL,
- wxLIST_STATE_SELECTED);
-
- bool ContinueAcc = TRUE;
- wxString AccountDir;
- wxString AccountType;
- wxString AccountDirFull;
- wxString AccountDirDelFull;
- wxString AccountName;
- wxString AccName;
- long itemindex = 0;
-
- wxString AccFilename = GetAccountsFile();
+ if (dlgdel.ShowModal() == wxID_YES){
+
+ // Remove the selected item from the accounts list
+ // and mark in the accounts list as deleted (Don't write to
+ // accounts file).
+
+ lstAccountsIndex = lstAccounts->GetNextItem(lstAccountsIndex,
+ wxLIST_NEXT_ALL,
+ wxLIST_STATE_SELECTED);
+
+ bool ContinueAcc = TRUE;
+ wxString AccountDir;
+ wxString AccountType;
+ wxString AccountDirFull;
+ wxString AccountDirDelFull;
+ wxString AccountName;
+ wxString AccName;
+ long itemindex = 0;
+
+ wxString AccFilename = GetAccountsFile();
- cfgfile->Read("accountdir", &AccountDir);
- cfgfile->Read("type", &AccountType);
+ cfgfile->Read("accountdir", &AccountDir);
+ cfgfile->Read("type", &AccountType);
- cfgfile->SetPath(wxT("/"));
- ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex);
-
- }
+ cfgfile->SetPath(wxT("/"));
+ ContinueAcc = cfgfile->GetNextGroup(AccountName, itemindex);
-// Setup the preferences filename string. Default is the
-// *nix systems one (/home/$USER/.xestiaab/preferences)
+ // Setup the preferences filename string. Default is the
+ // *nix systems one (/home/$USER/.xestiaab/preferences)
- bool SaveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition"));
- bool HideLocalABs = preferences->GetBoolData(wxT("HideLocalAddressBooks"));
+ bool SaveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition"));
+ bool HideLocalABs = preferences->GetBoolData(wxT("HideLocalAddressBooks"));
- themecol0.SetId(0);
- themecol0.SetWidth(250);
- themecol0.SetText(_("Theme"));
- lstThemes->InsertColumn(0,themecol0);
+ themecol0.SetId(0);
+ themecol0.SetWidth(250);
+ themecol0.SetText(_("Theme"));
+ lstThemes->InsertColumn(0,themecol0);
- if (FirstLoad == FALSE){
- delete preferences;
- preferences = NULL;
- preferences = new XABPreferences(preffilename);
- } else {
- FirstLoad = FALSE;
- }
+ // Reload the accounts in the accounts list.
+
+ if (FirstLoad == FALSE){
+ delete preferences;
+ preferences = NULL;
+ preferences = new XABPreferences(preffilename);
+ } else {
+ FirstLoad = FALSE;
+ }
- wxListItem accountscol0, accountscol1, accountscol2, accountscol3;
+ wxListItem accountscol0, accountscol1, accountscol2, accountscol3;
- accountscol0.SetId(0);
- accountscol0.SetWidth(24);
- lstAccounts->InsertColumn(0,accountscol0);
- lstAccounts->SetImageList(AccImgList, wxIMAGE_LIST_SMALL);
+ accountscol0.SetId(0);
+ accountscol0.SetWidth(24);
+ lstAccounts->InsertColumn(0,accountscol0);
+ lstAccounts->SetImageList(AccImgList, wxIMAGE_LIST_SMALL);
- accountscol1.SetId(1);
- accountscol1.SetText(_("Name"));
- accountscol1.SetWidth(224);
- lstAccounts->InsertColumn(1,accountscol1);
+ accountscol1.SetId(1);
+ accountscol1.SetText(_("Name"));
+ accountscol1.SetWidth(224);
+ lstAccounts->InsertColumn(1,accountscol1);
- accountscol2.SetId(2);
- accountscol2.SetText(_("Type"));
- accountscol2.SetWidth(96);
- lstAccounts->InsertColumn(2,accountscol2);
-
- /*accountscol1.SetId(1);
- accountscol1.SetText(_(""));
- accountscol1.SetWidth(32);
- lstAccounts->InsertColumn(1,accountscol1);
+ accountscol2.SetId(2);
+ accountscol2.SetText(_("Type"));
+ accountscol2.SetWidth(96);
+ lstAccounts->InsertColumn(2,accountscol2);
- accountscol3.SetId(3);
- accountscol3.SetText(_("Type"));
- accountscol3.SetWidth(96);
- lstAccounts->InsertColumn(3,accountscol3);*/
-
- wxString AccType;
-
- for (int i = 0; i < preferences->accounts.GetCount() ; i++){
+ for (int i = 0; i < preferences->accounts.GetCount() ; i++){
- lstAccounts->SetItem(itemindex, 1, preferences->accounts.GetAccountName(i));
- lstAccounts->SetItem(itemindex, 2, preferences->accounts.GetAccountType(i));
- //lstAccounts->SetItem(itemindex, 3, AccType);
+ lstAccounts->SetItem(itemindex, 1, preferences->accounts.GetAccountName(i));
+ lstAccounts->SetItem(itemindex, 2, preferences->accounts.GetAccountType(i));