修订版 | d16f70a92b9610a634111a73aa484118e7cb7d76 (tree) |
---|---|
时间 | 2009-10-06 14:53:28 |
作者 | Face |
Commiter | Face |
Added minor publication logic.
@@ -1433,7 +1433,7 @@ | ||
1433 | 1433 | |
1434 | 1434 | private void Upload() |
1435 | 1435 | { |
1436 | - var upload = new UploadForm(branchButton); | |
1436 | + var upload = new UploadForm(branchButton, uri.IsFile); | |
1437 | 1437 | var result = DialogResult.None; |
1438 | 1438 | upload.StartPosition = FormStartPosition.CenterParent; |
1439 | 1439 | Invoke(new MethodInvoker(delegate { result = upload.ShowDialog(); })); |
@@ -86,6 +86,7 @@ | ||
86 | 86 | this.branchComboBox.Size = new System.Drawing.Size(160, 21); |
87 | 87 | this.branchComboBox.TabIndex = 3; |
88 | 88 | this.toolTipProvider.SetToolTip(this.branchComboBox, "Branch name on remote repository"); |
89 | + this.branchComboBox.SelectedIndexChanged += new System.EventHandler(this.branchComboBox_SelectedIndexChanged); | |
89 | 90 | // |
90 | 91 | // PublishCheckBox |
91 | 92 | // |
@@ -7,9 +7,11 @@ | ||
7 | 7 | { |
8 | 8 | public partial class UploadForm : Form |
9 | 9 | { |
10 | - public UploadForm(ToolStripDropDownButton branchButton) | |
10 | + private bool local; | |
11 | + public UploadForm(ToolStripDropDownButton branchButton, bool local) | |
11 | 12 | { |
12 | 13 | InitializeComponent(); |
14 | + this.local = local; | |
13 | 15 | for(int i=0;i<branchButton.DropDownItems.Count-1;i++) |
14 | 16 | { |
15 | 17 | var branch = branchButton.DropDownItems[i].Text; |
@@ -27,11 +29,20 @@ | ||
27 | 29 | |
28 | 30 | public FormResult Result { get; private set; } |
29 | 31 | |
30 | - private void UploadForm_Load(object sender, EventArgs e) | |
32 | + public bool Publish { get { return PublishCheckBox.Checked; } } | |
33 | + | |
34 | + private void branchComboBox_SelectedIndexChanged(object sender, EventArgs e) | |
31 | 35 | { |
32 | - | |
36 | + if (branchComboBox.SelectedIndex>0) | |
37 | + { | |
38 | + PublishCheckBox.Checked = true; | |
39 | + PublishCheckBox.Enabled = false; | |
40 | + } | |
41 | + else | |
42 | + { | |
43 | + PublishCheckBox.Checked = local; | |
44 | + PublishCheckBox.Enabled = !local; | |
45 | + } | |
33 | 46 | } |
34 | - | |
35 | - public bool Publish { get { return PublishCheckBox.Checked; } } | |
36 | 47 | } |
37 | 48 | } |
@@ -120,13 +120,4 @@ | ||
120 | 120 | <metadata name="toolTipProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
121 | 121 | <value>14, 11</value> |
122 | 122 | </metadata> |
123 | - <metadata name="toolTipProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
124 | - <value>14, 11</value> | |
125 | - </metadata> | |
126 | - <metadata name="toolTipProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
127 | - <value>14, 11</value> | |
128 | - </metadata> | |
129 | - <metadata name="toolTipProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |
130 | - <value>14, 11</value> | |
131 | - </metadata> | |
132 | 123 | </root> |
\ No newline at end of file |