2012-10-22 Miguel de Dios <miguel.dedios@artica.es>

* src/pandroid_event_viewer/pandorafms/EventList.java: improved the
	code style.
	
	* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java:
	fixed the values criticity_name and criticity_image in the events.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8948 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-10-22 11:29:00 +00:00
parent 9920066b50
commit 7dfa1f31d9
3 changed files with 149 additions and 120 deletions

View File

@ -1,3 +1,11 @@
2012-10-22 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/EventList.java: improved the
code style.
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java:
fixed the values criticity_name and criticity_image in the events.
2012-10-22 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/API.java: added more log

View File

@ -367,15 +367,18 @@ public class EventList extends ListActivity {
Button button = (Button) view
.findViewById(R.id.button_load_more_events);
button.setVisibility(Button.GONE);
} else {
}
else {
Button button = (Button) view
.findViewById(R.id.button_load_more_events);
if (object.eventList.size() == 0) {
button.setVisibility(Button.GONE);
} else if (((long) object.eventList.size()) >= object.count_events) {
}
else if (((long) object.eventList.size()) >= object.count_events) {
button.setVisibility(Button.GONE);
} else {
}
else {
button.setVisibility(Button.VISIBLE);
}
@ -449,7 +452,8 @@ public class EventList extends ListActivity {
if (item.status == 1) {
Core.setTextViewLeftImage(timestamp, getResources()
.getDrawable(R.drawable.tick), 24);
} else {
}
else {
Core.setTextViewLeftImage(timestamp, getResources()
.getDrawable(R.drawable.tick_off), 24);
}
@ -477,7 +481,8 @@ public class EventList extends ListActivity {
}
tagText += "<a href=\"" + parts[1] + "\">"
+ parts[0] + "</a>";
} else {
}
else {
tagText += parts[0];
}
}
@ -553,7 +558,8 @@ public class EventList extends ListActivity {
.findViewById(R.id.validate_event_label);
text.setText("");
text.setVisibility(TextView.VISIBLE);
} else if (item.status != 1) {
}
else if (item.status != 1) {
currentElement = view;
OnClickListenerButtonValidate clickListener = new OnClickListenerButtonValidate(
item.id_event);
@ -574,7 +580,8 @@ public class EventList extends ListActivity {
showDialog(CREATE_INCIDENT_DIALOG, b);
}
});
} else {
}
else {
button.setVisibility(Button.GONE);
text = (TextView) viewEventExtended
.findViewById(R.id.validate_event_label);
@ -602,40 +609,52 @@ public class EventList extends ListActivity {
if (type.equals("alert_recovered")) {
return_var = getApplicationContext().getString(
R.string.alert_recovered_str);
} else if (type.equals("alert_manual_validation")) {
}
else if (type.equals("alert_manual_validation")) {
return_var = getApplicationContext().getString(
R.string.alert_manual_validation_str);
} else if (type.equals("going_up_warning")) {
}
else if (type.equals("going_up_warning")) {
return_var = getApplicationContext().getString(
R.string.going_up_warning_str);
} else if (type.equals("going_down_critical")) {
}
else if (type.equals("going_down_critical")) {
return_var = getApplicationContext().getString(
R.string.going_down_critical_str);
} else if (type.equals("going_up_critical")) {
}
else if (type.equals("going_up_critical")) {
return_var = getApplicationContext().getString(
R.string.going_down_critical_str);
} else if (type.equals("going_up_normal")) {
}
else if (type.equals("going_up_normal")) {
return_var = getApplicationContext().getString(
R.string.going_up_normal_str);
} else if (type.equals("going_down_normal")) {
}
else if (type.equals("going_down_normal")) {
return_var = getApplicationContext().getString(
R.string.going_up_normal_str);
} else if (type.equals("going_down_warning")) {
}
else if (type.equals("going_down_warning")) {
return_var = getApplicationContext().getString(
R.string.going_down_warning_str);
} else if (type.equals("alert_fired")) {
}
else if (type.equals("alert_fired")) {
return_var = getApplicationContext().getString(
R.string.alert_fired_str);
} else if (type.equals("system")) {
}
else if (type.equals("system")) {
return_var = getApplicationContext().getString(
R.string.system_str);
} else if (type.equals("recon_host_detected")) {
}
else if (type.equals("recon_host_detected")) {
return_var = getApplicationContext().getString(
R.string.system_str);
} else if (type.equals("new_agent")) {
}
else if (type.equals("new_agent")) {
return_var = getApplicationContext().getString(
R.string.new_agent_str);
} else {
}
else {
return_var = getApplicationContext().getString(
R.string.unknown_str)
+ " " + type;
@ -732,7 +751,8 @@ public class EventList extends ListActivity {
try {
sendNewIncident(params[0], params[1], params[2]);
return true;
} catch (IOException e) {
}
catch (IOException e) {
return false;
}
}
@ -744,7 +764,8 @@ public class EventList extends ListActivity {
R.string.incident_created, Toast.LENGTH_SHORT).show();
creatingIncidentDialog.dismiss();
finish();
} else {
}
else {
Toast.makeText(getApplicationContext(),
R.string.create_incident_group_error,
Toast.LENGTH_SHORT).show();

View File

@ -374,8 +374,8 @@ public class PandroidEventviewerActivity extends TabActivity implements
event.group_icon = items[24];
event.description_event = items[25];
event.description_image = items[26];
event.criticity_name = items[27];
event.criticity_image = items[28];
event.criticity_name = items[28];
event.criticity_image = items[27];
event.opened = false;
}