diff options
author | Sascha Woo <sascha.woo@gmail.com> | 2014-07-08 11:44:55 +0200 |
---|---|---|
committer | Sascha Woo <sascha.woo@gmail.com> | 2014-07-08 11:44:55 +0200 |
commit | 61f25494329314129f08dabfbd7afa5ad3a3edf2 (patch) | |
tree | f46d022f48c8785fe1004573305315164d6d2bd5 | |
parent | 202ad3ef6ee432eea485b87f46fa6029898dc5ff (diff) | |
parent | 196bb35ae533caf92a35b9ca860877a25e9a3d5d (diff) |
Merge pull request #4969 from xhaggi/pvr-refactor-setting-pvrplayback-startlast
[pvr] adjust labels and refactoring for setting 'pvrplayback.startlast'
-rwxr-xr-x | language/English/strings.po | 10 | ||||
-rw-r--r-- | system/settings/settings.xml | 11 | ||||
-rw-r--r-- | xbmc/pvr/PVRManager.cpp | 15 | ||||
-rw-r--r-- | xbmc/pvr/PVRManager.h | 14 | ||||
-rw-r--r-- | xbmc/settings/Settings.cpp | 2 |
5 files changed, 24 insertions, 28 deletions
diff --git a/language/English/strings.po b/language/English/strings.po index d386f688cb..17e8cb961a 100755 --- a/language/English/strings.po +++ b/language/English/strings.po @@ -8166,8 +8166,9 @@ msgctxt "#19189" msgid "Continue last channel on startup" msgstr "" +#: system/settings/settings.xml msgctxt "#19190" -msgid "Minimised" +msgid "Background" msgstr "" msgctxt "#19191" @@ -8595,7 +8596,12 @@ msgctxt "#19286" msgid "Searching for channel icons" msgstr "" -#empty strings from id 19287 to 19498 +#: system/settings/settings.xml +msgctxt "#19288" +msgid "Foreground" +msgstr "" + +#empty strings from id 19289 to 19498 #: xbmc/epg/Epg.cpp msgctxt "#19499" diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 7d1d51f27f..472256c4c5 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -1240,12 +1240,13 @@ </setting> <setting id="pvrplayback.startlast" type="integer" label="19189" help="36228"> <level>1</level> - <default>0</default> <!-- START_LAST_CHANNEL_OFF --> + <default>0</default> <!-- CONTINUE_LAST_CHANNEL_OFF --> <constraints> - <minimum>0</minimum> - <step>1</step> - <maximum>2</maximum> - <options>pvrstartlastchannel</options> + <options> + <option label="106">0</option> <!-- CONTINUE_LAST_CHANNEL_OFF --> + <option label="19190">1</option> <!-- CONTINUE_LAST_CHANNEL_IN_BACKGROUND --> + <option label="19288">2</option> <!-- CONTINUE_LAST_CHANNEL_IN_FOREGROUND --> + </options> </constraints> <control type="spinner" format="string" /> </setting> diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp index ac0de74e1f..b03bb61a7d 100644 --- a/xbmc/pvr/PVRManager.cpp +++ b/xbmc/pvr/PVRManager.cpp @@ -661,7 +661,7 @@ bool CPVRManager::ChannelUpDown(unsigned int *iNewChannelNumber, bool bPreview, bool CPVRManager::ContinueLastChannel(void) { - if (CSettings::Get().GetInt("pvrplayback.startlast") == START_LAST_CHANNEL_OFF) + if (CSettings::Get().GetInt("pvrplayback.startlast") == CONTINUE_LAST_CHANNEL_OFF) return false; CFileItemPtr channel = m_channelGroups->GetLastPlayedChannel(); @@ -669,7 +669,7 @@ bool CPVRManager::ContinueLastChannel(void) { CLog::Log(LOGNOTICE, "PVRManager - %s - continue playback on channel '%s'", __FUNCTION__, channel->GetPVRChannelInfoTag()->ChannelName().c_str()); SetPlayingGroup(m_channelGroups->GetLastPlayedGroup()); - StartPlayback(channel->GetPVRChannelInfoTag(), (CSettings::Get().GetInt("pvrplayback.startlast") == START_LAST_CHANNEL_MIN)); + StartPlayback(channel->GetPVRChannelInfoTag(), (CSettings::Get().GetInt("pvrplayback.startlast") == CONTINUE_LAST_CHANNEL_IN_BACKGROUND)); return true; } @@ -1143,9 +1143,9 @@ bool CPVRManager::UpdateItem(CFileItem& item) return false; } -bool CPVRManager::StartPlayback(const CPVRChannel *channel, bool bPreview /* = false */) +bool CPVRManager::StartPlayback(const CPVRChannel *channel, bool bMinimised /* = false */) { - CMediaSettings::Get().SetVideoStartWindowed(bPreview); + CMediaSettings::Get().SetVideoStartWindowed(bMinimised); CApplicationMessenger::Get().MediaPlay(CFileItem(*channel)); CLog::Log(LOGNOTICE, "PVRManager - %s - started playback on channel '%s'", __FUNCTION__, channel->ChannelName().c_str()); @@ -1544,13 +1544,6 @@ bool CPVRManager::OnAction(const CAction &action) return false; } -void CPVRManager::SettingOptionsPvrStartLastChannelFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data) -{ - list.push_back(make_pair(g_localizeStrings.Get(106), PVR::START_LAST_CHANNEL_OFF)); - list.push_back(make_pair(g_localizeStrings.Get(19190), PVR::START_LAST_CHANNEL_MIN)); - list.push_back(make_pair(g_localizeStrings.Get(107), PVR::START_LAST_CHANNEL_ON)); -} - bool CPVRChannelSwitchJob::DoWork(void) { // announce OnStop and delete m_previous when done diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h index 505bed6ab1..0d478881d8 100644 --- a/xbmc/pvr/PVRManager.h +++ b/xbmc/pvr/PVRManager.h @@ -70,11 +70,11 @@ namespace PVR PlaybackTypeRadio }; - enum ChannelStartLast + enum ContinueLastChannelOnStartup { - START_LAST_CHANNEL_OFF = 0, - START_LAST_CHANNEL_MIN, - START_LAST_CHANNEL_ON + CONTINUE_LAST_CHANNEL_OFF = 0, + CONTINUE_LAST_CHANNEL_IN_BACKGROUND, + CONTINUE_LAST_CHANNEL_IN_FOREGROUND }; #define g_PVRManager CPVRManager::Get() @@ -448,10 +448,10 @@ namespace PVR /*! * @brief Start playback on a channel. * @param channel The channel to start to play. - * @param bPreview If true, open minimised. + * @param bMinimised If true, playback starts minimised, otherwise in fullscreen. * @return True if playback was started, false otherwise. */ - bool StartPlayback(const CPVRChannel *channel, bool bPreview = false); + bool StartPlayback(const CPVRChannel *channel, bool bMinimised = false); /*! * @brief Start playback of the last used channel, and if it fails use first channel in the current channelgroup. @@ -552,8 +552,6 @@ namespace PVR */ bool OnAction(const CAction &action); - static void SettingOptionsPvrStartLastChannelFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t, void *data); - /*! * @brief Create EPG tags for all channels in internal channel groups * @return True if EPG tags where created successfully, false otherwise diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 512cb9b141..69f0518314 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -233,7 +233,6 @@ void CSettings::Uninitialize() m_settingsManager->UnregisterSettingOptionsFiller("fontheights"); m_settingsManager->UnregisterSettingOptionsFiller("fonts"); m_settingsManager->UnregisterSettingOptionsFiller("languages"); - m_settingsManager->UnregisterSettingOptionsFiller("pvrstartlastchannel"); m_settingsManager->UnregisterSettingOptionsFiller("refreshchangedelays"); m_settingsManager->UnregisterSettingOptionsFiller("refreshrates"); m_settingsManager->UnregisterSettingOptionsFiller("regions"); @@ -579,7 +578,6 @@ void CSettings::InitializeOptionFillers() m_settingsManager->RegisterSettingOptionsFiller("epgguideviews", PVR::CGUIWindowPVRGuide::SettingOptionsEpgGuideViewFiller); m_settingsManager->RegisterSettingOptionsFiller("fonts", GUIFontManager::SettingOptionsFontsFiller); m_settingsManager->RegisterSettingOptionsFiller("languages", CLangInfo::SettingOptionsLanguagesFiller); - m_settingsManager->RegisterSettingOptionsFiller("pvrstartlastchannel", PVR::CPVRManager::SettingOptionsPvrStartLastChannelFiller); m_settingsManager->RegisterSettingOptionsFiller("refreshchangedelays", CDisplaySettings::SettingOptionsRefreshChangeDelaysFiller); m_settingsManager->RegisterSettingOptionsFiller("refreshrates", CDisplaySettings::SettingOptionsRefreshRatesFiller); m_settingsManager->RegisterSettingOptionsFiller("regions", CLangInfo::SettingOptionsRegionsFiller); |