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
1 changed files with 17 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#endif
#include <vector>
#include <algorithm>
#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();