mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
2012-10-29 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java: fixed when the data return to call for get events is bad format, before it was fails all app, now it tries to get correct event for each line. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8982 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0d95b97b09
commit
c4d24dc2cd
@ -1,3 +1,10 @@
|
|||||||
|
2012-10-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java:
|
||||||
|
fixed when the data return to call for get events is bad format,
|
||||||
|
before it was fails all app, now it tries to get correct event for
|
||||||
|
each line.
|
||||||
|
|
||||||
2012-10-23 Junichi Satoh <junichi@rworks.jp>
|
2012-10-23 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
* res/values-ja/strings.xml: Traslated string "empty".
|
* res/values-ja/strings.xml: Traslated string "empty".
|
||||||
|
@ -99,7 +99,8 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
&& (url.length() == 0)) {
|
&& (url.length() == 0)) {
|
||||||
startActivity(new Intent(this, Options.class));
|
startActivity(new Intent(this, Options.class));
|
||||||
this.showOptionsFirstTime = true;
|
this.showOptionsFirstTime = true;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
this.loadInProgress = true;
|
this.loadInProgress = true;
|
||||||
|
|
||||||
this.showOptionsFirstTime = false;
|
this.showOptionsFirstTime = false;
|
||||||
@ -272,7 +273,12 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
String[] items = lines[i].split(";");
|
String[] items = lines[i].split(";");
|
||||||
|
|
||||||
EventListItem event = new EventListItem();
|
EventListItem event = new EventListItem();
|
||||||
|
boolean extract = true;
|
||||||
try {
|
try {
|
||||||
|
if (items.length < 14) {
|
||||||
|
extract = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//Get id event
|
//Get id event
|
||||||
if (items[0].length() == 0) {
|
if (items[0].length() == 0) {
|
||||||
event.id_event = 0;
|
event.id_event = 0;
|
||||||
@ -368,14 +374,28 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//Get agent name
|
event.agent_name = "";
|
||||||
event.agent_name = items[22];
|
event.group_name = "";
|
||||||
event.group_name = items[23];
|
event.group_icon = "";
|
||||||
event.group_icon = items[24];
|
event.description_event = "";
|
||||||
event.description_event = items[25];
|
event.description_image = "";
|
||||||
event.description_image = items[26];
|
event.criticity_name = "";
|
||||||
event.criticity_name = items[28];
|
event.criticity_image = "";
|
||||||
event.criticity_image = items[27];
|
|
||||||
|
if (items.length >= 23)
|
||||||
|
event.agent_name = items[22];
|
||||||
|
if (items.length >= 24)
|
||||||
|
event.group_name = items[23];
|
||||||
|
if (items.length >= 25)
|
||||||
|
event.group_icon = items[24];
|
||||||
|
if (items.length >= 26)
|
||||||
|
event.description_event = items[25];
|
||||||
|
if (items.length >= 27)
|
||||||
|
event.description_image = items[26];
|
||||||
|
if (items.length >= 28)
|
||||||
|
event.criticity_name = items[28];
|
||||||
|
if (items.length >= 27)
|
||||||
|
event.criticity_image = items[27];
|
||||||
|
|
||||||
event.opened = false;
|
event.opened = false;
|
||||||
}
|
}
|
||||||
@ -384,7 +404,8 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
R.string.unknown_event_str);
|
R.string.unknown_event_str);
|
||||||
launchProblemParsingNotification();
|
launchProblemParsingNotification();
|
||||||
}
|
}
|
||||||
this.eventList.add(event);
|
if (extract)
|
||||||
|
this.eventList.add(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,7 +604,8 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
Log.i(TAG + " GetEventsAsyncTask", "doInBackground");
|
Log.i(TAG + " GetEventsAsyncTask", "doInBackground");
|
||||||
try {
|
try {
|
||||||
getEvents();
|
getEvents();
|
||||||
} catch (IOException e) {
|
}
|
||||||
|
catch (IOException e) {
|
||||||
connectionProblem = true;
|
connectionProblem = true;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -602,7 +624,8 @@ public class PandroidEventviewerActivity extends TabActivity implements
|
|||||||
getNewListEvents = false;
|
getNewListEvents = false;
|
||||||
|
|
||||||
i.putExtra("load_more", 0);
|
i.putExtra("load_more", 0);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
i.putExtra("load_more", 1);
|
i.putExtra("load_more", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user