Fixed NotifyIcon problem when canceling the SaveWithDialog destination.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1634 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-02-06 13:45:52 +00:00
commit 6ae97acd99
2 changed files with 4 additions and 3 deletions

View file

@ -82,8 +82,6 @@ namespace Greenshot.Destinations {
surface.LastSaveFullPath = savedTo; surface.LastSaveFullPath = savedTo;
captureDetails.Filename = savedTo; captureDetails.Filename = savedTo;
surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, lang.GetFormattedString(LangKey.editor_imagesaved,surface.LastSaveFullPath)); surface.SendMessageEvent(this, SurfaceMessageTyp.FileSaved, lang.GetFormattedString(LangKey.editor_imagesaved,surface.LastSaveFullPath));
} else {
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, "");
} }
} }
return savedTo != null; return savedTo != null;

View file

@ -417,7 +417,10 @@ namespace Greenshot.Helpers {
// Register notify events if this is wanted // Register notify events if this is wanted
if (conf.ShowTrayNotification) { if (conf.ShowTrayNotification) {
surface.SurfaceMessage += delegate(object source, SurfaceMessageEventArgs eventArgs) { surface.SurfaceMessage += delegate(object source, SurfaceMessageEventArgs eventArgs) {
if (string.IsNullOrEmpty(eventArgs.Message)) {
return;
}
switch (eventArgs.MessageType) { switch (eventArgs.MessageType) {
case SurfaceMessageTyp.Error: case SurfaceMessageTyp.Error:
MainForm.instance.notifyIcon.ShowBalloonTip(10000, "Greenshot", eventArgs.Message, ToolTipIcon.Error); MainForm.instance.notifyIcon.ShowBalloonTip(10000, "Greenshot", eventArgs.Message, ToolTipIcon.Error);