Skip to content

Commit

Permalink
Force session .xml suffix & ignore CTRL-S / etc. accel global keys
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Aug 16, 2016
1 parent 6ede20c commit 7901701
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/AppFrame.cpp
Expand Up @@ -14,6 +14,7 @@
#endif

#include <vector>
#include <algorithm>
#include "AudioThread.h"
#include "CubicSDR.h"
#include "DataTree.h"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 7901701

Please sign in to comment.