export as: disable launch button during 'export as' job
authorjihye424.kim <jihye424.kim@samsung.com>
Mon, 21 Dec 2015 09:12:54 +0000 (18:12 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 22 Dec 2015 04:50:51 +0000 (13:50 +0900)
- 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 <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/ui/MainDialog.java
src/org/tizen/emulator/manager/ui/MenuHandling.java
src/org/tizen/emulator/manager/vms/VMWorkerCommon.java
src/org/tizen/emulator/manager/vms/helper/CheckingRunningEmulator.java

index 90a710d..fc95f24 100644 (file)
@@ -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();
index 2c40e69..18fd016 100644 (file)
@@ -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);
                        }
                }
        }
index 38f7a79..fb0e23e 100644 (file)
@@ -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);
index 4eb7e85..343f7e1 100644 (file)
@@ -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;