Force session .xml suffix & ignore CTRL-S / etc. accel global keys

This commit is contained in:
Charles J. Cliffe 2016-08-16 19:45:42 -04:00
parent 6ede20c3e8
commit 7901701eed

View File

@ -14,6 +14,7 @@
#endif #endif
#include <vector> #include <vector>
#include <algorithm>
#include "AudioThread.h" #include "AudioThread.h"
#include "CubicSDR.h" #include "CubicSDR.h"
#include "DataTree.h" #include "DataTree.h"
@ -1677,6 +1678,14 @@ void AppFrame::saveSession(std::string fileName) {
} }
} //end for demodulators } //end for demodulators
// Make sure the file name actually ends in .xml
std::string lcFileName = fileName;
std::transform(lcFileName.begin(), lcFileName.end(), lcFileName.begin(), ::tolower);
if (lcFileName.find_last_of(".xml") != lcFileName.length()-1) {
fileName.append(".xml");
}
s.SaveToFileXML(fileName); s.SaveToFileXML(fileName);
currentSessionFile = fileName; currentSessionFile = fileName;
@ -1999,6 +2008,10 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) {
DemodulatorInstance *demod = nullptr, *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); DemodulatorInstance *demod = nullptr, *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();
int snap = wxGetApp().getFrequencySnap(); int snap = wxGetApp().getFrequencySnap();
if (event.ControlDown()) {
return 1;
}
if (event.ShiftDown()) { if (event.ShiftDown()) {
if (snap != 1) { if (snap != 1) {
snap /= 2; snap /= 2;
@ -2093,6 +2106,10 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) {
return -1; return -1;
} }
if (event.ControlDown()) {
return 1;
}
DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator(); DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator();
DemodulatorInstance *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); DemodulatorInstance *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();