From ff1d14b6f0f37f76a0ed8685b616e0c13e3509e0 Mon Sep 17 00:00:00 2001 From: lado Date: Wed, 13 Jun 2012 12:49:25 +0200 Subject: switch to channel --- .../vdrmanager/gui/BaseEventListActivity.java | 6 ++++++ .../vdrmanager/gui/ChannelListActivity.java | 21 ++------------------- .../vdrmanager/gui/EpgDetailsActivity.java | 5 +++++ 3 files changed, 13 insertions(+), 19 deletions(-) (limited to 'vdrmanager') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java index 37b34d3..fce57f8 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java @@ -137,6 +137,12 @@ public abstract class BaseEventListActivity extends Utils.shareEvent(this, event); break; } + + case R.id.epg_item_menu_switchto: { + Utils.switchTo(this, event.getChannelId(), event.getChannelName()); + break; + } + default: return super.onContextItemSelected(item); } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java index f185932..6a6e5b2 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java @@ -371,25 +371,8 @@ public class ChannelListActivity extends break; case R.id.channel_item_menu_switch: - final String name = channel.getName(); - final SwitchChannelClient scc = new SwitchChannelClient(channel.getId()); - SvdrpAsyncTask task = new SvdrpAsyncTask(scc); - task.addListener(new SvdrpAsyncListener() { - public void svdrpEvent(SvdrpEvent event, String result) { - if(event == SvdrpEvent.FINISHED_SUCCESS){ - say(getString(R.string.switching_success, name)); - } else if(event == SvdrpEvent.CONNECT_ERROR || event == SvdrpEvent.FINISHED_ABNORMALY || event == SvdrpEvent.ABORTED || event == SvdrpEvent.ERROR || event == SvdrpEvent.CACHE_HIT){ - say(getString(R.string.switching_failed, name, event.name())); - } - - } - - public void svdrpException(SvdrpException e) { - Log.w(TAG, e.getMessage(), e); - say(e.getMessage()); - } - }); - task.run(); + Utils.switchTo(this, channel); + break; } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java index 6b957f5..2dea654 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java @@ -594,6 +594,11 @@ public class EpgDetailsActivity extends ICSBaseActivity implements OnClickListen intent.putExtra(SearchManager.QUERY, cEvent.getTitle()); startActivity(intent); return true; + } + + if(item.getItemId() == R.id.epg_details_menu_switch){ + Utils.switchTo(this, cEvent.getChannelId(), cEvent.getChannelName()); + return true; } return super.onOptionsItemSelected(item); } -- cgit v1.2.3