From db9e7a2788bbb6116b2775344ff1f9fba1817c29 Mon Sep 17 00:00:00 2001 From: ttp Date: Sun, 15 Nov 2009 19:02:52 +0900 Subject: [PATCH] =?utf8?q?AppliStation-GUI,=E3=83=AA=E3=82=B9=E3=83=88?= =?utf8?q?=E3=83=93=E3=83=A5=E3=83=BC=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86?= =?utf8?q?=E3=82=AD=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC?= =?utf8?q?=E3=81=8C=E3=80=8C=E6=83=85=E5=A0=B1=E3=80=8D=E3=83=9C=E3=82=BF?= =?utf8?q?=E3=83=B3=E3=81=AE=E8=BF=91=E3=81=8F=E3=81=A7=E9=96=8B=E3=81=84?= =?utf8?q?=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F=E9=A1=8C=E3=82=92?= =?utf8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- AppliStation/PackageListViewForm.Designer.cs | 211 ++++++++++++++++----------- AppliStation/PackageListViewForm.cs | 84 ++++++----- 2 files changed, 173 insertions(+), 122 deletions(-) diff --git a/AppliStation/PackageListViewForm.Designer.cs b/AppliStation/PackageListViewForm.Designer.cs index f5735d8..942d368 100644 --- a/AppliStation/PackageListViewForm.Designer.cs +++ b/AppliStation/PackageListViewForm.Designer.cs @@ -48,14 +48,12 @@ this.optionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.upgradeToolStripButton = new System.Windows.Forms.ToolStripButton(); this.informationToolStripDropDownButton = new System.Windows.Forms.ToolStripDropDownButton(); - this.packageListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.installToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.uninstallToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.webResourcesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.webOfficialToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.webGoogleSearchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.installedDirectoryStripMenuItem = new AppliStation.Util.ToolStripPetitLauncherMenuItem(); - this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.webResourceMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.webResourceCommonContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.webOfficialMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.webGoogleSearchMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.installedDirectoryMenuItem = new AppliStation.Util.ToolStripPetitLauncherMenuItem(); + this.propertiesMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.installToolStripButton = new System.Windows.Forms.ToolStripButton(); this.uninstallToolStripButton = new System.Windows.Forms.ToolStripButton(); this.splitContainer = new System.Windows.Forms.SplitContainer(); @@ -63,22 +61,29 @@ this.nameHeader = new System.Windows.Forms.ColumnHeader(); this.versionHeader = new System.Windows.Forms.ColumnHeader(); this.summaryHeader = new System.Windows.Forms.ColumnHeader(); + this.packageListContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); + this.installToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.uninstallToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.webResourceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.installedDirectoryToolStripMenuItem = new AppliStation.Util.ToolStripPetitLauncherMenuItem(); + this.propertiesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.packageListViewImageList = new System.Windows.Forms.ImageList(this.components); this.detailBox = new System.Windows.Forms.RichTextBox(); this.tableLayoutPanel1.SuspendLayout(); this.toolStripContainer.SuspendLayout(); this.packageListFilterToolStrip.SuspendLayout(); this.packageCommandsToolStrip.SuspendLayout(); - this.packageListContextMenuStrip.SuspendLayout(); + this.webResourceCommonContextMenuStrip.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); + this.packageListContextMenuStrip.SuspendLayout(); this.SuspendLayout(); // // packageListContextMenuStripSeparator // this.packageListContextMenuStripSeparator.Name = "packageListContextMenuStripSeparator"; - this.packageListContextMenuStripSeparator.Size = new System.Drawing.Size(236, 6); + this.packageListContextMenuStripSeparator.Size = new System.Drawing.Size(211, 6); // // tableLayoutPanel1 // @@ -114,7 +119,7 @@ this.searchTextBox}); this.packageListFilterToolStrip.Location = new System.Drawing.Point(3, 0); this.packageListFilterToolStrip.Name = "packageListFilterToolStrip"; - this.packageListFilterToolStrip.Size = new System.Drawing.Size(177, 25); + this.packageListFilterToolStrip.Size = new System.Drawing.Size(175, 25); this.packageListFilterToolStrip.TabIndex = 1; // // packageFilterToolStripDropDownButton @@ -130,7 +135,7 @@ // allPackageFilterToolStripMenuItem // this.allPackageFilterToolStripMenuItem.Name = "allPackageFilterToolStripMenuItem"; - this.allPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.allPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.allPackageFilterToolStripMenuItem.Text = "全て"; this.allPackageFilterToolStripMenuItem.ToolTipText = "全てのソフトを表示"; this.allPackageFilterToolStripMenuItem.Click += new System.EventHandler(this.AnyPackageFilterToolStripMenuItemClicked); @@ -138,7 +143,7 @@ // notInstalledPackageFilterToolStripMenuItem // this.notInstalledPackageFilterToolStripMenuItem.Name = "notInstalledPackageFilterToolStripMenuItem"; - this.notInstalledPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.notInstalledPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.notInstalledPackageFilterToolStripMenuItem.Text = "未インストール"; this.notInstalledPackageFilterToolStripMenuItem.ToolTipText = "インストールされていないソフトを表示"; this.notInstalledPackageFilterToolStripMenuItem.Click += new System.EventHandler(this.AnyPackageFilterToolStripMenuItemClicked); @@ -146,7 +151,7 @@ // installedASPackageFilterToolStripMenuItem // this.installedASPackageFilterToolStripMenuItem.Name = "installedASPackageFilterToolStripMenuItem"; - this.installedASPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.installedASPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.installedASPackageFilterToolStripMenuItem.Text = "AppliStation内"; this.installedASPackageFilterToolStripMenuItem.ToolTipText = "AppliStationにインストールされているソフトを表示"; this.installedASPackageFilterToolStripMenuItem.Click += new System.EventHandler(this.AnyPackageFilterToolStripMenuItemClicked); @@ -154,7 +159,7 @@ // installedSysPackageFilterToolStripMenuItem // this.installedSysPackageFilterToolStripMenuItem.Name = "installedSysPackageFilterToolStripMenuItem"; - this.installedSysPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(160, 22); + this.installedSysPackageFilterToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.installedSysPackageFilterToolStripMenuItem.Text = "コンピュータ内"; this.installedSysPackageFilterToolStripMenuItem.ToolTipText = "コンピュータにインストールされているソフトを表示"; this.installedSysPackageFilterToolStripMenuItem.Click += new System.EventHandler(this.AnyPackageFilterToolStripMenuItemClicked); @@ -181,7 +186,7 @@ this.uninstallToolStripButton}); this.packageCommandsToolStrip.Location = new System.Drawing.Point(3, 25); this.packageCommandsToolStrip.Name = "packageCommandsToolStrip"; - this.packageCommandsToolStrip.Size = new System.Drawing.Size(489, 25); + this.packageCommandsToolStrip.Size = new System.Drawing.Size(184, 25); this.packageCommandsToolStrip.TabIndex = 2; // // organizeToolStripDropDownButton1 @@ -194,7 +199,7 @@ this.organizeToolStripDropDownButton1.Image = ((System.Drawing.Image)(resources.GetObject("organizeToolStripDropDownButton1.Image"))); this.organizeToolStripDropDownButton1.Name = "organizeToolStripDropDownButton1"; this.organizeToolStripDropDownButton1.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.organizeToolStripDropDownButton1.Size = new System.Drawing.Size(80, 22); + this.organizeToolStripDropDownButton1.Size = new System.Drawing.Size(74, 22); this.organizeToolStripDropDownButton1.Text = "整理(&O)"; this.organizeToolStripDropDownButton1.ToolTipText = "ソフトリストの管理など"; // @@ -203,7 +208,7 @@ this.updateToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("updateToolStripMenuItem.Image"))); this.updateToolStripMenuItem.Name = "updateToolStripMenuItem"; this.updateToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F5))); - this.updateToolStripMenuItem.Size = new System.Drawing.Size(296, 22); + this.updateToolStripMenuItem.Size = new System.Drawing.Size(256, 22); this.updateToolStripMenuItem.Text = "リストの更新(&U)"; this.updateToolStripMenuItem.ToolTipText = "ソフトリストを更新します"; this.updateToolStripMenuItem.Click += new System.EventHandler(this.UpdateToolStripMenuItemClick); @@ -212,19 +217,19 @@ // this.localupdateToolStripMenuItem.Name = "localupdateToolStripMenuItem"; this.localupdateToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.localupdateToolStripMenuItem.Size = new System.Drawing.Size(296, 22); + this.localupdateToolStripMenuItem.Size = new System.Drawing.Size(256, 22); this.localupdateToolStripMenuItem.Text = "インストール済ソフトの読み直し(&R)"; this.localupdateToolStripMenuItem.Click += new System.EventHandler(this.LocalupdateToolStripMenuItemClick); // // organizeToolStripSeparator1 // this.organizeToolStripSeparator1.Name = "organizeToolStripSeparator1"; - this.organizeToolStripSeparator1.Size = new System.Drawing.Size(293, 6); + this.organizeToolStripSeparator1.Size = new System.Drawing.Size(253, 6); // // optionToolStripMenuItem // this.optionToolStripMenuItem.Name = "optionToolStripMenuItem"; - this.optionToolStripMenuItem.Size = new System.Drawing.Size(296, 22); + this.optionToolStripMenuItem.Size = new System.Drawing.Size(256, 22); this.optionToolStripMenuItem.Text = "設定(&O)..."; this.optionToolStripMenuItem.Click += new System.EventHandler(this.OptionToolStripMenuItemClick); // @@ -232,92 +237,76 @@ // this.upgradeToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("upgradeToolStripButton.Image"))); this.upgradeToolStripButton.Name = "upgradeToolStripButton"; - this.upgradeToolStripButton.Size = new System.Drawing.Size(119, 22); + this.upgradeToolStripButton.Size = new System.Drawing.Size(100, 22); this.upgradeToolStripButton.Text = "ソフトの更新(&G)"; this.upgradeToolStripButton.ToolTipText = "最新版のソフトを取得して更新します"; this.upgradeToolStripButton.Click += new System.EventHandler(this.UpgradeToolStripButtonClick); // // informationToolStripDropDownButton // - this.informationToolStripDropDownButton.DropDown = this.packageListContextMenuStrip; + this.informationToolStripDropDownButton.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.webResourceMenuItem, + this.installedDirectoryMenuItem, + this.propertiesMenuItem}); this.informationToolStripDropDownButton.Image = ((System.Drawing.Image)(resources.GetObject("informationToolStripDropDownButton.Image"))); this.informationToolStripDropDownButton.Name = "informationToolStripDropDownButton"; - this.informationToolStripDropDownButton.Size = new System.Drawing.Size(80, 22); + this.informationToolStripDropDownButton.Size = new System.Drawing.Size(74, 22); this.informationToolStripDropDownButton.Text = "情報(&D)"; this.informationToolStripDropDownButton.ToolTipText = "選択されたソフトの情報を調べます"; this.informationToolStripDropDownButton.Visible = false; + this.informationToolStripDropDownButton.DropDownOpening += new System.EventHandler(this.InformationToolStripDropDownButtonDropDownOpening); // - // packageListContextMenuStrip + // webResourceMenuItem // - this.packageListContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.installToolStripMenuItem, - this.uninstallToolStripMenuItem, - this.packageListContextMenuStripSeparator, - this.webResourcesToolStripMenuItem, - this.installedDirectoryStripMenuItem, - this.propertiesToolStripMenuItem}); - this.packageListContextMenuStrip.Name = "packageListContextMenuStrip"; - this.packageListContextMenuStrip.OwnerItem = this.informationToolStripDropDownButton; - this.packageListContextMenuStrip.Size = new System.Drawing.Size(240, 120); - this.packageListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.PackageListContextMenuStripOpening); - // - // installToolStripMenuItem - // - this.installToolStripMenuItem.Name = "installToolStripMenuItem"; - this.installToolStripMenuItem.Size = new System.Drawing.Size(239, 22); - this.installToolStripMenuItem.Text = "インストール(&I)..."; - this.installToolStripMenuItem.Click += new System.EventHandler(this.InstallToolStripButtonClick); - // - // uninstallToolStripMenuItem - // - this.uninstallToolStripMenuItem.Name = "uninstallToolStripMenuItem"; - this.uninstallToolStripMenuItem.Size = new System.Drawing.Size(239, 22); - this.uninstallToolStripMenuItem.Text = "アンインストール(&U)..."; - this.uninstallToolStripMenuItem.Click += new System.EventHandler(this.UninstallToolStripButtonClick); + this.webResourceMenuItem.DropDown = this.webResourceCommonContextMenuStrip; + this.webResourceMenuItem.Name = "webResourceMenuItem"; + this.webResourceMenuItem.Size = new System.Drawing.Size(214, 22); + this.webResourceMenuItem.Tag = ""; + this.webResourceMenuItem.Text = "Webページ(&W)"; // - // webResourcesToolStripMenuItem + // webResourceCommonContextMenuStrip // - this.webResourcesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.webOfficialToolStripMenuItem, - this.webGoogleSearchToolStripMenuItem}); - this.webResourcesToolStripMenuItem.Name = "webResourcesToolStripMenuItem"; - this.webResourcesToolStripMenuItem.Size = new System.Drawing.Size(239, 22); - this.webResourcesToolStripMenuItem.Tag = "\"{0}\"に関するWebページ(&W)"; + this.webResourceCommonContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.webOfficialMenuItem, + this.webGoogleSearchMenuItem}); + this.webResourceCommonContextMenuStrip.Name = "packageListContextMenuStrip"; + this.webResourceCommonContextMenuStrip.Size = new System.Drawing.Size(152, 48); + this.webResourceCommonContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.WebResourceCommonContextMenuStripOpening); // - // webOfficialToolStripMenuItem + // webOfficialMenuItem // - this.webOfficialToolStripMenuItem.Name = "webOfficialToolStripMenuItem"; - this.webOfficialToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.webOfficialToolStripMenuItem.Text = "公式サイト(&O)"; - this.webOfficialToolStripMenuItem.Click += new System.EventHandler(this.WebOfficialToolStripMenuItemClick); + this.webOfficialMenuItem.Name = "webOfficialMenuItem"; + this.webOfficialMenuItem.Size = new System.Drawing.Size(151, 22); + this.webOfficialMenuItem.Text = "公式サイト(&O)"; + this.webOfficialMenuItem.Click += new System.EventHandler(this.WebOfficialMenuItemClick); // - // webGoogleSearchToolStripMenuItem + // webGoogleSearchMenuItem // - this.webGoogleSearchToolStripMenuItem.Name = "webGoogleSearchToolStripMenuItem"; - this.webGoogleSearchToolStripMenuItem.Size = new System.Drawing.Size(159, 22); - this.webGoogleSearchToolStripMenuItem.Text = "Google検索(&G)"; - this.webGoogleSearchToolStripMenuItem.Click += new System.EventHandler(this.WebGoogleSearchToolStripMenuItemClick); + this.webGoogleSearchMenuItem.Name = "webGoogleSearchMenuItem"; + this.webGoogleSearchMenuItem.Size = new System.Drawing.Size(151, 22); + this.webGoogleSearchMenuItem.Text = "Google検索(&G)"; + this.webGoogleSearchMenuItem.Click += new System.EventHandler(this.WebGoogleSearchMenuItemClick); // - // installedDirectoryStripMenuItem + // installedDirectoryMenuItem // - this.installedDirectoryStripMenuItem.InvokerForm = this; - this.installedDirectoryStripMenuItem.Name = "installedDirectoryStripMenuItem"; - this.installedDirectoryStripMenuItem.Size = new System.Drawing.Size(239, 22); - this.installedDirectoryStripMenuItem.Text = "インストール先のフォルダー(&O)"; + this.installedDirectoryMenuItem.InvokerForm = this; + this.installedDirectoryMenuItem.Name = "installedDirectoryMenuItem"; + this.installedDirectoryMenuItem.Size = new System.Drawing.Size(214, 22); + this.installedDirectoryMenuItem.Text = "インストール先のフォルダー(&O)"; // - // propertiesToolStripMenuItem + // propertiesMenuItem // - this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem"; - this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(239, 22); - this.propertiesToolStripMenuItem.Text = "プロパティ(&R)"; - this.propertiesToolStripMenuItem.Click += new System.EventHandler(this.PropertiesToolStripMenuItemClick); + this.propertiesMenuItem.Name = "propertiesMenuItem"; + this.propertiesMenuItem.Size = new System.Drawing.Size(214, 22); + this.propertiesMenuItem.Text = "プロパティ(&R)"; + this.propertiesMenuItem.Click += new System.EventHandler(this.PropertiesCommonMenuItemClick); // // installToolStripButton // this.installToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("installToolStripButton.Image"))); this.installToolStripButton.Name = "installToolStripButton"; this.installToolStripButton.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.installToolStripButton.Size = new System.Drawing.Size(115, 22); + this.installToolStripButton.Size = new System.Drawing.Size(91, 22); this.installToolStripButton.Text = "インストール(&I)"; this.installToolStripButton.ToolTipText = "選択されているソフトをインストールします"; this.installToolStripButton.Visible = false; @@ -328,7 +317,7 @@ this.uninstallToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("uninstallToolStripButton.Image"))); this.uninstallToolStripButton.Name = "uninstallToolStripButton"; this.uninstallToolStripButton.Overflow = System.Windows.Forms.ToolStripItemOverflow.Never; - this.uninstallToolStripButton.Size = new System.Drawing.Size(143, 22); + this.uninstallToolStripButton.Size = new System.Drawing.Size(114, 22); this.uninstallToolStripButton.Text = "アンインストール(&U)"; this.uninstallToolStripButton.ToolTipText = "選択されているソフトをアンインストールします"; this.uninstallToolStripButton.Visible = false; @@ -389,6 +378,55 @@ this.summaryHeader.Text = "概要"; this.summaryHeader.Width = 300; // + // packageListContextMenuStrip + // + this.packageListContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.installToolStripMenuItem, + this.uninstallToolStripMenuItem, + this.packageListContextMenuStripSeparator, + this.webResourceToolStripMenuItem, + this.installedDirectoryToolStripMenuItem, + this.propertiesToolStripMenuItem}); + this.packageListContextMenuStrip.Name = "packageListContextMenuStrip"; + this.packageListContextMenuStrip.Size = new System.Drawing.Size(215, 120); + this.packageListContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.PackageListContextMenuStripOpening); + // + // installToolStripMenuItem + // + this.installToolStripMenuItem.Name = "installToolStripMenuItem"; + this.installToolStripMenuItem.Size = new System.Drawing.Size(214, 22); + this.installToolStripMenuItem.Text = "インストール(&I)..."; + this.installToolStripMenuItem.Click += new System.EventHandler(this.InstallToolStripButtonClick); + // + // uninstallToolStripMenuItem + // + this.uninstallToolStripMenuItem.Name = "uninstallToolStripMenuItem"; + this.uninstallToolStripMenuItem.Size = new System.Drawing.Size(214, 22); + this.uninstallToolStripMenuItem.Text = "アンインストール(&U)..."; + this.uninstallToolStripMenuItem.Click += new System.EventHandler(this.UninstallToolStripButtonClick); + // + // webResourceToolStripMenuItem + // + this.webResourceToolStripMenuItem.DropDown = this.webResourceCommonContextMenuStrip; + this.webResourceToolStripMenuItem.Name = "webResourceToolStripMenuItem"; + this.webResourceToolStripMenuItem.Size = new System.Drawing.Size(214, 22); + this.webResourceToolStripMenuItem.Tag = ""; + this.webResourceToolStripMenuItem.Text = "Webページ(&W)"; + // + // installedDirectoryToolStripMenuItem + // + this.installedDirectoryToolStripMenuItem.InvokerForm = this; + this.installedDirectoryToolStripMenuItem.Name = "installedDirectoryToolStripMenuItem"; + this.installedDirectoryToolStripMenuItem.Size = new System.Drawing.Size(214, 22); + this.installedDirectoryToolStripMenuItem.Text = "インストール先のフォルダー(&O)"; + // + // propertiesToolStripMenuItem + // + this.propertiesToolStripMenuItem.Name = "propertiesToolStripMenuItem"; + this.propertiesToolStripMenuItem.Size = new System.Drawing.Size(214, 22); + this.propertiesToolStripMenuItem.Text = "プロパティ(&R)"; + this.propertiesToolStripMenuItem.Click += new System.EventHandler(this.PropertiesCommonMenuItemClick); + // // packageListViewImageList // this.packageListViewImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("packageListViewImageList.ImageStream"))); @@ -430,12 +468,21 @@ this.packageListFilterToolStrip.PerformLayout(); this.packageCommandsToolStrip.ResumeLayout(false); this.packageCommandsToolStrip.PerformLayout(); - this.packageListContextMenuStrip.ResumeLayout(false); + this.webResourceCommonContextMenuStrip.ResumeLayout(false); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); + this.packageListContextMenuStrip.ResumeLayout(false); this.ResumeLayout(false); } + private System.Windows.Forms.ToolStripMenuItem webResourceToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem propertiesMenuItem; + private AppliStation.Util.ToolStripPetitLauncherMenuItem installedDirectoryMenuItem; + private System.Windows.Forms.ToolStripMenuItem webResourceMenuItem; + private AppliStation.Util.ToolStripPetitLauncherMenuItem installedDirectoryToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem webGoogleSearchMenuItem; + private System.Windows.Forms.ToolStripMenuItem webOfficialMenuItem; + private System.Windows.Forms.ContextMenuStrip webResourceCommonContextMenuStrip; private System.Windows.Forms.ToolStripMenuItem optionToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator organizeToolStripSeparator1; private System.Windows.Forms.ToolStripMenuItem localupdateToolStripMenuItem; @@ -444,11 +491,7 @@ private System.Windows.Forms.ImageList packageListViewImageList; private System.Windows.Forms.ToolStripDropDownButton informationToolStripDropDownButton; private System.Windows.Forms.ToolStripSeparator packageListContextMenuStripSeparator; - private AppliStation.Util.ToolStripPetitLauncherMenuItem installedDirectoryStripMenuItem; private System.Windows.Forms.ToolStripMenuItem propertiesToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem webGoogleSearchToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem webOfficialToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem webResourcesToolStripMenuItem; private System.Windows.Forms.RichTextBox detailBox; private System.Windows.Forms.SplitContainer splitContainer; private System.Windows.Forms.ToolStripPanel toolStripContainer; diff --git a/AppliStation/PackageListViewForm.cs b/AppliStation/PackageListViewForm.cs index 5c4b7b1..61f44d0 100644 --- a/AppliStation/PackageListViewForm.cs +++ b/AppliStation/PackageListViewForm.cs @@ -93,16 +93,21 @@ namespace AppliStation installPkgCount ++; } } + uint pkgCount = installPkgCount + uninstallPkgCount; installBtnEnabled = (installPkgCount > 0) && (uninstallPkgCount == 0); uninstallBtnEnabled = (uninstallPkgCount == 1) && (installPkgCount == 0); + // ToolStrip informationToolStripDropDownButton.Visible = (pkgCount == 1); uninstallToolStripButton.Visible = uninstallBtnEnabled; installToolStripButton.Visible = installBtnEnabled; + // MenuStrip + webResourceToolStripMenuItem.Visible = (pkgCount == 1); + uninstallToolStripMenuItem.Visible = uninstallBtnEnabled; + installToolStripMenuItem.Visible = installBtnEnabled; // detailBoxのメッセージ設定 - detailBox.Clear(); switch (pkgCount) { case 0: int count = packageListView.Items.Count; @@ -140,12 +145,6 @@ namespace AppliStation } } - private void buildInstalledDirectoryMenuItemStripChildren(InstalledPackage pkg) - { - //installedDirectoryStripMenuItem.BaseFolderPath = pkg.UninstallInfo.InstallLocation; - installedDirectoryStripMenuItem.BaseFolderPath = pkg.discoverInstalledLocation(); - } - void Form_OnLoad(object sender, EventArgs e) { packageListViewImageList.Images.Add("installed", Icon.ExtractAssociatedIcon(Application.ExecutablePath)); @@ -426,7 +425,7 @@ namespace AppliStation } - void WebOfficialToolStripMenuItemClick(object sender, EventArgs e) + void WebOfficialMenuItemClick(object sender, EventArgs e) { Package pkg = packageListView.SelectedPackage; if (pkg != null) { @@ -442,7 +441,7 @@ namespace AppliStation } } - void WebGoogleSearchToolStripMenuItemClick(object sender, EventArgs e) + void WebGoogleSearchMenuItemClick(object sender, EventArgs e) { Package pkg = packageListView.SelectedPackage; if (pkg != null) { @@ -470,7 +469,7 @@ namespace AppliStation } - void PropertiesToolStripMenuItemClick(object sender, EventArgs e) + void PropertiesCommonMenuItemClick(object sender, EventArgs e) { Package pkg = packageListView.SelectedPackage; if (pkg != null) { @@ -482,54 +481,63 @@ namespace AppliStation } } - void PackageListContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e) + private void updateLauncherMenuItem(AppliStation.Util.ToolStripPetitLauncherMenuItem launcherMenuItem) { - // コンテクストメニューから開かれなかった場合はインストール/アンインストールは表示しない - bool parentIsPkgListView = (packageListContextMenuStrip.SourceControl == packageListView); - // メニューアイテムのインストール/アンインストールの表示はツールストリップに同じ - installToolStripMenuItem.Visible = parentIsPkgListView && installToolStripButton.Visible; - uninstallToolStripMenuItem.Visible = parentIsPkgListView && uninstallToolStripButton.Visible; - - // インストールもアンインストールもできない状態ならば、メニューを表示しない - if (! (installToolStripButton.Visible || uninstallToolStripButton.Visible)) { - e.Cancel = true; - return; - } - - // 選択パッケージが1つのとき bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1; + if (selectionIsOnlyOne) { Package pkg = packageListView.SelectedPackage; InstalledPackage iPkg = pkg as InstalledPackage; - webResourcesToolStripMenuItem.Text = string.Format( - webResourcesToolStripMenuItem.Tag.ToString(), - pkg.Name.Replace("&", "&&")); // pkg.Nameに&が含まれているときはエンコード - webOfficialToolStripMenuItem.Enabled = ! (pkg.Url == null || string.IsNullOrEmpty(pkg.Url.Href)); - // webGoogleSearchToolStripMenuItem always active. - // インストール済みパッケージのとき if (iPkg != null) { - bool installedDirectoryStripMenuItemVisible = + bool launcherMenuItemVisible = (pkg.Type == InstallerType.ARCHIVE) || (pkg.Type == InstallerType.ITSELF) || Directory.Exists(iPkg.discoverInstalledLocation()); - installedDirectoryStripMenuItem.Visible = installedDirectoryStripMenuItemVisible; - if (installedDirectoryStripMenuItemVisible) { - buildInstalledDirectoryMenuItemStripChildren(iPkg); + launcherMenuItem.Visible = launcherMenuItemVisible; + if (launcherMenuItemVisible) { + launcherMenuItem.BaseFolderPath = iPkg.discoverInstalledLocation(); } } else { - installedDirectoryStripMenuItem.Visible = false; + launcherMenuItem.Visible = false; } + } else { + launcherMenuItem.Visible = false; } + } + + void PackageListContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e) + { + bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1; + + // インストール先のフォルダの設定 + updateLauncherMenuItem(installedDirectoryToolStripMenuItem); - packageListContextMenuStripSeparator.Visible = parentIsPkgListView && selectionIsOnlyOne; - webResourcesToolStripMenuItem.Visible = selectionIsOnlyOne; - if (! selectionIsOnlyOne) installedDirectoryStripMenuItem.Visible = false; + packageListContextMenuStripSeparator.Visible = selectionIsOnlyOne; + webResourceToolStripMenuItem.Visible = selectionIsOnlyOne; propertiesToolStripMenuItem.Visible = selectionIsOnlyOne; } + void InformationToolStripDropDownButtonDropDownOpening(object sender, EventArgs e) + { + bool selectionIsOnlyOne = packageListView.SelectedItems.Count == 1; + + // インストール先のフォルダの設定 + updateLauncherMenuItem(installedDirectoryMenuItem); + + webResourceMenuItem.Visible = selectionIsOnlyOne; + propertiesMenuItem.Visible = selectionIsOnlyOne; + } + + void WebResourceCommonContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e) + { + Package pkg = packageListView.SelectedPackage; + webOfficialMenuItem.Enabled = (pkg != null && pkg.Url != null && !string.IsNullOrEmpty(pkg.Url.Href)); + // webGoogleSearchMenuItem always active. + } + private IEnumerable getUpdatedPackages(PackageList installedPkgList, PackageList avaiablePkgList, IComparer verComp) { foreach (InstalledPackage pkg in installedPkgList) { -- 2.11.0