2012-07-13 Santiago Munín <burning1@gmail.com>
* ChangeLog: Fixed a line. * src/pandroid_event_viewer/pandorafms/Main.java: Fixed a bug. Default profile can't be deleted. * res/layout/main.xml, res/layout/item_list_event_layout.xml, res/layout/about.xml, res/layout/item_list_event_extended.xml, res/layout/options.xml, res/values/styles.xml: UI improvements. * res/values/strings.xml git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6767 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
5950c09e08
commit
184acd0c5d
|
@ -1,7 +1,18 @@
|
|||
2012-07-13 Santiago Munín <burning1@gmail.com>
|
||||
* ChangeLog: Fixed a line.
|
||||
* src/pandroid_event_viewer/pandorafms/Main.java: Fixed a bug. Default profile can't be deleted.
|
||||
* res/layout/main.xml,
|
||||
res/layout/item_list_event_layout.xml,
|
||||
res/layout/about.xml,
|
||||
res/layout/item_list_event_extended.xml,
|
||||
res/layout/options.xml,
|
||||
res/values/styles.xml: UI improvements.
|
||||
* res/values/strings.xml
|
||||
|
||||
2012-07-11 Santiago Munín <burning1@gmail.com>
|
||||
* src/pandroid_event_viewer/pandorafms/API.java,
|
||||
src/pandroid_event_viewer/pandorafms/Main.java: Added some SupressWarning annotations.
|
||||
* res/layout/options.xml: Textview
|
||||
* res/layout/options.xml: Textview color changed.
|
||||
* res/drawable-ldpi/incident.png,
|
||||
res/drawable-ldpi/house.png,
|
||||
res/drawable-ldpi/lightning_go.png: Removed, no longer needed.
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/develop_team_str"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="left"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/url_pandora"
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
android:layout_height="fill_parent"
|
||||
android:background="#FFFFFF" >
|
||||
|
||||
<TableRow
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" >
|
||||
<TableRow style="@style/table_row" >
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -39,7 +37,7 @@
|
|||
android:textColor="#000" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow style="@style/table_row" >
|
||||
|
||||
<TextView
|
||||
android:paddingRight="5dip"
|
||||
|
@ -57,6 +55,7 @@
|
|||
|
||||
<TableRow
|
||||
android:id="@+id/row_agent"
|
||||
style="@style/table_row"
|
||||
android:visibility="gone" >
|
||||
|
||||
<TextView
|
||||
|
@ -70,7 +69,7 @@
|
|||
android:textColor="#000" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow style="@style/table_row" >
|
||||
|
||||
<TextView
|
||||
android:paddingRight="5dip"
|
||||
|
@ -86,23 +85,8 @@
|
|||
android:text="@string/all_str"
|
||||
android:textColor="#000" />
|
||||
</TableRow>
|
||||
<!--
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:textColor="#000"
|
||||
android:text="Count"
|
||||
android:paddingRight="5dip"
|
||||
/>
|
||||
<TextView
|
||||
android:textColor="#000"
|
||||
android:text="1"
|
||||
/>
|
||||
</TableRow>
|
||||
-->
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
<TableRow style="@style/table_row" >
|
||||
|
||||
<TextView
|
||||
android:paddingRight="5dip"
|
||||
|
@ -117,7 +101,7 @@
|
|||
android:textColor="#000" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
<TableRow style="@style/table_row" >
|
||||
|
||||
<TextView
|
||||
android:paddingRight="5dip"
|
||||
|
|
|
@ -18,14 +18,16 @@
|
|||
android:id="@+id/item_linear_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:paddingBottom="5dp"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/content_event_item"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" >
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginBottom="1dp" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/event_name"
|
||||
|
@ -50,6 +52,7 @@
|
|||
android:textColor="#000"
|
||||
android:textColorHighlight="#000"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/timestamp"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
<TableLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp" >
|
||||
android:layout_marginTop="10dp"
|
||||
android:stretchColumns="0" >
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
|
@ -44,12 +45,15 @@
|
|||
<Spinner
|
||||
android:id="@+id/profile_combo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete_profile"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="10dp"
|
||||
android:contentDescription="@string/profile_delete"
|
||||
android:src="@drawable/cross" />
|
||||
</TableRow>
|
||||
|
@ -130,7 +134,8 @@
|
|||
<ProgressBar
|
||||
android:id="@+id/loading_tag"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right" />
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
|
||||
|
|
|
@ -118,9 +118,8 @@
|
|||
|
||||
<Spinner
|
||||
android:id="@+id/refresh_combo"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="left" />
|
||||
android:layout_width="155dp"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -133,7 +132,9 @@
|
|||
android:id="@+id/check_connection_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:drawableBottom="@drawable/help"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/check_connection"
|
||||
android:textColor="#ffffff" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<string name="event_search_label_str">Event search</string>
|
||||
<string name="max_time_old_event_str">Oldest event</string>
|
||||
<string name="licensed_under_gpl_str">Licensed under GPL v2</string>
|
||||
<string name="develop_team_str">Developer: Miguel de Dios</string>
|
||||
<string name="develop_team_str">Developers:\nMiguel de Dios and Santiago Munín</string>
|
||||
<string name="alert_recovered_str">Alert recovered</string>
|
||||
<string name="alert_manual_validation_str">Alert manually validated</string>
|
||||
<string name="going_up_warning_str">Going from critical to warning</string>
|
||||
|
@ -120,5 +120,6 @@
|
|||
<string name="connection_settings_problem">The operation can not be performed until you configure a correct connection.</string>
|
||||
<string name="unknown_version">Unknown version</string>
|
||||
<string name="enable_background_service">Check events in background</string>
|
||||
<string name="default_profile_can_not_remove">Default profile can not be removed</string>
|
||||
|
||||
</resources>
|
|
@ -12,13 +12,15 @@
|
|||
<item name="android:textSize">20dp</item>
|
||||
<item name="android:textColor">#FFFFFF</item>
|
||||
</style>
|
||||
<!--
|
||||
<style name="options_section">
|
||||
|
||||
<style name="table_row">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:layout_margin">5dp</item>
|
||||
</style>-->
|
||||
<item name="android:layout_marginRight">2dp</item>
|
||||
<item name="android:layout_marginLeft">2dp</item>
|
||||
<item name="android:layout_marginTop">1dp</item>
|
||||
<item name="android:layout_marginBottom">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="options_entry_text">
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
|
@ -26,6 +28,6 @@
|
|||
<item name="android:textSize">20dp</item>
|
||||
<item name="android:layout_margin">5dp</item>
|
||||
<item name="android:textColor">#FFFFFF</item>
|
||||
</style>
|
||||
</style>
|
||||
|
||||
</resources>
|
|
@ -151,19 +151,19 @@ public class Main extends Activity {
|
|||
loadProfiles();
|
||||
combo = (Spinner) findViewById(R.id.profile_combo);
|
||||
combo.setOnItemSelectedListener(new OnItemSelectedListener() {
|
||||
|
||||
|
||||
public void onItemSelected(AdapterView<?> parent, View view,
|
||||
int pos, long id) {
|
||||
String selected = parent.getItemAtPosition(pos).toString();
|
||||
setProfile(selected);
|
||||
}
|
||||
|
||||
|
||||
public void onNothingSelected(AdapterView<?> arg0) {
|
||||
}
|
||||
});
|
||||
((ImageView) findViewById(R.id.delete_profile))
|
||||
.setOnClickListener(new OnClickListener() {
|
||||
|
||||
|
||||
public void onClick(View v) {
|
||||
String profileName = ((Spinner) findViewById(R.id.profile_combo))
|
||||
.getSelectedItem().toString();
|
||||
|
@ -194,13 +194,13 @@ public class Main extends Activity {
|
|||
|
||||
buttonbuttonSetAsFilterWatcher
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
|
||||
public void onClick(View v) {
|
||||
save_filter_watcher();
|
||||
}
|
||||
});
|
||||
buttonSaveProfile.setOnClickListener(new OnClickListener() {
|
||||
|
||||
|
||||
public void onClick(View v) {
|
||||
final EditText profileName = new EditText(getBaseContext());
|
||||
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
|
||||
|
@ -262,7 +262,6 @@ public class Main extends Activity {
|
|||
cb.setChecked(preferences.getBoolean("show_advanced", false));
|
||||
cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
|
||||
|
||||
public void onCheckedChanged(CompoundButton buttonView,
|
||||
boolean isChecked) {
|
||||
LinearLayout advancedOptions = (LinearLayout) findViewById(R.id.show_hide_layout);
|
||||
|
@ -744,28 +743,36 @@ public class Main extends Activity {
|
|||
SharedPreferences preferences = getSharedPreferences(
|
||||
this.getString(R.string.const_string_preferences),
|
||||
Activity.MODE_PRIVATE);
|
||||
if (profileName.equals(DEFAULT_PROFILE_NAME)) {
|
||||
Toast.makeText(getApplicationContext(),
|
||||
R.string.default_profile_can_not_remove, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
return;
|
||||
}
|
||||
SharedPreferences.Editor editorPreferences = preferences.edit();
|
||||
editorPreferences.remove(PROFILE_PREFIX + profileName);
|
||||
String profiles = preferences.getString("allProfiles", "");
|
||||
int firstPos = profiles.indexOf(profileName);
|
||||
int amount = profileName.length();
|
||||
if (firstPos != 0) {
|
||||
// Includes the separator char
|
||||
firstPos--;
|
||||
amount++;
|
||||
}
|
||||
profiles = profiles.substring(0, firstPos)
|
||||
+ profiles.substring(firstPos + amount);
|
||||
if (profiles.startsWith("|")) {
|
||||
if (profiles.length() > 1) {
|
||||
profiles = profiles.substring(1);
|
||||
} else {
|
||||
profiles = "";
|
||||
if (profiles.length() > 0) {
|
||||
if (firstPos > 0) {
|
||||
// Includes the separator char
|
||||
firstPos--;
|
||||
amount++;
|
||||
}
|
||||
profiles = profiles.substring(0, firstPos)
|
||||
+ profiles.substring(firstPos + amount);
|
||||
if (profiles.startsWith("|")) {
|
||||
if (profiles.length() > 1) {
|
||||
profiles = profiles.substring(1);
|
||||
} else {
|
||||
profiles = "";
|
||||
}
|
||||
}
|
||||
editorPreferences.putString("allProfiles", profiles);
|
||||
if (editorPreferences.commit()) {
|
||||
Log.i(TAG, "Removed profile: " + profileName);
|
||||
}
|
||||
}
|
||||
editorPreferences.putString("allProfiles", profiles);
|
||||
if (editorPreferences.commit()) {
|
||||
Log.i(TAG, "Removed profile: " + profileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue