diff --git a/extras/pandroid_event_viewer/AndroidManifest.xml b/extras/pandroid_event_viewer/AndroidManifest.xml
index c109d409f8..f2315e7285 100644
--- a/extras/pandroid_event_viewer/AndroidManifest.xml
+++ b/extras/pandroid_event_viewer/AndroidManifest.xml
@@ -56,6 +56,13 @@
android:label="@string/option_title_str"
android:configChanges="orientation|keyboardHidden"
>
+
+
+
+ * AndroidManifest.xml: added activity about.
+
+ * src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java,
+ src/pandroid_event_viewer/pandorafms/Main.java,
+ src/pandroid_event_viewer/pandorafms/About.java,
+ src/pandroid_event_viewer/pandorafms/Options.java,
+ src/pandroid_event_viewer/pandorafms/EventList.java: wip and fixes.
+
+ * res/values/strings.xml, res/values-en/strings.xml,
+ res/values-es/strings.xml: added more strings and array values.
+
+ * res/menu/options_menu_list_events.xml,
+ res/menu/options_menu.xml: added about menu
+
+ * res/drawable-ldpi/criticity_0.png, res/drawable-ldpi/criticity_1.png,
+ res/drawable-ldpi/criticity_2.png, res/drawable-ldpi/criticity_3.png,
+ res/drawable-ldpi/criticity_4.png, res/drawable-ldpi/criticity_default.png,
+ res/drawable-ldpi/pandorafms_logo.png: change the images.
+
+ * res/drawable-ldpi/about.png: added image.
+
+ * res/layout/item_list_event_extended.xml, res/layout/about.xml: added about
+ and fixes the extended view.
+
+
2011-09-28 Miguel de Dios
* src/pandroid_event_viewer/pandorafms/PopupValidationEvent.java,
@@ -16,7 +43,6 @@
* res/layout/main.xml, res/layout/options.xml: modify the layer.
-
2011-09-27 Miguel de Dios
* AndroidManifest.xml: change for avoid the crash when rotate mobile.
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/about.png b/extras/pandroid_event_viewer/res/drawable-ldpi/about.png
new file mode 100644
index 0000000000..85c1876b5f
Binary files /dev/null and b/extras/pandroid_event_viewer/res/drawable-ldpi/about.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_0.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_0.png
index 42d54d6879..111604f377 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_0.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_0.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_1.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_1.png
index e252a7fd16..ca43bde6ed 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_1.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_1.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_2.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_2.png
index eb2acfba19..3722e10a11 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_2.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_2.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_3.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_3.png
index 6bd6809158..66ce869823 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_3.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_3.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_4.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_4.png
index 96cf593f49..345fe9df26 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_4.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_4.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_default.png b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_default.png
index e252a7fd16..94ec329b64 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_default.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/criticity_default.png differ
diff --git a/extras/pandroid_event_viewer/res/drawable-ldpi/pandorafms_logo.png b/extras/pandroid_event_viewer/res/drawable-ldpi/pandorafms_logo.png
index 6e0d609efc..5369386f92 100644
Binary files a/extras/pandroid_event_viewer/res/drawable-ldpi/pandorafms_logo.png and b/extras/pandroid_event_viewer/res/drawable-ldpi/pandorafms_logo.png differ
diff --git a/extras/pandroid_event_viewer/res/layout/about.xml b/extras/pandroid_event_viewer/res/layout/about.xml
new file mode 100644
index 0000000000..0a939dccf3
--- /dev/null
+++ b/extras/pandroid_event_viewer/res/layout/about.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/extras/pandroid_event_viewer/res/layout/item_list_event_extended.xml b/extras/pandroid_event_viewer/res/layout/item_list_event_extended.xml
index 893cc8eeb5..781ecf214d 100644
--- a/extras/pandroid_event_viewer/res/layout/item_list_event_extended.xml
+++ b/extras/pandroid_event_viewer/res/layout/item_list_event_extended.xml
@@ -79,14 +79,12 @@
android:visibility="gone"
>
@@ -156,12 +154,12 @@
-
+ >
+
\ No newline at end of file
diff --git a/extras/pandroid_event_viewer/res/menu/options_menu.xml b/extras/pandroid_event_viewer/res/menu/options_menu.xml
index bc713b6574..f01c63c371 100644
--- a/extras/pandroid_event_viewer/res/menu/options_menu.xml
+++ b/extras/pandroid_event_viewer/res/menu/options_menu.xml
@@ -20,4 +20,9 @@
android:title="@string/options_label_str"
android:icon="@drawable/config"
/>
+
\ No newline at end of file
diff --git a/extras/pandroid_event_viewer/res/menu/options_menu_list_events.xml b/extras/pandroid_event_viewer/res/menu/options_menu_list_events.xml
index 0896e0f76a..9037a3382c 100644
--- a/extras/pandroid_event_viewer/res/menu/options_menu_list_events.xml
+++ b/extras/pandroid_event_viewer/res/menu/options_menu_list_events.xml
@@ -25,4 +25,9 @@
android:title="@string/refresh_label_str"
android:icon="@drawable/refresh"
/>
+
diff --git a/extras/pandroid_event_viewer/res/values-en/strings.xml b/extras/pandroid_event_viewer/res/values-en/strings.xml
index 6059c0de89..7da12897ff 100644
--- a/extras/pandroid_event_viewer/res/values-en/strings.xml
+++ b/extras/pandroid_event_viewer/res/values-en/strings.xml
@@ -44,6 +44,7 @@
Update
Options
Refresh
+ About
Load more events
Empty list events
Refresh time watcher
@@ -74,4 +75,7 @@
Status
Event search
Max time old event
+
+ Licensed under GPL
+ Develop team: Miguel de Dios
diff --git a/extras/pandroid_event_viewer/res/values-es/strings.xml b/extras/pandroid_event_viewer/res/values-es/strings.xml
index 943467596b..f1297614f0 100644
--- a/extras/pandroid_event_viewer/res/values-es/strings.xml
+++ b/extras/pandroid_event_viewer/res/values-es/strings.xml
@@ -44,6 +44,7 @@
Contraseña
Actualizar
Opciones
+ Sobre
Cargar mas eventos
Lista vacia de eventos
Refresco scanner eventos
@@ -74,4 +75,7 @@
Estado
Buscar evento
Máx tiempo de antiguedad
+
+ Licenciado bajo GPL
+ Equipo de desarrollo: Miguel de Dios
diff --git a/extras/pandroid_event_viewer/res/values/strings.xml b/extras/pandroid_event_viewer/res/values/strings.xml
index a69d21483c..e9d014a088 100644
--- a/extras/pandroid_event_viewer/res/values/strings.xml
+++ b/extras/pandroid_event_viewer/res/values/strings.xml
@@ -44,6 +44,7 @@
Loading
Options
Refresh
+ About
URL
User
Password
@@ -79,4 +80,7 @@
Status
Event search
Max time old event
+
+ Licensed under GPL
+ Develop team: Miguel de Dios
diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/About.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/About.java
new file mode 100644
index 0000000000..60b8cfe21b
--- /dev/null
+++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/About.java
@@ -0,0 +1,20 @@
+package pandroid_event_viewer.pandorafms;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.text.Html;
+import android.text.method.LinkMovementMethod;
+import android.widget.TextView;
+
+public class About extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.about);
+
+ TextView text = (TextView) findViewById(R.id.url_pandora);
+ text.setText(Html.fromHtml("PandoraFMS.org"));
+ text.setMovementMethod(LinkMovementMethod.getInstance());
+ }
+}
diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/EventList.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/EventList.java
index bf9bdf97ad..03539f85f8 100644
--- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/EventList.java
+++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/EventList.java
@@ -19,6 +19,8 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
+import android.text.Html;
+import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -130,9 +132,10 @@ public class EventList extends ListActivity {
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
+ Intent i;
switch (item.getItemId()) {
case R.id.options_button_menu_options:
- Intent i = new Intent(this, Options.class);
+ i = new Intent(this, Options.class);
//FAIL//i.putExtra("object", object);
i.putExtra("core", this.core);
@@ -145,6 +148,10 @@ public class EventList extends ListActivity {
this.toggleLoadingLayout();
this.object.executeBackgroundGetEvents();
break;
+ case R.id.about_button_menu_options:
+ i = new Intent(this, About.class);
+ startActivity(i);
+ break;
}
return true;
@@ -264,6 +271,7 @@ public class EventList extends ListActivity {
Log.e("onListItemClick", new Integer(position).toString());
EventListItem item = this.object.eventList.get(position);
+ Log.e("onListItemClick", position + "");
item.opened = !item.opened;
this.object.eventList.set(position, item);
la.notifyDataSetChanged();
@@ -429,8 +437,14 @@ public class EventList extends ListActivity {
View row = viewEventExtended.findViewById(R.id.row_agent);
row.setVisibility(View.VISIBLE);
- text = (TextView)viewEventExtended.findViewById(R.id.type_text);
- text.setText(item.description_event);
+ text = (TextView)viewEventExtended.findViewById(R.id.agent_text);
+ //http://127.0.0.1/pandora_console/mobile/index.php?page=agent&id=1
+ //Log.e("url", this.object.url);
+ text.setText(Html.fromHtml(
+ "" + item.agent_name + ""));
+ text.setMovementMethod(LinkMovementMethod.getInstance());
+ //text.setText(item.agent_name);
setImageType(viewEventExtended, item.description_image, R.id.img_type);
}
@@ -442,15 +456,17 @@ public class EventList extends ListActivity {
setImageType(viewEventExtended, item.criticity_image, R.id.img_severity);
}
-
- final Button button;
+ Button button;
button = (Button)viewEventExtended.findViewById(R.id.validate_button_extended);
+ //button.setOnClickListener(this);
+
OnClickListenerButtonValidate clickListener = new OnClickListenerButtonValidate();
clickListener.id_event = item.id_event;
//clickListener.object = this.object;
clickListener.core = this.core;
button.setOnClickListener(clickListener);
+ view.setOnClickListener(new OnItemClickListener(position, this.object));
LinearLayout itemLinearLayout = (LinearLayout)view.findViewById(R.id.item_linear_layout);
itemLinearLayout.addView(viewEventExtended);
@@ -460,6 +476,22 @@ public class EventList extends ListActivity {
return view;
}
+ private class OnItemClickListener implements OnClickListener{
+ private int mPosition;
+ private PandroidEventviewerActivity object;
+ OnItemClickListener(int position, PandroidEventviewerActivity object){
+ mPosition = position;
+ this.object = object;
+ }
+ @Override
+ public void onClick(View arg0) {
+ EventListItem item = this.object.eventList.get(mPosition);
+ item.opened = !item.opened;
+ this.object.eventList.set(mPosition, item);
+ la.notifyDataSetChanged();
+ }
+ }
+
public class OnClickListenerButtonValidate implements OnClickListener {
public int id_event;
//public PandroidEventviewerActivity object;
@@ -467,6 +499,7 @@ public class EventList extends ListActivity {
@Override
public void onClick(View v) {
+ Log.e("id_event", "" + id_event);
Intent i = new Intent(getApplicationContext(), PopupValidationEvent.class);
i.putExtra("id_event", id_event);
//i.putExtra("object", this.object);
diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java
index 901256550b..b15e039088 100644
--- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java
+++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Main.java
@@ -77,6 +77,10 @@ public class Main extends Activity {
new GetGroupsAsyncTask().execute();
}
+ SharedPreferences preferences = getSharedPreferences(
+ this.getString(R.string.const_string_preferences),
+ Activity.MODE_PRIVATE);
+
comboSeverity = (Spinner) findViewById(R.id.severity_combo);
ArrayAdapter adapter = ArrayAdapter.createFromResource(
this, R.array.severity_array_values, android.R.layout.simple_spinner_item);
@@ -97,7 +101,7 @@ public class Main extends Activity {
this, R.array.max_time_old_event_values, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
combo.setAdapter(adapter);
- combo.setSelection(4);
+ combo.setSelection(preferences.getInt("filterLastTime", 6));
buttonReset.setOnClickListener(new View.OnClickListener() {
@@ -218,6 +222,10 @@ public class Main extends Activity {
//FAIL//i.putExtra("object", object);
i.putExtra("core", this.core);
+ startActivity(i);
+ break;
+ case R.id.about_button_menu_options:
+ i = new Intent(this, About.class);
startActivity(i);
break;
}
@@ -291,6 +299,7 @@ public class Main extends Activity {
int filterIDGroup = 0;
int filterSeverity = -1;
int filterStatus = -1;
+ int filterLastTime = 0;
String filterEventSearch = "";
@@ -316,6 +325,9 @@ public class Main extends Activity {
combo = (Spinner)findViewById(R.id.status_combo);
filterStatus = combo.getSelectedItemPosition() - 1;
+ combo = (Spinner)findViewById(R.id.max_time_old_event_combo);
+ filterLastTime = combo.getSelectedItemPosition();
+
text = (EditText)findViewById(R.id.event_search_text);
filterEventSearch = text.getText().toString();
@@ -330,6 +342,7 @@ public class Main extends Activity {
editorPreferences.putInt("filterSeverity", filterSeverity);
editorPreferences.putInt("filterStatus", filterStatus);
editorPreferences.putString("filterEventSearch", filterEventSearch);
+ editorPreferences.putInt("filterLastTime", filterLastTime);
if (editorPreferences.commit()) {
this.core.stopServiceEventWatcher(getApplicationContext());
@@ -357,7 +370,7 @@ public class Main extends Activity {
combo.setSelection(0);
combo = (Spinner)findViewById(R.id.max_time_old_event_combo);
- combo.setSelection(4);
+ combo.setSelection(6);
combo = (Spinner)findViewById(R.id.status_combo);
combo.setSelection(4);
diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Options.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Options.java
index 8049a4bf34..d2e571a472 100644
--- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Options.java
+++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/Options.java
@@ -43,6 +43,8 @@ public class Options extends Activity {
text.setText(url);
text = (EditText) findViewById(R.id.user);
text.setText(user);
+ text = (EditText) findViewById(R.id.password);
+ text.setText(password);
Spinner combo = (Spinner) findViewById(R.id.refresh_combo);
ArrayAdapter adapter = ArrayAdapter.createFromResource(
diff --git a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java
index 8e8f901390..0b5fc37751 100644
--- a/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java
+++ b/extras/pandroid_event_viewer/src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java
@@ -62,6 +62,7 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
public long offset;
public int status;
public String eventSearch;
+ public int filterLastTime;
public Intent intent_service;
@@ -88,6 +89,7 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
this.severity = preferences.getInt("filterSeverity", -1);
this.status = preferences.getInt("filterStatus", 4);
this.eventSearch = preferences.getString("filterEventSearch", "");
+ this.filterLastTime = preferences.getInt("filterLastTime", 6);
this.eventList = new ArrayList();
this.loadInProgress = false;