Skip to content

Commit

Permalink
Save chooser fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Oct 27, 2023
1 parent a5c73e3 commit 54f4ea0
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Source/Canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ void Canvas::duplicateSelection()
}
bool overlap = true;
int moveDistance = 0;
while (overlap) {
while (overlap && moveDistance < 300) {
overlap = false;
for (auto* object : objects) {
if (!duplicated.isEmpty() && !duplicated.contains(object) && duplicated[0]->getBounds().translated(moveDistance, 0).intersects(object->getBounds())) {
Expand Down
2 changes: 1 addition & 1 deletion Source/Components/PropertiesPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ class PropertiesPanel : public Component {
if (result.getParentDirectory().exists()) {
label.setText(result.getFullPathName(), sendNotification);
}
});
}, "", "");
};
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Dialogs/Dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ void Dialogs::showOpenDialog(std::function<void(File&)> callback, bool canSelect
auto initialFile = lastFileId.isNotEmpty() ? SettingsFile::getInstance()->getLastBrowserPathForId(lastFileId) : ProjectInfo::appDataDir;
if(!initialFile.exists()) initialFile = ProjectInfo::appDataDir;

fileChooser = std::make_unique<FileChooser>("Choose save location...", initialFile, extension, nativeDialog);
fileChooser = std::make_unique<FileChooser>("Choose file to open...", initialFile, extension, nativeDialog);

auto openChooserFlags = FileBrowserComponent::openMode;

Expand All @@ -625,7 +625,7 @@ void Dialogs::showOpenDialog(std::function<void(File&)> callback, bool canSelect
});
}

void Dialogs::showSaveDialog(std::function<void(File&)> callback, const String& extension, const String& lastFileId)
void Dialogs::showSaveDialog(std::function<void(File&)> callback, const String& extension, const String& lastFileId, bool directoryMode)
{
bool nativeDialog = SettingsFile::getInstance()->wantsNativeDialog();
auto initialFile = lastFileId.isNotEmpty() ? SettingsFile::getInstance()->getLastBrowserPathForId(lastFileId) : ProjectInfo::appDataDir;
Expand Down
4 changes: 2 additions & 2 deletions Source/Dialogs/Dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ struct Dialogs {

static PopupMenu createObjectMenu(PluginEditor* parent);

static void showOpenDialog(std::function<void(File&)> callback, bool canSelectFiles, bool canSelectDirectories, const String& lastFileId = "", const String& extension = "");
static void showOpenDialog(std::function<void(File&)> callback, bool canSelectFiles, bool canSelectDirectories, const String& lastFileId, const String& extension);

static void showSaveDialog(std::function<void(File&)> callback, const String& extension = "", const String& lastFileId = "");
static void showSaveDialog(std::function<void(File&)> callback, const String& extension, const String& lastFileId, bool directoryMode = false);

static inline std::unique_ptr<FileChooser> fileChooser = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion Source/Heavy/ExporterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct ExporterBase : public Component
if (result.getParentDirectory().exists()) {
startExport(result);
}
}, "HeavyExport");
}, "", "HeavyExport", true);
};
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Objects/PdTildeObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PdTildeObject final : public TextBase {
pdTilde->x_schedlibdir = gensym(schedPath.toRawUTF8());
pd->sendDirectMessage(pdTilde.get(), "pd~", { "start" });
}
}, true, true, "LastPdLocation");
}, true, true, "", "LastPdLocation");
} else {
if (auto pdTilde = ptr.get<t_fake_pd_tilde>()) {
auto pdPath = pdLocation.getFullPathName();
Expand Down
2 changes: 1 addition & 1 deletion Source/Pd/Instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ void Instance::createPanel(int type, char const* snd, char const* location, char
lockAudioThread();
pd_typedmess(obj, generateSymbol(callback), 1, argv);
unlockAudioThread();
}, "openpanel");
}, "", "openpanel");
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Sidebar/DocumentationBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ class DocumentationBrowser : public DocumentBrowserBase {
pd->settingsFile->setProperty("browser_path", path);
directory.setDirectory(path, true, true);
}
}, false, true, "DocumentationFileChooser");
}, false, true, "", "DocumentationFileChooser");
};

auto resetFolderCallback = [this]() {
Expand Down

0 comments on commit 54f4ea0

Please sign in to comment.