2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/EventList.java: fixed the incident dialog when two times. * src/pandroid_event_viewer/pandorafms/Options.java: updated the api password for the pandora_demo in firefly. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9194 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
31a97f0673
commit
0032039a22
|
@ -1,3 +1,11 @@
|
||||||
|
2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* src/pandroid_event_viewer/pandorafms/EventList.java: fixed the
|
||||||
|
incident dialog when two times.
|
||||||
|
|
||||||
|
* src/pandroid_event_viewer/pandorafms/Options.java: updated the
|
||||||
|
api password for the pandora_demo in firefly.
|
||||||
|
|
||||||
2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
|
2013-12-09 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java,
|
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java,
|
||||||
|
|
|
@ -19,8 +19,11 @@ package pandroid_event_viewer.pandorafms;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
@ -28,6 +31,9 @@ import android.app.ListActivity;
|
||||||
import android.app.TabActivity;
|
import android.app.TabActivity;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.DialogInterface.OnCancelListener;
|
||||||
|
import android.content.DialogInterface.OnDismissListener;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
@ -54,9 +60,6 @@ import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity where events are displayed.
|
* Activity where events are displayed.
|
||||||
*
|
*
|
||||||
|
@ -229,6 +232,7 @@ public class EventList extends ListActivity {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case CREATE_INCIDENT_DIALOG:
|
case CREATE_INCIDENT_DIALOG:
|
||||||
final String group;
|
final String group;
|
||||||
|
|
||||||
creatingIncidentDialog = new Dialog(this);
|
creatingIncidentDialog = new Dialog(this);
|
||||||
creatingIncidentDialog.setContentView(R.layout.create_incident);
|
creatingIncidentDialog.setContentView(R.layout.create_incident);
|
||||||
creatingIncidentDialog.setTitle(getString(R.string.create_incident));
|
creatingIncidentDialog.setTitle(getString(R.string.create_incident));
|
||||||
|
@ -236,6 +240,12 @@ public class EventList extends ListActivity {
|
||||||
.findViewById(R.id.incident_title);
|
.findViewById(R.id.incident_title);
|
||||||
final EditText descriptionEditText = (EditText) creatingIncidentDialog
|
final EditText descriptionEditText = (EditText) creatingIncidentDialog
|
||||||
.findViewById(R.id.incident_description);
|
.findViewById(R.id.incident_description);
|
||||||
|
|
||||||
|
Log.e("onCreateDialog",
|
||||||
|
"Group: " + args.getString("group") +
|
||||||
|
"Title: " + args.getString("title") +
|
||||||
|
"Description: " + args.getString("description"));
|
||||||
|
|
||||||
String temp = args.getString("title");
|
String temp = args.getString("title");
|
||||||
|
|
||||||
if (temp != null) {
|
if (temp != null) {
|
||||||
|
@ -253,6 +263,7 @@ public class EventList extends ListActivity {
|
||||||
else {
|
else {
|
||||||
group = "";
|
group = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
creatingIncidentDialog.findViewById(R.id.incident_create_button)
|
creatingIncidentDialog.findViewById(R.id.incident_create_button)
|
||||||
.setOnClickListener(new OnClickListener() {
|
.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
|
@ -266,6 +277,8 @@ public class EventList extends ListActivity {
|
||||||
.getText().toString();
|
.getText().toString();
|
||||||
new SetNewIncidentAsyncTask().execute(title,
|
new SetNewIncidentAsyncTask().execute(title,
|
||||||
description, group);
|
description, group);
|
||||||
|
|
||||||
|
removeDialog(CREATE_INCIDENT_DIALOG);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Toast.makeText(getApplicationContext(),
|
Toast.makeText(getApplicationContext(),
|
||||||
|
@ -274,6 +287,21 @@ public class EventList extends ListActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
creatingIncidentDialog.setOnDismissListener(
|
||||||
|
new OnDismissListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
removeDialog(CREATE_INCIDENT_DIALOG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return creatingIncidentDialog;
|
return creatingIncidentDialog;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -568,7 +596,8 @@ public class EventList extends ListActivity {
|
||||||
comments = comments + mJsonObject.getString("action") + " by " + mJsonObject.getString("id_user") + "\n";
|
comments = comments + mJsonObject.getString("action") + " by " + mJsonObject.getString("id_user") + "\n";
|
||||||
comments = comments + "\"" + mJsonObject.getString("comment") + "\"" + "\n\n";
|
comments = comments + "\"" + mJsonObject.getString("comment") + "\"" + "\n\n";
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
}
|
||||||
|
catch (Exception e) {
|
||||||
// If comment is not stored as JSON (old format), clean it and show it as stored
|
// If comment is not stored as JSON (old format), clean it and show it as stored
|
||||||
item.user_comment = item.user_comment.replaceAll("^-- ", "\n");
|
item.user_comment = item.user_comment.replaceAll("^-- ", "\n");
|
||||||
item.user_comment = item.user_comment.replaceAll(" --$", "\n");
|
item.user_comment = item.user_comment.replaceAll(" --$", "\n");
|
||||||
|
@ -633,7 +662,7 @@ public class EventList extends ListActivity {
|
||||||
button = (Button) viewEventExtended
|
button = (Button) viewEventExtended
|
||||||
.findViewById(R.id.validate_button_extended);
|
.findViewById(R.id.validate_button_extended);
|
||||||
if (item.status == -1) {
|
if (item.status == -1) {
|
||||||
// For unknow events
|
// For unknown events
|
||||||
button.setVisibility(Button.GONE);
|
button.setVisibility(Button.GONE);
|
||||||
text = (TextView) viewEventExtended
|
text = (TextView) viewEventExtended
|
||||||
.findViewById(R.id.validate_event_label);
|
.findViewById(R.id.validate_event_label);
|
||||||
|
@ -642,8 +671,8 @@ public class EventList extends ListActivity {
|
||||||
}
|
}
|
||||||
else if (item.status != 1) {
|
else if (item.status != 1) {
|
||||||
currentElement = view;
|
currentElement = view;
|
||||||
OnClickListenerButtonValidate clickListener = new OnClickListenerButtonValidate(
|
OnClickListenerButtonValidate clickListener =
|
||||||
item.id_event);
|
new OnClickListenerButtonValidate(item.id_event);
|
||||||
button.setOnClickListener(clickListener);
|
button.setOnClickListener(clickListener);
|
||||||
text = (TextView) viewEventExtended
|
text = (TextView) viewEventExtended
|
||||||
.findViewById(R.id.validate_event_label);
|
.findViewById(R.id.validate_event_label);
|
||||||
|
@ -657,8 +686,11 @@ public class EventList extends ListActivity {
|
||||||
b.putString("group", item.group_name);
|
b.putString("group", item.group_name);
|
||||||
b.putString("title", item.event);
|
b.putString("title", item.event);
|
||||||
b.putString("description", "");
|
b.putString("description", "");
|
||||||
|
|
||||||
showDialog(CREATE_INCIDENT_DIALOG, b);
|
showDialog(CREATE_INCIDENT_DIALOG, b);
|
||||||
Log.e("TEST", "TEST");
|
Log.e("CREATE_INCIDENT",
|
||||||
|
"Group: " + item.group_name +
|
||||||
|
"Title: " + item.event);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ public class Options extends Activity {
|
||||||
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);
|
||||||
|
|
||||||
// Connection
|
// Connection
|
||||||
EditText text = (EditText) findViewById(R.id.url);
|
EditText text = (EditText) findViewById(R.id.url);
|
||||||
text.setText(preferences.getString("url",
|
text.setText(preferences.getString("url",
|
||||||
|
@ -84,7 +85,7 @@ public class Options extends Activity {
|
||||||
text = (EditText) findViewById(R.id.password);
|
text = (EditText) findViewById(R.id.password);
|
||||||
text.setText(preferences.getString("password", "demo"));
|
text.setText(preferences.getString("password", "demo"));
|
||||||
text = (EditText) findViewById(R.id.api_password);
|
text = (EditText) findViewById(R.id.api_password);
|
||||||
text.setText(preferences.getString("api_password", "m1gu3l"));
|
text.setText(preferences.getString("api_password", "1234"));
|
||||||
text = (EditText) findViewById(R.id.timeout_connections);
|
text = (EditText) findViewById(R.id.timeout_connections);
|
||||||
text.setText(Integer.toString(preferences.getInt("timeout_connections", 10)));
|
text.setText(Integer.toString(preferences.getInt("timeout_connections", 10)));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue