From 5ef4b32fc9cf65fabfcf5a7004d361f84618749d Mon Sep 17 00:00:00 2001 From: "yongsung1.kim" Date: Thu, 15 May 2014 18:07:50 +0900 Subject: [PATCH] [INST] Add yes and no buttons to installmanager self update dialog. Add more logs for installmanager self updating. Change-Id: Ic81f027085a0c653c93c4ddd0250fe1128d883ac Signed-off-by: yongsung1.kim --- .../src/org/tizen/installmanager/ui/InstallManagerWindow.java | 8 ++++++-- .../src/org/tizen/installmanager/ui/dialog/LoginDlg.java | 2 +- .../src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java | 7 +++++-- .../org/tizen/installmanager/ui/dialog/ProxySettingsDialog.java | 4 ++-- .../src/org/tizen/installmanager/ui/page/ViewController.java | 3 +++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java b/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java index e4ac492..4cc9257 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java @@ -198,9 +198,13 @@ public class InstallManagerWindow extends ApplicationWindow { private void updateInstallManager(Shell shell) { if (controller.canInstallManagerUpdate()) { String msg = "There is a new installer on the server. \nNew install-manager will be started. \nIt may take a minute..."; - MessageBoxDlg.showDlg(shell, "InstallManager", msg, DialogType.NOTIFY, false); + int ret = MessageBoxDlg.showDlg(shell, "InstallManager", msg, DialogType.NOTIFY_YES, false); - controller.updateInstallManager(); + if (ret == MessageBoxDlg.YES) { + controller.updateInstallManager(); + } else { + Log.log("Installmanager was updatable itself but user did not want it."); + } } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/LoginDlg.java b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/LoginDlg.java index a53eaa7..b77169a 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/LoginDlg.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/LoginDlg.java @@ -156,7 +156,7 @@ public class LoginDlg extends Dialog { this.close(); } else { MessageBoxDlg.showDlg( - this.getShell(), "Input ID/PW", "Please input your ID or Password.", DialogType.NOTIFY, false); + this.getShell(), "Input ID/PW", "Please input your ID or Password.", DialogType.NOTIFY_OK, false); } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java index ca666b6..fd975f0 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java @@ -53,7 +53,8 @@ public class MessageBoxDlg { */ public enum DialogType { INFO, - NOTIFY, + NOTIFY_OK, + NOTIFY_YES, WARNING, ERROR, } @@ -74,8 +75,10 @@ public class MessageBoxDlg { return; } else if (dlgType == DialogType.INFO) { style = SWT.OK | SWT.ICON_INFORMATION; - } else if (dlgType == DialogType.NOTIFY) { + } else if (dlgType == DialogType.NOTIFY_OK) { style = SWT.OK | SWT.ICON_INFORMATION; + } else if (dlgType == DialogType.NOTIFY_YES) { + style = SWT.YES | SWT.NO | SWT.ICON_INFORMATION; } else if (dlgType == DialogType.WARNING) { style = SWT.YES | SWT.NO | SWT.ICON_WARNING; } else if (dlgType == DialogType.ERROR) { diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/ProxySettingsDialog.java b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/ProxySettingsDialog.java index 940b1d1..4ff6c0a 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/dialog/ProxySettingsDialog.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/dialog/ProxySettingsDialog.java @@ -354,13 +354,13 @@ public class ProxySettingsDialog extends Dialog { Log.ExceptionLog(e); MessageBoxDlg.showDlg( - this.getShell(), "Proxy settings", "Port number is invalid.", DialogType.NOTIFY, false); + this.getShell(), "Proxy settings", "Port number is invalid.", DialogType.NOTIFY_OK, false); return; } if (!Downloader.isAvailableURL(proxyHost, port)) { MessageBoxDlg.showDlg( - this.getShell(), "Proxy settings", "IP address is invalid.", DialogType.NOTIFY, false); + this.getShell(), "Proxy settings", "IP address is invalid.", DialogType.NOTIFY_OK, false); return; } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java index 1cff45d..f540558 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java @@ -805,6 +805,7 @@ public class ViewController { } public boolean updateInstallManager() { + Log.log("Installmanager will update itself"); Package pkg = packageManager.getPackageByName(InstallManagerConstants.INSTALLMANAGER_PACKAGE_NAME); if (pkg == null) { @@ -909,6 +910,8 @@ public class ViewController { File tempIMJarFile = new File(PathUtil.get( PathUtil.getTempDir(), "data", "install-manager", InstallManagerConstants.INSTALLMANAGERV2_JAR_FILE_NAME)); + + Log.log("New installmanager will start. => " + tempIMJarFile.getAbsolutePath()); if (tempIMJarFile.exists()) { try { -- 2.7.4