2011-09-29 Miguel de Dios <miguel.dedios@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5024 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-09-29 15:33:15 +00:00
parent 9df2277efb
commit e360d94aee
22 changed files with 187 additions and 17 deletions

View File

@ -56,6 +56,13 @@
android:label="@string/option_title_str"
android:configChanges="orientation|keyboardHidden"
>
</activity>
<activity
android:name=".About"
android:label="@string/pandroid_event_viewer_str"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Dialog"
>
</activity>
<activity
android:name=".PopupValidationEvent"

View File

@ -1,3 +1,30 @@
2011-09-29 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es>
* AndroidManifest.xml: change for avoid the crash when rotate mobile.

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,47 @@
<?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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dip"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Copyright (c) 2011 Artica Soluciones Tecnologicas"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/licensed_under_gpl_str"
android:gravity="center_horizontal"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/develop_team_str"
android:gravity="center_horizontal"
/>
<TextView
android:id="@+id/url_pandora"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
/>
</LinearLayout>

View File

@ -79,14 +79,12 @@
android:visibility="gone"
>
<TextView
android:textStyle="bold"
android:textColor="#000"
android:text="@string/agent_label_str"
android:paddingRight="5dip"
/>
<TextView
android:id="@+id/agent_text"
android:textStyle="bold"
android:textColor="#000"
android:text=""
/>
@ -156,12 +154,12 @@
</TableRow>
<TableRow
android:gravity="right"
>
<Button
android:id="@+id/validate_button_extended"
android:text="@string/validate_event_button_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
>
<Button
android:id="@+id/validate_button_extended"
android:text="@string/validate_event_button_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</TableRow>
</TableLayout>

View File

@ -20,4 +20,9 @@
android:title="@string/options_label_str"
android:icon="@drawable/config"
/>
<item
android:id="@+id/about_button_menu_options"
android:title="@string/about_label_str"
android:icon="@drawable/about"
/>
</menu>

View File

@ -25,4 +25,9 @@
android:title="@string/refresh_label_str"
android:icon="@drawable/refresh"
/>
<item
android:id="@+id/about_button_menu_options"
android:title="@string/about_label_str"
android:icon="@drawable/about"
/>
</menu>

View File

@ -44,6 +44,7 @@
<string name="update_button_str">Update</string>
<string name="option_title_str">Options</string>
<string name="refresh_label_str">Refresh</string>
<string name="about_label_str">About</string>
<string name="load_more_events_button_str">Load more events</string>
<string name="empty_label_str">Empty list events</string>
<string name="refresh_time_label_str">Refresh time watcher</string>
@ -74,4 +75,7 @@
<string name="status_label_str">Status</string>
<string name="event_search_label_str">Event search</string>
<string name="max_time_old_event_str">Max time old event</string>
<string name="licensed_under_gpl_str">Licensed under GPL</string>
<string name="develop_team_str">Develop team: Miguel de Dios</string>
</resources>

View File

@ -44,6 +44,7 @@
<string name="password_label_str">Contraseña</string>
<string name="update_button_str">Actualizar</string>
<string name="option_title_str">Opciones</string>
<string name="about_label_str">Sobre</string>
<string name="load_more_events_button_str">Cargar mas eventos</string>
<string name="empty_label_str">Lista vacia de eventos</string>
<string name="refresh_time_label_str">Refresco scanner eventos</string>
@ -74,4 +75,7 @@
<string name="status_label_str">Estado</string>
<string name="event_search_label_str">Buscar evento</string>
<string name="max_time_old_event_str">Máx tiempo de antiguedad</string>
<string name="licensed_under_gpl_str">Licenciado bajo GPL</string>
<string name="develop_team_str">Equipo de desarrollo: Miguel de Dios</string>
</resources>

View File

@ -44,6 +44,7 @@
<string name="loading_label_str">Loading</string>
<string name="options_label_str">Options</string>
<string name="refresh_label_str">Refresh</string>
<string name="about_label_str">About</string>
<string name="url_label_str">URL</string>
<string name="user_label_str">User</string>
<string name="password_label_str">Password</string>
@ -79,4 +80,7 @@
<string name="status_label_str">Status</string>
<string name="event_search_label_str">Event search</string>
<string name="max_time_old_event_str">Max time old event</string>
<string name="licensed_under_gpl_str">Licensed under GPL</string>
<string name="develop_team_str">Develop team: Miguel de Dios</string>
</resources>

View File

@ -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("<a href='http://pandorafms.org/'>PandoraFMS.org</a>"));
text.setMovementMethod(LinkMovementMethod.getInstance());
}
}

View File

@ -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(
"<a href='" + this.object.url + "/mobile/index.php?page=agent&id=" + item.id_agent
+ "'>" + item.agent_name + "</a>"));
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);

View File

@ -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);

View File

@ -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(

View File

@ -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<EventListItem>();
this.loadInProgress = false;