added load event handler to page, and change button text whilst refreshing.
This commit is contained in:
parent
ca98fd69a1
commit
b6a5099282
1 changed files with 5 additions and 1 deletions
|
@ -31,6 +31,7 @@ namespace Saviour_Backup_System
|
||||||
tempTip.SetToolTip(this.refreshButton, "Refresh List\nRefresh the list of backups.");
|
tempTip.SetToolTip(this.refreshButton, "Refresh List\nRefresh the list of backups.");
|
||||||
}
|
}
|
||||||
private void button1_Click(object sender, EventArgs e) { //refresh button
|
private void button1_Click(object sender, EventArgs e) { //refresh button
|
||||||
|
refreshButton.Text = "Refreshing..."
|
||||||
DataTable table = databaseTools.getAllDriveBackups();
|
DataTable table = databaseTools.getAllDriveBackups();
|
||||||
for (int i = 0; i > table.Rows.Count; i++) {
|
for (int i = 0; i > table.Rows.Count; i++) {
|
||||||
table.Rows[i].SetField(1, tools.unixDateTime( (long)table.Rows[i][1] ).ToString()); //convert time to better format
|
table.Rows[i].SetField(1, tools.unixDateTime( (long)table.Rows[i][1] ).ToString()); //convert time to better format
|
||||||
|
@ -44,6 +45,7 @@ namespace Saviour_Backup_System
|
||||||
table.Columns[4].ColumnName = "Drive Capacity";
|
table.Columns[4].ColumnName = "Drive Capacity";
|
||||||
|
|
||||||
dataGridView.DataSource = table; // add table to display
|
dataGridView.DataSource = table; // add table to display
|
||||||
|
refreshButton.Text = "Refresh";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,5 +64,7 @@ namespace Saviour_Backup_System
|
||||||
setup.ABW.drivesDropdown.Enabled = false;
|
setup.ABW.drivesDropdown.Enabled = false;
|
||||||
setup.ABW.ShowDialog();
|
setup.ABW.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void backupViewer_Load(object sender, EventArgs e) { refreshButton.PerformClick(); } //refresh the database view when form loaded
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in a new issue