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