| Line 53... |
Line 53... |
| 53 |
|
53 |
|
| 54 |
void DeleteRecord_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) |
54 |
void DeleteRecord_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) |
| 55 |
{ |
55 |
{ |
| 56 |
if (e.Error == null) |
56 |
if (e.Error == null) |
| 57 |
{ |
57 |
{ |
| 58 |
MessageBox.Show("Record Deleted!", "DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); |
58 |
MessageBox.Show("Record Deleted!", "Dreamhost DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); |
| 59 |
this.LoadRecords(); |
59 |
this.LoadRecords(); |
| 60 |
} |
60 |
} |
| 61 |
else |
61 |
else |
| 62 |
{ |
62 |
{ |
| 63 |
if (e.Error.Message.Contains("no_such")) |
63 |
if (e.Error.Message.Contains("no_such")) |
| 64 |
{ |
64 |
{ |
| 65 |
MessageBox.Show("Record not found.\nTry refreshing the record list to make sure it's not been deleted already.", "DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
65 |
MessageBox.Show("Record not found.\nTry refreshing the record list to make sure it's not been deleted already.", "Dreamhost DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 66 |
} |
66 |
} |
| 67 |
else if (e.Error.Message.Contains("internal_error")) |
67 |
else if (e.Error.Message.Contains("internal_error")) |
| 68 |
{ |
68 |
{ |
| 69 |
if (MessageBox.Show("An internal error has occurred", "DNS Manager", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) |
69 |
if (MessageBox.Show("An internal error has occurred", "Dreamhost DNS Manager", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) |
| 70 |
{ |
70 |
{ |
| 71 |
this.DeleteRecord.RunWorkerAsync((DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem); |
71 |
this.DeleteRecord.RunWorkerAsync((DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem); |
| 72 |
return; |
72 |
return; |
| 73 |
} |
73 |
} |
| 74 |
} |
74 |
} |
| 75 |
else |
75 |
else |
| 76 |
{ |
76 |
{ |
| 77 |
if (MessageBox.Show(e.Error.Message, "DNS Manager", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) |
77 |
if (MessageBox.Show(e.Error.Message, "Dreamhost DNS Manager", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Retry) |
| 78 |
{ |
78 |
{ |
| 79 |
this.DeleteRecord.RunWorkerAsync((DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem); |
79 |
this.DeleteRecord.RunWorkerAsync((DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem); |
| 80 |
return; |
80 |
return; |
| 81 |
} |
81 |
} |
| 82 |
} |
82 |
} |
| Line 137... |
Line 137... |
| 137 |
{ |
137 |
{ |
| 138 |
System.Diagnostics.Process.Start("http://software.clempaul.me.uk/"); |
138 |
System.Diagnostics.Process.Start("http://software.clempaul.me.uk/"); |
| 139 |
} |
139 |
} |
| 140 |
catch (Exception x) |
140 |
catch (Exception x) |
| 141 |
{ |
141 |
{ |
| 142 |
MessageBox.Show(x.Message, "DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
142 |
MessageBox.Show(x.Message, "Dreamhost DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 143 |
} |
143 |
} |
| 144 |
} |
144 |
} |
| 145 |
|
145 |
|
| 146 |
private void toolStripButtonSettings_Click(object sender, EventArgs e) |
146 |
private void toolStripButtonSettings_Click(object sender, EventArgs e) |
| 147 |
{ |
147 |
{ |
| Line 164... |
Line 164... |
| 164 |
{ |
164 |
{ |
| 165 |
DNSRecord record = (DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem; |
165 |
DNSRecord record = (DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem; |
| 166 |
|
166 |
|
| 167 |
if (!record.editable) |
167 |
if (!record.editable) |
| 168 |
{ |
168 |
{ |
| 169 |
MessageBox.Show("This record is not editable", "DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
169 |
MessageBox.Show("This record is not editable", "Dreamhost DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 170 |
} |
170 |
} |
| 171 |
else if (MessageBox.Show("Are you sure you want to delete the record for " + record.record + "?", "DNS Manager", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) |
171 |
else if (MessageBox.Show("Are you sure you want to delete the record for " + record.record + "?", "Dreamhost DNS Manager", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) |
| 172 |
{ |
172 |
{ |
| 173 |
this.toolStripStatusLabel.Text = "Deleting record..."; |
173 |
this.toolStripStatusLabel.Text = "Deleting record..."; |
| 174 |
this.DeleteRecord.RunWorkerAsync(record); |
174 |
this.DeleteRecord.RunWorkerAsync(record); |
| 175 |
} |
175 |
} |
| 176 |
} |
176 |
} |
| Line 190... |
Line 190... |
| 190 |
{ |
190 |
{ |
| 191 |
DNSRecord record = (DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem; |
191 |
DNSRecord record = (DNSRecord)this.dataGridView.SelectedRows[0].DataBoundItem; |
| 192 |
|
192 |
|
| 193 |
if (!record.editable) |
193 |
if (!record.editable) |
| 194 |
{ |
194 |
{ |
| 195 |
MessageBox.Show("This record is not editable", "DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
195 |
MessageBox.Show("This record is not editable", "Dreamhost DNS Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 196 |
} |
196 |
} |
| 197 |
else |
197 |
else |
| 198 |
{ |
198 |
{ |
| 199 |
if (new AddEdit(this.API, record).ShowDialog() == DialogResult.OK) |
199 |
if (new AddEdit(this.API, record).ShowDialog() == DialogResult.OK) |
| 200 |
{ |
200 |
{ |