mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
MachineMenu RadioItem lockup fix
This commit is contained in:
parent
9deb94e462
commit
dc9f58575a
@ -7873,7 +7873,7 @@
|
||||
<sleeplib/machine.h>
|
||||
<list>
|
||||
|
||||
1306663637 /home/mark/projects/git/sleepyhead/version.h
|
||||
1306667429 /home/mark/projects/git/sleepyhead/version.h
|
||||
|
||||
1306549105 /home/mark/projects/git/sleepyhead/libs/sleeplib/prs1_loader.h
|
||||
"machine.h"
|
||||
@ -7890,7 +7890,7 @@
|
||||
"preferences.h"
|
||||
"tinyxml/tinyxml.h"
|
||||
|
||||
1306663694 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
|
||||
1306667345 source:/home/mark/projects/git/sleepyhead/SleepyHeadMain.cpp
|
||||
"wx_pch.h"
|
||||
"version.h"
|
||||
<wx/app.h>
|
||||
|
@ -79,6 +79,12 @@ SleepyHeadFrame::SleepyHeadFrame(wxFrame *frame)
|
||||
}
|
||||
|
||||
UpdateMachineMenu();
|
||||
int id=0;
|
||||
if (pref.Exists("DefaultMachine")) {
|
||||
id=pref[wxT("DefaultMachine")].GetInteger();
|
||||
} else {
|
||||
pref[wxT("DefaultMachine")]=(long)0;
|
||||
}
|
||||
|
||||
//wxDisableAsserts();
|
||||
// Create AUINotebook Tabs
|
||||
@ -86,11 +92,6 @@ SleepyHeadFrame::SleepyHeadFrame(wxFrame *frame)
|
||||
OnViewMenuDaily(dummy); // Daily Page
|
||||
OnViewMenuSummary(dummy); // Summary Page
|
||||
|
||||
int id=0;
|
||||
if (pref.Exists("DefaultMachine")) {
|
||||
id=pref[wxT("DefaultMachine")].GetInteger();
|
||||
}
|
||||
|
||||
this->Connect(wxID_ANY, wxEVT_DO_SCREENSHOT, wxCommandEventHandler(SleepyHeadFrame::DoScreenshot));
|
||||
//this->Connect(wxID_ANY, wxEVT_MACHINE_SELECTED, wxCommandEventHandler(SleepyHeadFrame::OnMachineSelected));
|
||||
//this->Connect(wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(SleepyHeadFrame::DoScreenshot));
|
||||
@ -113,12 +114,12 @@ void SleepyHeadFrame::UpdateMachineMenu()
|
||||
{
|
||||
cpap_machines=profile->GetMachines(MT_CPAP);
|
||||
|
||||
wxMenuItemList &z=MachineMenu->GetMenuItems();
|
||||
//wxMenuItemList::iterator q;
|
||||
wxMenuItemList z=MachineMenu->GetMenuItems();
|
||||
int i=MachineMenuID;
|
||||
for (auto q=z.begin();q!=z.end();q++) {
|
||||
for (int j=0;j<z.size();j++) {
|
||||
wxMenuItem *mi=z[j];
|
||||
this->Disconnect(i,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(SleepyHeadFrame::OnMachineSelected));
|
||||
MachineMenu->Remove(*q);
|
||||
MachineMenu->Remove(mi);
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -159,8 +160,8 @@ void SleepyHeadFrame::OnFullscreen(wxCommandEvent& event)
|
||||
void SleepyHeadFrame::OnMachineSelected(wxCommandEvent& event)
|
||||
{
|
||||
int id=event.GetId()-MachineMenuID;
|
||||
|
||||
wxLogMessage(wxT("Machine Selected:")+wxString::Format(wxT("%i"),id));
|
||||
event.Skip();
|
||||
Machine *m=cpap_machines[id];
|
||||
|
||||
if (m) {
|
||||
@ -176,6 +177,7 @@ void SleepyHeadFrame::OnMachineSelected(wxCommandEvent& event)
|
||||
summary->RefreshData(m);
|
||||
summary->Refresh();
|
||||
}
|
||||
event.Skip();
|
||||
//Refresh();
|
||||
}
|
||||
void SleepyHeadFrame::OnScreenshot(wxCommandEvent& event)
|
||||
@ -252,13 +254,15 @@ void SleepyHeadFrame::OnImportSD(wxCommandEvent &event)
|
||||
loader_progress->Show(false);
|
||||
|
||||
UpdateMachineMenu(); // Also updates cpap_machines list.
|
||||
|
||||
auto q=MachineMenu->GetMenuItems().rbegin();
|
||||
int i=0;
|
||||
Machine *m;
|
||||
if (q!=MachineMenu->GetMenuItems().rend()) {
|
||||
(*q)->Check(true);
|
||||
i=(*q)->GetId()-MachineMenuID;
|
||||
}
|
||||
Machine *m=cpap_machines[i];
|
||||
m=cpap_machines[i];
|
||||
|
||||
int idx=main_auinotebook->GetPageIndex(daily);
|
||||
if (idx!=wxNOT_FOUND) {
|
||||
@ -573,9 +577,9 @@ void Daily::OnCalendarDay( wxCalendarEvent& event )
|
||||
TAP_EAP->Show(true);
|
||||
}
|
||||
|
||||
TAP_EAP->Refresh();
|
||||
TAP_IAP->Refresh();
|
||||
TAP->Refresh();
|
||||
//TAP_EAP->Refresh();
|
||||
//TAP_IAP->Refresh();
|
||||
//TAP->Refresh();
|
||||
fgSizer->Layout();
|
||||
// Update();
|
||||
ScrolledWindow->FitInside();
|
||||
|
@ -259,7 +259,7 @@ int PRS1Loader::OpenMachine(Machine *m,wxString path)
|
||||
delete sess;
|
||||
continue;
|
||||
}
|
||||
wxLogMessage(sess->first().Format(wxT("%Y-%m-%d %H:%M:%S"))+wxT(" ")+sess->last().Format(wxT("%Y-%m-%d %H:%M:%S")));
|
||||
//wxLogMessage(sess->first().Format(wxT("%Y-%m-%d %H:%M:%S"))+wxT(" ")+sess->last().Format(wxT("%Y-%m-%d %H:%M:%S")));
|
||||
|
||||
//sess->SetSessionID(sess->start().GetTicks());
|
||||
if (!s->second[1].IsEmpty()) {
|
||||
@ -414,7 +414,7 @@ bool PRS1Loader::OpenSummary(Session *session,wxString filename)
|
||||
wxUint16 bb=*(wxUint16*)b;
|
||||
int duration=bb;// | (buffer[0x15] << 8);
|
||||
session->summary[CPAP_Duration]=(long)duration;
|
||||
wxLogMessage(wxString::Format(wxT("ID: %i %i"),session->session(),duration));
|
||||
//wxLogMessage(wxString::Format(wxT("ID: %i %i"),session->session(),duration));
|
||||
float hours=float(duration)/3600.0;
|
||||
session->set_hours(hours);
|
||||
|
||||
|
12
version.h
12
version.h
@ -16,14 +16,14 @@ namespace AutoVersion{
|
||||
//Standard Version Type
|
||||
static const long MAJOR = 0;
|
||||
static const long MINOR = 7;
|
||||
static const long BUILD = 1853;
|
||||
static const long REVISION = 4678;
|
||||
static const long BUILD = 1872;
|
||||
static const long REVISION = 4785;
|
||||
|
||||
//Miscellaneous Version Types
|
||||
static const long BUILDS_COUNT = 6233;
|
||||
#define RC_FILEVERSION 0,7,1853,4678
|
||||
#define RC_FILEVERSION_STRING "0, 7, 1853, 4678\0"
|
||||
static const char FULLVERSION_STRING[] = "0.7.1853.4678";
|
||||
static const long BUILDS_COUNT = 6275;
|
||||
#define RC_FILEVERSION 0,7,1872,4785
|
||||
#define RC_FILEVERSION_STRING "0, 7, 1872, 4785\0"
|
||||
static const char FULLVERSION_STRING[] = "0.7.1872.4785";
|
||||
|
||||
//These values are to keep track of your versioning state, don't modify them.
|
||||
static const long BUILD_HISTORY = 62;
|
||||
|
Loading…
Reference in New Issue
Block a user