Browse Source

Use module preset directory for "Preset > Open" menu item.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
01743ca5f2
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/app/ModuleWidget.cpp

+ 5
- 3
src/app/ModuleWidget.cpp View File

@@ -636,15 +636,17 @@ void ModuleWidget::save(std::string filename) {
} }


void ModuleWidget::loadDialog() { void ModuleWidget::loadDialog() {
std::string dir = asset::user("presets");
system::createDirectory(dir);
std::string presetDir = asset::user("presets");
std::string pluginPresetDir = presetDir + "/" + model->plugin->slug;
std::string modulePresetDir = pluginPresetDir + "/" + model->slug;
system::createDirectory(modulePresetDir);


osdialog_filters* filters = osdialog_filters_parse(PRESET_FILTERS); osdialog_filters* filters = osdialog_filters_parse(PRESET_FILTERS);
DEFER({ DEFER({
osdialog_filters_free(filters); osdialog_filters_free(filters);
}); });


char* path = osdialog_file(OSDIALOG_OPEN, dir.c_str(), NULL, filters);
char* path = osdialog_file(OSDIALOG_OPEN, modulePresetDir.c_str(), NULL, filters);
if (!path) { if (!path) {
// No path selected // No path selected
return; return;


Loading…
Cancel
Save