wxImage icons_nossl_png(nosslstream, wxBITMAP_TYPE_PNG);
imgNoSSL = new wxBitmap(icons_nossl_png, -1);
-
+
+ // Toolbar icons.
+
+ wxMemoryInputStream addaddressbook(toolbar_addaddressbook_png, sizeof(toolbar_addaddressbook_png));
+ wxMemoryInputStream preferences(toolbar_preferences_png, sizeof(toolbar_preferences_png));
+ wxMemoryInputStream searchcontacts(toolbar_searchcontacts_png, sizeof(toolbar_searchcontacts_png));
+ wxMemoryInputStream addcontact(toolbar_addcontact_png, sizeof(toolbar_addcontact_png));
+ wxMemoryInputStream editcontact(toolbar_editcontact_png, sizeof(toolbar_editcontact_png));
+ wxMemoryInputStream deletecontact(toolbar_deletecontact_png, sizeof(toolbar_deletecontact_png));
+
+ wxImage toolbar_addaddressbook_png(addaddressbook, wxBITMAP_TYPE_PNG);
+ imgAddAddressBook = new wxBitmap (toolbar_addaddressbook_png, -1);
+ tblMain->SetToolNormalBitmap(tbtNewAccount->GetId(), *imgAddAddressBook);
+
+ wxImage toolbar_preferences_png(preferences, wxBITMAP_TYPE_PNG);
+ imgPreferences = new wxBitmap (toolbar_preferences_png, -1);
+ tblMain->SetToolNormalBitmap(tbtPreferences->GetId(), *imgPreferences);
+
+ wxImage toolbar_searchcontacts_png(searchcontacts, wxBITMAP_TYPE_PNG);
+ imgSearchContacts = new wxBitmap (toolbar_searchcontacts_png, -1);
+ tblMain->SetToolNormalBitmap(tbtSearch->GetId(), *imgSearchContacts);
+
+ wxImage toolbar_addcontact_png(addcontact, wxBITMAP_TYPE_PNG);
+ imgAddContact = new wxBitmap (toolbar_addcontact_png, -1);
+ tblMain->SetToolNormalBitmap(tbtAddContact->GetId(), *imgAddContact);
+
+ wxImage toolbar_editcontact_png(editcontact, wxBITMAP_TYPE_PNG);
+ imgEditContact = new wxBitmap (toolbar_editcontact_png, -1);
+ tblMain->SetToolNormalBitmap(tbtEditContact->GetId(), *imgEditContact);
+
+ wxImage toolbar_deletecontact_png(deletecontact, wxBITMAP_TYPE_PNG);
+ imgDeleteContact = new wxBitmap (toolbar_deletecontact_png, -1);
+ tblMain->SetToolNormalBitmap(tbtDeleteContact->GetId(), *imgDeleteContact);
+
// Activity Icon.
wxMemoryInputStream act1(icons_act1_png, sizeof(icons_act1_png));
{
// Function to run when quitting.
-
- //Go through the windows and close each one (be it search
- //or contact editor). Abort if user wants to cancel.
-
- // Close the contact editor windows.
-
- // Close the contact windows.
-
- // Close the search windows.
-
+
// Write out the ETag databases.
+
+ ETagProcTimer.Stop();
+ ETagProcTimer.Notify();
// Save Preferences: Save the window position if that option is enabled.
void frmMain::OpenPreferences( wxCommandEvent& event)
{
+ // Close all windows first.
+
+ if (CloseAllWindows() == false)
+ {
+ return;
+ }
+
// Open the preferences window.
ReloadAccounts = FALSE;
OldSessionID = SessionID;
SessionID = wxString::Format(wxT("%i"), rand() % 32768);
- LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList);
+ LoadContactData(&Person, htmContactData, SessionID, OldSessionID, &MemoryFileList, ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
ActiveFilename = ContactsFileIndex[ContactSeekNum];
}
wxPostEvent(this, addevent);
Contact->SetupPointers(&MemoryFileList);
+ Contact->SetBackgroundColour(ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
Contact->SetupContactData(&Person);
Contact->SetIcon(contacticon);
wxPostEvent(this, addevent);
Contact->SetupPointers(&MemoryFileList);
+ Contact->SetBackgroundColour(ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
Contact->SetupContactData(&Person);
Contact->SetIcon(contacticon);
bool SaveWindowPos = preferences.GetBoolData(wxT("SaveWindowPosition"));
bool HideLocalABs = preferences.GetBoolData(wxT("HideLocalAddressBooks"));
+ bool UseBackgroundContactColour = preferences.GetBoolData(wxT("UseBackgroundContactColour"));
- if (SaveWindowPos == TRUE){
+ if (SaveWindowPos == true){
this->SetSize(preferences.GetMainWindowData());
}
+ if (UseBackgroundContactColour == true){
+
+ ContactBackgroundColour = preferences.GetBackgroundContactColourData();
+
+ }
+
treAccounts->DeleteAllItems();
wxTreeItemId RootNode = treAccounts->AddRoot(wxT("Root Item"), AccountNoneID);
for (int i = 0; i < preferences.accounts.GetCount(); i++){
if ((preferences.accounts.GetAccountType(i) == wxT("Local") ||
- preferences.accounts.GetAccountType(i) == wxT("local")) && HideLocalABs == TRUE){
+ preferences.accounts.GetAccountType(i) == wxT("local")) && HideLocalABs == true){
continue;
vCardConflictObj *vCardConfObj = (vCardConflictObj*)event.GetClientData();
vCard *ClientDataPtr = vCardConfObj->vCardLocalData;
vCard *ServerDataPtr = vCardConfObj->vCardServerData;
- frameCR->LoadData(ClientDataPtr, ServerDataPtr, &MemoryFileList);
+ frameCR->LoadData(ClientDataPtr, ServerDataPtr, &MemoryFileList, ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
frameCR->ShowModal();
int FinalConflictResult = frameCR->GetResult();
vCard UpdatedPerson;
UpdatedPerson.LoadFile(ucd->ContactFilename);
+ frmContactPtr->SetBackgroundColour(ContactBackgroundColour.GetAsString(wxC2S_CSS_SYNTAX));
frmContactPtr->SetupContactData(&UpdatedPerson);
}
SSLColIter = AccountSSLData.find(i);
SSLCertCollectionString SSLCertInfo = SSLColIter->second;
-
+
frmSSLCertificate *frameSSLCert = new frmSSLCertificate ( this );
frameSSLCert->StartCertFrom(0);
frameSSLCert->SetupCertsString(SSLCertInfo);
htmContactData->SetPage(EmptyPage);
AccCtrl->SetValue("");
+}
+
+bool frmMain::CloseAllWindows()
+{
+ // Attempt to close all windows.
+
+ if (WindowListPointersMenu.size() == 0)
+ {
+ return true;
+ }
+
+ if (wxMessageBox(_("Before preforming the action, all windows that are open will need to close. Do you wish to continue?"), _("Close All Windowss"), wxYES_NO) == wxYES)
+ {
+ for(std::map<int, void*>::iterator windowIter = WindowListPointers.begin();
+ windowIter != WindowListPointers.end(); windowIter++)
+ {
+ wxWindow *windowPointer = static_cast<wxWindow*>(windowIter->second);
+ windowPointer->Close();
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
}
\ No newline at end of file