/// </summary>\r
private void InitializeComponent()\r
{\r
+ this.proxyURLLabel = new System.Windows.Forms.Label();\r
this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
- this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\r
+ this.buttonsPanel = new System.Windows.Forms.FlowLayoutPanel();\r
this.okButton = new System.Windows.Forms.Button();\r
this.cancelButton = new System.Windows.Forms.Button();\r
this.tabControl = new System.Windows.Forms.TabControl();\r
this.repoUrlTextBox = new System.Windows.Forms.TextBox();\r
this.repoUrlLabel = new System.Windows.Forms.Label();\r
this.repoListLabel = new System.Windows.Forms.Label();\r
+ this.networkTabPage = new System.Windows.Forms.TabPage();\r
+ this.proxyGroupBox = new System.Windows.Forms.GroupBox();\r
+ this.proxyTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();\r
+ this.proxySameAsIERadioButton = new System.Windows.Forms.RadioButton();\r
+ 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.tableLayoutPanel.SuspendLayout();\r
- this.flowLayoutPanel1.SuspendLayout();\r
+ this.buttonsPanel.SuspendLayout();\r
this.tabControl.SuspendLayout();\r
this.reposListTabPage.SuspendLayout();\r
this.repoTableLayoutPanel.SuspendLayout();\r
this.repoBtnsFlowLayoutPanel.SuspendLayout();\r
+ this.networkTabPage.SuspendLayout();\r
+ this.proxyGroupBox.SuspendLayout();\r
+ this.proxyTableLayoutPanel.SuspendLayout();\r
this.SuspendLayout();\r
// \r
+ // proxyURLLabel\r
+ // \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.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
+ // \r
// tableLayoutPanel\r
// \r
this.tableLayoutPanel.ColumnCount = 1;\r
this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
- this.tableLayoutPanel.Controls.Add(this.flowLayoutPanel1, 0, 1);\r
+ this.tableLayoutPanel.Controls.Add(this.buttonsPanel, 0, 1);\r
this.tableLayoutPanel.Controls.Add(this.tabControl, 0, 0);\r
this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0);\r
this.tableLayoutPanel.Size = new System.Drawing.Size(464, 283);\r
this.tableLayoutPanel.TabIndex = 0;\r
// \r
- // flowLayoutPanel1\r
+ // buttonsPanel\r
// \r
- this.flowLayoutPanel1.AutoSize = true;\r
- this.flowLayoutPanel1.Controls.Add(this.okButton);\r
- this.flowLayoutPanel1.Controls.Add(this.cancelButton);\r
- this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Right;\r
- this.flowLayoutPanel1.Location = new System.Drawing.Point(294, 250);\r
- this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);\r
- this.flowLayoutPanel1.Name = "flowLayoutPanel1";\r
- this.flowLayoutPanel1.Size = new System.Drawing.Size(170, 33);\r
- this.flowLayoutPanel1.TabIndex = 14;\r
+ this.buttonsPanel.AutoSize = true;\r
+ this.buttonsPanel.Controls.Add(this.okButton);\r
+ this.buttonsPanel.Controls.Add(this.cancelButton);\r
+ this.buttonsPanel.Dock = System.Windows.Forms.DockStyle.Right;\r
+ this.buttonsPanel.Location = new System.Drawing.Point(294, 250);\r
+ this.buttonsPanel.Margin = new System.Windows.Forms.Padding(0);\r
+ this.buttonsPanel.Name = "buttonsPanel";\r
+ this.buttonsPanel.Size = new System.Drawing.Size(170, 33);\r
+ this.buttonsPanel.TabIndex = 14;\r
// \r
// okButton\r
// \r
// tabControl\r
// \r
this.tabControl.Controls.Add(this.reposListTabPage);\r
+ this.tabControl.Controls.Add(this.networkTabPage);\r
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.tabControl.Location = new System.Drawing.Point(5, 5);\r
this.tabControl.Margin = new System.Windows.Forms.Padding(5);\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
// \r
// repoTableLayoutPanel\r
// \r
this.repoListLabel.TabIndex = 0;\r
this.repoListLabel.Text = "ソフトリストを取得するレポジトリ(&L):";\r
// \r
+ // networkTabPage\r
+ // \r
+ this.networkTabPage.Controls.Add(this.proxyGroupBox);\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, 214);\r
+ this.networkTabPage.TabIndex = 1;\r
+ this.networkTabPage.Text = "接続";\r
+ this.networkTabPage.UseVisualStyleBackColor = true;\r
+ // \r
+ // proxyGroupBox\r
+ // \r
+ this.proxyGroupBox.Controls.Add(this.proxyTableLayoutPanel);\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.TabIndex = 1;\r
+ this.proxyGroupBox.TabStop = false;\r
+ this.proxyGroupBox.Text = "プロキシサーバー";\r
+ // \r
+ // proxyTableLayoutPanel\r
+ // \r
+ this.proxyTableLayoutPanel.ColumnCount = 3;\r
+ this.proxyTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));\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.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.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.TabIndex = 0;\r
+ // \r
+ // proxySameAsIERadioButton\r
+ // \r
+ this.proxySameAsIERadioButton.AutoSize = true;\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.TabIndex = 0;\r
+ this.proxySameAsIERadioButton.TabStop = true;\r
+ this.proxySameAsIERadioButton.Text = "インターネットオプションと同じ設定を使う";\r
+ this.proxySameAsIERadioButton.UseVisualStyleBackColor = true;\r
+ this.proxySameAsIERadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
+ // \r
+ // directConnRadioButton\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.Name = "directConnRadioButton";\r
+ this.directConnRadioButton.Size = new System.Drawing.Size(218, 16);\r
+ this.directConnRadioButton.TabIndex = 1;\r
+ this.directConnRadioButton.TabStop = true;\r
+ this.directConnRadioButton.Text = "プロキシサーバーを使わずに直接接続する";\r
+ this.directConnRadioButton.UseVisualStyleBackColor = true;\r
+ this.directConnRadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
+ // \r
+ // specifyProxyRadioButton\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.Name = "specifyProxyRadioButton";\r
+ this.specifyProxyRadioButton.Size = new System.Drawing.Size(196, 16);\r
+ this.specifyProxyRadioButton.TabIndex = 2;\r
+ this.specifyProxyRadioButton.TabStop = true;\r
+ this.specifyProxyRadioButton.Text = "接続に指定のプロキシサーバーを使う";\r
+ this.specifyProxyRadioButton.UseVisualStyleBackColor = true;\r
+ this.specifyProxyRadioButton.Click += new System.EventHandler(this.ProxyRadioButtonsCheckedChanged);\r
+ // \r
+ // proxyURLTextBox\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.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
// UserPrefForm\r
// \r
this.AcceptButton = this.okButton;\r
this.Text = "設定";\r
this.tableLayoutPanel.ResumeLayout(false);\r
this.tableLayoutPanel.PerformLayout();\r
- this.flowLayoutPanel1.ResumeLayout(false);\r
- this.flowLayoutPanel1.PerformLayout();\r
+ this.buttonsPanel.ResumeLayout(false);\r
+ this.buttonsPanel.PerformLayout();\r
this.tabControl.ResumeLayout(false);\r
this.reposListTabPage.ResumeLayout(false);\r
this.repoTableLayoutPanel.ResumeLayout(false);\r
this.repoTableLayoutPanel.PerformLayout();\r
this.repoBtnsFlowLayoutPanel.ResumeLayout(false);\r
+ this.networkTabPage.ResumeLayout(false);\r
+ this.proxyGroupBox.ResumeLayout(false);\r
+ this.proxyTableLayoutPanel.ResumeLayout(false);\r
+ this.proxyTableLayoutPanel.PerformLayout();\r
this.ResumeLayout(false);\r
}\r
+ private System.Windows.Forms.Label proxyURLLabel;\r
+ private System.Windows.Forms.FlowLayoutPanel buttonsPanel;\r
+ private System.Windows.Forms.GroupBox proxyGroupBox;\r
+ private System.Windows.Forms.TableLayoutPanel proxyTableLayoutPanel;\r
+ private System.Windows.Forms.RadioButton proxySameAsIERadioButton;\r
+ private System.Windows.Forms.RadioButton directConnRadioButton;\r
+ private System.Windows.Forms.RadioButton specifyProxyRadioButton;\r
+ private System.Windows.Forms.TextBox proxyURLTextBox;\r
+ private System.Windows.Forms.TabPage networkTabPage;\r
private System.Windows.Forms.Label repoListLabel;\r
private System.Windows.Forms.TextBox repoUrlTextBox;\r
private System.Windows.Forms.Label repoUrlLabel;\r
private System.Windows.Forms.TabControl tabControl;\r
private System.Windows.Forms.Button okButton;\r
private System.Windows.Forms.Button cancelButton;\r
- private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\r
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;\r
}\r
}\r
{\r
private List<RepositoryInfo> repos;\r
\r
- private bool isRepositoriesChanged;\r
+ private bool isRepoListChanged;\r
\r
public UserPrefForm()\r
{\r
public void loadCurrentPref()\r
{\r
this.RepositoriesListSetting = NaGet.Utils.GetDeserializedObject<RepositoriesList>(NaGet.Env.RepositoriesListFile);\r
+ \r
+ NaGet.NaGetLibPref userPref = NaGet.Env.Pref;\r
+ this.ProxyAddress = userPref.ProxyAddress;\r
}\r
\r
+ #region レポジトリリスト設定関連\r
+ \r
public RepositoriesList RepositoriesListSetting {\r
get {\r
RepositoriesList repoList = new RepositoriesList();\r
set {\r
repos.Clear();\r
repos.AddRange(value.Repositories);\r
- isRepositoriesChanged = false;\r
\r
updateRepos();\r
+ \r
+ // レポジトリ変更状態をリセットする\r
+ isRepoListChanged = false;\r
}\r
}\r
\r
+ private string repoListCheckedListBoxRenderer(RepositoryInfo repo) {\r
+ return string.Format("{0}[{1}]", repo.Name, repo.Url.Href);\r
+ }\r
+ \r
private void updateRepos()\r
{\r
repoListCheckedListBox.Items.Clear();\r
}\r
}\r
\r
- public string repoListCheckedListBoxRenderer(RepositoryInfo repo)\r
- {\r
- return string.Format("{0}[{1}]", repo.Name, repo.Url.Href);\r
- }\r
- \r
\r
void RepoListCheckedListBoxSelectedIndexChanged(object sender, EventArgs e)\r
{\r
updateRepos();\r
repoListCheckedListBox.SelectedIndex = repos.Count - 1;\r
\r
- isRepositoriesChanged = true;\r
+ isRepoListChanged = true;\r
}\r
\r
void RepoListCheckedListBoxItemCheck(object sender, ItemCheckEventArgs e)\r
{\r
repos[e.Index].Enabled = (e.NewValue == CheckState.Checked);\r
\r
- isRepositoriesChanged = true;\r
+ isRepoListChanged = true;\r
}\r
\r
void RemoveRepoButtonClick(object sender, EventArgs e)\r
repos.RemoveAt(selectedIndex);\r
repoListCheckedListBox.Items.RemoveAt(selectedIndex);\r
\r
- isRepositoriesChanged = true;\r
+ isRepoListChanged = true;\r
}\r
}\r
}\r
AppliStation.Util.GUIUtils.CheckedListBox_SwapItems(repoListCheckedListBox, selectedIndex-1, selectedIndex);\r
repoListCheckedListBox.SelectedIndex --;\r
\r
- isRepositoriesChanged = true;\r
+ isRepoListChanged = true;\r
}\r
}\r
\r
AppliStation.Util.GUIUtils.CheckedListBox_SwapItems(repoListCheckedListBox, selectedIndex, selectedIndex+1);\r
repoListCheckedListBox.SelectedIndex ++;\r
\r
- isRepositoriesChanged = true;\r
+ isRepoListChanged = true;\r
}\r
}\r
\r
{\r
int selectedIndex = repoListCheckedListBox.SelectedIndex;\r
if ((0 <= selectedIndex) && (selectedIndex < repos.Count)) {\r
- repos[selectedIndex].Url = new LocationEntry(repoUrlTextBox.Text);\r
- repoListCheckedListBox.Items[selectedIndex] = repoListCheckedListBoxRenderer(repos[selectedIndex]);\r
- \r
- isRepositoriesChanged = true;\r
+ if (repoUrlTextBox.Text != repos[selectedIndex].Url.Href) {\r
+ repos[selectedIndex].Url = new LocationEntry(repoUrlTextBox.Text);\r
+ repoListCheckedListBox.Items[selectedIndex] = repoListCheckedListBoxRenderer(repos[selectedIndex]);\r
+ \r
+ isRepoListChanged = true;\r
+ }\r
}\r
}\r
\r
public bool IsRepositoryListSettingChanged {\r
- get { return isRepositoriesChanged; }\r
+ get { return isRepoListChanged; }\r
}\r
\r
- private void commitRepositorySetting()\r
+ private void commitRepositoryListSetting()\r
{\r
- if (isRepositoriesChanged) {\r
+ if (isRepoListChanged) {\r
NaGet.Utils.PutSerializeObject<RepositoriesList>(NaGet.Env.RepositoriesListFile, this.RepositoriesListSetting);\r
}\r
}\r
\r
+ #endregion\r
+ \r
+ #region プロキシサーバ設定関連\r
+\r
+ public string ProxyAddress {\r
+ get {\r
+ if (proxySameAsIERadioButton.Checked) {\r
+ return string.Empty; \r
+ } else if (directConnRadioButton.Checked) {\r
+ return "-";\r
+ } else {\r
+ return proxyURLTextBox.Text;\r
+ }\r
+ }\r
+ set {\r
+ if (string.IsNullOrEmpty(value)) {\r
+ proxySameAsIERadioButton.Checked = true; \r
+ } else if ("-" == value) {\r
+ directConnRadioButton.Checked = true;\r
+ } else {\r
+ specifyProxyRadioButton.Checked = true;\r
+ proxyURLTextBox.Text = value;\r
+ }\r
+ \r
+ updateProxyURLEnability();\r
+ }\r
+ }\r
+ \r
+ private void updateProxyURLEnability()\r
+ {\r
+ bool isSpecifiedProxy = specifyProxyRadioButton.Checked;\r
+ \r
+ proxyURLLabel.Enabled = isSpecifiedProxy;\r
+ proxyURLTextBox.Enabled = isSpecifiedProxy;\r
+ }\r
+ \r
+ void ProxyRadioButtonsCheckedChanged(object sender, EventArgs e)\r
+ {\r
+ updateProxyURLEnability();\r
+ }\r
+ \r
+ private void commitProxySetting(NaGet.NaGetLibPref pref)\r
+ {\r
+ pref.ProxyAddress = this.ProxyAddress;\r
+ \r
+ NaGet.Utils.PutSerializeObject<NaGet.NaGetLibPref>(NaGet.Env.PrefPath, pref);\r
+ }\r
+ \r
+ #endregion\r
+ \r
+ private void commitNaGetLibPref(NaGet.NaGetLibPref pref)\r
+ {\r
+ // ファイルに書き込む\r
+ string path = NaGet.Env.PrefPath;\r
+ NaGet.Utils.PutSerializeObject<NaGet.NaGetLibPref>(path, pref);\r
+ \r
+ // 設定についてファイルから設定を再読み込みさせる\r
+ NaGet.Env.LoadPref();\r
+ }\r
+ \r
void OkButtonClick(object sender, EventArgs e)\r
{\r
- commitRepositorySetting();\r
+ NaGet.NaGetLibPref pref = NaGet.Env.Pref;\r
+ \r
+ commitRepositoryListSetting();\r
+ commitProxySetting(pref);\r
+ \r
+ commitNaGetLibPref(pref);\r
}\r
\r
void CancelButtonClick(object sender, EventArgs e)\r