[Title] snapshot on/off fixed
authorLee <jy.exe.lee@samsung.com>
Mon, 3 Dec 2012 11:04:05 +0000 (20:04 +0900)
committerLee <jy.exe.lee@samsung.com>
Mon, 3 Dec 2012 11:04:05 +0000 (20:04 +0900)
[Desc.] snapshot on/off fixed
[Issue] -

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/CommonConstants.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java

index 344131e..07f24df 100644 (file)
@@ -57,6 +57,8 @@ public class CommonConstants {
        public static final String GRAVE_ACCENT = "`"; //$NON-NLS-1$
        public static final String PERCENT = "%"; //$NON-NLS-1$
        public static final String EMULATOR = "emulator"; //$NON-NLS-1$
+       public static final String ON = "on"; //$NON-NLS-1$
+       public static final String OFF = "off"; //$NON-NLS-1$
 
        public static final String LOCAL_HOST = "127.0.0.1"; //$NON-NLS-1$
 
index b3ae7bd..ad08a5e 100755 (executable)
@@ -54,6 +54,7 @@ import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.project.AppDesktopInfo;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
@@ -484,9 +485,13 @@ public class ToolbarArea {
                                if (snapshotButton.isToggled()) {
                                        ResourceCommunicator
                                                        .sendSnapshotMessage(AnalyzerConstants.SNAPSHOT_ON);
+                                       ConfigureManager.getInstance().setValue(
+                                                       ConfigureLabels.SNAPSHOT, CommonConstants.ON);
                                } else {
                                        ResourceCommunicator
                                                        .sendSnapshotMessage(AnalyzerConstants.SNAPSHOT_OFF);
+                                       ConfigureManager.getInstance().setValue(
+                                                       ConfigureLabels.SNAPSHOT, CommonConstants.OFF);
                                }
                        }
                });
@@ -581,6 +586,14 @@ public class ToolbarArea {
                                ImageResources.SCREEN_SHOT_TOGGLE,
                                ImageResources.SCREEN_SHOT_TOGGLE_HOVER);
                snapshotButton.setToolTipText(AnalyzerLabels.SNAPSHOT_ENABLE);
+               String snapshotEnable = ConfigureManager.getInstance().getValue(
+                               ConfigureLabels.SNAPSHOT);
+               if (null != snapshotEnable && !snapshotEnable.isEmpty()
+                               && snapshotEnable.equals(CommonConstants.ON)) {
+                       snapshotButton.setToggled(true);
+               } else {
+                       snapshotButton.setToggled(false);
+               }
 
                FormData data = new FormData();
                data.top = new FormAttachment(0, 4);