Skip to content

Commit

Permalink
New preferences dialog, with new policy for the selection of output f…
Browse files Browse the repository at this point in the history
…older
  • Loading branch information
hbitteur committed Jan 5, 2025
1 parent a880621 commit 67bc7e8
Show file tree
Hide file tree
Showing 8 changed files with 266 additions and 94 deletions.
11 changes: 11 additions & 0 deletions app/src/main/java/org/audiveris/omr/CLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,17 @@ public void printUsage ()
logger.info(buf.toString());
}

//---------------------//
// nullifyOutputFolder //
//---------------------//
/**
* Nullify the output folder on the CLI.
*/
public void nullifyOutputFolder ()
{
params.outputFolder = null;
}

//~ Inner classes ------------------------------------------------------------------------------

//----------//
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/audiveris/omr/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private static class Constants
"Should we show environment?");

private final Constant.Boolean showAllEnvironmentVariables = new Constant.Boolean(
true,
false,
"Should we show all environment variables?");

private final Constant.String locale = new Constant.String(
Expand Down
22 changes: 19 additions & 3 deletions app/src/main/java/org/audiveris/omr/sheet/BookManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ public static Path getBaseFolder ()
*
* @return the output base folder string
*/
public static String getBaseFolderString ()
private static String getBaseFolderString ()
{
return constants.baseFolder.getValue().trim();
}
Expand Down Expand Up @@ -618,6 +618,22 @@ public static boolean isMultiBook ()
return getInstance().books.size() > 1;
}

//---------------//
// setBaseFolder //
//---------------//
/**
* Set the base for output folders.
* <p>
* This is meant for interactive setting, overriding a potential cliOutput.
*
* @param dir the output base folder
*/
public static void setBaseFolder (Path dir)
{
Main.getCli().nullifyOutputFolder();
constants.baseFolder.setValue(dir.toString());
}

//----------------//
// useCompression //
//----------------//
Expand Down Expand Up @@ -696,11 +712,11 @@ private static class Constants
"Should we compress the MusicXML output?");

private final Constant.Boolean useSeparateBookFolders = new Constant.Boolean(
true,
false,
"Should we use a separate folder for each book?");

private final Constant.Boolean useInputBookFolder = new Constant.Boolean(
false,
true,
"Should we store book outputs next to book input?");

private final Constant.String baseFolder = new Constant.String(
Expand Down
Loading

0 comments on commit 67bc7e8

Please sign in to comment.