OSDN Git Service

AppliStation-GUI,キャッシュフォルダ指定設定を設定ダイアログに追加
authorttp <ttp@users.sourceforge.jp>
Sun, 20 Dec 2009 03:47:47 +0000 (12:47 +0900)
committerttp <ttp@users.sourceforge.jp>
Sun, 20 Dec 2009 03:47:47 +0000 (12:47 +0900)
AppliStation/UserPrefForm.Designer.cs
AppliStation/UserPrefForm.cs
AppliStation/UserPrefForm.resx

index 48821de..0e71739 100644 (file)
                        this.openInternetOptionLinkLabel = new System.Windows.Forms.LinkLabel();\r
                        this.openInternetOptionLinkAdminLabel = new System.Windows.Forms.LinkLabel();\r
                        this.installTabPage = new System.Windows.Forms.TabPage();\r
-                       this.installFlowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();\r
+                       this.installTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
                        this.installScanInstallerFileCheckbox = new System.Windows.Forms.CheckBox();\r
                        this.installOnBackgroundCheckBox = new System.Windows.Forms.CheckBox();\r
+                       this.cacheFolderGroupBox = new System.Windows.Forms.GroupBox();\r
+                       this.cacheFolderTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
+                       this.cacheFolderCustomCheckBox = new System.Windows.Forms.CheckBox();\r
+                       this.cacheFolderTextBox = new System.Windows.Forms.TextBox();\r
+                       this.cacheFolderBrowseButton = new System.Windows.Forms.Button();\r
+                       this.cacheFolderOpenLinkLabel = new System.Windows.Forms.LinkLabel();\r
                        this.toolTip = new System.Windows.Forms.ToolTip(this.components);\r
-                       this.repoUrlTextBoxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);\r
+                       this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);\r
                        this.tableLayoutPanel.SuspendLayout();\r
                        this.buttonsPanel.SuspendLayout();\r
                        this.tabControl.SuspendLayout();\r
                        this.proxyGroupBox.SuspendLayout();\r
                        this.proxyTableLayoutPanel.SuspendLayout();\r
                        this.installTabPage.SuspendLayout();\r
-                       this.installFlowLayoutPanel.SuspendLayout();\r
-                       ((System.ComponentModel.ISupportInitialize)(this.repoUrlTextBoxErrorProvider)).BeginInit();\r
+                       this.installTableLayoutPanel.SuspendLayout();\r
+                       this.cacheFolderGroupBox.SuspendLayout();\r
+                       this.cacheFolderTableLayoutPanel.SuspendLayout();\r
+                       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();\r
                        this.SuspendLayout();\r
                        // \r
                        // proxyURLLabel\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.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
                        // \r
                        // installTabPage\r
                        // \r
-                       this.installTabPage.Controls.Add(this.installFlowLayoutPanel);\r
-                       this.installTabPage.Location = new System.Drawing.Point(4, 22);\r
+                       this.installTabPage.Controls.Add(this.installTableLayoutPanel);\r
+                       this.installTabPage.Location = new System.Drawing.Point(4, 21);\r
                        this.installTabPage.Name = "installTabPage";\r
                        this.installTabPage.Padding = new System.Windows.Forms.Padding(3);\r
-                       this.installTabPage.Size = new System.Drawing.Size(446, 214);\r
+                       this.installTabPage.Size = new System.Drawing.Size(446, 215);\r
                        this.installTabPage.TabIndex = 2;\r
                        this.installTabPage.Text = "インストール";\r
                        this.installTabPage.UseVisualStyleBackColor = true;\r
                        // \r
-                       // installFlowLayoutPanel\r
-                       // \r
-                       this.installFlowLayoutPanel.Controls.Add(this.installScanInstallerFileCheckbox);\r
-                       this.installFlowLayoutPanel.Controls.Add(this.installOnBackgroundCheckBox);\r
-                       this.installFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
-                       this.installFlowLayoutPanel.Location = new System.Drawing.Point(3, 3);\r
-                       this.installFlowLayoutPanel.Name = "installFlowLayoutPanel";\r
-                       this.installFlowLayoutPanel.Padding = new System.Windows.Forms.Padding(10);\r
-                       this.installFlowLayoutPanel.Size = new System.Drawing.Size(440, 208);\r
-                       this.installFlowLayoutPanel.TabIndex = 0;\r
+                       // installTableLayoutPanel\r
+                       // \r
+                       this.installTableLayoutPanel.ColumnCount = 1;\r
+                       this.installTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.installTableLayoutPanel.Controls.Add(this.installScanInstallerFileCheckbox, 0, 0);\r
+                       this.installTableLayoutPanel.Controls.Add(this.installOnBackgroundCheckBox, 0, 1);\r
+                       this.installTableLayoutPanel.Controls.Add(this.cacheFolderGroupBox, 0, 2);\r
+                       this.installTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.installTableLayoutPanel.Location = new System.Drawing.Point(3, 3);\r
+                       this.installTableLayoutPanel.Name = "installTableLayoutPanel";\r
+                       this.installTableLayoutPanel.RowCount = 4;\r
+                       this.installTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.installTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.installTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.installTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.installTableLayoutPanel.Size = new System.Drawing.Size(440, 209);\r
+                       this.installTableLayoutPanel.TabIndex = 1;\r
                        // \r
                        // installScanInstallerFileCheckbox\r
                        // \r
                        this.installScanInstallerFileCheckbox.AutoSize = true;\r
-                       this.installFlowLayoutPanel.SetFlowBreak(this.installScanInstallerFileCheckbox, true);\r
-                       this.installScanInstallerFileCheckbox.Location = new System.Drawing.Point(13, 13);\r
+                       this.installScanInstallerFileCheckbox.Location = new System.Drawing.Point(3, 3);\r
                        this.installScanInstallerFileCheckbox.Name = "installScanInstallerFileCheckbox";\r
                        this.installScanInstallerFileCheckbox.Size = new System.Drawing.Size(237, 16);\r
                        this.installScanInstallerFileCheckbox.TabIndex = 0;\r
                        // installOnBackgroundCheckBox\r
                        // \r
                        this.installOnBackgroundCheckBox.AutoSize = true;\r
-                       this.installFlowLayoutPanel.SetFlowBreak(this.installOnBackgroundCheckBox, true);\r
-                       this.installOnBackgroundCheckBox.Location = new System.Drawing.Point(13, 35);\r
+                       this.installOnBackgroundCheckBox.Location = new System.Drawing.Point(3, 25);\r
                        this.installOnBackgroundCheckBox.Name = "installOnBackgroundCheckBox";\r
                        this.installOnBackgroundCheckBox.Size = new System.Drawing.Size(306, 16);\r
                        this.installOnBackgroundCheckBox.TabIndex = 1;\r
                        this.toolTip.SetToolTip(this.installOnBackgroundCheckBox, "ロースペックなPCであっても、インストール・アンインストール処理中に快適に他の作業を行えるよう優先度を下げることができます。");\r
                        this.installOnBackgroundCheckBox.UseVisualStyleBackColor = true;\r
                        // \r
-                       // repoUrlTextBoxErrorProvider\r
-                       // \r
-                       this.repoUrlTextBoxErrorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;\r
-                       this.repoUrlTextBoxErrorProvider.ContainerControl = this;\r
+                       // cacheFolderGroupBox\r
+                       // \r
+                       this.cacheFolderGroupBox.AutoSize = true;\r
+                       this.cacheFolderGroupBox.Controls.Add(this.cacheFolderTableLayoutPanel);\r
+                       this.cacheFolderGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.cacheFolderGroupBox.Location = new System.Drawing.Point(3, 47);\r
+                       this.cacheFolderGroupBox.Name = "cacheFolderGroupBox";\r
+                       this.cacheFolderGroupBox.Size = new System.Drawing.Size(434, 81);\r
+                       this.cacheFolderGroupBox.TabIndex = 2;\r
+                       this.cacheFolderGroupBox.TabStop = false;\r
+                       this.cacheFolderGroupBox.Text = "キャッシュフォルダー";\r
+                       // \r
+                       // cacheFolderTableLayoutPanel\r
+                       // \r
+                       this.cacheFolderTableLayoutPanel.AutoSize = true;\r
+                       this.cacheFolderTableLayoutPanel.ColumnCount = 3;\r
+                       this.cacheFolderTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));\r
+                       this.cacheFolderTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
+                       this.cacheFolderTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
+                       this.cacheFolderTableLayoutPanel.Controls.Add(this.cacheFolderCustomCheckBox, 0, 0);\r
+                       this.cacheFolderTableLayoutPanel.Controls.Add(this.cacheFolderTextBox, 1, 1);\r
+                       this.cacheFolderTableLayoutPanel.Controls.Add(this.cacheFolderBrowseButton, 2, 1);\r
+                       this.cacheFolderTableLayoutPanel.Controls.Add(this.cacheFolderOpenLinkLabel, 0, 2);\r
+                       this.cacheFolderTableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.cacheFolderTableLayoutPanel.Location = new System.Drawing.Point(3, 15);\r
+                       this.cacheFolderTableLayoutPanel.Name = "cacheFolderTableLayoutPanel";\r
+                       this.cacheFolderTableLayoutPanel.RowCount = 3;\r
+                       this.cacheFolderTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.cacheFolderTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.cacheFolderTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
+                       this.cacheFolderTableLayoutPanel.Size = new System.Drawing.Size(428, 63);\r
+                       this.cacheFolderTableLayoutPanel.TabIndex = 0;\r
+                       // \r
+                       // cacheFolderCustomCheckBox\r
+                       // \r
+                       this.cacheFolderCustomCheckBox.AutoSize = true;\r
+                       this.cacheFolderTableLayoutPanel.SetColumnSpan(this.cacheFolderCustomCheckBox, 3);\r
+                       this.cacheFolderCustomCheckBox.Location = new System.Drawing.Point(3, 3);\r
+                       this.cacheFolderCustomCheckBox.Name = "cacheFolderCustomCheckBox";\r
+                       this.cacheFolderCustomCheckBox.Size = new System.Drawing.Size(248, 16);\r
+                       this.cacheFolderCustomCheckBox.TabIndex = 0;\r
+                       this.cacheFolderCustomCheckBox.Text = "キャッシュフォルダに以下のフォルダを使用する(&C)";\r
+                       this.cacheFolderCustomCheckBox.UseVisualStyleBackColor = true;\r
+                       this.cacheFolderCustomCheckBox.CheckedChanged += new System.EventHandler(this.CacheFolderCustomCheckBoxCheckedChanged);\r
+                       // \r
+                       // cacheFolderTextBox\r
+                       // \r
+                       this.cacheFolderTextBox.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;\r
+                       this.cacheFolderTextBox.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.FileSystemDirectories;\r
+                       this.cacheFolderTextBox.Dock = System.Windows.Forms.DockStyle.Fill;\r
+                       this.cacheFolderTextBox.Enabled = false;\r
+                       this.cacheFolderTextBox.Location = new System.Drawing.Point(23, 25);\r
+                       this.cacheFolderTextBox.Name = "cacheFolderTextBox";\r
+                       this.cacheFolderTextBox.Size = new System.Drawing.Size(335, 19);\r
+                       this.cacheFolderTextBox.TabIndex = 1;\r
+                       this.cacheFolderTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.CacheFolderTextBoxValidating);\r
+                       // \r
+                       // cacheFolderBrowseButton\r
+                       // \r
+                       this.cacheFolderBrowseButton.AutoSize = true;\r
+                       this.cacheFolderBrowseButton.Enabled = false;\r
+                       this.cacheFolderBrowseButton.Location = new System.Drawing.Point(364, 25);\r
+                       this.cacheFolderBrowseButton.Name = "cacheFolderBrowseButton";\r
+                       this.cacheFolderBrowseButton.Size = new System.Drawing.Size(61, 23);\r
+                       this.cacheFolderBrowseButton.TabIndex = 2;\r
+                       this.cacheFolderBrowseButton.Text = "参照(&B)...";\r
+                       this.cacheFolderBrowseButton.Click += new System.EventHandler(this.CacheFolderBrowseButtonClick);\r
+                       // \r
+                       // cacheFolderOpenLinkLabel\r
+                       // \r
+                       this.cacheFolderOpenLinkLabel.AutoSize = true;\r
+                       this.cacheFolderTableLayoutPanel.SetColumnSpan(this.cacheFolderOpenLinkLabel, 3);\r
+                       this.cacheFolderOpenLinkLabel.LinkColor = System.Drawing.SystemColors.HotTrack;\r
+                       this.cacheFolderOpenLinkLabel.Location = new System.Drawing.Point(3, 51);\r
+                       this.cacheFolderOpenLinkLabel.Name = "cacheFolderOpenLinkLabel";\r
+                       this.cacheFolderOpenLinkLabel.Size = new System.Drawing.Size(120, 12);\r
+                       this.cacheFolderOpenLinkLabel.TabIndex = 3;\r
+                       this.cacheFolderOpenLinkLabel.TabStop = true;\r
+                       this.cacheFolderOpenLinkLabel.Text = "キャッシュフォルダーを開く";\r
+                       this.cacheFolderOpenLinkLabel.VisitedLinkColor = System.Drawing.SystemColors.HotTrack;\r
+                       this.cacheFolderOpenLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.CacheFolderOpenLinkLabelLinkClicked);\r
+                       // \r
+                       // errorProvider\r
+                       // \r
+                       this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.AlwaysBlink;\r
+                       this.errorProvider.ContainerControl = this;\r
                        // \r
                        // UserPrefForm\r
                        // \r
                        this.proxyTableLayoutPanel.ResumeLayout(false);\r
                        this.proxyTableLayoutPanel.PerformLayout();\r
                        this.installTabPage.ResumeLayout(false);\r
-                       this.installFlowLayoutPanel.ResumeLayout(false);\r
-                       this.installFlowLayoutPanel.PerformLayout();\r
-                       ((System.ComponentModel.ISupportInitialize)(this.repoUrlTextBoxErrorProvider)).EndInit();\r
+                       this.installTableLayoutPanel.ResumeLayout(false);\r
+                       this.installTableLayoutPanel.PerformLayout();\r
+                       this.cacheFolderGroupBox.ResumeLayout(false);\r
+                       this.cacheFolderGroupBox.PerformLayout();\r
+                       this.cacheFolderTableLayoutPanel.ResumeLayout(false);\r
+                       this.cacheFolderTableLayoutPanel.PerformLayout();\r
+                       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();\r
                        this.ResumeLayout(false);\r
                }\r
+               private System.Windows.Forms.LinkLabel cacheFolderOpenLinkLabel;\r
+               private System.Windows.Forms.Button cacheFolderBrowseButton;\r
+               private System.Windows.Forms.TextBox cacheFolderTextBox;\r
+               private System.Windows.Forms.CheckBox cacheFolderCustomCheckBox;\r
+               private System.Windows.Forms.TableLayoutPanel cacheFolderTableLayoutPanel;\r
+               private System.Windows.Forms.GroupBox cacheFolderGroupBox;\r
+               private System.Windows.Forms.TableLayoutPanel installTableLayoutPanel;\r
                private System.Windows.Forms.CheckBox installOnBackgroundCheckBox;\r
                private System.Windows.Forms.CheckBox installScanInstallerFileCheckbox;\r
-               private System.Windows.Forms.FlowLayoutPanel installFlowLayoutPanel;\r
                private System.Windows.Forms.TabPage installTabPage;\r
-               private System.Windows.Forms.ErrorProvider repoUrlTextBoxErrorProvider;\r
+               private System.Windows.Forms.ErrorProvider errorProvider;\r
                private System.Windows.Forms.ToolTip toolTip;\r
                private System.Windows.Forms.LinkLabel openInternetOptionLinkAdminLabel;\r
                private System.Windows.Forms.LinkLabel openInternetOptionLinkLabel;\r
index b9c3ba2..190b1c0 100644 (file)
@@ -42,6 +42,7 @@ namespace AppliStation
                        this.ProxyAddress = userPref.ProxyAddress;\r
                        this.EnableScanInstallerFile = userPref.EnableScanInstallerFile;\r
                        this.InstallOnBackground = userPref.InstallOnBackground;\r
+                       this.CacheFolder = userPref.CacheFolder;\r
                }\r
                \r
                #region レポジトリリスト設定関連\r
@@ -296,6 +297,25 @@ namespace AppliStation
                        get {   return this.installOnBackgroundCheckBox.Checked;        }\r
                }\r
                \r
+               public string CacheFolder {\r
+                       set {\r
+                               if (string.IsNullOrEmpty(value)) {\r
+                                       this.cacheFolderCustomCheckBox.Checked = false;\r
+                                       this.cacheFolderTextBox.Text = string.Empty;\r
+                               } else {\r
+                                       this.cacheFolderCustomCheckBox.Checked = true;\r
+                                       this.cacheFolderTextBox.Text = value;\r
+                               }\r
+                       }\r
+                       get {\r
+                               if (this.cacheFolderCustomCheckBox.Checked) {\r
+                                       return this.cacheFolderTextBox.Text;\r
+                               } else {\r
+                                       return null;\r
+                               }\r
+                       }\r
+               }\r
+               \r
                /// <summary>\r
                /// インストール関連設定を、指定された設定オブジェクトに設定する。\r
                /// </summary>\r
@@ -304,6 +324,7 @@ namespace AppliStation
                {\r
                        pref.EnableScanInstallerFile = this.EnableScanInstallerFile;\r
                        pref.InstallOnBackground = this.InstallOnBackground;\r
+                       pref.CacheFolder = this.CacheFolder;\r
                }\r
                \r
                #endregion\r
@@ -344,7 +365,7 @@ namespace AppliStation
                        if (string.IsNullOrEmpty(urlText)) {\r
                                return; // special case.\r
                        } if (Uri.IsWellFormedUriString(urlText, UriKind.Absolute) == false) {\r
-                               repoUrlTextBoxErrorProvider.SetError(repoUrlLabel, "URLの記述が不正です");\r
+                               errorProvider.SetError(repoUrlLabel, "URLの記述が不正です");\r
                                e.Cancel = true;\r
                        } else {\r
                                Uri uri = new Uri(urlText);\r
@@ -352,12 +373,68 @@ namespace AppliStation
                                    (uri.Scheme != Uri.UriSchemeFtp) &&\r
                                    (uri.Scheme != Uri.UriSchemeHttp) &&\r
                                    (uri.Scheme != Uri.UriSchemeHttps)){\r
-                                       repoUrlTextBoxErrorProvider.SetError(repoUrlLabel, "URLの記述が不正です");\r
+                                       errorProvider.SetError(repoUrlLabel, "URLの記述が不正です");\r
                                        e.Cancel = true;\r
                                } else {\r
-                                       repoUrlTextBoxErrorProvider.Clear();\r
+                                       errorProvider.Clear();\r
                                }\r
                        }\r
                }\r
+               \r
+               \r
+               void CacheFolderCustomCheckBoxCheckedChanged(object sender, EventArgs e)\r
+               {\r
+                       cacheFolderTextBox.Enabled = cacheFolderCustomCheckBox.Checked;\r
+                       cacheFolderBrowseButton.Enabled = cacheFolderCustomCheckBox.Checked;\r
+               }\r
+               \r
+               void CacheFolderBrowseButtonClick(object sender, EventArgs e)\r
+               {\r
+                       FolderBrowserDialog fd = new FolderBrowserDialog();\r
+                       fd.Description = "キャッシュフォルダーを指定してください。";\r
+                       fd.SelectedPath = cacheFolderTextBox.Text;\r
+                       fd.ShowNewFolderButton = true;\r
+                       \r
+                       if (fd.ShowDialog(this) == DialogResult.OK) {\r
+                               cacheFolderTextBox.Text = fd.SelectedPath;\r
+                       }\r
+               }\r
+               \r
+               void CacheFolderTextBoxValidating(object sender, System.ComponentModel.CancelEventArgs e)\r
+               {\r
+                       string folderPath = cacheFolderTextBox.Text;\r
+                       \r
+                       if (string.IsNullOrEmpty(folderPath)) {\r
+                               errorProvider.Clear();\r
+                               return; // special case\r
+                       } else if (! System.IO.Directory.Exists(folderPath)) {\r
+                               errorProvider.SetError(cacheFolderTextBox, "存在しないフォルダーパスを指定しています。");\r
+                               e.Cancel = true;\r
+                       } else {\r
+                               errorProvider.Clear();\r
+                       }\r
+               }\r
+               \r
+               void CacheFolderOpenLinkLabelLinkClicked(object sender, LinkLabelLinkClickedEventArgs e)\r
+               {\r
+                       string folderPath;\r
+                       \r
+                       if (cacheFolderCustomCheckBox.Checked) {\r
+                               folderPath = cacheFolderTextBox.Text;\r
+                       } else {\r
+                               // デフォルトは AppDataFolderPath/Cache。\r
+                               folderPath = System.IO.Path.Combine(NaGet.Env.AppDataFolderPath, "Cache");\r
+                       }\r
+                       \r
+                       if (System.IO.Directory.Exists(folderPath)) {\r
+                               try {\r
+                                       Process.Start(folderPath);\r
+                               } catch (Exception ex) {\r
+                                       MessageBox.Show(ex.Message, "キャッシュフォルダー", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                               }\r
+                       } else {\r
+                               MessageBox.Show(string.Format("フォルダーパス\"{0}\"は存在しませんでした。", folderPath), "キャッシュフォルダー", MessageBoxButtons.OK, MessageBoxIcon.Error);\r
+                       }\r
+               }\r
        }\r
 }\r
index 51f6c08..f3671ce 100644 (file)
         pwAAAABJRU5ErkJggg==\r
 </value>\r
   </data>\r
-  <metadata name="repoUrlTextBoxErrorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
+  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>104, 17</value>\r
   </metadata>\r
+  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
+    <value>51</value>\r
+  </metadata>\r
 </root>
\ No newline at end of file