Merge from branch for Exit problems

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@744 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2010-07-30 16:06:00 +00:00
commit 31456fc9dc

View file

@ -568,7 +568,12 @@ namespace Greenshot.Forms {
void ImageEditorFormFormClosing(object sender, FormClosingEventArgs e) {
if (!saved) {
DialogResult result = MessageBox.Show(lang.GetString(LangKey.editor_close_on_save), lang.GetString(LangKey.editor_close_on_save_title), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
// Dissallow "CANCEL" if the application needs to shutdown
if (e.CloseReason == CloseReason.ApplicationExitCall || e.CloseReason == CloseReason.WindowsShutDown) {
buttons = MessageBoxButtons.YesNo;
}
DialogResult result = MessageBox.Show(lang.GetString(LangKey.editor_close_on_save), lang.GetString(LangKey.editor_close_on_save_title), buttons, MessageBoxIcon.Question);
if (result.Equals(DialogResult.Cancel)) {
e.Cancel = true;
return;