[Title] refix : add module to prevent same logtab
authorhyunsik.noh <hyunsik.noh@samsung.com>
Thu, 8 Dec 2011 11:57:21 +0000 (20:57 +0900)
committerhyunsik.noh <hyunsik.noh@samsung.com>
Thu, 8 Dec 2011 11:57:21 +0000 (20:57 +0900)
change default name for save file
[Type] Enhancement
[Module] common
[Priority] Minor

com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/AddViewDialog.java
com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/LogPanel.java

index 5bb449c..e0629c0 100644 (file)
@@ -36,14 +36,15 @@ public class AddViewDialog extends Dialog {
        private Shell parent;
 
        private Shell shell;
-
+       
        private String dialogName = null;
 
        private boolean bOk = false;
 
-       private Boolean bMsg = false;
-       private Boolean bPid = false;
-       private Boolean bTag = false;
+       private LogTab oldTab = null;
+       private boolean bMsg = false;
+       private boolean bPid = false;
+       private boolean bTag = false;
 
        private String tabName = null;
        private String device = null;
@@ -85,6 +86,8 @@ public class AddViewDialog extends Dialog {
                        if ((bMode & LogTab.FILTER_MSG) != 0) {
                                bMsg = true;
                        }
+                       
+                       oldTab = tab;
                }
        }
 
@@ -300,6 +303,8 @@ public class AddViewDialog extends Dialog {
                                {
                                        if(tab.getFilterName().equals(newName))
                                        {                                       
+                                               if( oldTab != null && oldTab == tab)
+                                                       continue;                                                       
                                                int ret = FileDialogUtils.getInstance().checkTabName(newName);
                                                if (ret == IDialogConstants.OK_ID)
                                                        return ;
index 824ba65..933e872 100644 (file)
@@ -81,7 +81,7 @@ public class LogPanel extends Panel implements IDeviceChangeListener {
         * <code>mBufferEnd - 1</code>. Therefore its number of item is
         * <code>mBufferEnd - mBufferStart</code>.
         */
-       public static final ArrayList<LogTab> tabs = new ArrayList<LogTab>();
+       public static ArrayList<LogTab> tabs = new ArrayList<LogTab>();
 
        private LogTab currentTab;
        private static int tabCnt = 0;
@@ -475,7 +475,7 @@ public class LogPanel extends Panel implements IDeviceChangeListener {
                String fileName;
 
                dlg.setText("Export Log");
-               dlg.setFileName("log.txt");
+               dlg.setFileName(getCurrentLogTab().getFilterName() +"-log.txt");
                String defaultPath = mDefaultLogSave;
                if (defaultPath == null) {
                        defaultPath = System.getProperty("user.home"); //$NON-NLS-1$