mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2011-09-28 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/PopupValidationEvent.java, src/pandroid_event_viewer/pandorafms/AlarmReceiver.java, src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java, src/pandroid_event_viewer/pandorafms/Main.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: added custom menu for event list. * res/drawable-ldpi/refresh.png: icon for the refresh. * res/layout/main.xml, res/layout/options.xml: modify the layer. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5021 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0d99b931c8
commit
539ee6179e
@ -1,3 +1,22 @@
|
|||||||
|
2011-09-28 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* src/pandroid_event_viewer/pandorafms/PopupValidationEvent.java,
|
||||||
|
src/pandroid_event_viewer/pandorafms/AlarmReceiver.java,
|
||||||
|
src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java,
|
||||||
|
src/pandroid_event_viewer/pandorafms/Main.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: added custom menu for event list.
|
||||||
|
|
||||||
|
* res/drawable-ldpi/refresh.png: icon for the refresh.
|
||||||
|
|
||||||
|
* res/layout/main.xml, res/layout/options.xml: modify the layer.
|
||||||
|
|
||||||
|
|
||||||
2011-09-27 Miguel de Dios <miguel.dedios@artica.es>
|
2011-09-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* AndroidManifest.xml: change for avoid the crash when rotate mobile.
|
* AndroidManifest.xml: change for avoid the crash when rotate mobile.
|
||||||
|
BIN
extras/pandroid_event_viewer/res/drawable-ldpi/refresh.png
Normal file
BIN
extras/pandroid_event_viewer/res/drawable-ldpi/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 912 B |
@ -14,7 +14,8 @@
|
|||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
@ -28,32 +29,41 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
>
|
||||||
<TableLayout
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
>
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/agent_label_str"
|
android:text="@string/agent_label_str"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
|
||||||
/>
|
/>
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/agent_name"
|
android:id="@+id/agent_name"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:editable="true"
|
android:editable="true"
|
||||||
android:layout_width="0dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
<TextView
|
||||||
|
android:text="@string/event_search_label_str"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/event_search_text"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:editable="true"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
/>
|
||||||
|
<TableLayout
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/group_label_str"
|
android:text="@string/group_label_str"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/group_combo"
|
android:id="@+id/group_combo"
|
||||||
@ -65,6 +75,7 @@
|
|||||||
android:id="@+id/loading_group"
|
android:id="@+id/loading_group"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
@ -73,6 +84,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/severity_combo"
|
android:id="@+id/severity_combo"
|
||||||
@ -86,6 +98,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
|
android:layout_weight="1"
|
||||||
/>
|
/>
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/status_combo"
|
android:id="@+id/status_combo"
|
||||||
@ -93,35 +106,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
|
||||||
<TextView
|
|
||||||
android:text="@string/event_search_label_str"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingRight="5dip"
|
|
||||||
/>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/event_search_text"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:editable="true"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
|
||||||
android:text="@string/max_time_old_event_str"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingRight="5dip"
|
|
||||||
/>
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/max_time_old_event_combo"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
/>
|
|
||||||
</TableRow>
|
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
<!--
|
<!--
|
||||||
<TextView
|
<TextView
|
||||||
@ -142,7 +126,27 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
-->
|
-->
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<TextView
|
||||||
|
android:text="@string/max_time_old_event_str"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingRight="5dip"
|
||||||
|
/>
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/max_time_old_event_combo"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_marginTop="10px"
|
||||||
|
android:layout_marginBottom="10px"
|
||||||
|
android:layout_height="2px"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:background="#ffffff"
|
||||||
|
/>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
|
@ -20,11 +20,15 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
>
|
>
|
||||||
<TableLayout
|
<ScrollView
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
>
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
>
|
||||||
<TableRow>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:text="@string/url_label_str"
|
android:text="@string/url_label_str"
|
||||||
@ -37,11 +41,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:editable="true"
|
android:editable="true"
|
||||||
android:layout_width="0dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:text="@string/user_label_str"
|
android:text="@string/user_label_str"
|
||||||
@ -54,11 +55,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:editable="true"
|
android:editable="true"
|
||||||
android:layout_width="0dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:text="@string/password_label_str"
|
android:text="@string/password_label_str"
|
||||||
@ -71,12 +69,9 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:editable="true"
|
android:editable="true"
|
||||||
android:layout_width="0dp"
|
android:layout_width="fill_parent"
|
||||||
android:layout_weight="1"
|
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
|
||||||
<TableRow>
|
|
||||||
<TextView
|
<TextView
|
||||||
android:textColor="#ffffff"
|
android:textColor="#ffffff"
|
||||||
android:text="@string/refresh_time_label_str"
|
android:text="@string/refresh_time_label_str"
|
||||||
@ -89,13 +84,12 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
</TableRow>
|
|
||||||
</TableLayout>
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/update_options"
|
android:id="@+id/update_options"
|
||||||
android:text="@string/update_button_str"
|
android:text="@string/update_button_str"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
// Pandora FMS - http://pandorafms.com
|
||||||
|
// ==================================================
|
||||||
|
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||||
|
// Please see http://pandorafms.org for full contribution list
|
||||||
|
|
||||||
|
// This program is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public License
|
||||||
|
// as published by the Free Software Foundation; version 2
|
||||||
|
|
||||||
|
// This program is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
-->
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:id="@+id/options_button_menu_options"
|
||||||
|
android:title="@string/options_label_str"
|
||||||
|
android:icon="@drawable/config"
|
||||||
|
/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/refresh_button_menu_options"
|
||||||
|
android:title="@string/refresh_label_str"
|
||||||
|
android:icon="@drawable/refresh"
|
||||||
|
/>
|
||||||
|
</menu>
|
@ -43,6 +43,7 @@
|
|||||||
<string name="password_label_str">Password</string>
|
<string name="password_label_str">Password</string>
|
||||||
<string name="update_button_str">Update</string>
|
<string name="update_button_str">Update</string>
|
||||||
<string name="option_title_str">Options</string>
|
<string name="option_title_str">Options</string>
|
||||||
|
<string name="refresh_label_str">Refresh</string>
|
||||||
<string name="load_more_events_button_str">Load more events</string>
|
<string name="load_more_events_button_str">Load more events</string>
|
||||||
<string name="empty_label_str">Empty list events</string>
|
<string name="empty_label_str">Empty list events</string>
|
||||||
<string name="refresh_time_label_str">Refresh time watcher</string>
|
<string name="refresh_time_label_str">Refresh time watcher</string>
|
||||||
|
@ -34,10 +34,11 @@
|
|||||||
<string name="severity_label_str">Severidad</string>
|
<string name="severity_label_str">Severidad</string>
|
||||||
<string name="date_label_str">Fecha</string>
|
<string name="date_label_str">Fecha</string>
|
||||||
<string name="number_events_label_str">Número de eventos</string>
|
<string name="number_events_label_str">Número de eventos</string>
|
||||||
<string name="reset_button_str">Reserteo</string>
|
<string name="reset_button_str">Reseteo</string>
|
||||||
<string name="search_button_str">Buscar</string>
|
<string name="search_button_str">Buscar</string>
|
||||||
<string name="loading_label_str">Cargando</string>
|
<string name="loading_label_str">Cargando</string>
|
||||||
<string name="options_label_str">Opciones</string>
|
<string name="options_label_str">Opciones</string>
|
||||||
|
<string name="refresh_label_str">Refrescar</string>
|
||||||
<string name="url_label_str">URL</string>
|
<string name="url_label_str">URL</string>
|
||||||
<string name="user_label_str">Usuario</string>
|
<string name="user_label_str">Usuario</string>
|
||||||
<string name="password_label_str">Contraseña</string>
|
<string name="password_label_str">Contraseña</string>
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
<string name="search_button_str">Search</string>
|
<string name="search_button_str">Search</string>
|
||||||
<string name="loading_label_str">Loading</string>
|
<string name="loading_label_str">Loading</string>
|
||||||
<string name="options_label_str">Options</string>
|
<string name="options_label_str">Options</string>
|
||||||
|
<string name="refresh_label_str">Refresh</string>
|
||||||
<string name="url_label_str">URL</string>
|
<string name="url_label_str">URL</string>
|
||||||
<string name="user_label_str">User</string>
|
<string name="user_label_str">User</string>
|
||||||
<string name="password_label_str">Password</string>
|
<string name="password_label_str">Password</string>
|
||||||
|
@ -47,6 +47,11 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||||||
this.user = preferences.getString("user", "");
|
this.user = preferences.getString("user", "");
|
||||||
this.password = preferences.getString("password", "");
|
this.password = preferences.getString("password", "");
|
||||||
|
|
||||||
|
if ((user.length() == 0) && (password.length() == 0)
|
||||||
|
&& (url.length() == 0)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DefaultHttpClient httpClient = new DefaultHttpClient();
|
DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||||
UrlEncodedFormEntity entity;
|
UrlEncodedFormEntity entity;
|
||||||
@ -56,7 +61,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||||||
HttpEntity entityResponse;
|
HttpEntity entityResponse;
|
||||||
String return_api;
|
String return_api;
|
||||||
|
|
||||||
httpPost = new HttpPost(this.url);
|
httpPost = new HttpPost(this.url + "/include/api.php");
|
||||||
|
|
||||||
String parametersAPI = serializeParams2Api(context);
|
String parametersAPI = serializeParams2Api(context);
|
||||||
|
|
||||||
@ -121,7 +126,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||||||
String filterAgentName = preferences.getString("filterAgentName", "");
|
String filterAgentName = preferences.getString("filterAgentName", "");
|
||||||
int filterIDGroup = preferences.getInt("filterIDGroup", 0);
|
int filterIDGroup = preferences.getInt("filterIDGroup", 0);
|
||||||
int filterSeverity = preferences.getInt("filterSeverity", -1);
|
int filterSeverity = preferences.getInt("filterSeverity", -1);
|
||||||
int filterStatus = preferences.getInt("filterStatus", -1);
|
int filterStatus = preferences.getInt("filterStatus", 4);
|
||||||
String filterEventSearch = preferences.getString("filterEventSearch", "");
|
String filterEventSearch = preferences.getString("filterEventSearch", "");
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,11 +7,13 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.ListActivity;
|
import android.app.ListActivity;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
@ -32,6 +34,7 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
public class EventList extends ListActivity {
|
public class EventList extends ListActivity {
|
||||||
private ListView lv;
|
private ListView lv;
|
||||||
@ -78,6 +81,7 @@ public class EventList extends ListActivity {
|
|||||||
Log.e("onReceive", "onReceive");
|
Log.e("onReceive", "onReceive");
|
||||||
|
|
||||||
int load_more = intent.getIntExtra("load_more", 0);
|
int load_more = intent.getIntExtra("load_more", 0);
|
||||||
|
Log.e("load_more", "" + load_more);
|
||||||
|
|
||||||
if (load_more == 1) {
|
if (load_more == 1) {
|
||||||
la.showLoadingEvents = false;
|
la.showLoadingEvents = false;
|
||||||
@ -121,7 +125,7 @@ public class EventList extends ListActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
inflater.inflate(R.menu.options_menu, menu);
|
inflater.inflate(R.menu.options_menu_list_events, menu);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
@ -134,6 +138,13 @@ public class EventList extends ListActivity {
|
|||||||
|
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
break;
|
break;
|
||||||
|
case R.id.refresh_button_menu_options:
|
||||||
|
Log.e("onOptionsItemSelected","refresh_button_menu_options");
|
||||||
|
this.object.loadInProgress = true;
|
||||||
|
this.object.getNewListEvents = true;
|
||||||
|
this.toggleLoadingLayout();
|
||||||
|
this.object.executeBackgroundGetEvents();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -187,8 +198,14 @@ public class EventList extends ListActivity {
|
|||||||
img = this.imgGroups.get(group_icon);
|
img = this.imgGroups.get(group_icon);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
SharedPreferences preferences = getApplicationContext().getSharedPreferences(
|
||||||
|
getApplicationContext().getString(R.string.const_string_preferences),
|
||||||
|
Activity.MODE_PRIVATE);
|
||||||
|
|
||||||
|
String url = preferences.getString("url", "");
|
||||||
|
|
||||||
img = this.downloadFile(
|
img = this.downloadFile(
|
||||||
"http://192.168.70.112/pandora_console/images/groups_small/" + group_icon + ".png");
|
url + "/images/groups_small/" + group_icon + ".png");
|
||||||
|
|
||||||
if (img != null) {
|
if (img != null) {
|
||||||
this.imgGroups.put(group_icon, img);
|
this.imgGroups.put(group_icon, img);
|
||||||
|
@ -90,12 +90,14 @@ public class Main extends Activity {
|
|||||||
this, R.array.event_status_values, android.R.layout.simple_spinner_item);
|
this, R.array.event_status_values, android.R.layout.simple_spinner_item);
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
combo.setAdapter(adapter);
|
combo.setAdapter(adapter);
|
||||||
|
combo.setSelection(4);
|
||||||
|
|
||||||
combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
|
combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
|
||||||
adapter = ArrayAdapter.createFromResource(
|
adapter = ArrayAdapter.createFromResource(
|
||||||
this, R.array.max_time_old_event_values, android.R.layout.simple_spinner_item);
|
this, R.array.max_time_old_event_values, android.R.layout.simple_spinner_item);
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
combo.setAdapter(adapter);
|
combo.setAdapter(adapter);
|
||||||
|
combo.setSelection(4);
|
||||||
|
|
||||||
|
|
||||||
buttonReset.setOnClickListener(new View.OnClickListener() {
|
buttonReset.setOnClickListener(new View.OnClickListener() {
|
||||||
@ -127,11 +129,11 @@ public class Main extends Activity {
|
|||||||
try {
|
try {
|
||||||
DefaultHttpClient httpClient = new DefaultHttpClient();
|
DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||||
|
|
||||||
HttpPost httpPost = new HttpPost(this.object.url);
|
HttpPost httpPost = new HttpPost(this.object.url + "/include/api.php");
|
||||||
|
|
||||||
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
|
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
|
||||||
parameters.add(new BasicNameValuePair("user", this.object.user));
|
parameters.add(new BasicNameValuePair("user", this.object.user));
|
||||||
parameters.add(new BasicNameValuePair("pass", this.object.password));
|
parameters.add(new BasicNameValuePair("pass", this.object.password));Log.e("getGroups", this.object.password);
|
||||||
parameters.add(new BasicNameValuePair("op", "get"));
|
parameters.add(new BasicNameValuePair("op", "get"));
|
||||||
parameters.add(new BasicNameValuePair("op2", "groups"));
|
parameters.add(new BasicNameValuePair("op2", "groups"));
|
||||||
parameters.add(new BasicNameValuePair("other_mode", "url_encode_separator_|"));
|
parameters.add(new BasicNameValuePair("other_mode", "url_encode_separator_|"));
|
||||||
@ -355,10 +357,10 @@ public class Main extends Activity {
|
|||||||
combo.setSelection(0);
|
combo.setSelection(0);
|
||||||
|
|
||||||
combo = (Spinner)findViewById(R.id.max_time_old_event_combo);
|
combo = (Spinner)findViewById(R.id.max_time_old_event_combo);
|
||||||
combo.setSelection(0);
|
combo.setSelection(4);
|
||||||
|
|
||||||
combo = (Spinner)findViewById(R.id.status_combo);
|
combo = (Spinner)findViewById(R.id.status_combo);
|
||||||
combo.setSelection(0);
|
combo.setSelection(4);
|
||||||
|
|
||||||
text = (EditText)findViewById(R.id.event_search_text);
|
text = (EditText)findViewById(R.id.event_search_text);
|
||||||
text.setText("");
|
text.setText("");
|
||||||
|
@ -34,7 +34,7 @@ public class Options extends Activity {
|
|||||||
this.getString(R.string.const_string_preferences),
|
this.getString(R.string.const_string_preferences),
|
||||||
Activity.MODE_PRIVATE);
|
Activity.MODE_PRIVATE);
|
||||||
|
|
||||||
url = preferences.getString("url", "");
|
url = preferences.getString("url", "http://farscape.artica.es/pandora_console");
|
||||||
user = preferences.getString("user", "");
|
user = preferences.getString("user", "");
|
||||||
password = preferences.getString("password", "");
|
password = preferences.getString("password", "");
|
||||||
refreshTimeKey = preferences.getInt("refreshTimeKey", 3);
|
refreshTimeKey = preferences.getInt("refreshTimeKey", 3);
|
||||||
@ -81,8 +81,11 @@ public class Options extends Activity {
|
|||||||
int duration = Toast.LENGTH_SHORT;
|
int duration = Toast.LENGTH_SHORT;
|
||||||
|
|
||||||
if (editorPreferences.commit()) {
|
if (editorPreferences.commit()) {
|
||||||
|
if (this.core != null) {
|
||||||
|
Log.e("Options", "reset service");
|
||||||
this.core.stopServiceEventWatcher(getApplicationContext());
|
this.core.stopServiceEventWatcher(getApplicationContext());
|
||||||
this.core.startServiceEventWatcher(getApplicationContext());
|
this.core.startServiceEventWatcher(getApplicationContext());
|
||||||
|
}
|
||||||
|
|
||||||
Toast toast = Toast.makeText(context, this.getString(R.string.config_update_succesful_str), duration);
|
Toast toast = Toast.makeText(context, this.getString(R.string.config_update_succesful_str), duration);
|
||||||
toast.show();
|
toast.show();
|
||||||
|
@ -16,6 +16,7 @@ package pandroid_event_viewer.pandorafms;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -71,7 +72,6 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
|
||||||
SharedPreferences preferences = getSharedPreferences(
|
SharedPreferences preferences = getSharedPreferences(
|
||||||
this.getString(R.string.const_string_preferences),
|
this.getString(R.string.const_string_preferences),
|
||||||
Activity.MODE_PRIVATE);
|
Activity.MODE_PRIVATE);
|
||||||
@ -80,14 +80,14 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
this.user = preferences.getString("user", "");
|
this.user = preferences.getString("user", "");
|
||||||
this.password = preferences.getString("password", "");
|
this.password = preferences.getString("password", "");
|
||||||
|
|
||||||
//this.timestamp = 1315015715;
|
Calendar c = Calendar.getInstance();
|
||||||
this.timestamp = new Date().getTime() / 1000;
|
this.timestamp = (c.getTimeInMillis() / 1000) - (4 * 60 * 60);
|
||||||
this.pagination = 20;
|
this.pagination = 20;
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
this.agentNameStr = "";
|
this.agentNameStr = preferences.getString("filterAgentName", "");
|
||||||
this.severity = -1;
|
this.severity = preferences.getInt("filterSeverity", -1);
|
||||||
this.status = -1;
|
this.status = preferences.getInt("filterStatus", 4);
|
||||||
this.eventSearch = "";
|
this.eventSearch = preferences.getString("filterEventSearch", "");
|
||||||
|
|
||||||
this.eventList = new ArrayList<EventListItem>();
|
this.eventList = new ArrayList<EventListItem>();
|
||||||
this.loadInProgress = false;
|
this.loadInProgress = false;
|
||||||
@ -108,8 +108,9 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
this.loadInProgress = true;
|
this.loadInProgress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Start the background service for the notifications
|
|
||||||
this.core = new Core();
|
this.core = new Core();
|
||||||
|
|
||||||
|
//Start the background service for the notifications
|
||||||
this.core.startServiceEventWatcher(getApplicationContext());
|
this.core.startServiceEventWatcher(getApplicationContext());
|
||||||
|
|
||||||
Intent i_main = new Intent(this, Main.class);
|
Intent i_main = new Intent(this, Main.class);
|
||||||
@ -119,8 +120,7 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
tabHost.addTab
|
tabHost.addTab
|
||||||
(
|
(
|
||||||
tabHost.newTabSpec(getResources().getString(R.string.item_tab_main_text))
|
tabHost.newTabSpec(getResources().getString(R.string.item_tab_main_text))
|
||||||
.setIndicator(getResources().getString(R.string.item_tab_main_text),
|
.setIndicator(getResources().getString(R.string.item_tab_main_text)
|
||||||
this.getResources().getDrawable(R.drawable.house)
|
|
||||||
)
|
)
|
||||||
.setContent(i_main)
|
.setContent(i_main)
|
||||||
);
|
);
|
||||||
@ -131,8 +131,7 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
tabHost.addTab
|
tabHost.addTab
|
||||||
(
|
(
|
||||||
tabHost.newTabSpec(getResources().getString(R.string.item_tab_event_list_text))
|
tabHost.newTabSpec(getResources().getString(R.string.item_tab_event_list_text))
|
||||||
.setIndicator(getResources().getString(R.string.item_tab_event_list_text),
|
.setIndicator(getResources().getString(R.string.item_tab_event_list_text)
|
||||||
this.getResources().getDrawable(R.drawable.lightning_go)
|
|
||||||
)
|
)
|
||||||
.setContent(i_event_list)
|
.setContent(i_event_list)
|
||||||
);
|
);
|
||||||
@ -191,11 +190,9 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
getString(R.string.const_string_preferences),
|
getString(R.string.const_string_preferences),
|
||||||
Activity.MODE_PRIVATE);
|
Activity.MODE_PRIVATE);
|
||||||
this.timestamp = preferences.getLong("previous_filterTimestamp", (new Date().getTime() / 1000));
|
this.timestamp = preferences.getLong("previous_filterTimestamp", (new Date().getTime() / 1000));
|
||||||
|
|
||||||
|
|
||||||
this.getTabHost().setCurrentTab(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.getTabHost().setCurrentTab(1);
|
||||||
executeBackgroundGetEvents();
|
executeBackgroundGetEvents();
|
||||||
|
|
||||||
Log.e("PandroidEventviewerActivity", "onResume");
|
Log.e("PandroidEventviewerActivity", "onResume");
|
||||||
@ -250,7 +247,7 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
|
|||||||
HttpEntity entityResponse;
|
HttpEntity entityResponse;
|
||||||
String return_api;
|
String return_api;
|
||||||
|
|
||||||
httpPost = new HttpPost(this.url);
|
httpPost = new HttpPost(this.url + "/include/api.php");
|
||||||
|
|
||||||
//Get total count.
|
//Get total count.
|
||||||
parameters = new ArrayList<NameValuePair>();
|
parameters = new ArrayList<NameValuePair>();
|
||||||
|
@ -97,7 +97,7 @@ public class PopupValidationEvent extends Activity {
|
|||||||
HttpEntity entityResponse;
|
HttpEntity entityResponse;
|
||||||
String return_api;
|
String return_api;
|
||||||
|
|
||||||
httpPost = new HttpPost(this.url);
|
httpPost = new HttpPost(this.url + "/include/api.php");
|
||||||
|
|
||||||
//Set event validation.
|
//Set event validation.
|
||||||
parameters = new ArrayList<NameValuePair>();
|
parameters = new ArrayList<NameValuePair>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user