From: Steve Brokenshire Date: Mon, 13 Nov 2017 23:35:32 +0000 (+0000) Subject: CalDAV: WIP CalDAV support X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=28f3ef896d323eb07dbc74bfb6e71c364295105a;p=xestiacalendar%2F.git CalDAV: WIP CalDAV support Progressing on creating a new account through frmNewAccount --- diff --git a/source/AppXestiaCalendar.cpp b/source/AppXestiaCalendar.cpp index 66726f5..591afc4 100644 --- a/source/AppXestiaCalendar.cpp +++ b/source/AppXestiaCalendar.cpp @@ -1,23 +1,5 @@ -// AppXesitaCalendar.cpp - Xestia Calendar application form code -// -// (c) 2016-2017 Xestia Software Development. -// -// This file is part of Xestia Calendar. -// -// Xestia Calendar is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by the -// Free Software Foundation, version 3 of the license. -// -// Xestia Calendar is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with Xestia Calendar. If not, see - /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 13 2016) +// C++ code generated with wxFormBuilder (version Dec 21 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -66,6 +48,13 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, menuBar->Append( mnuCreate, wxT("Create") ); + mnuView = new wxMenu(); + wxMenuItem* mnuViewActMgr; + mnuViewActMgr = new wxMenuItem( mnuView, wxID_ANY, wxString( wxT("Activity Manager") ) , wxEmptyString, wxITEM_NORMAL ); + mnuView->Append( mnuViewActMgr ); + + menuBar->Append( mnuView, wxT("View") ); + mnuWindow = new wxMenu(); menuBar->Append( mnuWindow, wxT("Window") ); @@ -105,6 +94,7 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, this->Connect( mnuManageExit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::QuitApp ) ); this->Connect( mnuCreateCalendar->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::CreateNewCalendar ) ); this->Connect( mnuCreateEvent->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::CreateNewEvent ) ); + this->Connect( mnuViewActMgr->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowActivityManager ) ); this->Connect( mnuHelpShow->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowHelp ) ); this->Connect( mnuHelpUpdate->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowUpdateWindow ) ); this->Connect( mnuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowAboutWindow ) ); @@ -119,6 +109,7 @@ frmMainADT::~frmMainADT() this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::QuitApp ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::CreateNewCalendar ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::CreateNewEvent ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowActivityManager ) ); this->Disconnect( wxID_HELP, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowHelp ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowUpdateWindow ) ); this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::ShowAboutWindow ) ); @@ -489,7 +480,7 @@ frmNewAccountADT::frmNewAccountADT( wxWindow* parent, wxWindowID id, const wxStr lblType->Wrap( -1 ); fgSizer33->Add( lblType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - wxString cmbServerTypeChoices[] = { wxT("Local") }; + wxString cmbServerTypeChoices[] = { wxT("Local"), wxT("CalDAV") }; int cmbServerTypeNChoices = sizeof( cmbServerTypeChoices ) / sizeof( wxString ); cmbServerType = new wxChoice( tabType, wxID_ANY, wxDefaultPosition, wxDefaultSize, cmbServerTypeNChoices, cmbServerTypeChoices, 0 ); cmbServerType->SetSelection( 0 ); @@ -667,10 +658,10 @@ frmNewAccountADT::frmNewAccountADT( wxWindow* parent, wxWindowID id, const wxStr wxBoxSizer* bSizer322; bSizer322 = new wxBoxSizer( wxHORIZONTAL ); - btnPrevious = new wxButton( this, wxID_ANY, wxT("< Previous"), wxDefaultPosition, wxDefaultSize, 0 ); + btnPrevious = new wxButton( this, wxID_PREV, wxT("< Previous"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer322->Add( btnPrevious, 0, wxALL, 5 ); - btnNext = new wxButton( this, wxID_ANY, wxT("Next >"), wxDefaultPosition, wxDefaultSize, 0 ); + btnNext = new wxButton( this, wxID_NEXT, wxT("Next >"), wxDefaultPosition, wxDefaultSize, 0 ); btnNext->SetDefault(); bSizer322->Add( btnNext, 0, wxALL, 5 ); @@ -689,8 +680,8 @@ frmNewAccountADT::frmNewAccountADT( wxWindow* parent, wxWindowID id, const wxStr // Connect Events cmbServerType->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( frmNewAccountADT::UpdateRequirements ), NULL, this ); txtAccountName->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( frmNewAccountADT::CheckAccountName ), NULL, this ); - btnPrevious->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::ProcessPrevious ), NULL, this ); - btnNext->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::ProcessNext ), NULL, this ); + btnPrevious->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::Navigate ), NULL, this ); + btnNext->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::Navigate ), NULL, this ); btnClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::CloseWindow ), NULL, this ); } @@ -699,8 +690,8 @@ frmNewAccountADT::~frmNewAccountADT() // Disconnect Events cmbServerType->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( frmNewAccountADT::UpdateRequirements ), NULL, this ); txtAccountName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( frmNewAccountADT::CheckAccountName ), NULL, this ); - btnPrevious->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::ProcessPrevious ), NULL, this ); - btnNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::ProcessNext ), NULL, this ); + btnPrevious->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::Navigate ), NULL, this ); + btnNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::Navigate ), NULL, this ); btnClose->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( frmNewAccountADT::CloseWindow ), NULL, this ); } diff --git a/source/AppXestiaCalendar.h b/source/AppXestiaCalendar.h index 300a686..a4b3007 100644 --- a/source/AppXestiaCalendar.h +++ b/source/AppXestiaCalendar.h @@ -1,23 +1,5 @@ -// AppXesitaCalendar.h - Xestia Calendar application form code header -// -// (c) 2016-2017 Xestia Software Development. -// -// This file is part of Xestia Calendar. -// -// Xestia Calendar is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by the -// Free Software Foundation, version 3 of the license. -// -// Xestia Calendar is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with Xestia Calendar. If not, see - /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 13 2016) +// C++ code generated with wxFormBuilder (version Dec 21 2016) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -62,6 +44,8 @@ /////////////////////////////////////////////////////////////////////////// +#define wxID_PREV 1000 +#define wxID_NEXT 1001 /////////////////////////////////////////////////////////////////////////////// /// Class frmMainADT @@ -75,6 +59,7 @@ class frmMainADT : public wxFrame wxMenuBar* menuBar; wxMenu* mnuManage; wxMenu* mnuCreate; + wxMenu* mnuView; wxMenu* mnuWindow; wxMenu* mnuHelp; wxBoxSizer* szrMain; @@ -86,6 +71,7 @@ class frmMainADT : public wxFrame virtual void QuitApp( wxCommandEvent& event ) { event.Skip(); } virtual void CreateNewCalendar( wxCommandEvent& event ) { event.Skip(); } virtual void CreateNewEvent( wxCommandEvent& event ) { event.Skip(); } + virtual void ShowActivityManager( wxCommandEvent& event ) { event.Skip(); } virtual void ShowHelp( wxCommandEvent& event ) { event.Skip(); } virtual void ShowUpdateWindow( wxCommandEvent& event ) { event.Skip(); } virtual void ShowAboutWindow( wxCommandEvent& event ) { event.Skip(); } @@ -256,8 +242,7 @@ class frmNewAccountADT : public wxDialog // Virtual event handlers, overide them in your derived class virtual void UpdateRequirements( wxCommandEvent& event ) { event.Skip(); } virtual void CheckAccountName( wxCommandEvent& event ) { event.Skip(); } - virtual void ProcessPrevious( wxCommandEvent& event ) { event.Skip(); } - virtual void ProcessNext( wxCommandEvent& event ) { event.Skip(); } + virtual void Navigate( wxCommandEvent& event ) { event.Skip(); } virtual void CloseWindow( wxCommandEvent& event ) { event.Skip(); } diff --git a/source/Makefile.in b/source/Makefile.in index a154fc6..f05c050 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -19,7 +19,8 @@ BMCOOBJS=tools/bitmapcode.o COMMONOBJS=common/monthviewgen.o common/file.o common/text.o \ common/uuid.o common/preferences.o common/dirs.o common/defaults.o \ common/random.o common/svrblist.o -FORM_MAINOBJS=forms/main/frmMain.o forms/main/frmMain-Window.o +FORM_MAINOBJS=forms/main/frmMain.o forms/main/frmMain-Window.o \ + forms/main/frmMain-Setup.o FORM_UPDATEOBJS=forms/update/frmUpdate.o FORM_EDITACCOUNTOBJS=forms/editaccount/frmEditAccount.o FORM_NEWACCOUNTOBJS=forms/newaccount/frmNewAccount.o @@ -27,6 +28,7 @@ FORM_CALENDAREDITOROBJS=forms/calendareditor/frmCalendarEditor.o FORM_EVENTEDITOROBJS=forms/eventeditor/frmEventEditor.o FORM_PREFERENCESOBJS=forms/preferences/frmPreferences.o FORM_ABOUTOBJS=forms/about/frmAbout.o +FORM_ACTMGROBJS=forms/actmgr/frmActivityMgr.o WIDGETSOBJS=widgets/XCCalendarCtrl.o widgets/XCCalendarDay.o \ widgets/XCCalendarDayEntry.o widgets/XCCalendarMonthView.o \ widgets/XCCalendarMonthViewDayTitle.o \ @@ -43,6 +45,7 @@ CALENDAROBJS=objects/calendarobject/CalendarObject-Save.o \ CALENDAREVENTOBJS=objects/calendarevent/CalendarEvent-Save.o \ objects/calendarevent/CalendarEvent.o CDSOBJS=libraries/CalendarDataStorage/CalendarDataStorage.o +CALDAVOBJS=objects/CalDAV/CalDAV.o objects/CalDAV/CalDAV-XMLProcessing.o default: $(MAKE) bitmaphelper @@ -51,15 +54,16 @@ default: forms: form_mainobjs form_editaccountobjs form_newaccountobjs \ form_preferencesobjs form_aboutobjs form_updateobjs \ - form_calendareditorobjs form_eventeditorobjs + form_calendareditorobjs form_eventeditorobjs form_actmgrobjs -xestiacal: mainobjs forms widgetsobjs commonobjs calendarlistobjs calendarobjs calendareventobjs +xestiacal: mainobjs forms widgetsobjs commonobjs calendarlistobjs \ + calendarobjs calendareventobjs caldavobjs $(CPP) -Os $(MAINOBJS) $(FORM_MAINOBJS) $(FORM_PREFERENCESOBJS) \ $(FORM_ABOUTOBJS) $(FORM_UPDATEOBJS) $(FORM_EDITACCOUNTOBJS) \ $(FORM_NEWACCOUNTOBJS) $(FORM_CALENDAREDITOROBJS) \ - $(FORM_EVENTEDITOROBJS) \ + $(FORM_EVENTEDITOROBJS) $(FORM_ACTMGROBJS) \ $(WIDGETSOBJS) $(COMMONOBJS) $(CALENDARLISTOBJS) $(CALENDAROBJS) \ - $(CALENDAREVENTOBJS) \ + $(CALENDAREVENTOBJS) $(CALDAVOBJS) \ -o $(XCAL_OUT) $(CPPLIBS) bitmaphelperobjs: $(BMCOOBJS) @@ -91,6 +95,8 @@ form_preferencesobjs: $(FORM_PREFERENCESOBJS) form_aboutobjs: $(FORM_ABOUTOBJS) +form_actmgrobjs: $(FORM_ACTMGROBJS) + widgetsobjs: $(WIDGETSOBJS) commonobjs: $(COMMONOBJS) @@ -101,6 +107,8 @@ calendarobjs: $(CALENDAROBJS) calendareventobjs: $(CALENDAREVENTOBJS) +caldavobjs: $(CALDAVOBJS) + calendardatastorage: g++ -c -ggdb --std=c++11 libraries/CalendarDataStorage/CalendarDataStorage.cpp -o libraries/CalendarDataStorage/CalendarDataStorage.o -lsqlite3 ar rcs libraries/libCalendarDataStorage.a libraries/CalendarDataStorage/CalendarDataStorage.o diff --git a/source/forms/actmgr/frmActivityMgr.cpp b/source/forms/actmgr/frmActivityMgr.cpp index 0773ea4..810ef50 100644 --- a/source/forms/actmgr/frmActivityMgr.cpp +++ b/source/forms/actmgr/frmActivityMgr.cpp @@ -23,11 +23,57 @@ frmActivityMgr::frmActivityMgr( wxWindow* parent ) frmActivityMgrADT( parent ) { + /*wxMemoryInputStream istream(icons_activitywindow_png, sizeof(icons_activitywindow_png)); + wxImage icons_activitywindow_pngi(istream, wxBITMAP_TYPE_PNG); + wxBitmap activityiconbmp(icons_activitywindow_pngi, -1); + wxIcon activityicon; + activityicon.CopyFromBitmap(activityiconbmp); + this->SetIcon(activityicon); + + wxMemoryInputStream istream2(misc_activitysleep_png, sizeof(misc_activitysleep_png)); + wxImage misc_activitysleep_pngi(istream2, wxBITMAP_TYPE_PNG); + wxBitmap sleepiconbmp(misc_activitysleep_pngi, -1); + SleepBitmap = sleepiconbmp; + bmpActivity->SetBitmap(SleepBitmap); + ActProcessTimer.SetupPointers(this); + lblDetails->SetLabel(_("No activity.")); + + ActListProcTimer.SetupPointers(&ActivityList, &ActivityListIndex, &ActivityListTaskDetail, + &TasksActive, lstActivity, lblDetails, GauProgress, this, &AnimationTimer, + &ActProcessTimer, &ActivityListFinDate, &ActivityListConnObject); + + AnimationTimer.SetBitmap(bmpActivity); + AnimationTimer.SetSleepBitmap(&SleepBitmap); + AnimationTimer.SetupPointer(this->GetParent()); + + wxListItem ColumnData; + ColumnData.SetId(0); + ColumnData.SetText(_("Activity")); + ColumnData.SetWidth(175); + lstActivity->InsertColumn(0, ColumnData); + + wxListItem ColumnData2; + ColumnData2.SetId(1); + ColumnData2.SetText(_("Account")); + ColumnData2.SetWidth(100); + lstActivity->InsertColumn(1, ColumnData2); + + wxListItem ColumnData3; + ColumnData3.SetId(2); + ColumnData3.SetText(_("Status")); + ColumnData3.SetWidth(100); + lstActivity->InsertColumn(2, ColumnData3);*/ + +} + +void frmActivityMgr::CloseWindow( wxCommandEvent& event ) +{ + this->Hide(); } void frmActivityMgr::CloseWindow( wxCloseEvent& event ) { -// TODO: Implement CloseWindow + this->Hide(); } void frmActivityMgr::StopTask( wxCommandEvent& event ) diff --git a/source/forms/actmgr/frmActivityMgr.h b/source/forms/actmgr/frmActivityMgr.h index c049c17..91af1a9 100644 --- a/source/forms/actmgr/frmActivityMgr.h +++ b/source/forms/actmgr/frmActivityMgr.h @@ -24,16 +24,54 @@ Subclass of frmActivityMgrADT, which is generated by wxFormBuilder. */ +#include +#include + +#include +#include +#include + +#include "svrblist.h" +#include "../bitmaps.h" #include "../../AppXestiaCalendar.h" //// end generated include +struct ActivityMgrAccountSettings{ + wxString Address; + int Port; + wxString Username; + wxString Password; + bool SSL; + wxString Prefix; + wxString Dir; +}; + /** Implementing frmActivityMgrADT */ class frmActivityMgr : public frmActivityMgrADT { + private: + /*wxBitmap SleepBitmap; + std::map ActivityList; + std::map ActivityListType; + std::map ActivityListIndex; + std::map ActivityListData; + std::map ActivityListURL; + std::map ActivityListEditMode; + std::map ActivityListTaskDetail; + std::map ActivityListAccount; + std::map ActivityListFilename; + std::map ActivityListFullFilename; + //std::map ActivityListConnObject; + std::map ActivityListAccSettings; + std::map ActivityListETag; + std::map ActivityListETagOriginal; + std::map ActivityListFinDate; + std::map ActivityListLog;*/ protected: // Handlers for frmActivityMgrADT events. void CloseWindow( wxCloseEvent& event ); + void CloseWindow( wxCommandEvent& event ); void StopTask( wxCommandEvent& event ); void StopAllTasks( wxCommandEvent& event ); void RetryTask( wxCommandEvent& event ); diff --git a/source/forms/main/frmMain-Setup.cpp b/source/forms/main/frmMain-Setup.cpp new file mode 100644 index 0000000..d9d31cf --- /dev/null +++ b/source/forms/main/frmMain-Setup.cpp @@ -0,0 +1,118 @@ +// frmMain.h - frmMain setup functions +// +// (c) 2016-2017 Xestia Software Development. +// +// This file is part of Xestia Calendar. +// +// Xestia Calendar is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by the +// Free Software Foundation, version 3 of the license. +// +// Xestia Calendar is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with Xestia Calendar. If not, see + +#include "frmMain.h" + +void frmMain::SetupFormIcons() +{ + // SSL icons. + + wxMemoryInputStream sslstream(icons_ssl_png, sizeof(icons_ssl_png)); + wxMemoryInputStream sslwarningstream(icons_sslwarning_png, sizeof(icons_sslwarning_png)); + wxMemoryInputStream nosslstream(icons_nossl_png, sizeof(icons_nossl_png)); + + wxImage icons_ssl_png(sslstream, wxBITMAP_TYPE_PNG); + imgSSL = new wxBitmap(icons_ssl_png, -1); + + wxImage icons_sslwarning_png(sslwarningstream, wxBITMAP_TYPE_PNG); + imgSSLWarning = new wxBitmap(icons_sslwarning_png, -1); + + wxImage icons_nossl_png(nosslstream, wxBITMAP_TYPE_PNG); + imgNoSSL = new wxBitmap(icons_nossl_png, -1); + + // Activity Icon. + + wxMemoryInputStream act1(icons_act1_png, sizeof(icons_act1_png)); + wxMemoryInputStream act2(icons_act2_png, sizeof(icons_act2_png)); + wxMemoryInputStream act3(icons_act3_png, sizeof(icons_act3_png)); + wxMemoryInputStream act4(icons_act4_png, sizeof(icons_act4_png)); + wxMemoryInputStream actsleep(icons_actsleep_png, sizeof(icons_actsleep_png)); + + wxImage icons_actsleep_png(actsleep, wxBITMAP_TYPE_PNG); + imgActIconSleep = new wxBitmap (icons_actsleep_png, -1); + + wxImage icons_act1_png(act1, wxBITMAP_TYPE_PNG); + imgActIcon1 = new wxBitmap (icons_act1_png, -1); + wxIcon wxIAct1icon; + wxIAct1icon.CopyFromBitmap(*imgActIcon1); + + wxImage icons_act2_png(act2, wxBITMAP_TYPE_PNG); + imgActIcon2 = new wxBitmap (icons_act2_png, -1); + wxIcon wxIAct2icon; + wxIAct2icon.CopyFromBitmap(*imgActIcon2); + + wxImage icons_act3_png(act3, wxBITMAP_TYPE_PNG); + imgActIcon3 = new wxBitmap (icons_act3_png, -1); + wxIcon wxIAct3icon; + wxIAct3icon.CopyFromBitmap(*imgActIcon3); + + wxImage icons_act4_png(act4, wxBITMAP_TYPE_PNG); + imgActIcon4 = new wxBitmap (icons_act4_png, -1); + wxIcon wxIAct4icon; + wxIAct4icon.CopyFromBitmap(*imgActIcon4); + + // Online/Offline icons. + + wxMemoryInputStream onlinestream(icons_online_png, sizeof(icons_online_png)); + wxMemoryInputStream offlinestream(icons_offline_png, sizeof(icons_offline_png)); + + wxImage icons_online_png(onlinestream, wxBITMAP_TYPE_PNG); + imgOnline = new wxBitmap(icons_online_png, -1); + + wxImage icons_offline_png(offlinestream, wxBITMAP_TYPE_PNG); + imgOffline = new wxBitmap(icons_offline_png, -1); +} + +void frmMain::SetupStatusBar() +{ +#if defined(__HAIKU__) + +#elif defined(__WIN32__) + + int stbBottomData [3] = { -1, 8, 8 }; + +#else + + int stbBottomData [3] = { -1, 20, 20 }; + +#endif + + stbBottom->SetFieldsCount(3, stbBottomData); + stbBottom->SetMinHeight(16); + + wxRect rectOnline; + wxRect rectSSL; + wxRect rectActivity; + stbBottom->GetFieldRect(1, rectOnline); + stbBottom->GetFieldRect(2, rectActivity); + + sslToolTip = new wxToolTip(wxT("")); + + imgConnStatus = new wxStaticBitmap(stbBottom, wxID_ANY, wxNullBitmap, wxPoint((rectOnline.GetX()),(rectOnline.GetY())), wxDefaultSize, 0 ); + imgConnStatus->SetBitmap(*imgOnline); + // TODO: imgConnStatus->Connect( wxEVT_LEFT_DCLICK, wxCommandEventHandler( frmMain::ToggleConnectionStatus ), NULL, this ); + + imgActivityStatus = new wxStaticBitmap(stbBottom, wxID_ANY, wxNullBitmap, wxPoint((rectActivity.GetX()),(rectActivity.GetY())), wxDefaultSize, 0); + imgActivityStatus->SetBitmap(*imgActIconSleep); + // TODO: imgActivityStatus->Connect( wxEVT_LEFT_DCLICK, wxCommandEventHandler( frmMain::ShowActivityWindow ), NULL, this ); +} + +void frmMain::SetupPointers(frmActivityMgr *activityManager) +{ + this->activityManager = activityManager; +} diff --git a/source/forms/main/frmMain-Window.cpp b/source/forms/main/frmMain-Window.cpp index ab1c7cb..73f96dd 100644 --- a/source/forms/main/frmMain-Window.cpp +++ b/source/forms/main/frmMain-Window.cpp @@ -18,7 +18,8 @@ #include "frmMain.h" -void frmMain::WindowAdd( wxCommandEvent &event ){ +void frmMain::WindowAdd( wxCommandEvent &event ) +{ // Add a window to the window list. @@ -35,16 +36,17 @@ void frmMain::WindowAdd( wxCommandEvent &event ){ wxString windowTitle = frmEventEditorPtr->GetTitle(); mnuNewItem->SetItemLabel(windowTitle); - WindowListPointersMenu.insert(std::make_pair(receivedWindowData->WindowID, mnuNewItem)); - WindowListPointers.insert(std::make_pair(receivedWindowData->WindowID, receivedWindowData->WindowPointer)); - WindowListType.insert(std::make_pair(receivedWindowData->WindowID, 0)); + windowListPointersMenu.insert(std::make_pair(receivedWindowData->WindowID, mnuNewItem)); + windowListPointers.insert(std::make_pair(receivedWindowData->WindowID, receivedWindowData->WindowPointer)); + windowListType.insert(std::make_pair(receivedWindowData->WindowID, 0)); delete receivedWindowData; receivedWindowData = NULL; } -void frmMain::WindowUpdate( wxCommandEvent &event ){ +void frmMain::WindowUpdate( wxCommandEvent &event ) +{ // Add a window to the window list. @@ -56,7 +58,7 @@ void frmMain::WindowUpdate( wxCommandEvent &event ){ wxString windowTitle = frmEventEditorPtr->GetTitle(); - std::map::iterator MenuIter = WindowListPointersMenu.find(receivedWindowData->WindowID); + std::map::iterator MenuIter = windowListPointersMenu.find(receivedWindowData->WindowID); MenuIter->second->SetItemLabel(windowTitle); @@ -65,7 +67,8 @@ void frmMain::WindowUpdate( wxCommandEvent &event ){ } -void frmMain::WindowDelete( wxCommandEvent &event ){ +void frmMain::WindowDelete( wxCommandEvent &event ) +{ // Delete the window from the window list. @@ -73,24 +76,25 @@ void frmMain::WindowDelete( wxCommandEvent &event ){ size_t pos; - std::map::iterator menuIter = WindowListPointersMenu.find(receivedWindowData->WindowID); + std::map::iterator menuIter = windowListPointersMenu.find(receivedWindowData->WindowID); mnuWindow->Destroy(menuIter->second); - WindowListPointersMenu.erase(receivedWindowData->WindowID); - WindowListPointers.erase(receivedWindowData->WindowID); - WindowListType.erase(receivedWindowData->WindowID); + windowListPointersMenu.erase(receivedWindowData->WindowID); + windowListPointers.erase(receivedWindowData->WindowID); + windowListType.erase(receivedWindowData->WindowID); delete receivedWindowData; receivedWindowData = NULL; } -void frmMain::ShowEventWindow( wxCommandEvent &event ){ +void frmMain::ShowEventWindow( wxCommandEvent &event ) +{ // Show a contact window from the window list. - std::map::iterator WindowIter = WindowListPointers.find(event.GetId()); + std::map::iterator WindowIter = windowListPointers.find(event.GetId()); frmEventEditor *frmEventEditorPtr = static_cast(WindowIter->second); @@ -103,15 +107,15 @@ bool frmMain::CloseAllWindows() { // Attempt to close all windows. - if (WindowListPointersMenu.size() == 0) + 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::iterator windowIter = WindowListPointers.begin(); - windowIter != WindowListPointers.end(); windowIter++) + for(std::map::iterator windowIter = windowListPointers.begin(); + windowIter != windowListPointers.end(); windowIter++) { wxWindow *windowPointer = static_cast(windowIter->second); windowPointer->Close(); @@ -122,4 +126,4 @@ bool frmMain::CloseAllWindows() { return false; } -} \ No newline at end of file +} diff --git a/source/forms/main/frmMain.cpp b/source/forms/main/frmMain.cpp index 9c420ff..42ad5e8 100644 --- a/source/forms/main/frmMain.cpp +++ b/source/forms/main/frmMain.cpp @@ -82,6 +82,11 @@ frmMainADT( parent ) LoadAccountData(); + // Setup the form icons. + + SetupFormIcons(); + SetupStatusBar(); + // Setup the form control. mainCalendarCtrl = new XCCalendarCtrl(this, &calendarData); @@ -191,7 +196,8 @@ void frmMain::QuitApp() } -void frmMain::LoadAccountData(){ +void frmMain::LoadAccountData() +{ // Get the list of accounts and put into the calendar data storage. @@ -502,7 +508,8 @@ void frmMain::DeleteCalendar( wxCommandEvent& event ) } -void frmMain::CreateNewEvent( wxCommandEvent& event ){ +void frmMain::CreateNewEvent( wxCommandEvent& event ) +{ frmEventEditor *frameNewEvent = new frmEventEditor ( this ); frameNewEvent->SetupForm(&calendarData, preferences); @@ -525,7 +532,8 @@ void frmMain::CreateNewEvent( wxCommandEvent& event ){ } -void frmMain::EditEvent( wxCommandEvent& event ){ +void frmMain::EditEvent( wxCommandEvent& event ) +{ frmEventEditor *frameEditEvent = new frmEventEditor ( this ); frameEditEvent->SetEventID(event.GetInt()); @@ -552,7 +560,8 @@ void frmMain::EditEvent( wxCommandEvent& event ){ } -void frmMain::DeleteEvent( wxCommandEvent& event ){ +void frmMain::DeleteEvent( wxCommandEvent& event ) +{ EventProperties *eventInfo = (EventProperties*)event.GetClientData(); @@ -705,4 +714,11 @@ void frmMain::ShowHelp( wxCommandEvent& event ) wxMessageBox(_("The help documentation will be implemented in a future version of Xestia Calendar."), _("Unimplemented")); -} \ No newline at end of file +} + +void frmMain::ShowActivityManager( wxCommandEvent &event ) +{ + + activityManager->Show(); + +} diff --git a/source/forms/main/frmMain.h b/source/forms/main/frmMain.h index 188fad9..52202e7 100644 --- a/source/forms/main/frmMain.h +++ b/source/forms/main/frmMain.h @@ -27,6 +27,7 @@ Subclass of frmMainADT, which is generated by wxFormBuilder. #include #include #include +#include #include "../../AppXestiaCalendar.h" @@ -36,6 +37,7 @@ Subclass of frmMainADT, which is generated by wxFormBuilder. #include "../newaccount/frmNewAccount.h" #include "../calendareditor/frmCalendarEditor.h" #include "../eventeditor/frmEventEditor.h" +#include "../actmgr/frmActivityMgr.h" #include "../../widgets/XCCalendarCtrl.h" #include "../../libraries/CalendarDataStorage/CalendarDataStorage.h" @@ -59,11 +61,27 @@ class frmMain : public frmMainADT CalendarDataStorage calendarData; ColourUpdateProperties updateColourData; bool reloadAccounts = false; - std::map WindowListPointersMenu; - std::map WindowListPointers; - std::map WindowListType; + std::map windowListPointersMenu; + std::map windowListPointers; + std::map windowListType; int WindowMenuItemID = 0; - + wxBitmap *imgActIcon1 = nullptr; + wxBitmap *imgActIcon2 = nullptr; + wxBitmap *imgActIcon3 = nullptr; + wxBitmap *imgActIcon4 = nullptr; + wxBitmap *imgActIconSleep = nullptr; + wxBitmap *imgSSL = nullptr; + wxBitmap *imgNoSSL = nullptr; + wxBitmap *imgSSLWarning = nullptr; + wxBitmap *imgOnline = nullptr; + wxBitmap *imgOffline = nullptr; + wxStaticBitmap *imgConnStatus = nullptr; + wxStaticBitmap *imgActivityStatus = nullptr; + wxToolTip *sslToolTip = nullptr; + frmActivityMgr *activityManager = nullptr; + + void SetupFormIcons(); + void SetupStatusBar(); protected: void QuitApp( wxCloseEvent& event ); void QuitApp( wxCommandEvent& event ); @@ -80,6 +98,7 @@ class frmMain : public frmMainADT void ShowUpdateWindow( wxCommandEvent& event ); void ShowAboutWindow( wxCommandEvent& event ); void OpenNewAccountDialog( wxCommandEvent& event ); + void ShowActivityManager( wxCommandEvent& event ); void ProcessCalendar( wxCommandEvent& event ); void LoadAccountData(); void CloseWindow( wxCommandEvent& event ); @@ -94,6 +113,7 @@ class frmMain : public frmMainADT public: /** Constructor */ frmMain( wxWindow* parent ); + void SetupPointers(frmActivityMgr *activityManager); //// end generated class members }; diff --git a/source/forms/newaccount/frmNewAccount.cpp b/source/forms/newaccount/frmNewAccount.cpp index 5b94c5e..ec9aa1b 100644 --- a/source/forms/newaccount/frmNewAccount.cpp +++ b/source/forms/newaccount/frmNewAccount.cpp @@ -18,6 +18,14 @@ #include "frmNewAccount.h" +DEFINE_EVENT_TYPE(UPDATERESULTS); +DEFINE_EVENT_TYPE(RUNCALDAVTEST); + +BEGIN_EVENT_TABLE(frmNewAccount, wxDialog) +EVT_COMMAND(wxID_ANY, UPDATERESULTS, frmNewAccount::UpdateResults) +EVT_COMMAND(wxID_ANY, RUNCALDAVTEST, frmNewAccount::RunCalDAVTest) +END_EVENT_TABLE() + frmNewAccount::frmNewAccount( wxWindow* parent ) : frmNewAccountADT( parent ) @@ -36,28 +44,110 @@ frmNewAccountADT( parent ) void frmNewAccount::UpdateRequirements( wxCommandEvent& event ) { -// TODO: Implement UpdateRequirements -} - -void frmNewAccount::ProcessPrevious( wxCommandEvent& event ) -{ -// TODO: Implement ProcessPrevious + // Update the options. + + if (cmbServerType->GetCurrentSelection() == 1){ + + txtServerAddress->Enable(); + txtServerPort->Enable(); + txtUsername->Enable(); + txtPassword->Enable(); + chkUseSSL->Enable(); + + } else if (cmbServerType->GetCurrentSelection() == 0){ + + txtServerAddress->Disable(); + txtServerPort->Disable(); + txtUsername->Disable(); + txtPassword->Disable(); + chkUseSSL->Disable(); + + } } -void frmNewAccount::ProcessNext( wxCommandEvent& event ) +void frmNewAccount::Navigate( wxCommandEvent& event ) { - pageSeek++; - - if (pageSeek == 1){ + if (event.GetId() == wxID_NEXT) pageSeek++; - } + else + pageSeek--; if (pageSeek == 1){ // Skip this page. + + btnPrevious->Disable(); + btnNext->Enable(); + + tabConn->Hide(); + tabFinish->Hide(); + tabType->Show(); + btnNext->SetLabel(_("Next >")); } else if (pageSeek == 2){ + + if (cmbServerType->GetCurrentSelection() == 0){ + + tabType->Hide(); + tabConn->Hide(); + tabFinish->Show(); + szrNewAccount->RecalcSizes(); + pageSeek = 2; + + btnNext->Disable(); + btnPrevious->Enable(); + btnNext->SetLabel(_("Finish")); + return; + + } + + // Check if server address matches against the blacklist. + // Bring up warning message if it does. + + if (CheckBlacklist(txtServerAddress->GetValue())){ + + int MessageBoxResult = wxMessageBox(_("The server with the address given does not support the CalDAV 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){ + pageSeek--; + return; + } + + } + + btnNext->Disable(); + + bool ServerResult = FALSE; + bool ServerAction = FALSE; + bool UseSSL = TRUE; + wxString ServerMessage; + + // Connection test screen. + + tabType->Hide(); + tabConn->Show(); + tabFinish->Hide(); + szrNewAccount->RecalcSizes(); + btnPrevious->Disable(); + + // Reset screen. + + lblServerConnResult->SetLabel(wxT("")); + lblServerResponse->SetLabel(wxT("")); + lblServerSSLResult->SetLabel(wxT("")); + lblServerSSLValid->SetLabel(wxT("")); + lblAbleToLoginResult->SetLabel(wxT("")); + lblCalDAVSupportResult->SetLabel(wxT("")); + + // Depending on account type, run the test. + + if (cmbServerType->GetCurrentSelection() == 1){ + wxCommandEvent RunTest(RUNCALDAVTEST); + wxPostEvent(this, RunTest); + } + + } else if (pageSeek == 3){ // Finish screen. @@ -67,6 +157,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) szrNewAccount->RecalcSizes(); btnNext->Disable(); + btnPrevious->Enable(); btnNext->SetLabel(_("Finish")); if (txtAccountName->IsEmpty() && pageSeek == 2){ @@ -79,7 +170,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - } else if (pageSeek == 3){ + } else if (pageSeek == 4){ // Finished. @@ -130,7 +221,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - if (cmbServerType->GetCurrentSelection() == 0){ + if (cmbServerType->GetCurrentSelection() == 1){ // Create the account directory. @@ -193,7 +284,7 @@ void frmNewAccount::ProcessNext( wxCommandEvent& event ) } - if (cmbServerType->GetCurrentSelection() == 0){ + if (cmbServerType->GetCurrentSelection() == 1){ // Create the account directory. @@ -293,4 +384,207 @@ void frmNewAccount::WriteAccountDetails(wxFileConfig *cfgFileIn, wxString accoun cfgFileIn->Write(wxT("refresh"), wxT("1800")); cfgFileIn->Write(wxT("type"), accountType); +} + +void frmNewAccount::UpdateResults( wxCommandEvent &event ) +{ + +} + +void frmNewAccount::RunCalDAVTest( wxCommandEvent &event ) +{ + NewAccountResult *resultData = new NewAccountResult; + + lblServerConnResult->SetLabel(_("Testing...")); + lblCalDAVSupportResult->SetLabel(wxT("")); + lblServerResponse->SetLabel(wxT("")); + lblServerSSLResult->SetLabel(wxT("")); + lblServerSSLValid->SetLabel(wxT("")); + lblAbleToLoginResult->SetLabel(wxT("")); + bool usingSSLBypass = false; + + // Setup a CalDAV connection object for testing. + + CalDAVConnectionData connData; + connData.hostname = txtServerAddress->GetValue().ToStdString(); + connData.port = wxAtoi(txtServerPort->GetValue()); + connData.username = txtUsername->GetValue().ToStdString(); + connData.password = txtPassword->GetValue().ToStdString(); + connData.useSSL = chkUseSSL->GetValue() ? true : false); + + CalDAV testConnection; + testConnection.SetupConnectionData(&connData); + + /*CardDAV2 TestConnection(txtServerAddress->GetValue().ToStdString(), + wxAtoi(txtServerPort->GetValue()), + txtUsername->GetValue().ToStdString(), + txtPassword->GetValue().ToStdString(), + chkUseSSL->GetValue() ? true : false);*/ + + // Test the connection. + + testConnection.SetupConnectionObject(); + CalDAVServerResult testConnectionResult = testConnection.Connect(false); + + // If server is using SSL, verify that the SSL connection is valid. + + if (testConnection.SSLVerify() == COSSL_UNABLETOVERIFY){ +#if defined(__APPLE__) + + testConnection.BypassSSLVerification(true); + + CalDAVServerResult testConnection = testConnection.Connect(false); + + testConnection.BypassSSLVerification(false); + + int SSLResult = DisplayTrustPanel(&TestConnection); + + if (SSLResult != NSOKButton){ + + lblServerConnResult->SetLabel(_("Failed")); + lblServerResponse->SetLabel(_("Not applicable")); + lblServerSSLResult->SetLabel(_("Used")); + lblServerSSLValid->SetLabel(_("No")); + lblConnectionResultText->SetLabel(_("An error occured whilst connnecting: ") + TestConnection.GetErrorMessage()); + btnPrevious->Enable(true); + return; + + } else { + + // Evalulate the trust object. + + SecTrustResultType evalResult = ProcessResultType(&testConnection); + + switch(evalResult){ + case kSecTrustResultProceed: + lblServerSSLValid->SetLabel(_("Verified")); + break; + case kSecTrustResultConfirm: + lblServerSSLValid->SetLabel(_("Verified (user)")); + break; + default: + lblServerSSLValid->SetLabel(_("Unable to verify")); + } + + lblServerResponse->SetLabel(_("Not applicable")); + lblServerSSLResult->SetLabel(_("Used")); + + if (evalResult != kSecTrustResultProceed){ + return; + } + + } + +#elif defined(__WIN32__) + + testConnection.BypassSSLVerification(true); + + CalDAVServerResult testConnectionResult = testConnection.Connect(false); + + testConnection.BypassSSLVerification(false); + + bool modifiedCertificateData = false; + + CRYPTUI_VIEWCERTIFICATE_STRUCTW certificateDialogData = BuildCertificateData(&testConnection, (HWND)this->GetHandle()); + + if (!CryptUIDlgViewCertificate(&certificateDialogData, &modifiedCertificateData)){ + wxMessageBox(_("An error occured while trying to open the certificate dialog."), _("Error opening Certificate Information dialog")); + } + + if (modifiedCertificateData == false){ + + lblServerConnResult->SetLabel(_("Failed")); + lblServerResponse->SetLabel(_("Not applicable")); + lblServerSSLResult->SetLabel(_("Used")); + lblServerSSLValid->SetLabel(_("No")); + lblConnectionResultText->SetLabel(_("An error occured whilst connnecting: ") + testConnection.GetErrorMessage()); + btnPrevious->Enable(true); + return; + + } + +#else + + // Connect again and fetch SSL certificate information. + + testConnection.BypassSSLVerification(true); + + CalDAVServerResult testConnectionResult = testConnection.Connect(false); + + testConnection.BypassSSLVerification(false); + + SSLCertCollectionString certData = testConnection.BuildSSLCollection(); + frmInvalidSSLCertificate *frmICPtr = new frmInvalidSSLCertificate(this); + + frmICPtr->LoadDataNew(CertData, txtServerAddress->GetValue().ToStdString()); + frmICPtr->ShowModal(); + + int sslResult = frmICPtr->GetResult(); + + // Clean up before processing response. + + delete frmICPtr; + frmICPtr = NULL; + + // Process the response from the user. + + if (sslResult == 1){ + + // Accept the Certificate. + + usingSSLBypass = true; + testConnection.BypassSSLVerification(true); + + CalDAVServerResult testConnectionResult = testConnection.Connect(true); + + testConnection.BypassSSLVerification(false); + + } else if (sslResult == 2){ + + // Reject the certificate, abort the task and mark as failed. + + // TODO: Integrate into the code. + + //lblConnectionResultText->SetLabel(_("An error occured whilst connnecting: ") + CardDAVConn.GetErrorMessage() + wxString::Format(wxT(" (%i)\n%s"), sslcode, CardDAVConn.GetErrorBuffer().mb_str())); + + } + +#endif + } + + testConnectionResult = testConnection.Connect(true); + + // Get the server prefix if the connection was successful. + + if (testConnectionResult == COCONNECT_OK){ + + if (usingSSLBypass == true){ + testConnection.BypassSSLVerification(true); + } + + std::string receivedServerPrefix; + + receivedServerPrefix = testConnection.GetUserPrincipal(); + serverPrefix = receivedServerPrefix; + + if (usingSSLBypass == true){ + testConnection.BypassSSLVerification(true); + } + + } + + testConnectionResult == COCONNECT_OK ? resultData->Connected = true : resultData->Connected = false; + + resultData->SSLStatus = TestConnection.CanDoSSL(); + resultData->SSLVerified = TestConnection.SSLVerify(); + resultData->ValidResponse = TestConnection.HasValidResponse(); + resultData->AuthPassed = TestConnection.AbleToLogin(); + resultData->CanProcess = TestConnection.CanDoProcessing(); + resultData->ErrorMessage = TestConnection.GetErrorMessage(); + + // Post event back confirming the tests. + + wxCommandEvent resultsEvent(UPDATERESULTS); + resultsEvent.SetClientData(resultData); + wxPostEvent(this, resultsEvent); } \ No newline at end of file diff --git a/source/forms/newaccount/frmNewAccount.h b/source/forms/newaccount/frmNewAccount.h index 6cd24e0..3f02e77 100644 --- a/source/forms/newaccount/frmNewAccount.h +++ b/source/forms/newaccount/frmNewAccount.h @@ -31,30 +31,51 @@ Subclass of frmNewAccountADT, which is generated by wxFormBuilder. #include "../../AppXestiaCalendar.h" #include "../../libraries/CalendarDataStorage/CalendarDataStorage.h" +#include "../objects/CalDAV/CalDAV.h" +#include "svrblist.h" #include "dirs.h" +DECLARE_EVENT_TYPE(UPDATERESULTS, wxID_ANY); +DECLARE_EVENT_TYPE(RUNCALDAVTEST, wxID_ANY); + + //// end generated include /** Implementing frmNewAccountADT */ class frmNewAccount : public frmNewAccountADT { private: - int pageSeek = 0; + int pageSeek = 1; wxString serverPrefix; bool *reloadAccountConfig = NULL; + struct NewAccountResult{ + bool Connected = false; + bool SSLStatus = false; + COSSLVerified SSLVerified = COSSL_NORESULT; + bool ValidResponse = false; + bool AuthPassed = false; + bool CanProcess = false; + std::string ErrorMessage = ""; + }; protected: // Handlers for frmNewAccountADT events. - void UpdateRequirements( wxCommandEvent& event ); - void CheckAccountName( wxCommandEvent& event ); - void ProcessPrevious( wxCommandEvent& event ); - void ProcessNext( wxCommandEvent& event ); + void UpdateRequirements( wxCommandEvent &event ); + void UpdateResults( wxCommandEvent &event ); + void RunCalDAVTest( wxCommandEvent &event ); + void CheckAccountName( wxCommandEvent &event ); + void Navigate( wxCommandEvent& event ); void CloseWindow( wxCommandEvent& event ); void WriteAccountDetails( wxFileConfig *cfgFileIn, wxString accountType, wxString directoryName ); +#if defined(__APPLE__) + int DisplayTrustPanel(ConnectionObject *Connection); + SecTrustResultType ProcessResultType(ConnectionObject *Connection); +#endif public: /** Constructor */ frmNewAccount( wxWindow* parent ); void SetupPointers(bool *reloadAccountInc, CalendarDataStorage *dataStorage); + DECLARE_EVENT_TABLE() //// end generated class members }; diff --git a/source/main.cpp b/source/main.cpp index 77f7fbf..ee0cd0b 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -29,6 +29,7 @@ #include "version.h" #include "bitmaps.h" #include "forms/main/frmMain.h" +#include "forms/actmgr/frmActivityMgr.h" #include "defaults.h" class XestiaCALApp: public wxApp @@ -83,6 +84,8 @@ bool XestiaCALApp::OnInit() SetupDefaultSettings(); SetupDefaultCalendar(); + // Setup the main form. + frmMain *frameMain = new frmMain( NULL ); wxMemoryInputStream istream(bigimgs_appicon48_png, sizeof(bigimgs_appicon48_png)); @@ -92,8 +95,13 @@ bool XestiaCALApp::OnInit() appIcon.CopyFromBitmap(appIconBMP); + // Setup the activity manager. + + frmActivityMgr *frameActMgr = new frmActivityMgr ( frameMain ); + frameMain->SetIcon(appIcon); frameMain->Show(true); + frameMain->SetupPointers(frameActMgr); SetTopWindow(frameMain); diff --git a/source/version.h b/source/version.h index c8a7f95..f329214 100644 --- a/source/version.h +++ b/source/version.h @@ -24,8 +24,8 @@ // // THANK YOU FOR YOUR ATTENTION! -#define XSDCAL_VERSION "0.05" -#define XSDCAL_USERAGENT "XestiaCalendar/0.05" +#define XSDCAL_VERSION "0.06" +#define XSDCAL_USERAGENT "XestiaCalendar/0.06" #define XSDCAL_SOURCE "source" #define XSDCAL_RELEASE 0 #define XSDCAL_COPYRIGHT "(c)2016-2017 Xestia Software Development"