Skip to content

Commit

Permalink
fix some connection state changed callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Jan 22, 2024
1 parent 5278bd7 commit 6858767
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Source/GlobalSettingsArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ GlobalSettingsArea::GlobalSettingsArea (const LumatoneEditorState& stateIn)
settingsButton->setColour(TextButton::ColourIds::buttonColourId, Colour(0xff383b3d));
settingsButton->setColour(TextButton::ColourIds::textColourOffId, Colour(0xffffffff));

connectionStateChanged(getConnectionState());

/* We don't want a resize here
/*
//[/UserPreSize]
Expand Down
5 changes: 2 additions & 3 deletions Source/LumatoneEditorState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ bool LumatoneEditorState::Controller::requestCompleteConfigFromDevice()
{
setHasChangesToSave(false);
editorState.undoManager->clearUndoHistory();
LumatoneApplicationState::Controller::requestCompleteConfigFromDevice();
return LumatoneApplicationState::Controller::requestCompleteConfigFromDevice();
}

bool LumatoneEditorState::Controller::saveMappingToFile(juce::File fileToSave)
Expand All @@ -357,7 +357,7 @@ bool LumatoneEditorState::Controller::saveMappingToFile(juce::File fileToSave)

if (fileToSave.existsAsFile())
success = fileToSave.replaceWithText(fileText, false, false);

else if (fileToSave.create().ok())
{
success = fileToSave.appendText(fileText, false, false);
Expand Down Expand Up @@ -401,4 +401,3 @@ void LumatoneEditorState::Controller::setDeveloperMode(bool developerModeOn)
// writeBoolProperty(LumatoneEditorProperty::DeveloperModeOn, inDeveloperMode, undoManager);
editorState.setStateProperty(LumatoneEditorProperty::DeveloperModeOn, editorState.inDeveloperMode);
}

4 changes: 3 additions & 1 deletion Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void TerpstraSysExApplication::anotherInstanceStarted(const String& commandLine)
// if (palette.hasBeenModified())
// {
// ValueTree paletteNode = palette.toValueTree();
//
//
// // pathToFile is optional - default to path defined in palette
// if (pathToFile == File())
// pathToFile = File(palette.getPathToFile());
Expand Down Expand Up @@ -272,6 +272,8 @@ void TerpstraSysExApplication::getCommandInfo(CommandID commandID, ApplicationCo
case Lumatone::Menu::commandIDs::importSysExMapping:
result.setInfo("Import", "Import mapping from device.", "File", 0);
result.addDefaultKeypress('i', ModifierKeys::commandModifier);
if (state.getConnectionState() != ConnectionState::ONLINE)
result.setActive(false);
break;

case Lumatone::Menu::commandIDs::deleteOctaveBoard:
Expand Down

0 comments on commit 6858767

Please sign in to comment.