[Title]
authorshihyun <shihyun@shihyun-Samsung-Desktop-System.(none)>
Tue, 6 Aug 2013 08:17:36 +0000 (17:17 +0900)
committershihyun <shihyun@shihyun-Samsung-Desktop-System.(none)>
Tue, 6 Aug 2013 08:17:36 +0000 (17:17 +0900)
* Add meta packages to install

InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java
InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/ui/model/Item.java

index 7b02f0e..1a91b35 100644 (file)
@@ -708,10 +708,23 @@ public class InstallManager {
         * @return
         * @throws IMExitException
         */
-       public boolean install(PackageSet installablePackages, String targetDir,
+       public boolean install(PackageSet installablePackages, final String targetDir,
                        InstallProgressMonitor monitor) throws IMExitException, IMNetworkException{
                Log.log("InstallManager.install() installable packages : " + installablePackages);
                
+//             for (final Package pkg : installablePackages) {
+//                     String fileName = pkg.getFileName();
+//                     boolean downloadResult = downloadPackage(pkg, PathUtil.addURLPath(mConfig.getDownloadPkgPath(), fileName), monitor);
+//                     
+//                     if (downloadPackage(pkg, monitor)) {
+//                             new Thread() {
+//                                     public void run() {
+//                                             install(pkg, targetDir, null);
+//                                     }
+//                             }.run();
+//                     }
+//             }
+               
                //performance measurement
                Performance.sdkPackageSize = packageManager.getTotalSizeOfInstallablePackages(installablePackages, true);
                
index deb0b1d..528b3c4 100644 (file)
@@ -128,6 +128,8 @@ public class Performance {
                        out.newLine();
                        out.write("The install-manager end time\t: " + imEndTime);
                        out.newLine();
+                       out.write("Total package size\t: " + sdkPackageSize);
+                       out.newLine();
                        out.newLine();
                        
                        long progressSecond = getTotalTime();
index 704e097..0de4b9b 100644 (file)
@@ -374,15 +374,13 @@ public class Item implements Comparable<Item> {
         */
        public void setStateByChildren() {
                setCheckStateByChildren(this);
-               setInstallStateByChildren(this);
+//             setInstallStateByChildren(this);
        }
        
        private void setCheckStateByChildren(Item parentItem) {
-               if (!parentItem.hasChildren()) {
-                       return;
-               } else {
-                       for (Item item : parentItem.getChildren()) {
-                               setCheckStateByChildren(item);
+               if (parentItem.hasChildren()) {
+                       for (Item childItem : parentItem.getChildren()) {
+                               setCheckStateByChildren(childItem);
                        }
                        
                        if (parentItem.isChildrenAllChecked()) {
@@ -392,23 +390,11 @@ public class Item implements Comparable<Item> {
                        } else {
                                parentItem.setCheckState(CheckState.GRAYED);
                        }
-               }
-       }
-       
-       private void setInstallStateByChildren(Item parentItem) {
-               if (!parentItem.hasChildren()) {
-                       return;
                } else {
-                       for (Item item : parentItem.getChildren()) {
-                               setInstallStateByChildren(item);
-                       }
-                       
-                       if (parentItem.isChildrenAllUpdate()) {
-                               parentItem.setInstallState(InstallState.UPDATE);
-                       } else if (parentItem.isChildrenAllUninstall()) {
-                               parentItem.setInstallState(InstallState.UNINSTALL);
+                       if (parentItem.getInstallState() != InstallState.INSTALL) {
+                               parentItem.setCheckState(true);
                        } else {
-                               parentItem.setInstallState(InstallState.INSTALL);
+                               parentItem.setCheckState(false);
                        }
                }
        }
@@ -440,7 +426,16 @@ public class Item implements Comparable<Item> {
                return true;
        }
        
-       private boolean isChildrenAllUpdate() {
+       private boolean isChildrenAllInstallState() {
+               for (Item item : getChildren()) {
+                       if (item.getInstallState() != InstallState.INSTALL) {
+                               return false;
+                       }
+               }
+               return true;
+       }
+       
+       private boolean isChildrenAllUpdateState() {
                for (Item item : getChildren()) {
                        if (item.getInstallState() != InstallState.UPDATE) {
                                return false;
@@ -449,7 +444,7 @@ public class Item implements Comparable<Item> {
                return true;
        }
        
-       private boolean isChildrenAllUninstall() {
+       private boolean isChildrenAllUninstallState() {
                for (Item item : getChildren()) {
                        if (item.getInstallState() != InstallState.UNINSTALL) {
                                return false;
@@ -486,16 +481,14 @@ public class Item implements Comparable<Item> {
         * @param checked is true, checking in box on tree view. false is the opposite.
         */
        public void getTerminalPackages(List<String> installList, boolean checked) {
-               if (hasChildren()) {
+               if (getCheckState() == CheckState.CHECKED) {
+                       installList.add(getPackageName());
+               } else if (getCheckState() == CheckState.GRAYED) {
                        for (Item childItem : getChildren()) {
                                childItem.getTerminalPackages(installList, checked);
                        }
-               }
-               
-               if (getChildren().size() <= 0) {
-                       if (getCheckState() == CheckState.CHECKED) {
-                               installList.add(getPackageName());
-                       }
+               } else {
+                       return;
                }
        }