[SRADA-850]FIX : when new trace, report menu items reset.
authorggh1933.go <ggh1933.go@samsung.com>
Tue, 28 Jun 2016 06:20:50 +0000 (15:20 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Mon, 4 Jul 2016 01:38:28 +0000 (10:38 +0900)
 - + when feature setting OK, ReportMenu items reset.

Change-Id: Ia1b7b1cf847937cbb71306c31a31e244f2a29582

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/setting/SettingDataManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java

index bdf3a6d..9f2606f 100644 (file)
@@ -80,7 +80,8 @@ public enum SettingDataManager {
        private Map<String, TargetData> targetListMap = new LinkedHashMap<String, TargetData>();
        
        private boolean isPlatformDA = false;
-
+       private boolean isNewSetting = false;
+       
        private SettingDataManager() {
                // set SettingFilePath
                if (null == SettingConstants.SettingFilePath) {
@@ -836,6 +837,8 @@ public enum SettingDataManager {
 
                // update setting data
                updateSettingData();
+               
+               setNewSetting(true);
        }
 
        private void updateSettingData() {
@@ -858,6 +861,8 @@ public enum SettingDataManager {
                        TargetData target = entry.getValue();
                        target.revertSettingData();
                }
+               
+               setNewSetting(false);
        }
 
        public void writeAvailableChartList(String targetName, List<String> availableChartList) {
@@ -950,4 +955,12 @@ public enum SettingDataManager {
                return null;
        }
 
+       public boolean isNewSetting() {
+               return isNewSetting;
+       }
+
+       public void setNewSetting(boolean isNewSetting) {
+               this.isNewSetting = isNewSetting;
+       }
+
 }
index 305353e..de1f963 100644 (file)
@@ -253,9 +253,16 @@ public class MenuBar {
                                // change UI state
                                Toolbar.INSTANCE.changeUIState(DAState.INIT);
                                Toolbar.INSTANCE.setScaleSelection(DAScale.DEFAULT_SCALE_INDEX);
-
+                               
                                FlatFeatureDialog featureDialog = new FlatFeatureDialog(currentShell);
                                featureDialog.open();
+                               
+                               /// if Feature Select changed and OK, is NewSetting is true.
+                               if(SettingDataManager.INSTANCE.isNewSetting()){
+                                       // reset checks on ReportMenu items 
+                                       resetReportItemCheck();                                 
+                               }
+                               
                        } else if (menuName.equals(MenuBarLabels.FILE_LOAD)) {
                                FileDialog dialog = new FileDialog(currentShell, SWT.OPEN);
                                dialog.setFilterNames(new String[] { "Zip file" });
@@ -702,4 +709,27 @@ public class MenuBar {
        public boolean getSourceView() {
                return this.sourceView;
        }
+       
+       public boolean resetReportItemCheck() {
+               
+               
+               // reset check on Report MENU
+               for (int i = 0; i < menubar.getItems().length; i++) {
+                       MenuItem menuitem = menubar.getItem(i);
+                       if (menuitem.getText().equals("View")) {
+                               for(int ii = 0; ii < menuitem.getMenu().getItems().length ; ii++){
+                                        if(menuitem.getMenu().getItem(ii).getText().contains("Report")){
+                                                MenuItem submenu = menuitem.getMenu().getItem(ii);
+                                                submenu.getMenu().getItem(0).setSelection(false);
+                                                submenu.getMenu().getItem(1).setSelection(false);
+                                                submenu.getMenu().getItem(2).setSelection(false);
+                                                
+                                                return true;
+                                        }
+                               }
+                       }
+               }
+
+               return false;
+       }
 }
\ No newline at end of file