OSDN Git Service

na-get-lib,複数ソフトインストールかつハッシュ検証失敗したとき、ハッシュ検証成功したソフトの状態がおかしくなる不具合を修正
[applistation/AppliStation.git] / AppliStation / PackageListViewForm.cs
index 5d3e318..a66d9a6 100644 (file)
@@ -232,7 +232,7 @@ namespace AppliStation
                {\r
                        AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();\r
                        prog.Shown += delegate(object sender2, EventArgs e2) {\r
-                               NaGet.SubCommands.NaGetUpdate tasks = new NaGet.SubCommands.NaGetUpdate(pkgListsMan, downloadPackageListsFlag);\r
+                               NaGet.SubCommands.NaGetUpdate2 tasks = new NaGet.SubCommands.NaGetUpdate2(pkgListsMan, downloadPackageListsFlag);\r
                                prog.SetTaskSet(tasks);\r
                                prog.Refresh();\r
                                prog.StartTaskSet();\r
@@ -316,13 +316,17 @@ namespace AppliStation
                void SoftCollectionFileExportToolStripMenuItemClick(object sender, EventArgs e)\r
                {\r
                        string pwd = Directory.GetCurrentDirectory();\r
-                       string[] softtargets = new string[]{"PCにインストールされたソフト", "AppliStation内でインストールされたソフト", "インストールされたソフトすべて"};\r
+                       string[] softtargets = new string[]{\r
+                               "PCにインストールされたソフト",\r
+                               "AppliStation内でインストールされたソフト",\r
+                               "インストールされたソフトすべて;PCとAppliStationにインストールされたソフトの両方"\r
+                       };\r
                        int softtargetid = softtargets.Length - 1;\r
                        \r
                        {\r
-                               AppliStation.Util.OptionDialog optdialog = AppliStation.Util.OptionDialog.createOptionDialog(\r
+                               AppliStation.Util.OptionDialog optdialog = AppliStation.Util.OptionDialog.createCommandSelectionDialog(\r
                                        "ソフトコレクションファイルに出力するソフトの種類を選択してください。", "エクスポート", "エクスポートするソフト",\r
-                                       System.Drawing.SystemIcons.Question, MessageBoxButtons.OKCancel,\r
+                                       System.Drawing.SystemIcons.Question,\r
                                        softtargets, softtargets.Length-1);\r
                                if (optdialog.ShowDialog(this) != DialogResult.OK) {\r
                                        return; // canceled\r
@@ -412,7 +416,7 @@ namespace AppliStation
                {\r
                        AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();\r
                        prog.Shown += delegate(object sender2, EventArgs e2) {\r
-                               NaGet.SubCommands.NaGetInstall tasks = new NaGet.SubCommands.NaGetInstall(pkgListsMan, insts);\r
+                               NaGet.SubCommands.NaGetInstall2 tasks = new NaGet.SubCommands.NaGetInstall2(pkgListsMan, insts);\r
                                prog.SetTaskSet(tasks);\r
                                prog.Refresh();\r
                                prog.StartTaskSet();\r
@@ -482,7 +486,7 @@ namespace AppliStation
                {\r
                        AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();\r
                        prog.Shown += delegate(object sender2, EventArgs e2) {\r
-                               NaGet.SubCommands.NaGetUninstall tasks = new NaGet.SubCommands.NaGetUninstall(pkgListsMan, pkgs);\r
+                               NaGet.SubCommands.NaGetUninstall2 tasks = new NaGet.SubCommands.NaGetUninstall2(pkgListsMan, pkgs);\r
                                prog.SetTaskSet(tasks);\r
                                prog.Refresh();\r
                                prog.StartTaskSet();\r
@@ -552,7 +556,7 @@ namespace AppliStation
                {\r
                        AppliStation.Util.ExecutionProgressViewer prog = new AppliStation.Util.ExecutionProgressViewer();\r
                        prog.Shown += delegate(object sender2, EventArgs e2) {\r
-                               NaGet.SubCommands.NaGetDownloadToCache tasks = new NaGet.SubCommands.NaGetDownloadToCache(pkgListsMan, pkgs);\r
+                               NaGet.SubCommands.NaGetDownloadToCache2 tasks = new NaGet.SubCommands.NaGetDownloadToCache2(pkgListsMan, pkgs);\r
                                prog.SetTaskSet(tasks);\r
                                prog.Refresh();\r
                                prog.StartTaskSet();\r
@@ -713,30 +717,10 @@ namespace AppliStation
                        // webGoogleSearchMenuItem always active.\r
                }\r
                \r
-               private IEnumerable<Package> getUpdatedPackages(PackageList<InstalledPackage> installedPkgList, PackageList<Package> avaiablePkgList, IComparer<string> verComp)\r
-               {\r
-                       foreach (InstalledPackage pkg in installedPkgList) {\r
-                               Package avaiablePkg = avaiablePkgList.GetPackageForName(pkg.Name);\r
-                               \r
-                               if (avaiablePkg != null) {\r
-                                       if (verComp.Compare(pkg.Version, avaiablePkg.Version) < 0 &&\r
-                                           installedPkgList.GetPackageForPackage(pkg.Name, avaiablePkg.Version) == null) {\r
-                                               \r
-                                               yield return avaiablePkg;\r
-                                       }\r
-                               }\r
-                       }\r
-               }\r
-               \r
                void UpgradeToolStripButtonClick(object sender, EventArgs e)\r
                {\r
-                       List<Package> pkgs;\r
-                       VersionComparetor verComp = new VersionComparetor();\r
-                       PackageList<Package> avaiablePackageList = pkgListsMan.AvailablePkgList;\r
-                       \r
-                       pkgs = NaGet.Utils.MergeList(\r
-                               getUpdatedPackages(pkgListsMan.InstalledPkgList, avaiablePackageList, verComp),\r
-                               getUpdatedPackages(pkgListsMan.SystemInstalledPkgList, avaiablePackageList, verComp)\r
+                       List<Package> pkgs = new List<Package>(\r
+                               UpgradeFinder.GetUpgradePackages(pkgListsMan)\r
                        );\r
                        \r
                        if (pkgs.Count <= 0) {\r