About : modify contents of About dialog
authorwoojin <woojin2.jung@samsung.com>
Wed, 9 Mar 2016 07:04:45 +0000 (16:04 +0900)
committerwoojin <woojin2.jung@samsung.com>
Wed, 9 Mar 2016 07:11:26 +0000 (16:11 +0900)
1. change name of items to follow SDK common convention
2. remove DA version
3. add tizen developer site link

Change-Id: I774d9bf87a7ed9fd03d85408db32cc500e2fefc0
Signed-off-by: woojin <woojin2.jung@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java

index 95cf2a5..2df8b82 100755 (executable)
@@ -146,9 +146,10 @@ public class AnalyzerLabels extends NLS {
        public static String LICENSE_DIALOG_NOT_FOUND;
 
        public static String ABOUT_DIALOG_TITLE;
-       public static String ABOUT_DIALOG_BUILD_TIME_TAB;
+       public static String ABOUT_DIALOG_BUILD_ID_TAB;
        public static String ABOUT_DIALOG_VERSION_TAB;
-       public static String ABOUT_DIALOG_DA_VERSION_TAB;
+       public static String ABOUT_DIALOG_VISIT;
+       public static String ABOUT_DIALOG_SITE_URL;
        public static String ABOUT_DIALOG_LICENSE;
 
        public static String CONFIGURATION_DIALOG_AUTO_RANGE;
index 468648b..2ef8b3f 100755 (executable)
@@ -35,7 +35,7 @@ ABOUT_MAC=About Dynamic Analyzer [fn + F1]
 SETTING_MAC=Settings [fn + F2]
 VIEW_SOURCE_MAC=View source [fn + F3]
 
-#ABOUT_MAC=About Dynamic Analyzel;
+#ABOUT_MAC=About Dynamic Analyzer;
 
 ABOUT_TITLE=About Dynamic Analyzer
 LICENSE=License
@@ -110,10 +110,11 @@ COOLBAR_AREA_CONFIGURATION_OPTION=Options
 
 LICENSE_DIALOG_NOT_FOUND=License file not found
 
-ABOUT_DIALOG_TITLE=Dynamic Analyzer
-ABOUT_DIALOG_BUILD_TIME_TAB=Build time\t: 
-ABOUT_DIALOG_VERSION_TAB=SDK Version\t: 
-ABOUT_DIALOG_DA_VERSION_TAB=DA Version\t: 
+ABOUT_DIALOG_TITLE=Tizen SDK
+ABOUT_DIALOG_BUILD_ID_TAB=Build id\t: 
+ABOUT_DIALOG_VERSION_TAB=Version\t: 
+ABOUT_DIALOG_VISIT=Visit 
+ABOUT_DIALOG_SITE_URL=https://developer.tizen.org
 ABOUT_DIALOG_LICENSE=License
 
 CONFIGURATION_DIALOG_AUTO_RANGE=Auto Range View Transmit
index 08bd402..ef595c6 100644 (file)
@@ -40,6 +40,8 @@ import org.eclipse.swt.events.DisposeEvent;
 import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FormAttachment;
@@ -47,9 +49,9 @@ import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.appearance.DesignConstants;
-import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.path.PathManager;
 import org.tizen.dynamicanalyzer.constant.CommonConstants;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
@@ -69,18 +71,17 @@ public class AboutDialog extends DAMessageBox {
        private static boolean opened = false;
        private DACustomButton okButton = null;
 
-       private static String ideBuildVersionInfo = CommonConstants.EMPTY;
-       private static String daBuildTimeInfo = CommonConstants.EMPTY;
-       private static String daVersionInfo = AnalyzerConstants.DA_VERSION;
+       private static String sdkBuildVersionInfo = CommonConstants.EMPTY;
+       private static String daBuildIDInfo = CommonConstants.EMPTY;
 
        private final Image iconImage = ImageResources.ABOUT_TIZEN_SDK;
 
-       final static String daAboutFilePath = PathManager.getWorkbenchPluginPath() + File.separator
-                       + "about.mappings";
+       final static String daAboutFilePath = PathManager.getWorkbenchPluginPath()
+                       + File.separator + "about.mappings";
+
+       final static String sdkVersionFilePath = PathManager.TIZEN_SDK_INSTALL_PATH
+                       + File.separator + "sdk.version";
 
-       final static String sdkVersionFilePath = PathManager.TIZEN_SDK_INSTALL_PATH + File.separator 
-                       + "sdk.version";
-                       
        public AboutDialog(Shell parent) {
                super(parent);
        }
@@ -135,26 +136,21 @@ public class AboutDialog extends DAMessageBox {
                titleText.setText(AnalyzerLabels.ABOUT_DIALOG_TITLE);
 
                Label version = new Label(base, SWT.TRANSPARENT);
-               version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB + ideBuildVersionInfo);
+               version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB
+                               + sdkBuildVersionInfo);
                version.setBackground(ColorResources.DIALOG_BG_UPPER);
                version.setAlignment(SWT.LEFT);
                version.setForeground(ColorResources.DEFAULT_FONT_COLOR);
                version.setFont(FontResources.ABOUT_TEXT);
 
-               Label daVersion = new Label(base, SWT.TRANSPARENT);
-               daVersion.setText(AnalyzerLabels.ABOUT_DIALOG_DA_VERSION_TAB + daVersionInfo);
-               daVersion.setBackground(ColorResources.DIALOG_BG_UPPER);
-               daVersion.setAlignment(SWT.LEFT);
-               daVersion.setForeground(ColorResources.DEFAULT_FONT_COLOR);
-               daVersion.setFont(FontResources.ABOUT_TEXT);
-               
-               Label buildTime = new Label(base, SWT.TRANSPARENT);
-               buildTime.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME_TAB + daBuildTimeInfo);
-               buildTime.setBackground(ColorResources.DIALOG_BG_UPPER);
-               buildTime.setAlignment(SWT.LEFT);
-               buildTime.setForeground(ColorResources.DEFAULT_FONT_COLOR);
-               buildTime.setFont(FontResources.ABOUT_TEXT);
-               
+               Label buildID = new Label(base, SWT.TRANSPARENT);
+               buildID.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_ID_TAB
+                               + daBuildIDInfo);
+               buildID.setBackground(ColorResources.DIALOG_BG_UPPER);
+               buildID.setAlignment(SWT.LEFT);
+               buildID.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+               buildID.setFont(FontResources.ABOUT_TEXT);
+
                FormData labelData = new FormData();
                labelData.left = new FormAttachment(0, 0);
                labelData.top = new FormAttachment(0, 0);
@@ -171,7 +167,7 @@ public class AboutDialog extends DAMessageBox {
                titleText.setLayoutData(labelData);
 
                textPos += (17 + 15);
-               if(!ideBuildVersionInfo.equals(CommonConstants.EMPTY)){
+               if (!sdkBuildVersionInfo.equals(CommonConstants.EMPTY)) {
                        labelData = new FormData();
                        labelData.left = new FormAttachment(0, 155);
                        labelData.right = new FormAttachment(100, 0);
@@ -185,14 +181,41 @@ public class AboutDialog extends DAMessageBox {
                labelData.right = new FormAttachment(100, 0);
                labelData.top = new FormAttachment(0, textPos += 17);
                labelData.height = 17;
-               daVersion.setLayoutData(labelData);
-               
-               labelData = new FormData();
-               labelData.left = new FormAttachment(0, 155);
-               labelData.right = new FormAttachment(100, 0);
-               labelData.top = new FormAttachment(0, textPos += 17);
-               labelData.height = 17;
-               buildTime.setLayoutData(labelData);
+               buildID.setLayoutData(labelData);
+
+               Link visit = new Link(base, SWT.NONE);
+               baseData = new FormData();
+               baseData.left = new FormAttachment(0, 155);
+               baseData.right = new FormAttachment(100, 0);
+               baseData.top = new FormAttachment(0, textPos += 51);
+               visit.setLayoutData(baseData);
+               visit.setText(AnalyzerLabels.ABOUT_DIALOG_VISIT + " <a>"
+                               + AnalyzerLabels.ABOUT_DIALOG_SITE_URL + "</a>");
+               visit.setForeground(ColorResources.DEFAULT_FONT_COLOR);
+               visit.setBackground(ColorResources.DIALOG_BG_UPPER);
+               visit.setFont(FontResources.ABOUT_TEXT);
+               visit.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent arg0) {
+                       }
+
+                       @Override
+                       public void widgetSelected(SelectionEvent arg0) {
+                               try {
+                                       String url = AnalyzerLabels.ABOUT_DIALOG_SITE_URL;
+                                       if (CommonUtil.isWin()) {
+                                               org.eclipse.swt.program.Program.launch(url);
+                                       } else if (CommonUtil.isLinux()) {
+                                               Runtime.getRuntime().exec("xdg-open " + url); //$NON-NLS-1$
+                                       } else if (CommonUtil.isMac()) {
+                                               Runtime.getRuntime().exec("/usr/bin/open " + url); //$NON-NLS-1$
+                                       }
+                               } catch (Throwable e) {
+                                       Logger.error("Failed to open developer site");
+                                       return;
+                               }
+                       }
+               });
 
                Composite buttonComp = new Composite(shell, SWT.NONE);
                buttonComp.setLayout(new FormLayout());
@@ -207,7 +230,8 @@ public class AboutDialog extends DAMessageBox {
                                e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
                                e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
                                e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
-                               e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width, rect.y + 1);
+                               e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+                                               rect.y + 1);
                        }
                });
 
@@ -237,10 +261,10 @@ public class AboutDialog extends DAMessageBox {
        }
 
        public static void updateBuildInfo() {
-               if (ideBuildVersionInfo.equals(CommonConstants.EMPTY)
-                               || daBuildTimeInfo.equals(CommonConstants.EMPTY)) {
+               if (sdkBuildVersionInfo.equals(CommonConstants.EMPTY)
+                               || daBuildIDInfo.equals(CommonConstants.EMPTY)) {
                        updateDABuildInfo();
-                       ideBuildVersionInfo = getSdkVersion();
+                       sdkBuildVersionInfo = getSdkVersion();
                        writeBuildInfoToAboutFile();
                }
        }
@@ -259,8 +283,9 @@ public class AboutDialog extends DAMessageBox {
                        buffWriter = new BufferedWriter(fileWriter);
                        printWriter = new PrintWriter(buffWriter);
 
-                       printWriter.println("0" + CommonConstants.EQUAL + ideBuildVersionInfo);//$NON-NLS-1$
-                       printWriter.println("1" + CommonConstants.EQUAL + daBuildTimeInfo);//$NON-NLS-1$
+                       printWriter
+                                       .println("0" + CommonConstants.EQUAL + sdkBuildVersionInfo);//$NON-NLS-1$
+                       printWriter.println("1" + CommonConstants.EQUAL + daBuildIDInfo);//$NON-NLS-1$
                        printWriter.checkError();
                } catch (IOException e) {
                        Logger.exception(e);
@@ -291,8 +316,7 @@ public class AboutDialog extends DAMessageBox {
        private static String getSdkVersion() {
                File file = new File(sdkVersionFilePath);
                if (!file.exists()) {
-                       Logger.error(
-                                       "about dlg, not exists file : " + sdkVersionFilePath);
+                       Logger.error("about dlg, not exists file : " + sdkVersionFilePath);
                        return CommonConstants.EMPTY;
                }
                BufferedReader in = null;
@@ -332,11 +356,11 @@ public class AboutDialog extends DAMessageBox {
                        while (null != (content = in.readLine())) {
                                buildVersion = parseBuildVersion(content);
                                if (buildVersion != null) {
-                                       ideBuildVersionInfo = buildVersion;
+                                       sdkBuildVersionInfo = buildVersion;
                                }
                                buildTime = parseBuildTime(content);
                                if (buildTime != null) {
-                                       daBuildTimeInfo = buildTime;
+                                       daBuildIDInfo = buildTime;
                                }
                        }
                } catch (FileNotFoundException e) {
@@ -347,4 +371,5 @@ public class AboutDialog extends DAMessageBox {
                        CommonUtil.tryClose(in);
                }
        }
+
 }