[tuxdroid-svn] r4982 - software_suite_v3/software/plugin/plugin-feed/trunk/plugin-feed/src/net/karm
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-07-01 14:33:01
|
Author: remi
Date: 2009-07-01 15:33:18 +0200 (Wed, 01 Jul 2009)
New Revision: 4982
Modified:
software_suite_v3/software/plugin/plugin-feed/trunk/plugin-feed/src/net/karmaLab/tuxDroid/plugins/FeedPlugin.java
Log:
* Don't read the messages in the first check in alert mode.
Modified: software_suite_v3/software/plugin/plugin-feed/trunk/plugin-feed/src/net/karmaLab/tuxDroid/plugins/FeedPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-feed/trunk/plugin-feed/src/net/karmaLab/tuxDroid/plugins/FeedPlugin.java 2009-07-01 12:59:44 UTC (rev 4981)
+++ software_suite_v3/software/plugin/plugin-feed/trunk/plugin-feed/src/net/karmaLab/tuxDroid/plugins/FeedPlugin.java 2009-07-01 13:33:18 UTC (rev 4982)
@@ -38,7 +38,7 @@
public static class State implements Serializable {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
private Vector<String> lastMessages = new Vector<String>();
@@ -119,9 +119,9 @@
}
-
+
private boolean notified = false;
-
+
private void setNotified(boolean enabled) {
this.notified = enabled;
}
@@ -129,7 +129,7 @@
private boolean isNotified() {
return this.notified;
}
-
+
public static void main(String[] args) throws Exception {
new FeedPlugin().boot(args, new Configuration());
}
@@ -147,7 +147,7 @@
return;
}
}
-
+
public void run() throws FeedReaderException, IOException {
throwTrace("Loading " + configuration().getTitle() + " stream");
@@ -185,9 +185,15 @@
}
boolean notification = false;
+ boolean firstCheck = false;
int count = configuration().getNumberOfEntries();
String message = "";
+ if (state.getLastMessages().size() == 0)
+ {
+ firstCheck = true;
+ }
+
for (FeedEntry entry : feed) {
boolean found = false;
int j = 0;
@@ -209,7 +215,7 @@
else {
message = message + configuration().getTitle() + " : " + entry.getTitle().trim() + ". ";
}
-
+
if (configuration().isReadDescription()) {
message = message + entry.getTextDescription() + " ";
}
@@ -223,9 +229,20 @@
}
if (notification) {
if (this.isNotified()) {
- throwResult(true);
+ if (!firstCheck)
+ {
+ throwResult(true);
+ throwMessage(message);
+ }
+ else
+ {
+ throwResult(false);
+ }
}
- throwMessage(message);
+ else
+ {
+ throwMessage(message);
+ }
}
else {
if (this.isNotified()) {
@@ -238,7 +255,7 @@
}
}
-
+
public void onGadgetStop() {
}
|