From d9b28b41d52142550b179e98bb68c697dcf9175d Mon Sep 17 00:00:00 2001 From: "hyunsik.noh" Date: Thu, 8 Dec 2011 20:57:21 +0900 Subject: [PATCH] [Title] refix : add module to prevent same logtab change default name for save file [Type] Enhancement [Module] common [Priority] Minor --- .../samsung/tizen/common/connection/log/AddViewDialog.java | 13 +++++++++---- .../com/samsung/tizen/common/connection/log/LogPanel.java | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/AddViewDialog.java b/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/AddViewDialog.java index 5bb449c..e0629c0 100644 --- a/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/AddViewDialog.java +++ b/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/AddViewDialog.java @@ -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 ; diff --git a/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/LogPanel.java b/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/LogPanel.java index 824ba65..933e872 100644 --- a/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/LogPanel.java +++ b/com.samsung.tizen.common.connection/src/com/samsung/tizen/common/connection/log/LogPanel.java @@ -81,7 +81,7 @@ public class LogPanel extends Panel implements IDeviceChangeListener { * mBufferEnd - 1. Therefore its number of item is * mBufferEnd - mBufferStart. */ - public static final ArrayList tabs = new ArrayList(); + public static ArrayList tabs = new ArrayList(); 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$ -- 2.7.4