Image editor when saved set modified false

This commit is contained in:
Jaex 2014-07-30 14:15:46 +03:00
parent f4d95ccf42
commit 4acbe38586

View file

@ -330,6 +330,8 @@ public void SetImagePath(string fullpath)
} }
//updateStatusLabel(string.Format("Image saved to {0}.", fullpath), fileSavedStatusContextMenu); //updateStatusLabel(string.Format("Image saved to {0}.", fullpath), fileSavedStatusContextMenu);
SetTitle(Path.GetFileName(fullpath)); SetTitle(Path.GetFileName(fullpath));
btnSave.Enabled = File.Exists(surface.LastSaveFullPath);
} }
private void surface_DrawingModeChanged(object source, SurfaceDrawingModeEventArgs eventArgs) private void surface_DrawingModeChanged(object source, SurfaceDrawingModeEventArgs eventArgs)
@ -675,7 +677,7 @@ private void ImageEditorFormFormClosing(object sender, FormClosingEventArgs e)
buttons = MessageBoxButtons.YesNo; buttons = MessageBoxButtons.YesNo;
} }
DialogResult result = MessageBox.Show("Do you want the save the screenshot?", "Save image?", buttons, MessageBoxIcon.Question); DialogResult result = MessageBox.Show("Do you want to save the screenshot?", "Save confirmation", buttons, MessageBoxIcon.Question);
if (result == DialogResult.Cancel) if (result == DialogResult.Cancel)
{ {
@ -1363,6 +1365,7 @@ public void OnImageSaveRequested()
using (Image img = surface.GetImageForExport()) using (Image img = surface.GetImageForExport())
{ {
ImageSaveRequested(img, surface.LastSaveFullPath); ImageSaveRequested(img, surface.LastSaveFullPath);
surface.Modified = false;
} }
} }
} }
@ -1374,6 +1377,7 @@ public void OnImageSaveAsRequested()
using (Image img = surface.GetImageForExport()) using (Image img = surface.GetImageForExport())
{ {
string newFilePath = ImageSaveAsRequested(img, surface.LastSaveFullPath); string newFilePath = ImageSaveAsRequested(img, surface.LastSaveFullPath);
surface.Modified = false;
if (!string.IsNullOrEmpty(newFilePath)) if (!string.IsNullOrEmpty(newFilePath))
{ {
SetImagePath(newFilePath); SetImagePath(newFilePath);