fix CLI handling

This commit is contained in:
Eyck Jentzsch 2021-03-02 19:32:21 +01:00
parent 73f8d3d50a
commit 5ad813527a
2 changed files with 6 additions and 6 deletions

View File

@ -61,6 +61,8 @@ public class E4LifeCycle {
final Options opt = new Options(args, 0, Integer.MAX_VALUE);
opt.getSet()
.addOption("clearPersistedState", Multiplicity.ZERO_OR_ONE)
.addOption("launcher.defaultAction", Separator.BLANK, Multiplicity.ZERO_OR_ONE)
.addOption("launcher.openFile", Multiplicity.ZERO_OR_ONE)
.addOption("c", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
if (!opt.check(Options.DEFAULT_SET, true, false)) {
logger.error(opt.getCheckErrors());

View File

@ -577,7 +577,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
} else
sync.asyncExec(()->{
waveformPane.setMaxTime(database.getMaxTime());
if (state != null)
if(partConfig!=null && !partConfig.isEmpty())
loadState(partConfig);
if (state != null && !state.isEmpty())
restoreWaveformViewerState(state);
fileChecker = null;
if (checkForUpdates)
@ -630,13 +632,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
if (file.exists())
filesToLoad.add(file);
}
if(partConfig!=null) {
this.partConfig=partConfig;
}
this.partConfig=partConfig;
if (!filesToLoad.isEmpty())
loadDatabase(persistedState);
if(partConfig!=null && !partConfig.isEmpty())
loadState(partConfig);
}
/**