tabGeneral->SetSizer( szrGeneral );
tabGeneral->Layout();
szrGeneral->Fit( tabGeneral );
- NbtPreferences->AddPage( tabGeneral, wxT("General"), false );
+ NbtPreferences->AddPage( tabGeneral, wxT("General"), true );
tabTheme = new wxPanel( NbtPreferences, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
tabTheme->Hide();
tabAccounts->SetSizer( szrAccounts );
tabAccounts->Layout();
szrAccounts->Fit( tabAccounts );
- NbtPreferences->AddPage( tabAccounts, wxT("Accounts"), true );
+ NbtPreferences->AddPage( tabAccounts, wxT("Accounts"), false );
+ tabContacts = new wxPanel( NbtPreferences, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
+ wxFlexGridSizer* szrContacts;
+ szrContacts = new wxFlexGridSizer( 1, 2, 0, 0 );
+ szrContacts->AddGrowableCol( 0 );
+ szrContacts->SetFlexibleDirection( wxBOTH );
+ szrContacts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
+
+ chkUseBackgroundColour = new wxCheckBox( tabContacts, wxID_ANY, wxT("Use different background colour"), wxDefaultPosition, wxDefaultSize, 0 );
+ szrContacts->Add( chkUseBackgroundColour, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
+ clpContactBackgroundColour = new wxColourPickerCtrl( tabContacts, wxID_ANY, wxColour( 255, 255, 255 ), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
+ szrContacts->Add( clpContactBackgroundColour, 0, wxALL, 5 );
+
+
+ tabContacts->SetSizer( szrContacts );
+ tabContacts->Layout();
+ szrContacts->Fit( tabContacts );
+ NbtPreferences->AddPage( tabContacts, wxT("Contacts"), false );
szrTabs->Add( NbtPreferences, 1, wxALL|wxEXPAND, 5 );
btnAccountAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::AddABAccount ), NULL, this );
btnAccountModify->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::ModifyABAccount ), NULL, this );
btnAccountDelete->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::DeleteABAccount ), NULL, this );
+ chkUseBackgroundColour->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmPreferencesADT::EnableBackgroundColourPicker ), NULL, this );
btnSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::SavePreferences ), NULL, this );
btnCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::CloseWindow ), NULL, this );
}
btnAccountAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::AddABAccount ), NULL, this );
btnAccountModify->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::ModifyABAccount ), NULL, this );
btnAccountDelete->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::DeleteABAccount ), NULL, this );
+ chkUseBackgroundColour->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( frmPreferencesADT::EnableBackgroundColourPicker ), NULL, this );
btnSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::SavePreferences ), NULL, this );
btnCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmPreferencesADT::CloseWindow ), NULL, this );
#include <wx/scrolwin.h>
#include <wx/notebook.h>
#include <wx/checkbox.h>
+#include <wx/clrpicker.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/combobox.h>
wxButton* btnAccountAdd;
wxButton* btnAccountModify;
wxButton* btnAccountDelete;
+ wxPanel* tabContacts;
+ wxCheckBox* chkUseBackgroundColour;
+ wxColourPickerCtrl* clpContactBackgroundColour;
wxButton* btnSave;
wxButton* btnCancel;
virtual void ModifyABAccount( wxCommandEvent& event ) { event.Skip(); }
virtual void DeleteABAccount( wxCommandEvent& event ) { event.Skip(); }
virtual void ModifyABAccount( wxMouseEvent& event ) { event.Skip(); }
+ virtual void EnableBackgroundColourPicker( wxCommandEvent& event ) { event.Skip(); }
virtual void SavePreferences( wxCommandEvent& event ) { event.Skip(); }
virtual void CloseWindow( wxCommandEvent& event ) { event.Skip(); }
PrefsFile.Open(PrefsFilename, wxT("w"));
#endif
- PrefsFile.Write(wxT("HideLocalAddressBooks=false\nSaveWindowPosition=true\n"));
+ PrefsFile.Write(wxT("HideLocalAddressBooks=false\nSaveWindowPosition=true\nUseBackgroundContactColour=false\n"));
}
#include "../vcard/vcard34conv.h"
void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
- wxString OldSID, std::map<wxString, wxString> *MemoryFSList){
+ wxString OldSID, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour){
// Load the vCard contact data into the wxHTMLWindow given.
// Show message to user that the contact information is loading.
HTMLObj->SetBorders(0);
+ HTMLObj->SetBackgroundColour(wxColour(160,160,160,0));
wxString PageData;
}
+ // TODO: Setup the second table.
+
// Process Birthday
ContactData = vCardObj->GetByPartial(wxT("BDAY"));
}
- PageData.append("<table CELLPADDING=4 style=\"{width: 100%;}\"><tr><td>");
+ if (!backgroundColour.IsEmpty()){
+ PageData.append("<table CELLPADDING=4 style=\"{background-color: ");
+ PageData.append(backgroundColour);
+ PageData.append("; width: 100%;}\"><tr><td>");
+ } else {
+ PageData.append("<table CELLPADDING=4 style=\"{width: 100%;}\"><tr><td>");
+ }
if (DataDisplay == TRUE){
#define GETCONTACTINFO_H
void LoadContactData(vCard *vCardObj, wxHtmlWindow *HTMLObj, wxString SID,
- wxString OldSID, std::map<wxString, wxString> *MemoryFSList);
+ wxString OldSID, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour);
void ProcessIMPPType(wxString *PageData, wxString *IMPPType, bool PreferredContact);
void SplitPropertyData(wxString *PropertyLine, std::map<int,int> *SplitPoints, std::map<int,int> *SplitLength,
int intSize, std::map<wxString,wxString> *SplitData);
if (ValueInc == wxT("true")){
- SaveWindowPos = TRUE;
+ SaveWindowPos = true;
wxRect WindowPosition;
long PosX, PosY, PosH, PosW = 0;
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;
if (SettingName == wxT("SaveWindowPosition")) { return SaveWindowPos; }
else if (SettingName == wxT("HideLocalAddressBooks")) { return HideLocalABs; }
+ else if (SettingName == wxT("UseBackgroundContactColour")) { return UseBackgroundContactColour; }
- return FALSE;
+ return false;
}
}
+wxColour XABPreferences::GetBackgroundContactColourData(){
+
+ return BackgroundContactColour;
+
+}
+
+void XABPreferences::SetBackgroundContactColourData(wxColour ColourData){
+
+ BackgroundContactColour = ColourData;
+
+}
+
// XABPrefAccounts
XABPrefAccounts::XABPrefAccounts(){
private:
// General Tab
- bool SaveWindowPos = FALSE;
+ bool SaveWindowPos = false;
wxRect MainWindowData;
- bool HideLocalABs = FALSE;
+ bool HideLocalABs = false;
// Themes tab
- bool EnableThemes = FALSE;
+ bool EnableThemes = false;
// Accounts tab
+ // Contacts tab
+ bool UseBackgroundContactColour = false;
+ wxColour BackgroundContactColour;
+
// General things.
wxString Filename;
bool SetBoolData(wxString SettingName, bool SettingValue);
wxRect GetMainWindowData();
void SetMainWindowData(wxRect WindowData);
+ wxColour GetBackgroundContactColourData();
+ void SetBackgroundContactColourData(wxColour ColourData);
//int AddAccount(wxString Name);
}
-void frmConflictResolution::LoadData(vCard *LocalData, vCard *ServerData, std::map<wxString, wxString> *MemoryFSList){
+void frmConflictResolution::LoadData(vCard *LocalData, vCard *ServerData, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour){
// Load the local data.
wxString ServerSID = wxString::Format(wxT("%i"), rand() % 32768);
LoadContactData(LocalData, htmClient, ClientSID,
- wxT(""), MemoryFSList);
+ wxT(""), MemoryFSList, backgroundColour);
// Load the server data.
LoadContactData(ServerData, htmServer, ServerSID,
- wxT(""), MemoryFSList);
+ wxT(""), MemoryFSList, backgroundColour);
}
\ No newline at end of file
/** Constructor */
frmConflictResolution( wxWindow* parent );
int GetResult();
- void LoadData(vCard *LocalObj, vCard *ServerObj, std::map<wxString, wxString> *MemoryFSList);
+ void LoadData(vCard *LocalObj, vCard *ServerObj, std::map<wxString, wxString> *MemoryFSList, wxString backgroundColour);
//// end generated class members
};
OldSessionID = SessionID;
SessionID = wxString::Format(wxT("%i"), rand() % 32768);
- LoadContactData(vCardObj, htmContactData, SessionID, OldSessionID, MemoryFSListPtr);
+ LoadContactData(vCardObj, htmContactData, SessionID, OldSessionID, MemoryFSListPtr, backgroundColour);
ArrayvCardOutData FNList;
FNList = vCardObj->GetByPartial(wxT("FN"));
return vCardFilename;
+}
+
+void frmContact::SetBackgroundColour(wxString backgroundColour){
+
+ // Set the background colour.
+
+ this->backgroundColour = backgroundColour;
+
}
\ No newline at end of file
wxString OldSessionID;
int ContactUID;
wxString vCardFilename;
+ wxString backgroundColour;
bool StartupMode;
void CloseWindowProcessing();
void SetupPointers(std::map<wxString,wxString> *MemoryFSListIncPtr);
void SetUID(int UID);
void SetMode(bool StartupModeIn);
+ void SetBackgroundColour(wxString backgroundColour);
wxString GetFilename();
DECLARE_EVENT_TABLE();
//// end generated class members
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);
}
std::map<int,wxMenuItem*> WindowListPointersMenu;
std::map<int,void*> WindowListPointers;
std::map<int,int> WindowListType;
- //std::map<int,int> WindowListType;
wxMenuItem *mnuContactWindows;
wxMenuItem *mnuContactEditorWindows;
wxMenuItem *mnuSearchWindows;
bool RevealWait = FALSE;
wxString SessionID;
wxString OldSessionID;
+ wxColour ContactBackgroundColour;
wxIcon IconEmp;
- //wxIcon Emp;
- //wxComboCtrl* AccControl = new wxGenericComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize);
- //wxComboCtrl* AccControl = new wxComboCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxCB_READONLY|wxEXPAND|wxCC_STD_BUTTON);
- //wxStaticBitmap* AccIcon = new wxStaticBitmap(this, wxID_ANY, IconEmp, wxDefaultPosition, wxSize(16,16), wxALL|wxEXPAND, wxStaticBitmapNameStr);
XABAccountView* treAccounts = new XABAccountView();
wxImageList *AccImgList = new wxImageList(16,16,true);
wxImageList *ActMgrImgList = new wxImageList(16,16,true);
- //wxIcon wxIAccInet;
int AccountID;
int AccountNetID;
int AccountGrpID;
bool SaveWindowPos = preferences->GetBoolData(wxT("SaveWindowPosition"));
bool HideLocalABs = preferences->GetBoolData(wxT("HideLocalAddressBooks"));
+ bool UseBackgroundContactColour = preferences->GetBoolData(wxT("UseBackgroundContactColour"));
- if (SaveWindowPos == TRUE){
+ if (SaveWindowPos == true){
- chkSaveWindowPosition->SetValue(TRUE);
+ chkSaveWindowPosition->SetValue(true);
}
- if (HideLocalABs == TRUE){
+ if (HideLocalABs == true){
- chkHideLocal->SetValue(TRUE);
+ chkHideLocal->SetValue(true);
}
+ if (UseBackgroundContactColour == true){
+
+ chkUseBackgroundColour->SetValue(true);
+ std::cout << preferences->GetBackgroundContactColourData().GetAsString().ToStdString() << std::endl;
+ clpContactBackgroundColour->SetColour(preferences->GetBackgroundContactColourData());
+
+ } else {
+
+ clpContactBackgroundColour->Enable(false);
+
+ }
+
// Setup the Themes tab.
wxListItem themecol0;
*ReloadAccountConfig = TRUE;
}
+
+ if (chkUseBackgroundColour->GetValue() == TRUE){
+
+ cfgfile->Write(wxT("UseBackgroundContactColour"), wxT("true"));
+ cfgfile->Write(wxT("BackgroundContactColour"), clpContactBackgroundColour->GetColour().GetAsString(wxC2S_HTML_SYNTAX));
+ *ReloadAccountConfig = TRUE;
+
+ } else {
+
+ cfgfile->Write(wxT("UseBackgroundContactColour"), wxT("false"));
+ *ReloadAccountConfig = TRUE;
+
+ }
delete cfgfile;
cfgfile = NULL;
}
+void frmPreferences::EnableBackgroundColourPicker(wxCommandEvent &event){
+
+ if (chkUseBackgroundColour->GetValue() == true){
+ clpContactBackgroundColour->Enable(true);
+ } else {
+ clpContactBackgroundColour->Enable(false);
+ }
+
+}
+
void frmPreferences::CloseWindow(wxCommandEvent &event){
// Close the preferences window.
void ModifyABAccount( wxMouseEvent& event );
void SavePreferences( wxCommandEvent &event );
void AddABAccount( wxCommandEvent &event );
+ void EnableBackgroundColourPicker( wxCommandEvent &event );
void CloseWindow( wxCommandEvent &event );
private:
void ReloadAccounts();