dialog: show package version information
authorjihye424.kim <jihye424.kim@samsung.com>
Fri, 20 Nov 2015 06:45:35 +0000 (15:45 +0900)
committerJiHye Kim <jihye424.kim@samsung.com>
Mon, 23 Nov 2015 02:21:45 +0000 (11:21 +0900)
- about dialog
-- emulator manager's package version
-- installed plugin's package version
- main dialog
-- show package version on title bar

Change-Id: I49a1ac4df3e1eec765002b075ac4029ec6d9a165
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/ui/dialog/AboutDialog.java
src/org/tizen/emulator/manager/ui/renewal/MainDialog.java

index 78e8d70..b2e35f0 100644 (file)
@@ -30,6 +30,8 @@
 package org.tizen.emulator.manager.ui.dialog;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
@@ -38,16 +40,17 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Link;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
 import org.tizen.emulator.manager.EmulatorManager;
 import org.tizen.emulator.manager.logging.EMLogger;
+import org.tizen.emulator.manager.platform.ProfileList;
+import org.tizen.emulator.manager.plugin.EMPlugin;
 import org.tizen.emulator.manager.resources.FilePathResources;
 import org.tizen.emulator.manager.resources.ImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
 import org.tizen.emulator.manager.tool.About;
 import org.tizen.emulator.manager.ui.MainDialog;
 import org.tizen.emulator.manager.ui.Messages;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 
 public class AboutDialog {
        private static Shell dialog = null;
@@ -56,13 +59,11 @@ public class AboutDialog {
        private static int height = 290; // 180 + 110
        static {
                About.initAboutContents();
-               textContents = StringResources.NEW_LINE
-                                + Messages.getString("AboutDialog.0") //$NON-NLS-1$
-                                + StringResources.NEW_LINE + StringResources.NEW_LINE
-                                + Messages.getString("AboutDialog.2") + About.getInstance().getAboutVersion() //$NON-NLS-1$
+               textContents = Messages.getString("AboutDialog.2") + About.getInstance().getAboutVersion() //$NON-NLS-1$
                                 + StringResources.NEW_LINE
-                                + Messages.getString("AboutDialog.3") + About.getInstance().getBuildTime(); //$NON-NLS-1$
-
+                                + Messages.getString("AboutDialog.3") + About.getInstance().getBuildTime()
+                                + StringResources.NEW_LINE
+                                + "Package Version: " + About.getInstance().getPackageVersion(); //$NON-NLS-1$
        }
 
        public static void open() {
@@ -108,9 +109,11 @@ public class AboutDialog {
                okButton.setText(StringResources.OK);
                okButton.setFocus();
                okButton.addSelectionListener(new SelectionListener() {
+                       @Override
                        public void widgetSelected(SelectionEvent e) {
                                dialog.close();
                        }
+                       @Override
                        public void widgetDefaultSelected(SelectionEvent e) {
                        }
                });
@@ -138,8 +141,10 @@ public class AboutDialog {
                                                "<a>" + FilePathResources.getTizenVmsPath() + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
                workspace.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
                workspace.addSelectionListener(new SelectionListener(){
+                       @Override
                        public void widgetDefaultSelected(SelectionEvent arg0) {
                        }
+                       @Override
                        public void widgetSelected(SelectionEvent arg0) {
                                try {
                                        org.eclipse.swt.program.Program.launch(FilePathResources.getTizenVmsPath());
@@ -152,12 +157,15 @@ public class AboutDialog {
                // link to tizen developer site
                Link visit = new Link(textComposite, SWT.NONE);
                visit.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, false));
-               visit.setText(StringResources.NEW_LINE + StringResources.NEW_LINE +
-                                         Messages.getString("AboutDialog.8")); //$NON-NLS-1$
+               visit.setText(StringResources.NEW_LINE +
+                                         Messages.getString("AboutDialog.8")
+                                         + StringResources.NEW_LINE);
                visit.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
                visit.addSelectionListener(new SelectionListener(){
+                       @Override
                        public void widgetDefaultSelected(SelectionEvent arg0) {
                        }
+                       @Override
                        public void widgetSelected(SelectionEvent arg0) {
                                try {
                                        String url = Messages.getString("AboutDialog.9"); //$NON-NLS-1$
@@ -175,6 +183,18 @@ public class AboutDialog {
                                }
                        }
                });
+
+               Text plugin = new Text(textComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
+               plugin.setEditable(false);
+               String list = "";
+               for (EMPlugin p : ProfileList.getPluginList()) {
+                       if (!list.isEmpty()) {
+                               list = list + StringResources.NEW_LINE;
+                       }
+                       list = list + p.getPlatformName() + ": " + p.getPackageVersion();
+               }
+               plugin.setText(list);
+               plugin.setLayoutData(new GridData(270, 38));
        }
 
        private static GridLayout getGridLayout(int numColumns, boolean makeColumnEqualWidth) {
index 59e8df0..9b1b59e 100644 (file)
@@ -44,6 +44,7 @@ import org.tizen.emulator.manager.Messages;
 import org.tizen.emulator.manager.logging.EMLogger;
 import org.tizen.emulator.manager.renewal.resources.ImageResources;
 import org.tizen.emulator.manager.resources.StringResources;
+import org.tizen.emulator.manager.tool.About;
 import org.tizen.emulator.manager.ui.renewal.tableviewer.AbstractTableViewer;
 import org.tizen.emulator.manager.ui.renewal.tableviewer.VMListTableViewer;
 import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator;
@@ -78,7 +79,13 @@ public class MainDialog {
 
                shell.setSize(WIDTH + frameX, HEIGHT + frameY);
 
-               shell.setText(StringResources.MAIN_TITLE);
+               String title = StringResources.MAIN_TITLE;
+               String pkgVersion = About.getInstance().getPackageVersion();
+
+               if (pkgVersion != null) {
+                       title = title + " (" + pkgVersion + ")";
+               }
+               shell.setText(title);
 
                InputStream is = this.getClass().getClassLoader().getResourceAsStream(ICON_FILE_NAME);
                if(is != null) {