2012-08-01 Santiago Munín <burning1@gmail.com>

* src/pandroid_event_viewer/pandorafms/Main.java: Changed some buttons.
	* res/layout/options.xml,
	  res/layout/main.xml: UI changes.
	* res/values/strings.xml: Entry changed.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6837 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
santimunin 2012-08-01 10:16:12 +00:00
parent 920b6d855d
commit c138c42bc9
5 changed files with 46 additions and 79 deletions

View File

@ -1,3 +1,9 @@
2012-08-01 Santiago Munín <burning1@gmail.com>
* src/pandroid_event_viewer/pandorafms/Main.java: Changed some buttons.
* res/layout/options.xml,
res/layout/main.xml: UI changes.
* res/values/strings.xml: Entry changed.
2012-08-01 Santiago Munín <burning1@gmail.com> 2012-08-01 Santiago Munín <burning1@gmail.com>
* res/layout/create_incident.xml: UI changes. * res/layout/create_incident.xml: UI changes.
* AndroidManifest.xml: Removed some comments and removed header from all activities. * AndroidManifest.xml: Removed some comments and removed header from all activities.

View File

@ -38,24 +38,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingRight="5dip"
android:text="@string/profile_label_str" android:text="@string/profile_label_str"
android:textStyle="bold" /> android:textStyle="bold" />
<Spinner <Spinner
android:id="@+id/profile_combo" android:id="@+id/profile_combo"
android:layout_width="wrap_content" android:layout_width="wrap_content"
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> </TableRow>
<LinearLayout <LinearLayout
@ -248,10 +237,10 @@
android:layout_height="wrap_content" > android:layout_height="wrap_content" >
<Button <Button
android:id="@+id/button_reset" android:id="@+id/button_set_as_filter_watcher"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/reset_button_str" /> android:text="@string/set_as_filter_watcher_button_str" />
<Button <Button
android:id="@+id/button_send" android:id="@+id/button_send"
@ -273,11 +262,11 @@
android:text="@string/save_profile_button_str" /> android:text="@string/save_profile_button_str" />
<Button <Button
android:id="@+id/button_set_as_filter_watcher" android:id="@+id/button_delete_profile"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/set_as_filter_watcher_button_str" /> android:text="@string/profile_delete" />
</TableRow> </TableRow>
</TableLayout> </TableLayout>
</LinearLayout> </LinearLayout>

View File

@ -184,29 +184,38 @@
<TableRow> <TableRow>
<TextView android:text="@string/vibration" /> <TextView
android:layout_gravity="center_vertical"
android:text="@string/vibration" />
<CheckBox <CheckBox
android:id="@+id/vibration_on" android:id="@+id/vibration_on"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_gravity="center" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView android:text="@string/led_flash" /> <TextView
android:layout_gravity="center_vertical"
android:text="@string/led_flash" />
<CheckBox <CheckBox
android:id="@+id/led_flash_on" android:id="@+id/led_flash_on"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="63dp" /> android:layout_marginRight="63dp" />
</TableRow> </TableRow>
<TableRow> <TableRow>
<TextView <TextView
android:id="@+id/textView1" android:id="@+id/textView1"
android:layout_gravity="center_vertical"
android:text="@string/sound" /> android:text="@string/sound" />
<Button <Button

View File

@ -44,7 +44,7 @@
<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</string> <string name="refresh_time_label_str">Refresh time</string>
<string name="set_as_filter_watcher_button_str">Default</string> <string name="set_as_filter_watcher_button_str">Set background check filter</string>
<string name="validate_event_button_str">Validate Event</string> <string name="validate_event_button_str">Validate Event</string>
<string name="config_update_succesful_str">Update configuration successful.</string> <string name="config_update_succesful_str">Update configuration successful.</string>
<string name="config_update_fail_str">Update configuration is failed.</string> <string name="config_update_fail_str">Update configuration is failed.</string>

View File

@ -50,7 +50,6 @@ import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.Spinner; import android.widget.Spinner;
@ -95,9 +94,9 @@ public class Main extends Activity {
} }
setContentView(R.layout.main); setContentView(R.layout.main);
final Button buttonReset = (Button) findViewById(R.id.button_reset); final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher);
final Button buttonSearch = (Button) findViewById(R.id.button_send); final Button buttonSearch = (Button) findViewById(R.id.button_send);
final Button buttonbuttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher); final Button buttonDeleteProfile = (Button) findViewById(R.id.button_delete_profile);
final Button buttonSaveProfile = (Button) findViewById(R.id.button_save_profile); final Button buttonSaveProfile = (Button) findViewById(R.id.button_save_profile);
// Check if the user preferences it is set. // Check if the user preferences it is set.
if (object.user.length() == 0 || object.password.length() == 0 if (object.user.length() == 0 || object.password.length() == 0
@ -107,9 +106,9 @@ public class Main extends Activity {
Toast.LENGTH_SHORT); Toast.LENGTH_SHORT);
toast.show(); toast.show();
buttonReset.setEnabled(false); buttonSetAsFilterWatcher.setEnabled(false);
buttonSearch.setEnabled(false); buttonSearch.setEnabled(false);
buttonbuttonSetAsFilterWatcher.setEnabled(false); buttonDeleteProfile.setEnabled(false);
} else if (object.user.equals("demo") || object.password.equals("demo")) { } else if (object.user.equals("demo") || object.password.equals("demo")) {
Toast toast = Toast.makeText(this.getApplicationContext(), Toast toast = Toast.makeText(this.getApplicationContext(),
this.getString(R.string.preferences_set_demo_pandora_str), this.getString(R.string.preferences_set_demo_pandora_str),
@ -117,8 +116,8 @@ public class Main extends Activity {
toast.show(); toast.show();
} else { } else {
buttonSearch.setEnabled(false); buttonSearch.setEnabled(false);
buttonReset.setEnabled(false); buttonSetAsFilterWatcher.setEnabled(false);
buttonbuttonSetAsFilterWatcher.setEnabled(false); buttonDeleteProfile.setEnabled(false);
new GetGroupsAsyncTask().execute(); new GetGroupsAsyncTask().execute();
if (version402) { if (version402) {
@ -161,16 +160,6 @@ public class Main extends Activity {
public void onNothingSelected(AdapterView<?> arg0) { 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();
deleteProfile(profileName);
loadProfiles();
}
});
combo = (Spinner) findViewById(R.id.max_time_old_event_combo); combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
adapter = ArrayAdapter.createFromResource(this, adapter = ArrayAdapter.createFromResource(this,
@ -180,9 +169,9 @@ public class Main extends Activity {
combo.setAdapter(adapter); combo.setAdapter(adapter);
combo.setSelection(preferences.getInt("filterLastTime", 6)); combo.setSelection(preferences.getInt("filterLastTime", 6));
buttonReset.setOnClickListener(new View.OnClickListener() { buttonSetAsFilterWatcher.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
reset_form(); save_filter_watcher();
} }
}); });
@ -192,11 +181,13 @@ public class Main extends Activity {
} }
}); });
buttonbuttonSetAsFilterWatcher buttonDeleteProfile.setOnClickListener(new View.OnClickListener() {
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
save_filter_watcher(); String profileName = ((Spinner) findViewById(R.id.profile_combo))
.getSelectedItem().toString();
deleteProfile(profileName);
loadProfiles();
} }
}); });
buttonSaveProfile.setOnClickListener(new OnClickListener() { buttonSaveProfile.setOnClickListener(new OnClickListener() {
@ -336,13 +327,15 @@ public class Main extends Activity {
combo.setAdapter(spinnerArrayAdapter); combo.setAdapter(spinnerArrayAdapter);
combo.setSelection(0); combo.setSelection(0);
Button buttonReset = (Button) findViewById(R.id.button_reset); Button buttonSaveAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher);
Button buttonSearch = (Button) findViewById(R.id.button_send); Button buttonSearch = (Button) findViewById(R.id.button_send);
Button buttonbuttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher); Button buttonDeleteProfile = (Button) findViewById(R.id.button_delete_profile);
Button buttonSaveProfile = (Button) findViewById(R.id.button_save_profile);
buttonReset.setEnabled(true); buttonSaveAsFilterWatcher.setEnabled(true);
buttonSearch.setEnabled(true); buttonSearch.setEnabled(true);
buttonbuttonSetAsFilterWatcher.setEnabled(true); buttonDeleteProfile.setEnabled(true);
buttonSaveProfile.setEnabled(true);
} else { } else {
// Only this task will show the toast in order to prevent a // Only this task will show the toast in order to prevent a
// message repeated. // message repeated.
@ -546,36 +539,6 @@ public class Main extends Activity {
} }
} }
/**
* Resets the filter form.
*
*/
private void reset_form() {
Spinner combo = (Spinner) findViewById(R.id.group_combo);
combo.setSelection(0);
combo = (Spinner) findViewById(R.id.status_combo);
combo.setSelection(3);
if (version402) {
((EditText) findViewById(R.id.tag_text)).setText("");
} else {
combo = (Spinner) findViewById(R.id.tag);
combo.setSelection(0);
}
EditText text = (EditText) findViewById(R.id.agent_name);
text.setText("");
combo = (Spinner) findViewById(R.id.severity_combo);
combo.setSelection(0);
combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
combo.setSelection(6);
text = (EditText) findViewById(R.id.event_search_text);
text.setText("");
}
/** /**
* Clears advanced options. * Clears advanced options.
*/ */