From e6a464037191dd3bf02441a208471e03ed29e1f4 Mon Sep 17 00:00:00 2001 From: "jihye424.kim" Date: Mon, 21 Dec 2015 18:12:54 +0900 Subject: [PATCH] export as: disable launch button during 'export as' job - set 'running' state is true when start 'export as' job - set 'running' state is false when finish 'export as' job - this value is kept while emulator manager is alive - if to restart emulator manager, this value will be set false Change-Id: Icd02aaf119d47d7a7c50f4c960371cf021e88f3a Signed-off-by: jihye424.kim --- src/org/tizen/emulator/manager/ui/MainDialog.java | 4 +++- src/org/tizen/emulator/manager/ui/MenuHandling.java | 5 ----- src/org/tizen/emulator/manager/vms/VMWorkerCommon.java | 4 ++++ .../tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/org/tizen/emulator/manager/ui/MainDialog.java b/src/org/tizen/emulator/manager/ui/MainDialog.java index 90a710d..fc95f24 100644 --- a/src/org/tizen/emulator/manager/ui/MainDialog.java +++ b/src/org/tizen/emulator/manager/ui/MainDialog.java @@ -238,8 +238,10 @@ public class MainDialog { public static void refreshVMPropertyList(boolean isClear) { ProfileList.settingVMPropertyList(); - CheckingRunningEmulator.refreshVMPropertyList(); + // check vm socket connection RefreshWorker.refreshVMConnect(); + // check running emulator list + CheckingRunningEmulator.refreshVMPropertyList(); if (isClear) { tabFolder.getSelection().draw(); diff --git a/src/org/tizen/emulator/manager/ui/MenuHandling.java b/src/org/tizen/emulator/manager/ui/MenuHandling.java index 2c40e69..18fd016 100644 --- a/src/org/tizen/emulator/manager/ui/MenuHandling.java +++ b/src/org/tizen/emulator/manager/ui/MenuHandling.java @@ -148,9 +148,6 @@ public class MenuHandling { } - // block other function while to create base image - property.setRunning(true); - WorkerThread worker = new WorkerThread(property, path, useCompress); worker.start(); @@ -181,8 +178,6 @@ public class MenuHandling { } }); - } finally { - property.setRunning(false); } } } diff --git a/src/org/tizen/emulator/manager/vms/VMWorkerCommon.java b/src/org/tizen/emulator/manager/vms/VMWorkerCommon.java index 38f7a79..fb0e23e 100644 --- a/src/org/tizen/emulator/manager/vms/VMWorkerCommon.java +++ b/src/org/tizen/emulator/manager/vms/VMWorkerCommon.java @@ -232,6 +232,9 @@ public class VMWorkerCommon implements IVMWorker { EMLogger.getLogger().info("Start creating new base image" + (useCompress ? " using compress." : ".")); + + // block other function while to create base image + CheckingRunningEmulator.addEmulator(property); } finally { // lock.release WorkerLock.release(); @@ -273,6 +276,7 @@ public class VMWorkerCommon implements IVMWorker { propertyLockFile.delete(); } + CheckingRunningEmulator.removeEmulator(property, false); EMLogger.getLogger().info("Success to create base image." + StringResources.NEW_LINE + "Base image path: " + baseImagePath); diff --git a/src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java b/src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java index 4eb7e85..343f7e1 100644 --- a/src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java +++ b/src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java @@ -141,7 +141,7 @@ public class CheckingRunningEmulator { emList.add(prop.getName()); } } - setRunning(prop, true); + setRunning(prop.getName(), true); } public static void removeEmulator(VMProperty prop, boolean isSuccess) { @@ -149,7 +149,7 @@ public class CheckingRunningEmulator { emList.remove(prop.getName()); } if (!isSuccess) { - setRunning(prop, false); + setRunning(prop.getName(), false); } else { addLaunchedVMList(prop.getName()); boolean checkFinished; -- 2.7.4