diff options
author | bju <bju@maxi.fritz.box> | 2017-11-26 20:41:58 +0100 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2017-11-26 20:41:58 +0100 |
commit | 5ab0feb9daf73aced88e946ef6bc5b5a38fa99b0 (patch) | |
tree | 7964214471241e4651f3f4f12aa9e5ccb04abc49 /vdrmanager | |
parent | e02c002fab3de868ccd10dca59fa659fb1a2ed1a (diff) | |
download | vdr-manager-5ab0feb9daf73aced88e946ef6bc5b5a38fa99b0.tar.gz vdr-manager-5ab0feb9daf73aced88e946ef6bc5b5a38fa99b0.tar.bz2 |
Feature #2535: Extra host definition for remote control
Diffstat (limited to 'vdrmanager')
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 @@ -238,6 +238,15 @@ public class Preferences { * * @return port */ + public String getSvdrpHost() { + return getCurrentVdr().getSvdrpHost(); + } + + /** + * Gets the port + * + * @return port + */ public int getSvdrpPort() { return getCurrentVdr().getSvdrpPort(); } 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<Vdr, Integer> 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?</string> <string name="remote">Remote Control</string> <string name="remote_enable_summary">Shows the remote control view if enabled</string> <string name="remote_enable_title">Enable VDR remote control</string> + <string name="svdrp_host_title">SVDRP Hostname</string> + <string name="svdrp_host_summary">Standard ist der VDR Host</string> <string name="svdrp_port_title">SVDRP Port</string> - <string name="svdrp_port_summary">Default is 6419</string> + <string name="svdrp_port_summary">Standard ist 6419</string> <string name="label">Label</string> <string name="hitkcommand">HITK Command</string> <string name="menu_reset">Reset</string> 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?</string> <string name="remote">Télécommande</string> <string name="remote_enable_summary">Afficher la télécommande si activée</string> <string name="remote_enable_title">Activer la télécommande de VDR</string> - <string name="svdrp_port_title">Port DVDRP</string> + <string name="svdrp_host_title">Hôte SVDRP</string> + <string name="svdrp_host_summary">Hôte SVDRP</string> + <string name="svdrp_port_title">Port SVDRP</string> <string name="svdrp_port_summary">Par défaut le 6419</string> <string name="label">Label</string> <string name="hitkcommand">HITK Command</string> 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?</string> <string name="remote">Remote Control</string> <string name="remote_enable_summary">Shows the remote control view if enabled</string> <string name="remote_enable_title">Enable VDR remote control</string> + <string name="svdrp_host_title">SVDRP Nome sistema/IP</string> + <string name="svdrp_host_summary">Default is VDR host</string> <string name="svdrp_port_title">SVDRP Port</string> <string name="svdrp_port_summary">Default is 6419</string> <string name="label">Label</string> 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?</string> <string name="remote">Remote Control</string> <string name="remote_enable_summary">Shows the remote control view if enabled</string> <string name="remote_enable_title">Enable VDR remote control</string> + <string name="svdrp_host_title">Nazwa hosta SVDRP</string> + <string name="svdrp_host_summary">Default is VDR host</string> <string name="svdrp_port_title">SVDRP Port</string> <string name="svdrp_port_summary">Default is 6419</string> </resources> 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?</string> <string name="remote">Remote Control</string> <string name="remote_enable_summary">Shows the remote control view if enabled</string> <string name="remote_enable_title">Enable VDR remote control</string> + <string name="svdrp_host_title">SVDRP Host</string> + <string name="svdrp_host_summary">Default is vdr host</string> <string name="svdrp_port_title">SVDRP Port</string> <string name="svdrp_port_summary">Default is 6419</string> <string name="label">Label</string> 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 @@ <string name="remote_enable_title">Enable VDR remote control</string> <string name="svdrp_port_title">SVDRP Port</string> <string name="svdrp_port_summary">Default is 6419</string> + <string name="svdrp_host_title">SVDRP Host</string> + <string name="svdrp_host_summary">Default is vdr host</string> <string name="label">Label</string> <string name="hitkcommand">HITK Command</string> <string name="menu_reset">Reset</string> 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" /> - - <EditTextPreference + + <EditTextPreference + android:inputType="text" + android:dependency="key_remote_enable" + android:key="key_svdrp_host" + android:summary="@string/svdrp_host_summary" + android:title="@string/svdrp_host_title"/> + <EditTextPreference android:inputType="number" android:key="key_svdrp_port" android:dependency="key_remote_enable" android:summary="@string/svdrp_port_summary" android:defaultValue="@integer/svdrp_default_port" android:title="@string/svdrp_port_title" /> - + </PreferenceCategory> <PreferenceScreen android:title="Advanced" > |