OSDN Git Service

AppliStation-GUI,プロキシ設定にて、管理者権限でのインターネットオプションを開けるようにした。
authorunknown <ttp@users.sourceforge.jp>
Sat, 6 Jun 2009 02:39:39 +0000 (11:39 +0900)
committerunknown <ttp@users.sourceforge.jp>
Sat, 6 Jun 2009 02:39:39 +0000 (11:39 +0900)
AppliStation/UserPrefForm.Designer.cs
AppliStation/UserPrefForm.cs
AppliStation/UserPrefForm.resx

index bdcfc7a..51ef45f 100644 (file)
@@ -28,6 +28,8 @@
                /// </summary>\r
                private void InitializeComponent()\r
                {\r
+                       this.components = new System.ComponentModel.Container();\r
+                       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserPrefForm));\r
                        this.proxyURLLabel = new System.Windows.Forms.Label();\r
                        this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
                        this.buttonsPanel = new System.Windows.Forms.FlowLayoutPanel();\r
@@ -53,6 +55,8 @@
                        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.openInternetOptionLinkAdminLabel = new System.Windows.Forms.LinkLabel();\r
+                       this.toolTip = new System.Windows.Forms.ToolTip(this.components);\r
                        this.tableLayoutPanel.SuspendLayout();\r
                        this.buttonsPanel.SuspendLayout();\r
                        this.tabControl.SuspendLayout();\r
                        // \r
                        this.proxyURLLabel.AutoSize = true;\r
                        this.proxyURLLabel.Dock = System.Windows.Forms.DockStyle.Fill;\r
-                       this.proxyURLLabel.Location = new System.Drawing.Point(23, 78);\r
+                       this.proxyURLLabel.Location = new System.Drawing.Point(23, 90);\r
                        this.proxyURLLabel.Name = "proxyURLLabel";\r
                        this.proxyURLLabel.Size = new System.Drawing.Size(91, 25);\r
                        this.proxyURLLabel.TabIndex = 3;\r
                        this.proxyURLLabel.Text = "プロキシのURL(&U)";\r
                        this.proxyURLLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
+                       this.toolTip.SetToolTip(this.proxyURLLabel, "プロキシサーバーをURLの形式で指定します。\r\n書式は「http://サーバ名:ポート番号/」です");\r
                        // \r
                        // tableLayoutPanel\r
                        // \r
                        // reposListTabPage\r
                        // \r
                        this.reposListTabPage.Controls.Add(this.repoTableLayoutPanel);\r
-                       this.reposListTabPage.Location = new System.Drawing.Point(4, 21);\r
+                       this.reposListTabPage.Location = new System.Drawing.Point(4, 22);\r
                        this.reposListTabPage.Name = "reposListTabPage";\r
                        this.reposListTabPage.Padding = new System.Windows.Forms.Padding(3);\r
-                       this.reposListTabPage.Size = new System.Drawing.Size(446, 215);\r
+                       this.reposListTabPage.Size = new System.Drawing.Size(446, 214);\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, 209);\r
+                       this.repoTableLayoutPanel.Size = new System.Drawing.Size(440, 208);\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, 166);\r
+                       this.repoListCheckedListBox.Size = new System.Drawing.Size(347, 165);\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, 187);\r
+                       this.repoUrlTextBox.Location = new System.Drawing.Point(122, 186);\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, 190);\r
+                       this.repoUrlLabel.Location = new System.Drawing.Point(3, 189);\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, 21);\r
+                       this.networkTabPage.Location = new System.Drawing.Point(4, 22);\r
                        this.networkTabPage.Name = "networkTabPage";\r
                        this.networkTabPage.Padding = new System.Windows.Forms.Padding(3);\r
-                       this.networkTabPage.Size = new System.Drawing.Size(446, 215);\r
+                       this.networkTabPage.Size = new System.Drawing.Size(446, 214);\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, 209);\r
+                       this.proxyGroupBox.Size = new System.Drawing.Size(440, 208);\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, 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.directConnRadioButton, 0, 3);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.specifyProxyRadioButton, 0, 4);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLLabel, 1, 5);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.proxyURLTextBox, 2, 5);\r
                        this.proxyTableLayoutPanel.Controls.Add(this.openInternetOptionLinkLabel, 1, 1);\r
+                       this.proxyTableLayoutPanel.Controls.Add(this.openInternetOptionLinkAdminLabel, 1, 2);\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 = 6;\r
+                       this.proxyTableLayoutPanel.RowCount = 7;\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());\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, 191);\r
+                       this.proxyTableLayoutPanel.Size = new System.Drawing.Size(434, 190);\r
                        this.proxyTableLayoutPanel.TabIndex = 0;\r
                        // \r
                        // proxySameAsIERadioButton\r
                        // \r
                        this.directConnRadioButton.AutoSize = true;\r
                        this.proxyTableLayoutPanel.SetColumnSpan(this.directConnRadioButton, 3);\r
-                       this.directConnRadioButton.Location = new System.Drawing.Point(3, 37);\r
+                       this.directConnRadioButton.Location = new System.Drawing.Point(3, 49);\r
                        this.directConnRadioButton.Name = "directConnRadioButton";\r
                        this.directConnRadioButton.Size = new System.Drawing.Size(234, 16);\r
                        this.directConnRadioButton.TabIndex = 1;\r
                        // \r
                        this.specifyProxyRadioButton.AutoSize = true;\r
                        this.proxyTableLayoutPanel.SetColumnSpan(this.specifyProxyRadioButton, 3);\r
-                       this.specifyProxyRadioButton.Location = new System.Drawing.Point(3, 59);\r
+                       this.specifyProxyRadioButton.Location = new System.Drawing.Point(3, 71);\r
                        this.specifyProxyRadioButton.Name = "specifyProxyRadioButton";\r
                        this.specifyProxyRadioButton.Size = new System.Drawing.Size(211, 16);\r
                        this.specifyProxyRadioButton.TabIndex = 2;\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, 81);\r
+                       this.proxyURLTextBox.Location = new System.Drawing.Point(120, 93);\r
                        this.proxyURLTextBox.Name = "proxyURLTextBox";\r
                        this.proxyURLTextBox.Size = new System.Drawing.Size(311, 19);\r
                        this.proxyURLTextBox.TabIndex = 4;\r
                        this.openInternetOptionLinkLabel.TabIndex = 5;\r
                        this.openInternetOptionLinkLabel.TabStop = true;\r
                        this.openInternetOptionLinkLabel.Text = "インターネットオプションを開く";\r
+                       this.toolTip.SetToolTip(this.openInternetOptionLinkLabel, "インターネットオプション設定でWindowsのプロキシ設定を参照できます。");\r
                        this.openInternetOptionLinkLabel.VisitedLinkColor = System.Drawing.SystemColors.HotTrack;\r
                        this.openInternetOptionLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.OpenInternetOptionLinkLabelLinkClicked);\r
                        // \r
+                       // openInternetOptionLinkAdminLabel\r
+                       // \r
+                       this.openInternetOptionLinkAdminLabel.AutoSize = true;\r
+                       this.proxyTableLayoutPanel.SetColumnSpan(this.openInternetOptionLinkAdminLabel, 2);\r
+                       this.openInternetOptionLinkAdminLabel.Image = ((System.Drawing.Image)(resources.GetObject("openInternetOptionLinkAdminLabel.Image")));\r
+                       this.openInternetOptionLinkAdminLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;\r
+                       this.openInternetOptionLinkAdminLabel.LinkColor = System.Drawing.SystemColors.HotTrack;\r
+                       this.openInternetOptionLinkAdminLabel.Location = new System.Drawing.Point(23, 34);\r
+                       this.openInternetOptionLinkAdminLabel.Name = "openInternetOptionLinkAdminLabel";\r
+                       this.openInternetOptionLinkAdminLabel.Padding = new System.Windows.Forms.Padding(16, 0, 0, 0);\r
+                       this.openInternetOptionLinkAdminLabel.Size = new System.Drawing.Size(222, 12);\r
+                       this.openInternetOptionLinkAdminLabel.TabIndex = 5;\r
+                       this.openInternetOptionLinkAdminLabel.TabStop = true;\r
+                       this.openInternetOptionLinkAdminLabel.Text = "管理者権限のインターネットオプションを開く";\r
+                       this.toolTip.SetToolTip(this.openInternetOptionLinkAdminLabel, "管理者権限でインストールする場合、管理者権限のインターネットオプションを使用します。現在使用しているユーザが管理者権限を持たない場合、管理者権限のインターネットオ" +\r
+                                               "プションも設定する必要があります。");\r
+                       this.openInternetOptionLinkAdminLabel.VisitedLinkColor = System.Drawing.SystemColors.HotTrack;\r
+                       this.openInternetOptionLinkAdminLabel.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.ToolTip toolTip;\r
+               private System.Windows.Forms.LinkLabel openInternetOptionLinkAdminLabel;\r
                private System.Windows.Forms.LinkLabel openInternetOptionLinkLabel;\r
                private System.Windows.Forms.Label proxyURLLabel;\r
                private System.Windows.Forms.FlowLayoutPanel buttonsPanel;\r
index 984c169..f3234ad 100644 (file)
@@ -26,6 +26,8 @@ namespace AppliStation
                        \r
                        InitializeComponent();\r
                        \r
+                       this.openInternetOptionLinkAdminLabel.Visible = ! NaGet.Utils.IsAdministrators();\r
+                       \r
                        loadCurrentPref();\r
                }\r
                \r
@@ -243,15 +245,23 @@ namespace AppliStation
                \r
                void OpenInternetOptionLinkLabelLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)\r
                {\r
+                       string verb = "open";\r
+                       \r
+                       if (sender == openInternetOptionLinkAdminLabel) {\r
+                               verb = "runas"; \r
+                       }\r
+                       \r
                        try {\r
-                               ProcessStartInfo procInfo = new ProcessStartInfo("rundll32.exe");\r
-                               procInfo.Arguments = "shell32.dll,Control_RunDLL inetcpl.cpl,,4";\r
+                               ProcessStartInfo procInfo = new ProcessStartInfo("control.exe");\r
+                               procInfo.Arguments = "inetcpl.cpl,,4";\r
                                procInfo.UseShellExecute = true;\r
-                               procInfo.Verb = "open";\r
+                               procInfo.Verb = verb;\r
                                \r
                                Process.Start(procInfo);\r
+                       } catch (System.ComponentModel.Win32Exception ex) {\r
+                               MessageBox.Show(ex.Message, "インターネットオプション", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
                        } catch (Exception) {\r
-                               MessageBox.Show("インターネットオプションが開けませんでした", openInternetOptionLinkLabel.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                               MessageBox.Show("インターネットオプションが開けませんでした", "インターネットオプション", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
                        }\r
                }\r
                \r
index 5ea0895..5416f48 100644 (file)
   <resheader name="writer">\r
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
   </resheader>\r
+  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+    <value>17, 17</value>\r
+  </metadata>\r
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />\r
+  <data name="openInternetOptionLinkAdminLabel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+    <value>\r
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\r
+        YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAApdJREFUOE+Fk21I\r
+        k1EUx61vgRX0wYqc4mi+JOqoD4WV9oJKpC5fM6m1QKdJEpVCTZFCmpl92FaNEicJlWUffGtEy2eS5sbQ\r
+        9mIlFRWIIk60TZuYpPt37mgy6QEf+MPl3P/53XPPc+66IJ5PqVRGBwcHv/B6vSLaXk/fiMfjSVMoFE4+\r
+        /0qMEqNaWlpadTrdvNFohM1m84mtGxsbPbTXRp7I/yAULFSr1d9UKpXHZDKBafnDEJaeNaPpkQzlHfmw\r
+        WCy+OHnmNRqNneUEnjxhtVq97DT342YsDvRg8XU7FjQ3Uf8wAyVdWSh6KkGe5qivIvKCAO5AwIzdbseP\r
+        qmuYuV2Dn1olZq9XwC3Nw+VbeyF5nozM5v1IvbMb+xRRPggB5lYBWHD0ghyTFcWYKMrBZOIeOAUCyKp3\r
+        IuZBBBJUYRDf2AFh+WZewDSrYKr0NGZl6ZiKDYUrKAi/SKcUEdhyPxzRd0VIaBAhrHIbL2DM4XDgo7QQ\r
+        X9KOwBqyHcMbt+JzaCTOV+3CwdZ4HH8ihkSXgCRlmB8wFniFDqrAmyVrQsGZe8jMrcehjAak5KvRbZDD\r
+        8TURw58OY3goGe9fRsFsNi9TD14FAmoMBsOfpKscQuRGhF7isKGkB5vK3qCvrxxwpwLOE8BoOtAXC71e\r
+        P0OA2hVAXV1djFarHWeNFEk7ESfvRPi5TgiLu2B5R4CpY8B4LjBC16NfSN7vBBCuGigK2FgjcyrbIDrb\r
+        jQhpF4RFepj6CeDMBsYkcA0c8M+AgW8aBQRxsSqyq/SIL+MgvshhoP8K4CrF3EiBv3nT5BPwvgnaOEn6\r
+        zSBsbFNqzRgcrPat/w3PIvOs9aAYZKG3t3flMXEcxyZvYc1kP5mMcSQzaYnEkt+SYvhO/gusfu3mrz6d\r
+        pwAAAABJRU5ErkJggg==\r
+</value>\r
+  </data>\r
 </root>
\ No newline at end of file