diff --git a/app/src/main/java/org/openlp/android2/OpenLP.java b/app/src/main/java/org/openlp/android2/OpenLP.java
index 067b0b8..66dde80 100644
--- a/app/src/main/java/org/openlp/android2/OpenLP.java
+++ b/app/src/main/java/org/openlp/android2/OpenLP.java
@@ -35,6 +35,7 @@ import android.view.ViewGroup;
import android.support.v4.widget.DrawerLayout;
import org.openlp.android2.activities.ConnectionActivity;
import org.openlp.android2.activities.SettingsActivity;
+import org.openlp.android2.dialogs.AlertDisplayDialog;
import org.openlp.android2.dialogs.BlankDisplayDialog;
import org.openlp.android2.fragments.LiveListFragment;
import org.openlp.android2.fragments.NavigationDrawerFragment;
@@ -155,10 +156,14 @@ public class OpenLP extends Activity
startActivity(intent);
return true;
}
- if (id == R.id.action_alert) {
+ if (id == R.id.action_blank) {
new BlankDisplayDialog().show(getFragmentManager(), "BlankDialog");
return true;
}
+ if (id == R.id.action_alert) {
+ new AlertDisplayDialog().show(getFragmentManager(), "AlertDialog");
+ return true;
+ }
return super.onOptionsItemSelected(item);
}
diff --git a/app/src/main/java/org/openlp/android2/activities/ConnectionActivity.java b/app/src/main/java/org/openlp/android2/activities/ConnectionActivity.java
index 600f5bf..246e53f 100644
--- a/app/src/main/java/org/openlp/android2/activities/ConnectionActivity.java
+++ b/app/src/main/java/org/openlp/android2/activities/ConnectionActivity.java
@@ -308,11 +308,11 @@ public class ConnectionActivity extends PreferenceActivity {
title.setOnPreferenceChangeListener(onPreferenceChangeListener);
hostAddress = new EditTextPreference(getActivity());
- hostAddress.setTitle(getString(R.string.urlHint));
+ hostAddress.setTitle(getString(R.string.url_hint));
hostAddress.setKey(KEY_PREFIX + id + ".address");
- hostAddress.getEditText().setHint(R.string.urlHint);
- hostAddress.setSummary(getString(R.string.urlHint));
- hostAddress.setDialogTitle(getString(R.string.urlHint));
+ hostAddress.getEditText().setHint(R.string.url_hint);
+ hostAddress.setSummary(getString(R.string.url_hint));
+ hostAddress.setDialogTitle(getString(R.string.url_hint));
hostAddress.getEditText().setInputType(InputType.TYPE_TEXT_VARIATION_URI);
hostAddress.setOnPreferenceChangeListener(onPreferenceChangeListener);
diff --git a/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java b/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java
index 4dd8416..89dec57 100644
--- a/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java
+++ b/app/src/main/java/org/openlp/android2/common/OpenLPSSLSocketFactory.java
@@ -1,3 +1,22 @@
+/******************************************************************************
+ * OpenLP - Open Source Lyrics Projection *
+ * --------------------------------------------------------------------------- *
+ * Copyright (c) 2011-2014 Raoul Snyman *
+ * Portions copyright (c) 2011-2014 Tim Bentley, Johan Mynhardt *
+ * --------------------------------------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU General Public License as published by the Free *
+ * Software Foundation; version 2 of the License. *
+ * *
+ * 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. *
+ * *
+ * You should have received a copy of the GNU General Public License along *
+ * with this program; if not, write to the Free Software Foundation, Inc., 59 *
+ * Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ *******************************************************************************/
package org.openlp.android2.common;
import org.apache.http.conn.ssl.SSLSocketFactory;
diff --git a/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java b/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java
index 0933ddd..5f55360 100644
--- a/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java
+++ b/app/src/main/java/org/openlp/android2/dialogs/AlertDisplayDialog.java
@@ -21,7 +21,6 @@ package org.openlp.android2.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
-import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
@@ -30,13 +29,11 @@ import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
-
import org.openlp.android2.R;
import org.openlp.android2.api.Api;
import org.openlp.android2.common.JsonHelpers;
import org.openlp.android2.common.OpenLPDialog;
-
-import org.openlp.android2.common.OpenLPHttpReturn;
+import org.openlp.android2.common.OpenLPHttpClient;
public class AlertDisplayDialog extends OpenLPDialog {
private final String LOG_TAG = AlertDisplayDialog.class.getName();
@@ -53,6 +50,7 @@ public class AlertDisplayDialog extends OpenLPDialog {
// remove the dialog title, but you must call the superclass to get the Dialog.
context = getActivity();
+ httpClient = new OpenLPHttpClient(context);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
// Get the layout inflater
@@ -91,34 +89,20 @@ public class AlertDisplayDialog extends OpenLPDialog {
public void onResume() {
super.onResume();
Log.d(LOG_TAG, "Resuming...");
- triggerRequest(Api.POLL_STATUS);
- Log.d(LOG_TAG, "Resumed...");
}
- private void triggerRequest(String url) {
- //ExecuteHttpRequestTask task = new ExecuteHttpRequestTask();
- //task.execute(new String[]{url});
- }
-
- public void populateDisplay(OpenLPHttpReturn response) {
- Log.d(LOG_TAG, "populateDisplay");
- if (response.isSecurityError()) {
- Toast.makeText(context, R.string.httpreturn_unauthorised, Toast.LENGTH_LONG).show();
- } else if (response.isError()) {
- Toast.makeText(context, R.string.unable, Toast.LENGTH_LONG).show();
- }
+ public void processUpdate(String response) {
+ Toast.makeText(context, "Alert Requested", Toast.LENGTH_SHORT).show();
}
public void requestAlert(String text) {
try {
String request = JsonHelpers.createRequestJSON("text", text);
- triggerRequest(String.format("%s%s", Api.ALERT, request));
- Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)",
- Api.ALERT, text));
- Toast.makeText(getActivity().getBaseContext(), "Alert Requested", Toast.LENGTH_SHORT).show();
+ triggerTextRequest(String.format("%s%s", Api.ALERT, request));
+ Log.d(LOG_TAG, String.format("Setting list data. apiBase(%s), text(%s)", Api.ALERT, text));
} catch (JsonHelpers.JSONHandlerException e) {
e.printStackTrace();
- Toast.makeText(getActivity().getBaseContext(), "Request Failed", Toast.LENGTH_SHORT).show();
+ Toast.makeText(context, "Request Failed", Toast.LENGTH_SHORT).show();
}
}
}
diff --git a/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java b/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java
index 6fe85ed..a86d12b 100644
--- a/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java
+++ b/app/src/main/java/org/openlp/android2/dialogs/BlankDisplayDialog.java
@@ -124,7 +124,6 @@ public class BlankDisplayDialog extends OpenLPDialog {
}
public void populateDisplay(String json) {
-
Log.d(LOG_TAG, "populateDisplay");
try {
JSONObject item = new JSONObject(json).getJSONObject("results");
diff --git a/app/src/main/res/layout/alert_display_dialog.xml b/app/src/main/res/layout/alert_display_dialog.xml
index 69e39d9..c4cc68d 100644
--- a/app/src/main/res/layout/alert_display_dialog.xml
+++ b/app/src/main/res/layout/alert_display_dialog.xml
@@ -11,7 +11,7 @@
android:layout_width="294dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/enterAlertText"
+ android:text="@string/enter_alert_text"
android:id="@+id/textView"
android:autoText="true"
android:textStyle="bold|italic"
diff --git a/app/src/main/res/layout/blank_display_dialog.xml b/app/src/main/res/layout/blank_display_dialog.xml
index ec3aaa3..b0cea2c 100644
--- a/app/src/main/res/layout/blank_display_dialog.xml
+++ b/app/src/main/res/layout/blank_display_dialog.xml
@@ -11,7 +11,7 @@
android:layout_width="294dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/displayBlankSummary"
+ android:text="@string/display_blank_summary"
android:id="@+id/textView"
android:autoText="true"
android:textStyle="bold|italic"
@@ -20,7 +20,7 @@
-
+ VersionOpenLP is free church presentation software
- Find out more about visit the OpenLP website.
+ Find out more about visit the OpenLP website_CopyrightPortions copyrightLicense
- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
- 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.
+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License_
+ 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_Settings
- OpenLP
+ AboutAlertBack
+ Toggle Display
+ Connections
+ Preferences
+ Refresh
+ Search
+ OpenLP
+ Cancel
+ Connection Timeout
+ Connection timed out
+ Select a value (milliseconds)
+ List of available profiles
+ Tap to add a new profile
+ Tap to edit properties
+ New Server
+ Server
+ Profile Title
+ Use HTTPS
+ Specify whether HTTPS should be used
+ Userid
+ Password
+ Remove
+ Remove this configuration
+ Tap to set active
+ Save and Activate
+ Active ProfileService ListLive ListStage ViewLiveViewOpen navigation drawerClose navigation drawer
- Toggle Display
- Search
- Refresh
- Preferences
- Connections
- About
- Text Size Type
- Change the Service text size
- Connection Timeout
- Connection timed out
- Select a value (milliseconds)
- Enable Custom Timeouts
- Check to modify timeout settings
+ Text Size Type
+ Change the Service text size
+
+ Enable Custom Timeouts
+ Check to modify timeout settingsNone
- Active Profile - Tap to manage
+ Active Profile - Tap to manageServer
- Hostname or IP
- Not set
- Cancel
- List of available profiles
- Tap to add a new profile
- Tap to edit properties
- New Server
- Server
- Profile Title
- Use HTTPS
- Specify whether HTTPS should be used
- Userid
- Password
- Remove
- Remove this configuration
- Tap to set active
- Save and Activate
- Active Profile
- Reset Display
- Blank display to Blank
- Blank display to Theme
- Blank display to Desktop
- Select the required blank type
- Enter Alert Text
- Unauthorised Access, please enter valid userid and password
+ Hostname or IP
+ Not set
+
+ Reset Display
+ Blank display to Blank
+ Blank display to Theme
+ Blank display to Desktop
+ Select the required blank type
+ Enter Alert Text
+ Unauthorised Access, please enter valid userid and passwordProcess
- Unable to load page - check network settings
+ Unable to process request - check network settingsPort
diff --git a/app/src/main/res/xml/pref_general.xml b/app/src/main/res/xml/pref_general.xml
index 1fef444..2dbd328 100644
--- a/app/src/main/res/xml/pref_general.xml
+++ b/app/src/main/res/xml/pref_general.xml
@@ -1,20 +1,20 @@
+ android:summary="@string/custom_timeouts_summary"/>