From 5ac2940579938973b373f799509bd3fc54bf3ddb Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 29 Dec 2014 18:55:35 +0000 Subject: [PATCH] added click event, and added details for backups of drive --- Saviour Backup System/mainWindow.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Saviour Backup System/mainWindow.cs b/Saviour Backup System/mainWindow.cs index f92ee39..77e3a0f 100644 --- a/Saviour Backup System/mainWindow.cs +++ b/Saviour Backup System/mainWindow.cs @@ -88,7 +88,6 @@ namespace Saviour_Backup_System displayDriveDetails(USBTools.getDriveObject(selectedDevice.Substring(0,1))); } - private void displayDriveDetails(DriveInfo drive) { selectedDrive = drive; driveNameDisplay.Text = tools.Trim(selectedDrive.VolumeLabel, 16); @@ -107,9 +106,11 @@ namespace Saviour_Backup_System driveIconBox.Image = Properties.Resources.hddIcon; break; } + backupDirectoryDisplay.Text = databaseTools.getBackupDirectory(USBTools.calculateDriveID(selectedDrive)); + creationDateDisplay.Text = databaseTools.getBackupCreationDate(USBTools.calculateDriveID(selectedDrive)).ToString(); + if (creationDateDisplay.Text == 0.ToString()) { creationDateDisplay.Text = "NONE"; } } - private void formatDriveCapacity() { DriveInfo drive = selectedDrive; @@ -189,5 +190,11 @@ namespace Saviour_Backup_System setup.BV = new backupViewer(); setup.BV.Show(); } + + private void backupDeviceButton_Click(object sender, EventArgs e) + { + setup.CT.startCopy(selectedDrive, databaseTools.getBackupDirectory(USBTools.calculateDriveID(selectedDrive)), true); + MessageBox.Show("Backup initiated for drive '" + selectedDrive.VolumeLabel + "'", "Backup started", MessageBoxButtons.OK, MessageBoxIcon.Information); + } } }