OSDN Git Service

AppliStation-GUI,プロキシ設定GUIの改善
authorttp <ttp@users.sourceforge.jp>
Sat, 30 May 2009 09:18:32 +0000 (18:18 +0900)
committerttp <ttp@users.sourceforge.jp>
Sat, 30 May 2009 09:18:32 +0000 (18:18 +0900)
 - アクセラレータを付けてキーボードアクセスができるように
 - ここからインターネットオプションのダイアログを開けるようにした

AppliStation/UserPrefForm.Designer.cs
AppliStation/UserPrefForm.cs

index 54980c7..a8a23ed 100644 (file)
@@ -52,6 +52,7 @@
                        this.directConnRadioButton = new System.Windows.Forms.RadioButton();\r
                        this.specifyProxyRadioButton = new System.Windows.Forms.RadioButton();\r
                        this.proxyURLTextBox = new System.Windows.Forms.TextBox();\r
+                       this.openInternetOptionLinkLabel = new System.Windows.Forms.LinkLabel();\r
                        this.tableLayoutPanel.SuspendLayout();\r
                        this.buttonsPanel.SuspendLayout();\r
                        this.tabControl.SuspendLayout();\r
@@ -67,7 +68,7 @@
                        // \r
                        this.proxyURLLabel.AutoSize = true;\r
                        this.proxyURLLabel.Dock = System.Windows.Forms.DockStyle.Fill;\r
-                       this.proxyURLLabel.Location = new System.Drawing.Point(23, 66);\r
+                       this.proxyURLLabel.Location = new System.Drawing.Point(23, 78);\r
                        this.proxyURLLabel.Name = "proxyURLLabel";\r
                        this.proxyURLLabel.Size = new System.Drawing.Size(91, 25);\r
                        this.proxyURLLabel.TabIndex = 3;\r
                        // reposListTabPage\r
                        // \r
                        this.reposListTabPage.Controls.Add(this.repoTableLayoutPanel);\r
-                       this.reposListTabPage.Location = new System.Drawing.Point(4, 22);\r
+                       this.reposListTabPage.Location = new System.Drawing.Point(4, 21);\r
                        this.reposListTabPage.Name = "reposListTabPage";\r
                        this.reposListTabPage.Padding = new System.Windows.Forms.Padding(3);\r
-                       this.reposListTabPage.Size = new System.Drawing.Size(446, 214);\r
+                       this.reposListTabPage.Size = new System.Drawing.Size(446, 215);\r
                        this.reposListTabPage.TabIndex = 0;\r
                        this.reposListTabPage.Text = "レポジトリ";\r
                        this.reposListTabPage.UseVisualStyleBackColor = true;\r
                        this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
                        this.repoTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
-                       this.repoTableLayoutPanel.Size = new System.Drawing.Size(440, 208);\r
+                       this.repoTableLayoutPanel.Size = new System.Drawing.Size(440, 209);\r
                        this.repoTableLayoutPanel.TabIndex = 1;\r
                        // \r
                        // repoListCheckedListBox\r
                        this.repoListCheckedListBox.Location = new System.Drawing.Point(3, 15);\r
                        this.repoListCheckedListBox.Name = "repoListCheckedListBox";\r
                        this.repoListCheckedListBox.ScrollAlwaysVisible = true;\r
-                       this.repoListCheckedListBox.Size = new System.Drawing.Size(347, 165);\r
+                       this.repoListCheckedListBox.Size = new System.Drawing.Size(347, 166);\r
                        this.repoListCheckedListBox.TabIndex = 1;\r
                        this.repoListCheckedListBox.SelectedIndexChanged += new System.EventHandler(this.RepoListCheckedListBoxSelectedIndexChanged);\r
                        this.repoListCheckedListBox.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.RepoListCheckedListBoxItemCheck);\r
                        this.repoUrlTextBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.repoUrlTextBox.Enabled = false;\r
                        this.repoUrlTextBox.ImeMode = System.Windows.Forms.ImeMode.Off;\r
-                       this.repoUrlTextBox.Location = new System.Drawing.Point(122, 186);\r
+                       this.repoUrlTextBox.Location = new System.Drawing.Point(122, 187);\r
                        this.repoUrlTextBox.Name = "repoUrlTextBox";\r
                        this.repoUrlTextBox.Size = new System.Drawing.Size(315, 19);\r
                        this.repoUrlTextBox.TabIndex = 3;\r
                        this.repoUrlLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));\r
                        this.repoUrlLabel.AutoSize = true;\r
                        this.repoUrlLabel.Enabled = false;\r
-                       this.repoUrlLabel.Location = new System.Drawing.Point(3, 189);\r
+                       this.repoUrlLabel.Location = new System.Drawing.Point(3, 190);\r
                        this.repoUrlLabel.Name = "repoUrlLabel";\r
                        this.repoUrlLabel.Size = new System.Drawing.Size(113, 12);\r
                        this.repoUrlLabel.TabIndex = 2;\r
                        // networkTabPage\r
                        // \r
                        this.networkTabPage.Controls.Add(this.proxyGroupBox);\r
-                       this.networkTabPage.Location = new System.Drawing.Point(4, 22);\r
+                       this.networkTabPage.Location = new System.Drawing.Point(4, 21);\r
                        this.networkTabPage.Name = "networkTabPage";\r
                        this.networkTabPage.Padding = new System.Windows.Forms.Padding(3);\r
-                       this.networkTabPage.Size = new System.Drawing.Size(446, 214);\r
+                       this.networkTabPage.Size = new System.Drawing.Size(446, 215);\r
                        this.networkTabPage.TabIndex = 1;\r
                        this.networkTabPage.Text = "接続";\r
                        this.networkTabPage.UseVisualStyleBackColor = true;\r
                        this.proxyGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.proxyGroupBox.Location = new System.Drawing.Point(3, 3);\r
                        this.proxyGroupBox.Name = "proxyGroupBox";\r
-                       this.proxyGroupBox.Size = new System.Drawing.Size(440, 208);\r
+                       this.proxyGroupBox.Size = new System.Drawing.Size(440, 209);\r
                        this.proxyGroupBox.TabIndex = 1;\r
                        this.proxyGroupBox.TabStop = false;\r
                        this.proxyGroupBox.Text = "プロキシサーバー";\r
                        this.proxyTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
                        this.proxyTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
                        this.proxyTableLayoutPanel.Controls.Add(this.proxySameAsIERadioButton, 0, 0);\r
-                       this.proxyTableLayoutPanel.Controls.Add(this.directConnRadioButton, 0, 1);\r
-                       this.proxyTableLayoutPanel.Controls.Add(this.specifyProxyRadioButton, 0, 2);\r
-                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLLabel, 1, 3);\r
-                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLTextBox, 2, 3);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.directConnRadioButton, 0, 2);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.specifyProxyRadioButton, 0, 3);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLLabel, 1, 4);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLTextBox, 2, 4);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.openInternetOptionLinkLabel, 1, 1);\r
                        this.proxyTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.proxyTableLayoutPanel.Location = new System.Drawing.Point(3, 15);\r
                        this.proxyTableLayoutPanel.Name = "proxyTableLayoutPanel";\r
-                       this.proxyTableLayoutPanel.RowCount = 5;\r
+                       this.proxyTableLayoutPanel.RowCount = 6;\r
+                       this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
                        this.proxyTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
-                       this.proxyTableLayoutPanel.Size = new System.Drawing.Size(434, 190);\r
+                       this.proxyTableLayoutPanel.Size = new System.Drawing.Size(434, 191);\r
                        this.proxyTableLayoutPanel.TabIndex = 0;\r
                        // \r
                        // proxySameAsIERadioButton\r
                        this.proxyTableLayoutPanel.SetColumnSpan(this.proxySameAsIERadioButton, 3);\r
                        this.proxySameAsIERadioButton.Location = new System.Drawing.Point(3, 3);\r
                        this.proxySameAsIERadioButton.Name = "proxySameAsIERadioButton";\r
-                       this.proxySameAsIERadioButton.Size = new System.Drawing.Size(208, 16);\r
+                       this.proxySameAsIERadioButton.Size = new System.Drawing.Size(219, 16);\r
                        this.proxySameAsIERadioButton.TabIndex = 0;\r
                        this.proxySameAsIERadioButton.TabStop = true;\r
-                       this.proxySameAsIERadioButton.Text = "インターネットオプションと同じ設定を使う";\r
+                       this.proxySameAsIERadioButton.Text = "インターネットオプションと同じ設定を使う(&I)";\r
                        this.proxySameAsIERadioButton.UseVisualStyleBackColor = true;\r
                        this.proxySameAsIERadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
                        // \r
                        // \r
                        this.directConnRadioButton.AutoSize = true;\r
                        this.proxyTableLayoutPanel.SetColumnSpan(this.directConnRadioButton, 3);\r
-                       this.directConnRadioButton.Location = new System.Drawing.Point(3, 25);\r
+                       this.directConnRadioButton.Location = new System.Drawing.Point(3, 37);\r
                        this.directConnRadioButton.Name = "directConnRadioButton";\r
-                       this.directConnRadioButton.Size = new System.Drawing.Size(218, 16);\r
+                       this.directConnRadioButton.Size = new System.Drawing.Size(234, 16);\r
                        this.directConnRadioButton.TabIndex = 1;\r
                        this.directConnRadioButton.TabStop = true;\r
-                       this.directConnRadioButton.Text = "プロキシサーバーを使わずに直接接続する";\r
+                       this.directConnRadioButton.Text = "プロキシサーバーを使わずに直接接続する(&D)";\r
                        this.directConnRadioButton.UseVisualStyleBackColor = true;\r
                        this.directConnRadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
                        // \r
                        // \r
                        this.specifyProxyRadioButton.AutoSize = true;\r
                        this.proxyTableLayoutPanel.SetColumnSpan(this.specifyProxyRadioButton, 3);\r
-                       this.specifyProxyRadioButton.Location = new System.Drawing.Point(3, 47);\r
+                       this.specifyProxyRadioButton.Location = new System.Drawing.Point(3, 59);\r
                        this.specifyProxyRadioButton.Name = "specifyProxyRadioButton";\r
-                       this.specifyProxyRadioButton.Size = new System.Drawing.Size(196, 16);\r
+                       this.specifyProxyRadioButton.Size = new System.Drawing.Size(211, 16);\r
                        this.specifyProxyRadioButton.TabIndex = 2;\r
                        this.specifyProxyRadioButton.TabStop = true;\r
-                       this.specifyProxyRadioButton.Text = "接続に指定のプロキシサーバーを使う";\r
+                       this.specifyProxyRadioButton.Text = "接続に指定のプロキシサーバーを使う(&S)";\r
                        this.specifyProxyRadioButton.UseVisualStyleBackColor = true;\r
                        this.specifyProxyRadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
                        // \r
                        // \r
                        this.proxyURLTextBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
                        this.proxyURLTextBox.ImeMode = System.Windows.Forms.ImeMode.Off;\r
-                       this.proxyURLTextBox.Location = new System.Drawing.Point(120, 69);\r
+                       this.proxyURLTextBox.Location = new System.Drawing.Point(120, 81);\r
                        this.proxyURLTextBox.Name = "proxyURLTextBox";\r
                        this.proxyURLTextBox.Size = new System.Drawing.Size(311, 19);\r
                        this.proxyURLTextBox.TabIndex = 4;\r
                        this.proxyURLTextBox.Text = "http://localhost:8080/";\r
                        // \r
+                       // openInternetOptionLinkLabel\r
+                       // \r
+                       this.openInternetOptionLinkLabel.AutoSize = true;\r
+                       this.proxyTableLayoutPanel.SetColumnSpan(this.openInternetOptionLinkLabel, 2);\r
+                       this.openInternetOptionLinkLabel.Location = new System.Drawing.Point(23, 22);\r
+                       this.openInternetOptionLinkLabel.Name = "openInternetOptionLinkLabel";\r
+                       this.openInternetOptionLinkLabel.Size = new System.Drawing.Size(136, 12);\r
+                       this.openInternetOptionLinkLabel.TabIndex = 5;\r
+                       this.openInternetOptionLinkLabel.TabStop = true;\r
+                       this.openInternetOptionLinkLabel.Text = "インターネットオプションを開く";\r
+                       this.openInternetOptionLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OpenInternetOptionLinkLabelLinkClicked);\r
+                       // \r
                        // UserPrefForm\r
                        // \r
                        this.AcceptButton = this.okButton;\r
                        this.proxyTableLayoutPanel.PerformLayout();\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.LinkLabel openInternetOptionLinkLabel;\r
                private System.Windows.Forms.Label proxyURLLabel;\r
                private System.Windows.Forms.FlowLayoutPanel buttonsPanel;\r
                private System.Windows.Forms.GroupBox proxyGroupBox;\r
index e5f1bd6..984c169 100644 (file)
@@ -2,6 +2,7 @@
 using System.Collections.Generic;\r
 using System.Drawing;\r
 using System.Windows.Forms;\r
+using System.Diagnostics;\r
 \r
 using NaGet.Packages;\r
 \r
@@ -240,6 +241,20 @@ namespace AppliStation
                        updateProxyURLEnability();\r
                }\r
                \r
+               void OpenInternetOptionLinkLabelLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)\r
+               {\r
+                       try {\r
+                               ProcessStartInfo procInfo = new ProcessStartInfo("rundll32.exe");\r
+                               procInfo.Arguments = "shell32.dll,Control_RunDLL inetcpl.cpl,,4";\r
+                               procInfo.UseShellExecute = true;\r
+                               procInfo.Verb = "open";\r
+                               \r
+                               Process.Start(procInfo);\r
+                       } catch (Exception) {\r
+                               MessageBox.Show("インターネットオプションが開けませんでした", openInternetOptionLinkLabel.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                       }\r
+               }\r
+               \r
                /// <summary>\r
                /// プロキシ設定を、指定された設定オブジェクトに設定する。\r
                /// </summary>\r