diff --git a/Projects/CodeBlocks/SleepyHead.cbp b/Projects/CodeBlocks/SleepyHead.cbp
index 5d838a35..26cfa240 100644
--- a/Projects/CodeBlocks/SleepyHead.cbp
+++ b/Projects/CodeBlocks/SleepyHead.cbp
@@ -119,6 +119,8 @@
+
+
diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend
index 83b196bd..42b4eadb 100644
--- a/Projects/CodeBlocks/SleepyHead.depend
+++ b/Projects/CodeBlocks/SleepyHead.depend
@@ -8210,12 +8210,12 @@
"wx/treebase.h"
"wx/hashmap.h"
-1307861037 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp
+1308106038 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp
"wx/wxprec.h"
"GUIFrame.h"
-1307995741 /home/mark/projects/git/sleepyhead/src/GUIFrame.h
+1308105778 /home/mark/projects/git/sleepyhead/src/GUIFrame.h
@@ -8240,7 +8240,7 @@
-1308095988 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
+1308099489 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadApp.cpp
"wx_pch.h"
@@ -8258,7 +8258,7 @@
1307418393 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h
-1307862247 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h
+1308105875 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h
"SleepyHeadApp.h"
@@ -8309,7 +8309,7 @@
1308026543 D
-1308097644 /home/mark/projects/git/sleepyhead/src/version.h
+1308106147 /home/mark/projects/git/sleepyhead/src/version.h
1308003040 ent of cb2ab33... Linux wx2.8 & wx2.9 builds fixed
@@ -8341,7 +8341,7 @@
"preferences.h"
"tinyxml/tinyxml.h"
-1308088585 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
+1308105937 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp
"wx_pch.h"
"version.h"
@@ -8361,7 +8361,7 @@
"sleeplib/profiles.h"
"sleeplib/machine_loader.h"
-1308097644 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
+1308104848 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
"freetype-gl/font-manager.h"
"freetype-gl/texture-font.h"
"graph.h"
@@ -11067,7 +11067,7 @@
-1308097442 source:/home/mark/projects/git/sleepyhead/src/graphs/gl_pbuffer.cpp
+1308100135 source:/home/mark/projects/git/sleepyhead/src/graphs/gl_pbuffer.cpp
"gl_pbuffer.h"
diff --git a/Projects/CodeBlocks/SleepyHead.layout b/Projects/CodeBlocks/SleepyHead.layout
index bb3ad24a..39dfa023 100644
--- a/Projects/CodeBlocks/SleepyHead.layout
+++ b/Projects/CodeBlocks/SleepyHead.layout
@@ -1,17 +1,17 @@
-
-
+
+
-
+
-
+
@@ -19,47 +19,53 @@
-
-
+
+
-
-
+
+
-
+
-
+
+
+
+
+
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
@@ -73,10 +79,10 @@
-
+
-
+
@@ -88,7 +94,7 @@
-
+
diff --git a/src/GUIFrame.cpp b/src/GUIFrame.cpp
index e68664f8..36c9cb35 100644
--- a/src/GUIFrame.cpp
+++ b/src/GUIFrame.cpp
@@ -88,9 +88,13 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
HelpMenu = new wxMenu();
wxMenuItem* HelpMenuAbout;
- HelpMenuAbout = new wxMenuItem( HelpMenu, wxID_ABOUT, wxString( _("&About") ) , wxEmptyString, wxITEM_NORMAL );
+ HelpMenuAbout = new wxMenuItem( HelpMenu, wxID_ABOUT, wxString( _("&About") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL );
HelpMenu->Append( HelpMenuAbout );
+ wxMenuItem* HelpMenuLog;
+ HelpMenuLog = new wxMenuItem( HelpMenu, wxID_ANY, wxString( _("&View Log") ) + wxT('\t') + wxT("Ctrl+L"), wxEmptyString, wxITEM_NORMAL );
+ HelpMenu->Append( HelpMenuLog );
+
menubar->Append( HelpMenu, _("&Help") );
this->SetMenuBar( menubar );
@@ -117,6 +121,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons
this->Connect( ViewMenuFullscreen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFullscreen ) );
this->Connect( ToolsMenuScreenshot->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnScreenshot ) );
this->Connect( HelpMenuAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) );
+ this->Connect( HelpMenuLog->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnViewLog ) );
}
GUIFrame::~GUIFrame()
@@ -135,6 +140,7 @@ GUIFrame::~GUIFrame()
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFullscreen ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnScreenshot ) );
this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) );
+ this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnViewLog ) );
m_mgr.UnInit();
diff --git a/src/GUIFrame.h b/src/GUIFrame.h
index e63c6249..6e96a7c8 100644
--- a/src/GUIFrame.h
+++ b/src/GUIFrame.h
@@ -70,6 +70,7 @@ class GUIFrame : public wxFrame
virtual void OnFullscreen( wxCommandEvent& event ) { event.Skip(); }
virtual void OnScreenshot( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAbout( wxCommandEvent& event ) { event.Skip(); }
+ virtual void OnViewLog( wxCommandEvent& event ) { event.Skip(); }
public:
diff --git a/src/SleepyHeadApp.cpp b/src/SleepyHeadApp.cpp
index 8d103d3f..ac00f1d1 100644
--- a/src/SleepyHeadApp.cpp
+++ b/src/SleepyHeadApp.cpp
@@ -41,7 +41,7 @@ bool SleepyHeadApp::OnInit()
// It helps to allocate the logger on the heap.. This show work for all platforms now :)
- wxLog *logger=new wxLogStderr(NULL); //new wxLogWindow(NULL,wxT("Debug"),true,false); //new wxLogStderr(NULL); //
+ wxLog *logger=new wxLogStderr(NULL);
wxLog::SetActiveTarget(logger);
//wxLog::SetLogLevel(wxLOG_Max);
diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp
index aa0233ef..994e7535 100644
--- a/src/SleepyHeadMain.cpp
+++ b/src/SleepyHeadMain.cpp
@@ -81,6 +81,8 @@ SleepyHeadFrame::SleepyHeadFrame(wxFrame *frame)
wxString title=wxTheApp->GetAppName()+wxT(" v")+wxString(AutoVersion::_FULLVERSION_STRING,wxConvUTF8);
SetTitle(title);
+ logwindow=new wxLogWindow(this,wxT("Debug"),false,false); //new wxLogStderr(NULL); //
+
profile=Profiles::Get();
if (!profile) {
wxLogError(wxT("Couldn't get active profile"));
@@ -127,7 +129,11 @@ SleepyHeadFrame::SleepyHeadFrame(wxFrame *frame)
SleepyHeadFrame::~SleepyHeadFrame()
{
GraphDone();
-}
+}
+void SleepyHeadFrame::OnViewLog(wxCommandEvent & event)
+{
+ logwindow->Show();
+}
void SleepyHeadFrame::UpdateProfiles()
{
wxMenuItemList z=ProfileMenu->GetMenuItems();
@@ -322,8 +328,7 @@ void SleepyHeadFrame::OnImportSD(wxCommandEvent &event)
int idx=main_auinotebook->GetPageIndex(daily);
if (idx!=wxNOT_FOUND) {
daily->ResetDate();
- daily->RefreshData();
- daily->Refresh();
+ //daily->RefreshData();
}
idx=main_auinotebook->GetPageIndex(summary);
if (idx!=wxNOT_FOUND) {
@@ -339,8 +344,8 @@ void SleepyHeadFrame::OnViewMenuDaily( wxCommandEvent& event )
if (idx==wxNOT_FOUND) {
daily=new Daily(this,profile);
main_auinotebook->AddPage(daily,_("Daily"),true,wxNullBitmap);
- daily->RefreshData();
- daily->Refresh();
+ //daily->ResetDate();
+ //daily->RefreshData();
} else {
main_auinotebook->SetSelection(idx);
@@ -804,7 +809,9 @@ Daily::Daily(wxWindow *win,Profile *p)
//fgSizer->Add(TAP_IAP,1,wxEXPAND);
//fgSizer->Add(TAP_EAP,1,wxEXPAND);
-
+ this->Connect(wxID_ANY, wxEVT_REFRESH_DAILY, wxCommandEventHandler(Daily::RefreshData));
+ Refresh();
+ Update();
ResetDate();
}
Daily::~Daily()
@@ -853,6 +860,8 @@ void Daily::ResetDate()
{
foobar_datehack=false; // this exists due to a wxGTK bug.
// RefreshData();
+
+ Update();
wxDateTime date;
if (profile->LastDay().IsValid()) {
date=profile->LastDay()+wxTimeSpan::Day();
@@ -864,8 +873,14 @@ void Daily::ResetDate()
wxCalendarEvent ev;
ev.SetDate(date);
OnCalendarMonth(ev);
+ RefreshData();
}
void Daily::RefreshData()
+{
+ wxCommandEvent MyEvent( wxEVT_REFRESH_DAILY);
+ wxPostEvent(this, MyEvent);
+}
+void Daily::RefreshData(wxCommandEvent& event)
{
wxDateTime date=Calendar->GetDate();
date.ResetTime();
@@ -1204,7 +1219,7 @@ void Daily::RefreshData()
} */
html+=wxT("