Skip to contentSkip to conversation

eclipse-plugin/yocto-bsp-wizard : Progress Dialog

PATCH New Ioana Grigoropol 1 participant 1 message Sep 25, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eclipse-plugin/yocto-bsp-wizard : Progress Dialog

- removed progress dialog for loading kernel choices (it is a short process and it only causes the Process Dialog to appear and disapear quickly)

---
 .../remotetools/wizards/bsp/PropertiesPage.java    |   36 +++++++++++---------
 1 file changed, 20 insertions(+), 16 deletions(-)
plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/wizards/bsp/PropertiesPage.java +20 -16
index 14de18c..4a79d64 100644
@@ -135,7 +135,7 @@ public class PropertiesPage extends WizardPage {
 			newButton.setSelection(true);
 			existingButton.setSelection(false);
 
-			updateKernelValues(KERNEL_CHOICES, KERNEL_CHOICE);
+			updateKernelValues(KERNEL_CHOICES, KERNEL_CHOICE, false);
 		}
 
 		try {
@@ -383,7 +383,7 @@ public class PropertiesPage extends WizardPage {
 			 existingButton.setSelection(false);
 			 kbCombo.removeAll();
 			 
-			 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + NEW_KBRANCH_NAME);
+			 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + NEW_KBRANCH_NAME, true);
 		 } else if (widget == kbCombo) {
 			 setErrorMessage(null);
 		 } else if (widget == newButton) {
@@ -392,34 +392,38 @@ public class PropertiesPage extends WizardPage {
 			 
 			 if (newBranch) {
 				 kbCombo.removeAll();
-				 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + NEW_KBRANCH_NAME);
+				 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + NEW_KBRANCH_NAME, true);
 			 }
 		 } else if (widget == existingButton) {
 			 boolean existingBranch = existingButton.getSelection();
 
 			 if (existingBranch) {
 				 kbCombo.removeAll();
-				 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + EXISTING_KBRANCH_NAME);
+				 updateKernelValues(KERNEL_BRANCHES, "\\\"" + kernel_choice + "\\\"." + EXISTING_KBRANCH_NAME, true);
 			 }
 		 }
 		 canFlipToNextPage();
 		 getWizard().getContainer().updateButtons();
 	}
 
-	private void updateKernelValues(final String value, String property) {
+	private void updateKernelValues(final String value, String property, boolean showProgress) {
 		final ValuesGetter runnable  = new ValuesGetter(property);
 
-		ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
-		try {
-			dialog.run(true, true, new IRunnableWithProgress(){
-			     public void run(IProgressMonitor monitor) {
-			         monitor.beginTask("Loading Kernel " + value + " ...", 100);
-			         runnable.run();
-			         monitor.done();
-			     }
-			 });
-		} catch (Exception e) {
-			runnable.getBspAction().setMessage(e.getMessage());
+		if (showProgress) {
+			ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
+			try {
+				dialog.run(true, true, new IRunnableWithProgress(){
+				     public void run(IProgressMonitor monitor) {
+				         monitor.beginTask("Loading Kernel " + value + " ...", 100);
+				         runnable.run();
+				         monitor.done();
+				     }
+				 });
+			} catch (Exception e) {
+				runnable.getBspAction().setMessage(e.getMessage());
+			}
+		} else {
+			runnable.run();
 		}
 
 		BSPAction action = runnable.getBspAction();
Signature · 1 line
1.7.9.5