fix CLI handling

This commit is contained in:
Eyck Jentzsch 2021-03-02 19:32:21 +01:00
parent f337a94112
commit 6ab8fd232e
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); final Options opt = new Options(args, 0, Integer.MAX_VALUE);
opt.getSet() opt.getSet()
.addOption("clearPersistedState", Multiplicity.ZERO_OR_ONE) .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); .addOption("c", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
if (!opt.check(Options.DEFAULT_SET, true, false)) { if (!opt.check(Options.DEFAULT_SET, true, false)) {
logger.error(opt.getCheckErrors()); logger.error(opt.getCheckErrors());

View File

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