diff options
author | bju <bju@maxi.fritz.box> | 2014-01-11 05:03:11 +0100 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2014-01-11 05:03:11 +0100 |
commit | 2676b99b3a7cae3ea8ebe827ac20684a90a84d07 (patch) | |
tree | f9fe3565bba7a77f7e75535ca6516bfd01438aa8 /vdrmanager/src/de | |
parent | f8ef6e8fbb2865ce53e3deee6015bef97c6125a1 (diff) | |
download | vdr-manager-2676b99b3a7cae3ea8ebe827ac20684a90a84d07.tar.gz vdr-manager-2676b99b3a7cae3ea8ebe827ac20684a90a84d07.tar.bz2 |
http://projects.vdr-developer.org/issues/1674 (mark conflicting timers in list)
Diffstat (limited to 'vdrmanager/src/de')
7 files changed, 54 insertions, 29 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java index 03de2a2..a1aace4 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Event.java @@ -138,4 +138,8 @@ public abstract class Event { } return String.valueOf(channelNumber); } + + public boolean isConflict() { + return false; + } } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java index 89f1089..bf2f048 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Timer.java @@ -32,6 +32,7 @@ public class Timer extends Event implements Timerable { private int priority; private int lifetime; private String weekdays = "-------"; + private boolean conflict; public void setPriority(int priority) { this.priority = priority; @@ -58,8 +59,6 @@ public class Timer extends Event implements Timerable { * * @param timerData * result line - * @param channels - * list of channels */ public Timer(final String timerData) { @@ -103,6 +102,10 @@ public class Timer extends Event implements Timerable { this.weekdays = values[13]; } + if (values.length > 14) { + this.conflict = values[14].equals("1"); + } + description = Utils.mapSpecialChars(description); } @@ -118,6 +121,7 @@ public class Timer extends Event implements Timerable { t.stop = new Date(stop.getTime()); t.title = title; t.weekdays = weekdays; + t.conflict = conflict; return t; } @@ -216,6 +220,10 @@ public class Timer extends Event implements Timerable { return (flags & RECORDING) == RECORDING; } + public boolean isConflict() { + return conflict; + } + public void setStart(final Date start) { this.start = start; } @@ -251,7 +259,11 @@ public class Timer extends Event implements Timerable { @Override public TimerMatch getTimerMatch() { - return TimerMatch.Full; + + if (isConflict()) + return TimerMatch.Conflict; + + return TimerMatch.Full; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/TimerMatch.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/TimerMatch.java index 72cc52c..b8126ab 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/TimerMatch.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/TimerMatch.java @@ -3,5 +3,6 @@ package de.bjusystems.vdrmanager.data; public enum TimerMatch { Full, // Begin, // - End// + End, // + Conflict, // } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java index b022311..f670951 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java @@ -169,26 +169,29 @@ abstract class BaseEventAdapter<T extends EventListItem> extends ArrayAdapter<T> } else { itemHolder.state.setImageResource(R.drawable.timer_none); } - } else if (item.getEvent() instanceof Timerable == true) { + } else if (item.getEvent() instanceof Timerable) { TimerMatch match = ((Timerable) item.getEvent()).getTimerMatch(); switch (((Timerable) item.getEvent()).getTimerState()) { case Active: itemHolder.state.setImageResource(Utils.getTimerStateDrawable( match, R.drawable.timer_active, R.drawable.timer_active_begin, - R.drawable.timer_active_end)); + R.drawable.timer_active_end, + R.drawable.timer_active_conflict)); break; case Inactive: itemHolder.state.setImageResource(Utils.getTimerStateDrawable( match, R.drawable.timer_inactive, R.drawable.timer_inactive_begin, - R.drawable.timer_inactive_end)); + R.drawable.timer_inactive_end, + R.drawable.timer_inactive)); break; case Recording: itemHolder.state.setImageResource(Utils.getTimerStateDrawable( match, R.drawable.timer_recording, R.drawable.timer_recording_begin, - R.drawable.timer_recording_end)); + R.drawable.timer_recording_end, + R.drawable.timer_recording_conflict)); break; case None: itemHolder.state.setImageResource(R.drawable.timer_none); diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java index b9d6be3..e639355 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java @@ -273,20 +273,24 @@ public class EpgDetailsActivity extends ICSBaseActivity implements switch (timerable.getTimerState()) { case Active: setState(state, Utils.getTimerStateDrawable(match, - R.drawable.timer_active, R.drawable.timer_active_begin, - R.drawable.timer_active_end)); + R.drawable.timer_active, + R.drawable.timer_active_begin, + R.drawable.timer_active_end, + R.drawable.timer_active_conflict)); break; case Inactive: setState(state, Utils.getTimerStateDrawable(match, R.drawable.timer_inactive, R.drawable.timer_inactive_begin, - R.drawable.timer_inactive_end)); + R.drawable.timer_inactive_end, + R.drawable.timer_inactive)); break; case Recording: setState(state, Utils.getTimerStateDrawable(match, R.drawable.timer_recording, R.drawable.timer_recording_begin, - R.drawable.timer_recording_end)); + R.drawable.timer_recording_end, + R.drawable.timer_recording_conflict)); break; default: setState(state, R.drawable.timer_none); @@ -611,12 +615,14 @@ public class EpgDetailsActivity extends ICSBaseActivity implements res = Utils.getTimerStateDrawable(match, R.drawable.timer_inactive, R.drawable.timer_inactive_begin, - R.drawable.timer_inactive_end); + R.drawable.timer_inactive_end, + R.drawable.timer_inactive); } else if (state == TimerState.Inactive) { Utils.getTimerStateDrawable(match, R.drawable.timer_active, R.drawable.timer_active_begin, - R.drawable.timer_active_end); + R.drawable.timer_active_end, + R.drawable.timer_active_conflict); res = R.drawable.timer_active; } if (res != -1) { diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java index c95e759..8d2fca8 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java @@ -445,16 +445,18 @@ public class Utils { } public static int getTimerStateDrawable(final TimerMatch match, - final int full, final int begin, final int end) { - if (match == TimerMatch.Full) { - return full; - } - - if (match == TimerMatch.Begin) { - return begin; - } - - return end; + final int full, final int begin, final int end, final int conflict) { + + switch (match) { + case Begin: + return begin; + case End: + return end; + case Conflict: + return conflict; + default: + return full; + } } public static String formatAudio(final Context context, diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java index 4983745..1f55750 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/utils/svdrp/TimerClient.java @@ -19,9 +19,7 @@ public class TimerClient extends SvdrpClient<Timer> { /** * Constructor - * @param host host - * @param port port - * @param ssl use ssl + * @param certificateProblemListener CertificateProblemListener */ public TimerClient(final CertificateProblemListener certificateProblemListener) { super(certificateProblemListener); @@ -30,11 +28,10 @@ public class TimerClient extends SvdrpClient<Timer> { /** * Starts the EPG request - * @param parameter parameter for lste */ @Override public synchronized void run() { - runCommand("timers"); + runCommand("timers conflicts"); } @Override |