mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
2012-06-29 Santiago Munin <burning1@gmail.com>
* src/pandroid_event_viewer/pandorafms/Main.java: Added a little hack to make it compatible with v4.0.2 * res/layout/main.xml: Added a little hack to make it compatible with v4.0.2 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6725 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
e6479b2fea
commit
e77d26b03d
@ -1,3 +1,7 @@
|
|||||||
|
2012-06-29 Santiago Munín <burning1@gmail.com>
|
||||||
|
* src/pandroid_event_viewer/pandorafms/Main.java: Added a little hack to make it compatible with v4.0.2
|
||||||
|
* res/layout/main.xml: Added a little hack to make it compatible with v4.0.2
|
||||||
|
|
||||||
2012-06-27 Santiago Munín <burning1@gmail.com>
|
2012-06-27 Santiago Munín <burning1@gmail.com>
|
||||||
|
|
||||||
* src/pandroid_event_viewer/pandorafms/Core.java: Added "apipass" parameter to petitions.
|
* src/pandroid_event_viewer/pandorafms/Core.java: Added "apipass" parameter to petitions.
|
||||||
|
4
extras/pandroid_event_viewer/lint.xml
Normal file
4
extras/pandroid_event_viewer/lint.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<lint>
|
||||||
|
<issue id="ParserError" severity="ignore" />
|
||||||
|
</lint>
|
@ -114,6 +114,13 @@
|
|||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
android:text="@string/tag_label_str" />
|
android:text="@string/tag_label_str" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/tag_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="text"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/tag"
|
android:id="@+id/tag"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -70,6 +70,8 @@ public class Main extends Activity {
|
|||||||
private List<String> profiles;
|
private List<String> profiles;
|
||||||
private Context context = this;
|
private Context context = this;
|
||||||
private boolean selectLastProfile = false;
|
private boolean selectLastProfile = false;
|
||||||
|
// If this version, there will be changes
|
||||||
|
private boolean version402 = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@ -80,6 +82,13 @@ public class Main extends Activity {
|
|||||||
.getSerializableExtra("object");
|
.getSerializableExtra("object");
|
||||||
|
|
||||||
this.pandoraGroups = new HashMap<Integer, String>();
|
this.pandoraGroups = new HashMap<Integer, String>();
|
||||||
|
final SharedPreferences preferences = getSharedPreferences(
|
||||||
|
this.getString(R.string.const_string_preferences),
|
||||||
|
Activity.MODE_PRIVATE);
|
||||||
|
|
||||||
|
if (preferences.getString("api_version", "v4.0.2").equals("v4.0.2")) {
|
||||||
|
version402 = true;
|
||||||
|
}
|
||||||
|
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
final Button buttonReset = (Button) findViewById(R.id.button_reset);
|
final Button buttonReset = (Button) findViewById(R.id.button_reset);
|
||||||
@ -108,13 +117,17 @@ public class Main extends Activity {
|
|||||||
buttonbuttonSetAsFilterWatcher.setEnabled(false);
|
buttonbuttonSetAsFilterWatcher.setEnabled(false);
|
||||||
|
|
||||||
new GetGroupsAsyncTask().execute();
|
new GetGroupsAsyncTask().execute();
|
||||||
new GetTagsAsyncTask().execute();
|
if (version402) {
|
||||||
|
((EditText) findViewById(R.id.tag_text))
|
||||||
|
.setVisibility(View.VISIBLE);
|
||||||
|
((ProgressBar) findViewById(R.id.loading_tag))
|
||||||
|
.setVisibility(View.GONE);
|
||||||
|
((Spinner) findViewById(R.id.tag)).setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
new GetTagsAsyncTask().execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final SharedPreferences preferences = getSharedPreferences(
|
|
||||||
this.getString(R.string.const_string_preferences),
|
|
||||||
Activity.MODE_PRIVATE);
|
|
||||||
|
|
||||||
comboSeverity = (Spinner) findViewById(R.id.severity_combo);
|
comboSeverity = (Spinner) findViewById(R.id.severity_combo);
|
||||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
|
||||||
this, R.array.severity_array_values,
|
this, R.array.severity_array_values,
|
||||||
@ -282,7 +295,9 @@ public class Main extends Activity {
|
|||||||
if (preferences.getBoolean("url_changed", false)) {
|
if (preferences.getBoolean("url_changed", false)) {
|
||||||
Log.i(TAG, "Getting groups and tags");
|
Log.i(TAG, "Getting groups and tags");
|
||||||
new GetGroupsAsyncTask().execute();
|
new GetGroupsAsyncTask().execute();
|
||||||
new GetTagsAsyncTask().execute();
|
if (!version402) {
|
||||||
|
new GetTagsAsyncTask().execute();
|
||||||
|
}
|
||||||
editorPreferences.putBoolean("url_changed", false);
|
editorPreferences.putBoolean("url_changed", false);
|
||||||
editorPreferences.commit();
|
editorPreferences.commit();
|
||||||
}
|
}
|
||||||
@ -438,10 +453,14 @@ public class Main extends Activity {
|
|||||||
|
|
||||||
text = (EditText) findViewById(R.id.event_search_text);
|
text = (EditText) findViewById(R.id.event_search_text);
|
||||||
this.object.eventSearch = text.getText().toString();
|
this.object.eventSearch = text.getText().toString();
|
||||||
|
if (version402) {
|
||||||
combo = (Spinner) findViewById(R.id.tag);
|
text = (EditText) findViewById(R.id.tag_text);
|
||||||
if (combo.getSelectedItem() != null) {
|
this.object.eventTag = text.getText().toString();
|
||||||
this.object.eventTag = combo.getSelectedItem().toString();
|
} else {
|
||||||
|
combo = (Spinner) findViewById(R.id.tag);
|
||||||
|
if (combo.getSelectedItem() != null) {
|
||||||
|
this.object.eventTag = combo.getSelectedItem().toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.object.getNewListEvents = true;
|
this.object.getNewListEvents = true;
|
||||||
this.object.executeBackgroundGetEvents(true);
|
this.object.executeBackgroundGetEvents(true);
|
||||||
@ -489,9 +508,13 @@ public class Main extends Activity {
|
|||||||
|
|
||||||
combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
|
combo = (Spinner) findViewById(R.id.max_time_old_event_combo);
|
||||||
filterLastTime = combo.getSelectedItemPosition();
|
filterLastTime = combo.getSelectedItemPosition();
|
||||||
|
if (version402) {
|
||||||
combo = (Spinner) findViewById(R.id.tag);
|
text = (EditText) findViewById(R.id.tag_text);
|
||||||
filterTag = combo.getSelectedItem().toString();
|
filterTag = text.getText().toString();
|
||||||
|
} else {
|
||||||
|
combo = (Spinner) findViewById(R.id.tag);
|
||||||
|
filterTag = combo.getSelectedItem().toString();
|
||||||
|
}
|
||||||
|
|
||||||
text = (EditText) findViewById(R.id.event_search_text);
|
text = (EditText) findViewById(R.id.event_search_text);
|
||||||
filterEventSearch = text.getText().toString();
|
filterEventSearch = text.getText().toString();
|
||||||
@ -532,8 +555,12 @@ public class Main extends Activity {
|
|||||||
combo.setSelection(0);
|
combo.setSelection(0);
|
||||||
combo = (Spinner) findViewById(R.id.status_combo);
|
combo = (Spinner) findViewById(R.id.status_combo);
|
||||||
combo.setSelection(3);
|
combo.setSelection(3);
|
||||||
combo = (Spinner) findViewById(R.id.tag);
|
if (version402) {
|
||||||
combo.setSelection(0);
|
((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);
|
EditText text = (EditText) findViewById(R.id.agent_name);
|
||||||
text.setText("");
|
text.setText("");
|
||||||
@ -594,7 +621,13 @@ public class Main extends Activity {
|
|||||||
.getSelectedItemPosition();
|
.getSelectedItemPosition();
|
||||||
int status = ((Spinner) findViewById(R.id.status_combo))
|
int status = ((Spinner) findViewById(R.id.status_combo))
|
||||||
.getSelectedItemPosition();
|
.getSelectedItemPosition();
|
||||||
int tag = ((Spinner) findViewById(R.id.tag)).getSelectedItemPosition();
|
String tag = "";
|
||||||
|
if (version402) {
|
||||||
|
tag = ((EditText) findViewById(R.id.tag_text)).getText().toString();
|
||||||
|
} else {
|
||||||
|
tag = String.valueOf(((Spinner) findViewById(R.id.tag))
|
||||||
|
.getSelectedItemPosition());
|
||||||
|
}
|
||||||
String agentName = ((EditText) findViewById(R.id.agent_name)).getText()
|
String agentName = ((EditText) findViewById(R.id.agent_name)).getText()
|
||||||
.toString();
|
.toString();
|
||||||
String eventSearch = ((EditText) findViewById(R.id.event_search_text))
|
String eventSearch = ((EditText) findViewById(R.id.event_search_text))
|
||||||
@ -663,8 +696,17 @@ public class Main extends Activity {
|
|||||||
spinner.setSelection(Integer.valueOf(options[0]));
|
spinner.setSelection(Integer.valueOf(options[0]));
|
||||||
spinner = (Spinner) findViewById(R.id.status_combo);
|
spinner = (Spinner) findViewById(R.id.status_combo);
|
||||||
spinner.setSelection(Integer.valueOf(options[1]));
|
spinner.setSelection(Integer.valueOf(options[1]));
|
||||||
spinner = (Spinner) findViewById(R.id.tag);
|
if (version402) {
|
||||||
spinner.setSelection(Integer.valueOf(options[2]));
|
((EditText) findViewById(R.id.tag_text))
|
||||||
|
.setText(options[2]);
|
||||||
|
} else {
|
||||||
|
spinner = (Spinner) findViewById(R.id.tag);
|
||||||
|
try {
|
||||||
|
spinner.setSelection(Integer.valueOf(options[2]));
|
||||||
|
} catch (NumberFormatException nf) {
|
||||||
|
spinner.setSelection(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
EditText editText = (EditText) findViewById(R.id.agent_name);
|
EditText editText = (EditText) findViewById(R.id.agent_name);
|
||||||
editText.setText(options[3]);
|
editText.setText(options[3]);
|
||||||
editText = (EditText) findViewById(R.id.event_search_text);
|
editText = (EditText) findViewById(R.id.event_search_text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user