Project

General

Profile

Defect #506 » patch.txt

Akiko Takano, 08/03/2010 02:33 AM

 
1
### Eclipse Workspace Patch 1.0
2
#P redmineair
3
Index: src/redmineair.as
4
===================================================================
5
--- src/redmineair.as	(revision 52)
6
+++ src/redmineair.as	(working copy)
7
@@ -112,14 +112,6 @@
8
 
9
 	// タスクトレイに常駐化
10
 	var menu:NativeMenu = new NativeMenu();
11
-	var menuExit:NativeMenuItem = new NativeMenuItem("exit");
12
-	menu.addItem(menuExit);
13
-	menuExit.addEventListener(Event.SELECT,
14
-		function(e:Event):void {
15
-			saveStickies();
16
-            NativeApplication.nativeApplication.exit();
17
-		}
18
-	);
19
 
20
 	if (NativeApplication.supportsMenu) {
21
 		var doc:DockIcon = NativeApplication.nativeApplication.icon as DockIcon;
22
@@ -128,6 +120,15 @@
23
 		doc.menu = menu;
24
 		NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, systemTrayIconClickHandler);
25
 	} else {
26
+		var menuExit:NativeMenuItem = new NativeMenuItem("exit");
27
+		menu.addItem(menuExit);
28
+		menuExit.addEventListener(Event.SELECT,
29
+			function(e:Event):void {
30
+				saveStickies();
31
+            	NativeApplication.nativeApplication.exit();
32
+			}
33
+		);
34
+
35
 		var tray:SystemTrayIcon = NativeApplication.nativeApplication.icon as SystemTrayIcon;
36
 		var icon032:BitmapData = (new icon032() as BitmapAsset).bitmapData;
37
 		var icon016:BitmapData = (new icon016() as BitmapAsset).bitmapData;
38
@@ -136,6 +137,13 @@
39
 		tray.tooltip = "RedmineAir";
40
 		tray.addEventListener(MouseEvent.CLICK, systemTrayIconClickHandler);
41
 	}
42
+
43
+	// for Mac
44
+	NativeApplication.nativeApplication.addEventListener(Event.EXITING, function(e:Event):void {
45
+      saveStickies();
46
+      NativeApplication.nativeApplication.exit();        
47
+	});
48
+
49
 }
50
 
51
 public function onInitialize():void
(2-2/6)