From 7901701eeda9472af638c3a6f8d913059126dc5d Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Tue, 16 Aug 2016 19:45:42 -0400 Subject: [PATCH] Force session .xml suffix & ignore CTRL-S / etc. accel global keys --- src/AppFrame.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/AppFrame.cpp b/src/AppFrame.cpp index 58e032a..dff457b 100644 --- a/src/AppFrame.cpp +++ b/src/AppFrame.cpp @@ -14,6 +14,7 @@ #endif #include +#include #include "AudioThread.h" #include "CubicSDR.h" #include "DataTree.h" @@ -1677,6 +1678,14 @@ void AppFrame::saveSession(std::string fileName) { } } //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); currentSessionFile = fileName; @@ -1999,6 +2008,10 @@ int AppFrame::OnGlobalKeyDown(wxKeyEvent &event) { DemodulatorInstance *demod = nullptr, *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator(); int snap = wxGetApp().getFrequencySnap(); + if (event.ControlDown()) { + return 1; + } + if (event.ShiftDown()) { if (snap != 1) { snap /= 2; @@ -2093,6 +2106,10 @@ int AppFrame::OnGlobalKeyUp(wxKeyEvent &event) { return -1; } + if (event.ControlDown()) { + return 1; + } + DemodulatorInstance *activeDemod = wxGetApp().getDemodMgr().getActiveDemodulator(); DemodulatorInstance *lastDemod = wxGetApp().getDemodMgr().getLastActiveDemodulator();