diff --git a/Form1.cs b/Form1.cs index 2cf638d..c697767 100644 --- a/Form1.cs +++ b/Form1.cs @@ -458,11 +458,19 @@ namespace photo_sorter { if (MessageBox.Show("Are you sure you want to delete this photo?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { - MessageBox.Show("Poof! The photo would normally get deleted here if this function's code were completed, but alas, it is not, so this photo you have deemed to be subpar is still existing."); - } - else - { - MessageBox.Show("Forsooth! This photo is a keeper after all and would not have been deleted!"); + string src_fname = global.filenames[global.position]; + try + { + File.Delete(src_fname); + status_msg("Deleted file: " + src_fname, 2); + remove_index(global.position); + update_image(); + } + catch (IOException ex) + { + status_msg("Unable to delete " + src_fname + "!", 4); + MessageBox.Show(ex.ToString(), "Critical: IO Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } public void prerender_init()