OSDN Git Service

AppliStation-GUI,インストール確認ダイアログで「インストール」と「アップグレード」を分けた
authorttp <ttp@users.sourceforge.jp>
Sun, 7 Jun 2009 04:38:25 +0000 (13:38 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 7 Jun 2009 04:38:25 +0000 (13:38 +0900)
AppliStation/InstallationConfirmForm.Designer.cs
AppliStation/InstallationConfirmForm.cs

index 28f1928..4ddfaf7 100644 (file)
@@ -31,8 +31,9 @@ namespace AppliStation
                {\r
                        this.components = new System.ComponentModel.Container();\r
                        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationConfirmForm));\r
-                       System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("インストール(またはアップグレード)するソフト", System.Windows.Forms.HorizontalAlignment.Left);\r
-                       System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("動作させるのに必要なソフト", System.Windows.Forms.HorizontalAlignment.Left);\r
+                       System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("インストールするソフト", System.Windows.Forms.HorizontalAlignment.Left);\r
+                       System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("アップデートするソフト", System.Windows.Forms.HorizontalAlignment.Left);\r
+                       System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("動作させるのに必要なソフト", System.Windows.Forms.HorizontalAlignment.Left);\r
                        this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\r
                        this.btnPanel = new System.Windows.Forms.FlowLayoutPanel();\r
                        this.runasCheckBox = new System.Windows.Forms.CheckBox();\r
@@ -44,13 +45,13 @@ namespace AppliStation
                        this.versionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.currentVersionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.silentInstColumnHeader = new System.Windows.Forms.ColumnHeader();\r
+                       this.pkgListNameColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.instListViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);\r
                        this.silentInstallStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.instListToolStripSeparator = new System.Windows.Forms.ToolStripSeparator();\r
                        this.selectAllInstsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.unselectAllInstsStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.instListViewSilentInstallImageList = new System.Windows.Forms.ImageList(this.components);\r
-                       this.pkgListNameColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.tableLayoutPanel1.SuspendLayout();\r
                        this.btnPanel.SuspendLayout();\r
                        this.instListViewContextMenuStrip.SuspendLayout();\r
@@ -143,13 +144,16 @@ namespace AppliStation
                        this.instsListView.ContextMenuStrip = this.instListViewContextMenuStrip;\r
                        this.instsListView.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.instsListView.GridLines = true;\r
-                       listViewGroup1.Header = "インストール(またはアップグレード)するソフト";\r
+                       listViewGroup1.Header = "インストールするソフト";\r
                        listViewGroup1.Name = "install";\r
-                       listViewGroup2.Header = "動作させるのに必要なソフト";\r
-                       listViewGroup2.Name = "requires";\r
+                       listViewGroup2.Header = "アップデートするソフト";\r
+                       listViewGroup2.Name = "update";\r
+                       listViewGroup3.Header = "動作させるのに必要なソフト";\r
+                       listViewGroup3.Name = "requires";\r
                        this.instsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {\r
                                                                        listViewGroup1,\r
-                                                                       listViewGroup2});\r
+                                                                       listViewGroup2,\r
+                                                                       listViewGroup3});\r
                        this.instsListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;\r
                        this.instsListView.Location = new System.Drawing.Point(5, 53);\r
                        this.instsListView.Margin = new System.Windows.Forms.Padding(5, 3, 5, 5);\r
@@ -160,9 +164,9 @@ namespace AppliStation
                        this.instsListView.TabIndex = 2;\r
                        this.instsListView.UseCompatibleStateImageBehavior = false;\r
                        this.instsListView.View = System.Windows.Forms.View.Details;\r
+                       this.instsListView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.InstsListViewDrawColumnHeader);\r
                        this.instsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.InstsListViewItemChecked);\r
                        this.instsListView.DrawSubItem += new System.Windows.Forms.DrawListViewSubItemEventHandler(this.InstsListViewDrawSubItem);\r
-                       this.instsListView.DrawColumnHeader += new System.Windows.Forms.DrawListViewColumnHeaderEventHandler(this.InstsListViewDrawColumnHeader);\r
                        // \r
                        // nameColumnHeader\r
                        // \r
@@ -184,6 +188,10 @@ namespace AppliStation
                        this.silentInstColumnHeader.Text = "自動インストール";\r
                        this.silentInstColumnHeader.Width = 28;\r
                        // \r
+                       // pkgListNameColumnHeader\r
+                       // \r
+                       this.pkgListNameColumnHeader.Text = "レポジトリ";\r
+                       // \r
                        // instListViewContextMenuStrip\r
                        // \r
                        this.instListViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
@@ -192,32 +200,32 @@ namespace AppliStation
                                                                        this.selectAllInstsStripMenuItem,\r
                                                                        this.unselectAllInstsStripMenuItem});\r
                        this.instListViewContextMenuStrip.Name = "packageListViewContextMenuStrip";\r
-                       this.instListViewContextMenuStrip.Size = new System.Drawing.Size(220, 76);\r
+                       this.instListViewContextMenuStrip.Size = new System.Drawing.Size(263, 76);\r
                        this.instListViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.InstsListViewContextMenuStripOpening);\r
                        // \r
                        // silentInstallStripMenuItem\r
                        // \r
                        this.silentInstallStripMenuItem.Name = "silentInstallStripMenuItem";\r
-                       this.silentInstallStripMenuItem.Size = new System.Drawing.Size(219, 22);\r
+                       this.silentInstallStripMenuItem.Size = new System.Drawing.Size(262, 22);\r
                        this.silentInstallStripMenuItem.Text = "サイレントインストールをする(&S)";\r
                        this.silentInstallStripMenuItem.Click += new System.EventHandler(this.SilentInstallStripMenuItemClick);\r
                        // \r
                        // instListToolStripSeparator\r
                        // \r
                        this.instListToolStripSeparator.Name = "instListToolStripSeparator";\r
-                       this.instListToolStripSeparator.Size = new System.Drawing.Size(216, 6);\r
+                       this.instListToolStripSeparator.Size = new System.Drawing.Size(259, 6);\r
                        // \r
                        // selectAllInstsStripMenuItem\r
                        // \r
                        this.selectAllInstsStripMenuItem.Name = "selectAllInstsStripMenuItem";\r
-                       this.selectAllInstsStripMenuItem.Size = new System.Drawing.Size(219, 22);\r
+                       this.selectAllInstsStripMenuItem.Size = new System.Drawing.Size(262, 22);\r
                        this.selectAllInstsStripMenuItem.Text = "全て選択(&A)";\r
                        this.selectAllInstsStripMenuItem.Click += new System.EventHandler(this.SelectAllInstsStripMenuItemClick);\r
                        // \r
                        // unselectAllInstsStripMenuItem\r
                        // \r
                        this.unselectAllInstsStripMenuItem.Name = "unselectAllInstsStripMenuItem";\r
-                       this.unselectAllInstsStripMenuItem.Size = new System.Drawing.Size(219, 22);\r
+                       this.unselectAllInstsStripMenuItem.Size = new System.Drawing.Size(262, 22);\r
                        this.unselectAllInstsStripMenuItem.Text = "全ての選択を解除(&U)";\r
                        this.unselectAllInstsStripMenuItem.Click += new System.EventHandler(this.UnselectAllInstsStripMenuItemClick);\r
                        // \r
@@ -227,10 +235,6 @@ namespace AppliStation
                        this.instListViewSilentInstallImageList.TransparentColor = System.Drawing.Color.Transparent;\r
                        this.instListViewSilentInstallImageList.Images.SetKeyName(0, "automatic-install.png");\r
                        // \r
-                       // repoNameColumnHeader\r
-                       // \r
-                       this.pkgListNameColumnHeader.Text = "レポジトリ";\r
-                       // \r
                        // InstallationConfirmForm\r
                        // \r
                        this.AcceptButton = this.okButton;\r
index 3a3c4a2..3b7ed56 100644 (file)
@@ -12,10 +12,12 @@ namespace AppliStation
        /// </summary>\r
        public partial class InstallationConfirmForm : Form\r
        {\r
-               private Installation[] requiredInstallations = null;\r
-               \r
                private Installation[] selectedInstallations = null;\r
                \r
+               private Installation[] updateInstallations = null;\r
+               \r
+               private Installation[] requiredInstallations = null;\r
+               \r
                private PackageListsManager pkgListMan;\r
 \r
                public IEnumerable<Installation> Installations {\r
@@ -23,8 +25,22 @@ namespace AppliStation
                                return NaGet.Utils.MergeEnumerable<Installation>(requiredInstallations, selectedInstallations);\r
                        }\r
                        set {\r
+                               List<Installation> selectedInstList = new List<Installation>();\r
+                               List<Installation> updateInstList = new List<Installation>();\r
+                               \r
                                requiredInstallations = null;\r
-                               selectedInstallations = NaGet.Utils.IEnumerable2Array<Installation>(value);\r
+                               foreach (Installation inst in value) {\r
+                                       Package instPkg = pkgListMan.InstalledPkgList.GetPackageForName(inst.InstalledPackage.Name) ??\r
+                                               pkgListMan.SystemInstalledPkgList.GetPackageForName(inst.InstalledPackage.Name);\r
+                                       \r
+                                       if (instPkg != null) {\r
+                                               updateInstList.Add(inst);\r
+                                       } else {\r
+                                               selectedInstList.Add(inst);\r
+                                       }\r
+                               }\r
+                               selectedInstallations = selectedInstList.ToArray();\r
+                               updateInstallations = updateInstList.ToArray();\r
                                \r
                                updateInstsListView();\r
                        }\r
@@ -72,6 +88,7 @@ namespace AppliStation
                        \r
                        addInstsListItemPerGroup(requiredInstallations, instsListView.Groups["requires"], true);\r
                        addInstsListItemPerGroup(selectedInstallations, instsListView.Groups["install"], false);\r
+                       addInstsListItemPerGroup(updateInstallations, instsListView.Groups["update"], false);\r
                        \r
                        InstsListViewItemChecked(instsListView, null);\r
                        instsListView.Refresh();\r