From 897f2fcdf298bcac78b7405bbe085cf8dc7fe4a2 Mon Sep 17 00:00:00 2001 From: "yongsung1.kim" Date: Thu, 17 Apr 2014 19:06:58 +0900 Subject: [PATCH] [INST] Modified installable list page for multi profile. Change-Id: I0d4b5e977973b33f1716473ca54cdc8b8115e389 Signed-off-by: yongsung1.kim --- .../tizen/installmanager/core/InstallManager.java | 2 +- .../tizen/installmanager/lib/ErrorController.java | 2 +- .../ui/page/InstallableListPage.java | 150 +++++---------------- 3 files changed, 39 insertions(+), 115 deletions(-) diff --git a/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java b/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java index d1025b4..b85f6cc 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java @@ -154,7 +154,7 @@ public class InstallManager { private void initPackageManager(Collection repositoryURLs) { File installedPackageListFile = null; - if (Registry.targetPath != "") { + if (!Registry.targetPath.equalsIgnoreCase("")) { installedPackageListFile = new File(PathUtil.get( PathUtil.get(Registry.targetPath, Config.INFO_DIRECTORY), Config.INSTALLED_PACKAGE_LIST_FILE_NAME)); diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java b/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java index 94f8472..245dc8c 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java @@ -327,7 +327,7 @@ public class ErrorController { retryCount = cnt; } - public static int getNetworkRetryCount(int cnt) { + public static int getNetworkRetryCount() { return retryCount; } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallableListPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallableListPage.java index 369ced3..47fa6e5 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallableListPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallableListPage.java @@ -59,29 +59,23 @@ import org.tizen.installmanager.pkg.model.Package; * @author Yongsung Kim */ public class InstallableListPage extends PackageListPage { - - private static final String RSC_PATH_IMAGE = RESOURCE_PATH - + "/install_manager_graphicmotif_002.png"; private static final String RSC_PATH_IMAGE_NEW = RESOURCE_PATH_NEW + "/02_installation_option_bg.png"; private static final String RSC_PATH_BUTTON_NORMAL = RESOURCE_PATH_NEW + "/btn_01_normal.png"; - private static final String RSC_PATH_BUTTON_HOVER = RESOURCE_PATH_NEW + "/btn_01_hover.png"; - private static final String RSC_PATH_BUTTON_PUSHED = RESOURCE_PATH_NEW + "/btn_01_pushed.png"; - private static final String RSC_PATH_BUTTON_SELECTED = RESOURCE_PATH_NEW + "/btn_01_selected.png"; private static final String STRING_TITLE = "Select installation type"; // Web, Native minimal packages name. private static final String TYPICAL_PACKAGE_NAME = "TYPICAL"; private static final String MINIMAL_PACKAGE_NAME = "MINIMAL"; - private static final String WEB_MINIMAL_PACKAGE_NAME = "WEB-MINIMAL"; - private static final String NATIVE_MINIMAL_PACKAGE_NAME = "NATIVE-MINIMAL"; // UI button names private static final String TYPICAL_BUTTON_NAME = "Typical"; private static final String MINIMAL_BUTTON_NAME = "Minimal"; private static final String CUSTOM_BUTTON_NAME = "Custom"; - private static final String WEB_MINIMAL_BUTTON_NAME = "Web app"; - private static final String NATIVE_MINIMAL_BUTTON_NAME = "Native app"; + private static final String PRESET_BUTTON_NAME = "Preset"; + private static final String EXTRA_BUTTON_NAME = "Extra repository"; +// private static final String WEB_MINIMAL_BUTTON_NAME = "Web app"; +// private static final String NATIVE_MINIMAL_BUTTON_NAME = "Native app"; private Composite buttonComposite; @@ -89,8 +83,9 @@ public class InstallableListPage extends PackageListPage { private Button typicalButton; private Button minimalButton; private Button customButton; - private Button webMinimalButton; - private Button nativeMinimalButton; + private Button presetButton; +// private Button webMinimalButton; +// private Button nativeMinimalButton; private Button addExtraButton; private AddExtraRepositoryDialog extraDialog; @@ -125,10 +120,11 @@ public class InstallableListPage extends PackageListPage { setTypicalButton(); setMinimalButton(); setCustomButton(); + setPresetButton(); setAddRepositoryButton(); - setWebMinimalButton(); - setNativeMinimalButton(); +// setWebMinimalButton(); +// setNativeMinimalButton(); } /** @@ -184,25 +180,7 @@ public class InstallableListPage extends PackageListPage { minimalButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - if (viewController.hasWebNativeMinimal()) { - if (webMinimalButton.getSelection() && !nativeMinimalButton.getSelection()) { - refreshByType(InstallType.WEB_MINIMAL); - } else if (!webMinimalButton.getSelection() && nativeMinimalButton.getSelection()) { - refreshByType(InstallType.NATIVE_MINIMAL); - } else if (webMinimalButton.getSelection() && nativeMinimalButton.getSelection()) { - refreshByType(InstallType.MINIMAL); - } - webMinimalButton.setVisible(true); - webMinimalButton.setEnabled(true); - - nativeMinimalButton.setVisible(true); - nativeMinimalButton.setEnabled(true); - } else { - refreshByType(InstallType.MINIMAL); - } - customButton.setBounds(0, 152, 134, 34); - addExtraButton.setBounds(0, 190, 134, 34); - + refreshByType(InstallType.MINIMAL); String description = viewController.getDescription(MINIMAL_PACKAGE_NAME); setComponentDescriptionText(description); } @@ -213,75 +191,6 @@ public class InstallableListPage extends PackageListPage { minimalButton.setBackground(InstallManagerWindow.getBackgroundColor()); minimalButton.setBackgroundImage(PathUtil.getImageFromResource(RSC_PATH_BUTTON_NORMAL)); } - - /** - * Set Web Minimal Type checkbox button. - */ - private void setWebMinimalButton() { - if (webMinimalButton == null) { - webMinimalButton = new Button(buttonComposite, SWT.CHECK); - } - - webMinimalButton.setBounds(14, 76, 120, 34); - webMinimalButton.setText(WEB_MINIMAL_BUTTON_NAME); - webMinimalButton.setBackground(InstallManagerWindow.getBackgroundColor()); - webMinimalButton.setVisible(false); - webMinimalButton.setEnabled(false); - webMinimalButton.setSelection(true); - - webMinimalButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (webMinimalButton.getSelection()) { - if (nativeMinimalButton.getSelection()) { - refreshByType(InstallType.MINIMAL); - } else { - refreshByType(InstallType.WEB_MINIMAL); - } - } else { - if (!nativeMinimalButton.getSelection()) { - nativeMinimalButton.setSelection(true); - } - - refreshByType(InstallType.NATIVE_MINIMAL); - } - } - }); - } - - /** - * Set Native Minimal Type checkbox button. - */ - private void setNativeMinimalButton() { - if (nativeMinimalButton == null) { - nativeMinimalButton = new Button(buttonComposite, SWT.CHECK); - } - - nativeMinimalButton.setBounds(14, 114, 120, 34); - nativeMinimalButton.setText(NATIVE_MINIMAL_BUTTON_NAME); - nativeMinimalButton.setBackground(InstallManagerWindow.getBackgroundColor()); - nativeMinimalButton.setVisible(false); - nativeMinimalButton.setEnabled(false); -// nativeMinimalButton.setSelection(false); - - nativeMinimalButton.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - if (nativeMinimalButton.getSelection()) { - if (webMinimalButton.getSelection()) { - refreshByType(InstallType.MINIMAL); - } else { - refreshByType(InstallType.NATIVE_MINIMAL); - } - } else { - if (!webMinimalButton.getSelection()) { - webMinimalButton.setSelection(true); - } - refreshByType(InstallType.WEB_MINIMAL); - } - } - }); - } /** * Set Custom Type radio button. @@ -319,13 +228,34 @@ public class InstallableListPage extends PackageListPage { /** * Set add Repository button. */ + private void setPresetButton() { + if (presetButton == null) { + presetButton = new Button(buttonComposite ,SWT.NONE | SWT.LEFT); + } + + presetButton.setBounds(0, 114, 134, 34); + presetButton.setText(PRESET_BUTTON_NAME); + presetButton.setBackground(InstallManagerWindow.getBackgroundColor()); + + presetButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + extraDialog = new AddExtraRepositoryDialog(buttonComposite.getShell(), viewController); + extraDialog.open(); + loadPage(InstallManagerWindow.getInstallManagerWindow().getViewController()); + } + }); + } + + /** + * Set add Repository button. + */ private void setAddRepositoryButton() { if (addExtraButton == null) { addExtraButton = new Button(buttonComposite ,SWT.NONE | SWT.LEFT); } - addExtraButton.setBounds(0, 114, 133, 34); - addExtraButton.setText("Extra repository"); + addExtraButton.setBounds(0, 152, 134, 34); + addExtraButton.setText(EXTRA_BUTTON_NAME); addExtraButton.setBackground(InstallManagerWindow.getBackgroundColor()); addExtraButton.addSelectionListener(new SelectionAdapter() { @@ -348,10 +278,8 @@ public class InstallableListPage extends PackageListPage { iType = TYPICAL_PACKAGE_NAME; } else if (instType == InstallType.MINIMAL) { iType = MINIMAL_PACKAGE_NAME; - } else if (instType == InstallType.WEB_MINIMAL) { - iType = WEB_MINIMAL_PACKAGE_NAME; - } else if (instType == InstallType.NATIVE_MINIMAL) { - iType = NATIVE_MINIMAL_PACKAGE_NAME; + } else { + throw new IMFatalException("Not supported install type."); } setCheckedByType(iType); @@ -410,11 +338,7 @@ public class InstallableListPage extends PackageListPage { * Initialize minimal selection when installable page is re-loaded. */ private void initMinimalSetting() { - webMinimalButton.setSelection(true); - nativeMinimalButton.setSelection(false); - - webMinimalButton.setVisible(false); - nativeMinimalButton.setVisible(false); + } /** -- 2.7.4