- Timestamp:
- 02/13/09 16:53:17 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LogicMail/src/org/logicprobe/LogicMail/LogicMail.java
r376 r388 1 1 /*- 2 * Copyright (c) 200 6, Derek Konigsberg2 * Copyright (c) 2009, Derek Konigsberg 3 3 * All rights reserved. 4 4 * … … 33 33 34 34 import java.util.Calendar; 35 import java.util.Hashtable; 35 36 36 37 import net.rim.blackberry.api.homescreen.HomeScreen; … … 39 40 import net.rim.device.api.system.ApplicationManager; 40 41 import net.rim.device.api.system.EventLogger; 42 import net.rim.device.api.system.RuntimeStore; 41 43 import net.rim.device.api.ui.UiApplication; 44 42 45 import org.logicprobe.LogicMail.ui.MailHomeScreen; 43 46 import org.logicprobe.LogicMail.ui.NotificationHandler; 47 import org.logicprobe.LogicMail.conf.AccountConfig; 44 48 import org.logicprobe.LogicMail.conf.MailSettings; 45 49 … … 110 114 } 111 115 112 /** The constant event source object. */113 private static final Object eventSource = new Object() {114 public String toString() {115 return "LogicMail New Message";116 }117 };118 119 116 /** 120 117 * Method to execute in autostart mode. … … 141 138 HomeScreen.updateIcon(AppInfo.getIcon(), 0); 142 139 HomeScreen.setRolloverIcon(AppInfo.getRolloverIcon(), 0); 143 // Configure the notification source 144 NotificationsManager.registerSource(AppInfo.GUID, eventSource, NotificationsConstants.CASUAL); 140 141 // Configure a notification source for each account 142 MailSettings mailSettings = MailSettings.getInstance(); 143 mailSettings.loadSettings(); 144 int numAccounts = mailSettings.getNumAccounts(); 145 Hashtable eventSourceMap = new Hashtable(numAccounts); 146 for(int i=0; i<numAccounts; i++) { 147 AccountConfig accountConfig = mailSettings.getAccountConfig(i); 148 LogicMailEventSource eventSource = 149 new LogicMailEventSource(accountConfig.getAcctName(), accountConfig.getUniqueId()); 150 NotificationsManager.registerSource( 151 eventSource.getEventSourceId(), 152 eventSource, 153 NotificationsConstants.CASUAL); 154 eventSourceMap.put(new Long(accountConfig.getUniqueId()), eventSource); 155 } 145 156 157 // Save the registered event sources in the runtime store 158 RuntimeStore.getRuntimeStore().put(AppInfo.GUID, eventSourceMap); 146 159 keepGoing = false; 147 160 } … … 150 163 System.exit(0); 151 164 } 152 }); 165 }); 153 166 } 154 167 }
Note: See TracChangeset
for help on using the changeset viewer.
