From: yongsung1.kim Date: Sun, 1 Dec 2013 13:25:07 +0000 (+0900) Subject: [INST_UI] InstallManager has new UX. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F44%2F13244%2F1;p=sdk%2Finstaller%2Finstall-manager.git [INST_UI] InstallManager has new UX. InstallManager has new UX but it is not yet complete. We are developing it. We need to save modified codes to repository. Change-Id: I25a115c0920f9b8461f3d764fc90411a129713ad Signed-off-by: yongsung1.kim --- diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/IMError.java b/InstallManager_java/src/org/tizen/installmanager/lib/IMError.java index 689d92e..5086f62 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/IMError.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/IMError.java @@ -71,7 +71,7 @@ public class IMError { window.setCancelBtnEnabled(true); window.showComposite(completePage); completePage.setTitle("Installation Error"); - completePage.setCustomErrorMessage(message, SWT.CENTER); + completePage.setCustomErrorMessage(message); } }); diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java index 3542e47..03343d8 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java @@ -60,6 +60,7 @@ public class CompletePage extends InstallPage { public static final String STRING_TITLE = "Completed installation."; private Label completeMessageLabel; private Label informationLabel; + private Label errorMessageLabel; public Button releaseNoteButton; private StyledText errorText; @@ -82,6 +83,7 @@ public class CompletePage extends InstallPage { getCircularGraph().setGraphBgColor(PROGRESS_CIRCLE_COLOR); setCompleteMessageLabel(); + setErrorMessageLabel(); setInfoLabel(); setErrorText(); setCheckButton(); @@ -91,18 +93,22 @@ public class CompletePage extends InstallPage { } private void setCompleteMessageLabel() { - completeMessageLabel = new Label(customComposite, SWT.WRAP); - completeMessageLabel.setBounds(100, 133, 450, 45); -// completeMessageLabel.setAlignment(SWT.LEFT); + completeMessageLabel = new Label(customComposite, SWT.LEFT); + completeMessageLabel.setBounds(95, 133, 450, 45); completeMessageLabel.setText(""); -// completeMessageLabel.setBackground(InstallManagerWindow.getBackgroundColor()); - completeMessageLabel.setBackground(new Color(null, new RGB(191, 139, 41))); + completeMessageLabel.setBackground(InstallManagerWindow.getBackgroundColor()); + } + + private void setErrorMessageLabel() { + errorMessageLabel = new Label(customComposite, SWT.CENTER); + errorMessageLabel.setBounds(95, 133, 450, 45); + errorMessageLabel.setText(""); + errorMessageLabel.setBackground(InstallManagerWindow.getBackgroundColor()); } private void setInfoLabel() { - informationLabel = new Label(customComposite, SWT.WRAP); - informationLabel.setBounds(100, 183, 450, 50); -// informationLabel.setAlignment(SWT.LEFT); + informationLabel = new Label(customComposite, SWT.LEFT); + informationLabel.setBounds(95, 183, 450, 50); informationLabel.setText(""); informationLabel.setBackground(InstallManagerWindow.getBackgroundColor()); @@ -122,8 +128,8 @@ public class CompletePage extends InstallPage { releaseNoteButton.setBounds(243, 245, 122, 26); releaseNoteButton.pack(); // If JDK does not support to DeskTop class, InstallManager cannot show release note. -// releaseNoteButton.setVisible(Desktop.isDesktopSupported()); -// releaseNoteButton.setSelection(Desktop.isDesktopSupported()); + releaseNoteButton.setVisible(Desktop.isDesktopSupported()); + releaseNoteButton.setSelection(Desktop.isDesktopSupported()); } private void setErrorText() { @@ -131,16 +137,14 @@ public class CompletePage extends InstallPage { errorText.setBounds(10, 235, 608, 100); errorText.setAlignment(SWT.CENTER); errorText.setText(""); -// errorText.setBackground(InstallManagerWindow.getBackgroundColor()); - errorText.setBackground(new Color(null, new RGB(191, 139, 41))); - errorText.setVisible(Desktop.isDesktopSupported()); + errorText.setBackground(InstallManagerWindow.getBackgroundColor()); + errorText.setVisible(!Desktop.isDesktopSupported()); } public void setErrorTextMsg() { errorText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED)); errorText.setText("Your system does not support to show the release note.\n" + " Please refer to the following URL.\n"); - String tmp = Config.getInstance().getReleaseNoteUrl(); errorText.append(Config.getInstance().getReleaseNoteUrl()); } @@ -165,11 +169,12 @@ public class CompletePage extends InstallPage { * Show message on complete page. * @param completeMsg */ -// public void setCustomMessage(String completeMsg) { -// completeMessageLabel.setText(completeMsg); -// } + public void setCustomMessage(String completeMsg) { + completeMessageLabel.setText(completeMsg); + } public void setCustomMessage(String completeMsg, int style) { + errorMessageLabel.setVisible(false); completeMessageLabel.setText(completeMsg); completeMessageLabel.setAlignment(style); } @@ -178,6 +183,7 @@ public class CompletePage extends InstallPage { String msg = informationLabel.getText(); msg = msg + "Information : \n" + infoMsg; + errorMessageLabel.setVisible(false); informationLabel.setText(msg); informationLabel.setAlignment(style); } @@ -214,10 +220,11 @@ public class CompletePage extends InstallPage { * Show error message on complete page. * @param errorMsg */ - public void setCustomErrorMessage(String errorMsg, int style) { - completeMessageLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED)); - completeMessageLabel.setText(errorMsg); - completeMessageLabel.setAlignment(style); + public void setCustomErrorMessage(String errorMsg) { + completeMessageLabel.setVisible(false); + errorMessageLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED)); + errorMessageLabel.setText(errorMsg); + getCircularGraph().setGraphBgColor(PROGRESS_CIRCLE_ERROR_COLOR); } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallPage.java index 13fee8f..98e89e6 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallPage.java @@ -23,6 +23,7 @@ public class InstallPage extends PageTemplate { static final Color PROGRESS_CIRCLE_BACKGROUND_COLOR = new Color(null, new RGB(189, 189, 189)); // light gray static final Color PROGRESS_CIRCLE_COLOR = new Color(null, new RGB(131, 196, 218)); // light blue static final Color PROGRESS_CIRCLE_CENTER_COLOR = new Color(null, new RGB(255, 255, 255)); // white + static final Color PROGRESS_CIRCLE_ERROR_COLOR = new Color(null, new RGB(255, 0, 0)); // red protected Label titleLabel; private IMCircularGraph progressGraph; // private int circularType = 0; // 0 is percentage, 1 is custom. diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java index 083cf58..faaa69d 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java @@ -41,6 +41,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; import org.tizen.installmanager.core.Config; import org.tizen.installmanager.core.IMExitException; import org.tizen.installmanager.core.IMFatalException; @@ -86,7 +87,7 @@ public class InstallingPage extends InstallPage { private Button detailOpenButton; private Button detailCloseButton; - private Label detailLabel; + private Text detailText; private ViewController viewController; private String installPath; @@ -116,7 +117,7 @@ public class InstallingPage extends InstallPage { setInstallFileNameLabel(); setDetailOpenButton(); // to do later setDetailCloseButton(); // to do later - setDetailLabel(); // to do later + setDetailText(); // to do later } private void setDownloadCurrentSizeLabel() { @@ -197,7 +198,7 @@ public class InstallingPage extends InstallPage { installFileNameLabel.setVisible(false); detailOpenButton.setVisible(false); detailCloseButton.setVisible(true); - detailLabel.setVisible(true); + detailText.setVisible(true); } }); } @@ -216,16 +217,21 @@ public class InstallingPage extends InstallPage { installFileNameLabel.setVisible(true); detailOpenButton.setVisible(true); detailCloseButton.setVisible(false); - detailLabel.setVisible(false); + detailText.setVisible(false); } }); } - private void setDetailLabel() { - detailLabel = new Label(customComposite, SWT.NONE); - detailLabel.setAlignment(SWT.LEFT); - detailLabel.setBounds(10, 197, 608, 97); - detailLabel.setVisible(false); + private void setDetailText() { + detailText = new Text(customComposite, SWT.WRAP | SWT.V_SCROLL | SWT.BORDER | SWT.READ_ONLY); + detailText.setBounds(10, 197, 608, 97); + detailText.setText(""); + detailText.setEditable(false); + detailText.setVisible(false); + } + + public void setDetailMessage(String msg) { + detailText.append(msg + "/n"); } /** @@ -453,7 +459,7 @@ public class InstallingPage extends InstallPage { CompletePage completePage = mainWindow.getCompletePage(); - if (ErrorController.checkInstallationSuccess()) { + if (!ErrorController.checkInstallationSuccess()) { completePage.setTitleLabelText("Installation Completed"); String customMessage = ""; @@ -478,16 +484,14 @@ public class InstallingPage extends InstallPage { // if (ErrorController.existInfoMessage()) { completePage.setInfoMessage(InfoCode.RESTART_THE_COMPUTER.getInfoMessage() - /*ErrorController.getInfoMessage()*/, SWT.RIGHT); + /*ErrorController.getInfoMessage()*/, SWT.LEFT); // } Log.log("installation complete"); } else { Log.log("(un)installation failed"); completePage.setTitleLabelText("(Un)Installation failed"); - ErrorController.setErrorMessage("Test error"); -// completePage.setCustomErrorMessage(ErrorController.getErrorMessage() + "\n", SWT.RIGHT); - completePage.setCustomErrorMessage(ErrorController.getErrorMessage(), SWT.RIGHT); + completePage.setCustomErrorMessage(ErrorController.getErrorMessage() + "\n"); mainWindow.getCompletePage().showCheckButton(false); } @@ -553,6 +557,7 @@ public class InstallingPage extends InstallPage { @Override public void run() { downloadFileNameLabel.setText("Downloading : " + getEtcString(fileName)); + detailText.append(getEtcString(fileName) + "\n"); } }); } @@ -679,6 +684,7 @@ public class InstallingPage extends InstallPage { @Override public void run() { installFileNameLabel.setText("Installing : " + getEtcString(fileName)); + detailText.append(getEtcString(fileName) + "\n"); } }); } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java index b5d4db0..c9dd576 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java @@ -246,8 +246,6 @@ public class UninstallingPage extends InstallPage { circularGraph.update(100); CompletePage completePage = mainWindow.getCompletePage(); -// completePage.setLeftImageFromResource(CompletePage.RSC_PATH_IMAGE_NEW); - if (ErrorController.checkInstallationSuccess()) { completePage.setTitleLabelText("Uninstallation Completed!"); @@ -256,15 +254,15 @@ public class UninstallingPage extends InstallPage { } String msg = "Thank you for using Tizen SDK. "; - completePage.setCustomMessage(msg, SWT.RIGHT); + completePage.setCustomMessage(msg, SWT.CENTER); if (ErrorController.existInfoMessage()) { - completePage.setInfoMessage(ErrorController.getInfoMessage(), SWT.RIGHT); + completePage.setInfoMessage(ErrorController.getInfoMessage(), SWT.CENTER); } } else { completePage.setTitleLabelText("Uninstallation Failed!"); completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.\n" - + "Datail : " + ErrorController.getErrorMessage(), SWT.LEFT); + + "Datail : " + ErrorController.getErrorMessage()); } completePage.showCheckButton(false); diff --git a/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java b/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java index ed5d597..a4f9938 100644 --- a/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java +++ b/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java @@ -42,7 +42,6 @@ import java.net.URL; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; -import org.tizen.installmanager.core.Config; import org.tizen.installmanager.core.IMFatalException; import org.tizen.installmanager.core.Options; import org.tizen.installmanager.lib.Log; @@ -52,7 +51,6 @@ import org.tizen.installmanager.lib.Registry; import org.tizen.installmanager.lib.ErrorController.ErrorCode; import org.tizen.installmanager.lib.win.WindowsRegistry; - /** * Common function related path. * @author Shiyun Kim