OSDN Git Service

AppliStation-GUI,インストール確認ダイアログの大規模リファクタリング(改名)
authorttp <ttp@users.sourceforge.jp>
Sat, 21 Jun 2008 02:59:20 +0000 (02:59 +0000)
committerttp <ttp@users.sourceforge.jp>
Sat, 21 Jun 2008 02:59:20 +0000 (02:59 +0000)
git-svn-id: http://localhost/svn/AppliStation/trunk@927 34ed2c89-c49f-4a4b-abdb-c318350108cf

AppliStation/AppliStation.csproj
AppliStation/InstallationConfirmForm.Designer.cs [moved from AppliStation/PackagesInstallConfirmForm.Designer.cs with 76% similarity]
AppliStation/InstallationConfirmForm.cs [moved from AppliStation/PackagesInstallConfirmForm.cs with 70% similarity]
AppliStation/InstallationConfirmForm.resx [moved from AppliStation/PackagesInstallConfirmForm.resx with 100% similarity]
AppliStation/PackageListViewForm.cs
AppliStation/PackageUninstallConfirmForm.cs

index b3200ba..f0979b9 100644 (file)
@@ -82,9 +82,9 @@
     <Compile Include="PackageListViewForm.Designer.cs">\r
       <DependentUpon>PackageListViewForm.cs</DependentUpon>\r
     </Compile>\r
-    <Compile Include="PackagesInstallConfirmForm.cs" />\r
-    <Compile Include="PackagesInstallConfirmForm.Designer.cs">\r
-      <DependentUpon>PackagesInstallConfirmForm.cs</DependentUpon>\r
+    <Compile Include="InstallationConfirmForm.cs" />\r
+    <Compile Include="InstallationConfirmForm.Designer.cs">\r
+      <DependentUpon>InstallationConfirmForm.cs</DependentUpon>\r
     </Compile>\r
     <Compile Include="PackageUninstallConfirmForm.cs" />\r
     <Compile Include="PackageUninstallConfirmForm.Designer.cs">\r
     <EmbeddedResource Include="PackageListViewForm.resx">\r
       <DependentUpon>PackageListViewForm.cs</DependentUpon>\r
     </EmbeddedResource>\r
-    <EmbeddedResource Include="PackagesInstallConfirmForm.resx">\r
-      <DependentUpon>PackagesInstallConfirmForm.cs</DependentUpon>\r
+    <EmbeddedResource Include="InstallationConfirmForm.resx">\r
+      <DependentUpon>InstallationConfirmForm.cs</DependentUpon>\r
     </EmbeddedResource>\r
     <EmbeddedResource Include="PackageUninstallConfirmForm.resx">\r
       <DependentUpon>PackageUninstallConfirmForm.cs</DependentUpon>\r
@@ -1,7 +1,7 @@
 \r
 namespace AppliStation\r
 {\r
-       partial class PackagesInstallConfirmForm\r
+       partial class InstallationConfirmForm\r
        {\r
                /// <summary>\r
                /// Designer variable used to keep track of non-visual components.\r
@@ -30,23 +30,23 @@ namespace AppliStation
                private void InitializeComponent()\r
                {\r
                        this.components = new System.ComponentModel.Container();\r
-                       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackagesInstallConfirmForm));\r
+                       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationConfirmForm));\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
                        this.okButton = new System.Windows.Forms.Button();\r
                        this.cancelButton = new System.Windows.Forms.Button();\r
                        this.label = new System.Windows.Forms.Label();\r
-                       this.packageListView = new System.Windows.Forms.ListView();\r
+                       this.instsListView = new System.Windows.Forms.ListView();\r
                        this.nameColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.versionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
                        this.currentVersionColumnHeader = new System.Windows.Forms.ColumnHeader();\r
-                       this.packageListViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);\r
+                       this.instListViewContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);\r
                        this.selectAllPackagesStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.unselectAllPackagesStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();\r
                        this.tableLayoutPanel1.SuspendLayout();\r
                        this.btnPanel.SuspendLayout();\r
-                       this.packageListViewContextMenuStrip.SuspendLayout();\r
+                       this.instListViewContextMenuStrip.SuspendLayout();\r
                        this.SuspendLayout();\r
                        // \r
                        // tableLayoutPanel1\r
@@ -55,7 +55,7 @@ namespace AppliStation
                        this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
                        this.tableLayoutPanel1.Controls.Add(this.btnPanel, 0, 2);\r
                        this.tableLayoutPanel1.Controls.Add(this.label, 0, 0);\r
-                       this.tableLayoutPanel1.Controls.Add(this.packageListView, 0, 1);\r
+                       this.tableLayoutPanel1.Controls.Add(this.instsListView, 0, 1);\r
                        this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r
                        this.tableLayoutPanel1.Name = "tableLayoutPanel1";\r
@@ -124,26 +124,26 @@ namespace AppliStation
                        this.label.TabIndex = 1;\r
                        this.label.Text = "以下のソフトをインストールしようとしています。インストールするソフトをチェックしてください";\r
                        // \r
-                       // packageListView\r
+                       // instsListView\r
                        // \r
-                       this.packageListView.CheckBoxes = true;\r
-                       this.packageListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {\r
+                       this.instsListView.CheckBoxes = true;\r
+                       this.instsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {\r
                                                                        this.nameColumnHeader,\r
                                                                        this.versionColumnHeader,\r
                                                                        this.currentVersionColumnHeader});\r
-                       this.packageListView.ContextMenuStrip = this.packageListViewContextMenuStrip;\r
-                       this.packageListView.Dock = System.Windows.Forms.DockStyle.Fill;\r
-                       this.packageListView.GridLines = true;\r
-                       this.packageListView.Location = new System.Drawing.Point(5, 53);\r
-                       this.packageListView.Margin = new System.Windows.Forms.Padding(5, 3, 5, 5);\r
-                       this.packageListView.Name = "packageListView";\r
-                       this.packageListView.ShowItemToolTips = true;\r
-                       this.packageListView.Size = new System.Drawing.Size(382, 173);\r
-                       this.packageListView.TabIndex = 2;\r
-                       this.packageListView.UseCompatibleStateImageBehavior = false;\r
-                       this.packageListView.View = System.Windows.Forms.View.Details;\r
-                       this.packageListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.PackageListViewItemChecked);\r
-                       this.packageListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.PackageListViewColumnClick);\r
+                       this.instsListView.ContextMenuStrip = this.instListViewContextMenuStrip;\r
+                       this.instsListView.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.instsListView.GridLines = true;\r
+                       this.instsListView.Location = new System.Drawing.Point(5, 53);\r
+                       this.instsListView.Margin = new System.Windows.Forms.Padding(5, 3, 5, 5);\r
+                       this.instsListView.Name = "packageListView";\r
+                       this.instsListView.ShowItemToolTips = true;\r
+                       this.instsListView.Size = new System.Drawing.Size(382, 173);\r
+                       this.instsListView.TabIndex = 2;\r
+                       this.instsListView.UseCompatibleStateImageBehavior = false;\r
+                       this.instsListView.View = System.Windows.Forms.View.Details;\r
+                       this.instsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.InstsListViewItemChecked);\r
+                       this.instsListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.InstsListViewColumnClick);\r
                        // \r
                        // nameColumnHeader\r
                        // \r
@@ -153,35 +153,35 @@ namespace AppliStation
                        // versionColumnHeader\r
                        // \r
                        this.versionColumnHeader.Text = "バージョン";\r
-                       this.versionColumnHeader.Width = 82;\r
+                       this.versionColumnHeader.Width = 52;\r
                        // \r
                        // currentVersionColumnHeader\r
                        // \r
                        this.currentVersionColumnHeader.Text = "現バージョン";\r
-                       this.currentVersionColumnHeader.Width = 89;\r
+                       this.currentVersionColumnHeader.Width = 52;\r
                        // \r
-                       // packageListViewContextMenuStrip\r
+                       // instsListViewContextMenuStrip\r
                        // \r
-                       this.packageListViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+                       this.instListViewContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
                                                                        this.selectAllPackagesStripMenuItem,\r
                                                                        this.unselectAllPackagesStripMenuItem});\r
-                       this.packageListViewContextMenuStrip.Name = "packageListViewContextMenuStrip";\r
-                       this.packageListViewContextMenuStrip.Size = new System.Drawing.Size(175, 48);\r
-                       this.packageListViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.PackageListViewContextMenuStripOpening);\r
+                       this.instListViewContextMenuStrip.Name = "packageListViewContextMenuStrip";\r
+                       this.instListViewContextMenuStrip.Size = new System.Drawing.Size(175, 48);\r
+                       this.instListViewContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.InstsListViewContextMenuStripOpening);\r
                        // \r
                        // selectAllPackagesStripMenuItem\r
                        // \r
                        this.selectAllPackagesStripMenuItem.Name = "selectAllPackagesStripMenuItem";\r
                        this.selectAllPackagesStripMenuItem.Size = new System.Drawing.Size(174, 22);\r
                        this.selectAllPackagesStripMenuItem.Text = "全て選択(&A)";\r
-                       this.selectAllPackagesStripMenuItem.Click += new System.EventHandler(this.SelectAllPackagesStripMenuItemClick);\r
+                       this.selectAllPackagesStripMenuItem.Click += new System.EventHandler(this.SelectAllInstsStripMenuItemClick);\r
                        // \r
                        // unselectAllPackagesStripMenuItem\r
                        // \r
                        this.unselectAllPackagesStripMenuItem.Name = "unselectAllPackagesStripMenuItem";\r
                        this.unselectAllPackagesStripMenuItem.Size = new System.Drawing.Size(174, 22);\r
                        this.unselectAllPackagesStripMenuItem.Text = "全ての選択を解除(&U)";\r
-                       this.unselectAllPackagesStripMenuItem.Click += new System.EventHandler(this.UnselectAllPackagesStripMenuItemClick);\r
+                       this.unselectAllPackagesStripMenuItem.Click += new System.EventHandler(this.UnselectAllInstsStripMenuItemClick);\r
                        // \r
                        // PackagesInstallConfirmForm\r
                        // \r
@@ -201,17 +201,17 @@ namespace AppliStation
                        this.tableLayoutPanel1.PerformLayout();\r
                        this.btnPanel.ResumeLayout(false);\r
                        this.btnPanel.PerformLayout();\r
-                       this.packageListViewContextMenuStrip.ResumeLayout(false);\r
+                       this.instListViewContextMenuStrip.ResumeLayout(false);\r
                        this.ResumeLayout(false);\r
                }\r
                private System.Windows.Forms.ToolStripMenuItem unselectAllPackagesStripMenuItem;\r
                private System.Windows.Forms.ToolStripMenuItem selectAllPackagesStripMenuItem;\r
-               private System.Windows.Forms.ContextMenuStrip packageListViewContextMenuStrip;\r
+               private System.Windows.Forms.ContextMenuStrip instListViewContextMenuStrip;\r
                private System.Windows.Forms.CheckBox runasCheckBox;\r
                private System.Windows.Forms.ColumnHeader currentVersionColumnHeader;\r
                private System.Windows.Forms.ColumnHeader versionColumnHeader;\r
                private System.Windows.Forms.ColumnHeader nameColumnHeader;\r
-               private System.Windows.Forms.ListView packageListView;\r
+               private System.Windows.Forms.ListView instsListView;\r
                private System.Windows.Forms.Label label;\r
                private System.Windows.Forms.Button cancelButton;\r
                private System.Windows.Forms.Button okButton;\r
similarity index 70%
rename from AppliStation/PackagesInstallConfirmForm.cs
rename to AppliStation/InstallationConfirmForm.cs
index e0e7ecb..5fc8f4b 100644 (file)
@@ -9,7 +9,7 @@ namespace AppliStation
        /// <summary>\r
        /// Description of PackagesInstallConfirmForm.\r
        /// </summary>\r
-       public partial class PackagesInstallConfirmForm : Form\r
+       public partial class InstallationConfirmForm : Form\r
        {\r
                private Installation[] installations;\r
                \r
@@ -23,7 +23,7 @@ namespace AppliStation
                        set {\r
                                installations = value;\r
                                \r
-                               updatePackagesListView();\r
+                               updateInstsListView();\r
                        }\r
                }\r
                \r
@@ -32,11 +32,11 @@ namespace AppliStation
                        set {\r
                                pkgListMan = value;\r
                                \r
-                               updatePackagesListView();\r
+                               updateInstsListView();\r
                        }\r
                }\r
                \r
-               public PackagesInstallConfirmForm()\r
+               public InstallationConfirmForm()\r
                {\r
                        //\r
                        // The InitializeComponent() call is required for Windows Forms designer support.\r
@@ -50,9 +50,9 @@ namespace AppliStation
                        }\r
                }\r
                \r
-               private void updatePackagesListView()\r
+               private void updateInstsListView()\r
                {\r
-                       packageListView.Items.Clear();\r
+                       instsListView.Items.Clear();\r
                        \r
                        if (installations != null) {\r
                                foreach (Installation inst in installations) {\r
@@ -70,31 +70,31 @@ namespace AppliStation
                                        item.ToolTipText = pkg.Summary;\r
                                        item.Checked = true;\r
                                        \r
-                                       packageListView.Items.Add(item);\r
+                                       instsListView.Items.Add(item);\r
                                }\r
                        }\r
                        \r
-                       PackageListViewItemChecked(packageListView, null);\r
-                       packageListView.Refresh();\r
+                       InstsListViewItemChecked(instsListView, null);\r
+                       instsListView.Refresh();\r
                }\r
                \r
-               void PackageListViewItemChecked(object sender, ItemCheckedEventArgs e)\r
+               void InstsListViewItemChecked(object sender, ItemCheckedEventArgs e)\r
                {\r
-                       System.Windows.Forms.ListView.CheckedListViewItemCollection checkeds = packageListView.CheckedItems;\r
+                       System.Windows.Forms.ListView.CheckedListViewItemCollection checkeds = instsListView.CheckedItems;\r
                        \r
                        okButton.Enabled = checkeds != null && checkeds.Count > 0;\r
                }\r
                \r
                AppliStation.Util.ListViewItemSortComparer packageListViewSortComparer;\r
 \r
-               void PackageListViewColumnClick(object sender, ColumnClickEventArgs e)\r
+               void InstsListViewColumnClick(object sender, ColumnClickEventArgs e)\r
                {\r
                        SortOrder order = SortOrder.None;\r
                        \r
                        if (packageListViewSortComparer == null) {\r
                                order = SortOrder.Ascending;\r
                                packageListViewSortComparer = new AppliStation.Util.ListViewItemSortComparer(e.Column, order);\r
-                               packageListView.ListViewItemSorter = packageListViewSortComparer;\r
+                               instsListView.ListViewItemSorter = packageListViewSortComparer;\r
                        } else {\r
                                if (packageListViewSortComparer.Column == e.Column) {\r
                                        order = (packageListViewSortComparer.Order == SortOrder.Ascending)? SortOrder.Descending : SortOrder.Ascending;\r
@@ -105,40 +105,40 @@ namespace AppliStation
                                        packageListViewSortComparer.Column = e.Column;\r
                                }\r
                                \r
-                               packageListView.Sort();\r
+                               instsListView.Sort();\r
                        }\r
-                       AppliStation.Util.NativeMethods.ColumnHeader_SetSortState(packageListView, e.Column, order);\r
+                       AppliStation.Util.NativeMethods.ColumnHeader_SetSortState(instsListView, e.Column, order);\r
                        \r
                        // \83\\81[\83g\91Î\8fÛ\97ñ\82Ì\90F\95t\82¯\r
                        try {\r
                                // SendMessage(hWnd, LVM_SETSELECTEDCOLUMN, column, NULL);\r
-                               AppliStation.Util.NativeMethods.SendMessage(packageListView.Handle, 0x1000+140, (uint) e.Column, 0);\r
+                               AppliStation.Util.NativeMethods.SendMessage(instsListView.Handle, 0x1000+140, (uint) e.Column, 0);\r
                        } catch (Exception) {   \r
                        }\r
                }\r
                \r
                                \r
-               void PackageListViewContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)\r
+               void InstsListViewContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)\r
                {\r
-                       System.Windows.Forms.ListView.CheckedIndexCollection coll = packageListView.CheckedIndices;\r
-                       selectAllPackagesStripMenuItem.Enabled = coll.Count < packageListView.Items.Count;\r
+                       System.Windows.Forms.ListView.CheckedIndexCollection coll = instsListView.CheckedIndices;\r
+                       selectAllPackagesStripMenuItem.Enabled = coll.Count < instsListView.Items.Count;\r
                        unselectAllPackagesStripMenuItem.Enabled = coll.Count > 0;\r
                }\r
                                \r
-               void SelectAllPackagesStripMenuItemClick(object sender, EventArgs e)\r
+               void SelectAllInstsStripMenuItemClick(object sender, EventArgs e)\r
                {\r
-                       foreach (ListViewItem item in packageListView.Items) {\r
+                       foreach (ListViewItem item in instsListView.Items) {\r
                                item.Checked = true;\r
                        }\r
-                       packageListView.Refresh();\r
+                       instsListView.Refresh();\r
                }\r
                \r
-               void UnselectAllPackagesStripMenuItemClick(object sender, EventArgs e)\r
+               void UnselectAllInstsStripMenuItemClick(object sender, EventArgs e)\r
                {\r
-                       foreach (ListViewItem item in packageListView.CheckedItems) {\r
+                       foreach (ListViewItem item in instsListView.CheckedItems) {\r
                                item.Checked = false;\r
                        }\r
-                       packageListView.Refresh();\r
+                       instsListView.Refresh();\r
                }\r
                \r
                /// <summary>\r
@@ -147,7 +147,7 @@ namespace AppliStation
                public Installation[] CheckedInstallations {\r
                        get {\r
                                System.Collections.Generic.List<Installation> insts = new System.Collections.Generic.List<Installation>();\r
-                               foreach (ListViewItem item in packageListView.CheckedItems) {\r
+                               foreach (ListViewItem item in instsListView.CheckedItems) {\r
                                        insts.Add((Installation) item.Tag);\r
                                }\r
                                return insts.ToArray();\r
@@ -199,7 +199,7 @@ namespace AppliStation
                private void updateUseRunas()\r
                {\r
                        if (UseRunas) {\r
-                               System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackagesInstallConfirmForm));\r
+                               System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationConfirmForm));\r
                                okButton.Image = ((System.Drawing.Bitmap)(resources.GetObject("okButton.Image")));\r
                        } else {\r
                                okButton.Image = null;\r
index f84da5a..432f619 100644 (file)
@@ -342,7 +342,7 @@ namespace AppliStation
                \r
                void InstallToolStripButtonClick(object sender, EventArgs e)\r
                {\r
-                       PackagesInstallConfirmForm confirm = new PackagesInstallConfirmForm();\r
+                       InstallationConfirmForm confirm = new InstallationConfirmForm();\r
                        confirm.PkgListsManager = pkgListsMan;\r
                        confirm.Installations = Installation.ConvertInstallations(SelectedPackages<Package>());\r
                        confirm.UseRunas = confirm.GetShouldUseRunas();\r
@@ -579,7 +579,7 @@ namespace AppliStation
                                return;\r
                        }\r
                        \r
-                       PackagesInstallConfirmForm confirm = new PackagesInstallConfirmForm();\r
+                       InstallationConfirmForm confirm = new InstallationConfirmForm();\r
                        confirm.PkgListsManager = pkgListsMan;\r
                        confirm.Installations = Installation.ConvertInstallations(pkgs.ToArray());\r
                        DialogResult result = confirm.ShowDialog(this);\r
index d5a29fb..b1b9cd8 100644 (file)
@@ -81,7 +81,7 @@ namespace AppliStation
                private void updateUseRunas()\r
                {\r
                        if (UseRunas) {\r
-                               System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PackagesInstallConfirmForm));\r
+                               System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationConfirmForm));\r
                                okButton.Image = ((System.Drawing.Bitmap)(resources.GetObject("okButton.Image")));\r
                        } else {\r
                                okButton.Image = null;\r