From 5ab0feb9daf73aced88e946ef6bc5b5a38fa99b0 Mon Sep 17 00:00:00 2001 From: bju Date: Sun, 26 Nov 2017 20:41:58 +0100 Subject: Feature #2535: Extra host definition for remote control --- .../java/de/bjusystems/vdrmanager/data/Preferences.java | 9 +++++++++ .../src/main/java/de/bjusystems/vdrmanager/data/Vdr.java | 13 +++++++++++++ .../java/de/bjusystems/vdrmanager/data/db/DBAccess.java | 6 +++++- .../de/bjusystems/vdrmanager/remote/RemoteActivity.java | 6 +++++- .../src/main/res/values-de/strings.xml | 4 +++- .../src/main/res/values-fr/strings.xml | 4 +++- .../src/main/res/values-it/strings.xml | 2 ++ .../src/main/res/values-pl/strings.xml | 2 ++ .../src/main/res/values-uk/strings.xml | 2 ++ .../src/main/res/values/strings.xml | 2 ++ .../de.bjusystems.vdrmanager/src/main/res/xml/vdr_prefs.xml | 12 +++++++++--- 11 files changed, 55 insertions(+), 7 deletions(-) diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Preferences.java b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Preferences.java index d4aaab9..4d19d0e 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Preferences.java +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Preferences.java @@ -233,6 +233,15 @@ public class Preferences { return getCurrentVdr().getPort(); } + /** + * Gets the port + * + * @return port + */ + public String getSvdrpHost() { + return getCurrentVdr().getSvdrpHost(); + } + /** * Gets the port * diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Vdr.java b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Vdr.java index b7960d3..619bb9e 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Vdr.java +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/Vdr.java @@ -193,6 +193,9 @@ public class Vdr { @DatabaseField(columnName = "stz") private String serverTimeZone = "Europe/Berlin"; + @DatabaseField(columnName="svdrpHost") + private String svdrpHost = ""; + @DatabaseField(columnName="svdrpPort") private int svdrpPort = 6419; @@ -601,6 +604,7 @@ public class Vdr { map.put("key_smarttvweb_port", smarttvwebPort); map.put("key_smarttvweb_recstream_method", smarttvwebType); map.put("key_remote_enable", enableRemote); + map.put("key_svdrp_host", svdrpHost); map.put("key_svdrp_port", svdrpPort); return map; } @@ -694,6 +698,7 @@ public class Vdr { smarttvwebPort= getInteger(map, "key_smarttvweb_port", 8000); smarttvwebType= get(map, "key_smarttvweb_recstream_method", "progressive"); enableRemote = getBoolean(map, "key_remote_enable", true); + svdrpHost = get(map, "key_svdrp_host", ""); svdrpPort = getInteger(map, "key_svdrp_port", 6419); } @@ -713,6 +718,14 @@ public class Vdr { this.smarttvwebType = smarttvwebType; } + public String getSvdrpHost() { + return svdrpHost; + } + + public void setSvdrpHost(String svdrpHost) { + this.svdrpHost = svdrpHost; + } + public int getSvdrpPort() { return svdrpPort; } diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/db/DBAccess.java b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/db/DBAccess.java index f854204..0e529dc 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/db/DBAccess.java +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/data/db/DBAccess.java @@ -32,7 +32,7 @@ public class DBAccess extends OrmLiteSqliteOpenHelper { // any time you make changes to your database objects, you may have to // increase the database version // Version 3 since 0.6 - private static final int DATABASE_VERSION = 5; + private static final int DATABASE_VERSION = 6; private RuntimeExceptionDao vdrDAO = null; @@ -126,6 +126,10 @@ public class DBAccess extends OrmLiteSqliteOpenHelper { } + if (oldVersion < 6) { + getVdrDAO().executeRaw("ALTER TABLE `vdr` ADD COLUMN svdrpHost varchar"); + } + } catch (SQLException e) { Log.e(DBAccess.class.getName(), "Can't drop databases", e); throw new RuntimeException(e); diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/remote/RemoteActivity.java b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/remote/RemoteActivity.java index 254150e..7711a4a 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/remote/RemoteActivity.java +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/java/de/bjusystems/vdrmanager/remote/RemoteActivity.java @@ -620,7 +620,11 @@ public class RemoteActivity extends Activity implements OnClickListener, View.On try { if (connection == null) { - connection = new Connection(Preferences.get().getHost(), Preferences.get().getSvdrpPort()); + String host = Preferences.get().getSvdrpHost(); + if (host == null || host.length() == 0) { + host = Preferences.get().getHost(); + } + connection = new Connection(host, Preferences.get().getSvdrpPort()); } send = connection.send(new HITK(hitk[0])); diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-de/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-de/strings.xml index 3ba27fa..0ae6b80 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-de/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-de/strings.xml @@ -493,8 +493,10 @@ Wie soll verfahren werden? Remote Control Shows the remote control view if enabled Enable VDR remote control + SVDRP Hostname + Standard ist der VDR Host SVDRP Port - Default is 6419 + Standard ist 6419 Label HITK Command Reset diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-fr/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-fr/strings.xml index f7087cb..1816cef 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-fr/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-fr/strings.xml @@ -493,7 +493,9 @@ Que voulez-vous faire? Télécommande Afficher la télécommande si activée Activer la télécommande de VDR - Port DVDRP + Hôte SVDRP + Hôte SVDRP + Port SVDRP Par défaut le 6419 Label HITK Command diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-it/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-it/strings.xml index 01575cb..b815bda 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-it/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-it/strings.xml @@ -493,6 +493,8 @@ What do you want to do? Remote Control Shows the remote control view if enabled Enable VDR remote control + SVDRP Nome sistema/IP + Default is VDR host SVDRP Port Default is 6419 Label diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-pl/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-pl/strings.xml index a4338a4..e71e1a7 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-pl/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-pl/strings.xml @@ -489,6 +489,8 @@ What do you want to do? Remote Control Shows the remote control view if enabled Enable VDR remote control + Nazwa hosta SVDRP + Default is VDR host SVDRP Port Default is 6419 diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-uk/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-uk/strings.xml index 46dc34f..bf88f86 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-uk/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values-uk/strings.xml @@ -491,6 +491,8 @@ What do you want to do? Remote Control Shows the remote control view if enabled Enable VDR remote control + SVDRP Host + Default is vdr host SVDRP Port Default is 6419 Label diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values/strings.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values/strings.xml index 4f62261..5176908 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values/strings.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/values/strings.xml @@ -547,6 +547,8 @@ Enable VDR remote control SVDRP Port Default is 6419 + SVDRP Host + Default is vdr host Label HITK Command Reset diff --git a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/xml/vdr_prefs.xml b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/xml/vdr_prefs.xml index 5c6e8b1..efd13f8 100644 --- a/vdrmanager/de.bjusystems.vdrmanager/src/main/res/xml/vdr_prefs.xml +++ b/vdrmanager/de.bjusystems.vdrmanager/src/main/res/xml/vdr_prefs.xml @@ -202,15 +202,21 @@ android:key="key_remote_enable" android:summary="@string/remote_enable_summary" android:title="@string/remote_enable_title" /> - - + - + -- cgit v1.2.3