From: Bernd Hufmann Date: Tue, 6 May 2014 16:57:35 +0000 (-0400) Subject: tmf: persist dialog option for folders creation in import wizard X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=ff13a02561cb92458753cc09d9eb5e6101086f2e;p=deliverable%2Ftracecompass.git tmf: persist dialog option for folders creation in import wizard Change-Id: If4c866b3457cbb1178c4d6507f7d2f4d15e6cd46 Signed-off-by: Bernd Hufmann Reviewed-on: https://git.eclipse.org/r/26055 Tested-by: Hudson CI Reviewed-by: Marc-Andre Laperle Tested-by: Marc-Andre Laperle --- diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java index c5013d62ef..590a7f149a 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPage.java @@ -118,6 +118,7 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { // ------------------------------------------------------------------------ private static final String IMPORT_WIZARD_PAGE = "ImportTraceWizardPage"; //$NON-NLS-1$ private static final String IMPORT_WIZARD_IMPORT_UNRECOGNIZED_ID = IMPORT_WIZARD_PAGE + ".import_unrecognized_traces_id"; //$NON-NLS-1$ + private static final String IMPORT_WIZARD_PRESERVE_FOLDERS_ID = IMPORT_WIZARD_PAGE + ".import_preserve_folders_id"; //$NON-NLS-1$ private static final String SEPARATOR = ":"; //$NON-NLS-1$ private static final String AUTO_DETECT = Messages.ImportTraceWizard_AutoDetection; @@ -605,6 +606,15 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { fPreserveFolderStructureButton.setText(Messages.ImportTraceWizard_PreserveFolderStructure); fPreserveFolderStructureButton.setSelection(true); + IDialogSettings settings = getDialogSettings(); + boolean value; + if (settings.get(IMPORT_WIZARD_PRESERVE_FOLDERS_ID) == null) { + value = true; + } else { + value = settings.getBoolean(IMPORT_WIZARD_PRESERVE_FOLDERS_ID); + } + fPreserveFolderStructureButton.setSelection(value); + updateWidgetEnablements(); } @@ -660,8 +670,10 @@ public class ImportTraceWizardPage extends WizardResourceImportPage { * @return true if successful else false */ public boolean finish() { + // Persist dialog settings IDialogSettings settings = getDialogSettings(); settings.put(IMPORT_WIZARD_IMPORT_UNRECOGNIZED_ID, fImportUnrecognizedButton.getSelection()); + settings.put(IMPORT_WIZARD_PRESERVE_FOLDERS_ID, fPreserveFolderStructureButton.getSelection()); String traceTypeName = fTraceTypes.getText(); String traceId = null;