diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2015-12-18 14:13:39 +0100 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2015-12-18 14:13:39 +0100 |
commit | 5cd85cb42eb012543e34cfba7031733f0b433360 (patch) | |
tree | 3a6465f62a948937df7d19ef92cfc691cdbc7cd0 | |
parent | 7f55df5b6594a99006d963e977725dd95b463fe5 (diff) | |
parent | 6ebec9604645715b76d482ccc261c4c95fdc203f (diff) |
Merge pull request #8561 from ksooo/pvr-separate-timer-window
[PVR] Feature: Separate windows for "Timer Rules" and "Timers"
30 files changed, 690 insertions, 474 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj index b3d9da2c40..bd5abc4bab 100644 --- a/Kodi.xcodeproj/project.pbxproj +++ b/Kodi.xcodeproj/project.pbxproj @@ -141,6 +141,10 @@ 2A1A5A6C1BDEAA6D0084702D /* NOTE in Resources */ = {isa = PBXBuildFile; fileRef = 2A1A5A5D1BDEAA6D0084702D /* NOTE */; }; 2A7B2BDC1BD6F16600044BCD /* PVRSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A7B2BDB1BD6F16600044BCD /* PVRSettings.cpp */; }; 2A7B2BDD1BD6F16600044BCD /* PVRSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A7B2BDB1BD6F16600044BCD /* PVRSettings.cpp */; }; + 2AC7EB5A1C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7EB561C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp */; }; + 2AC7EB5B1C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7EB581C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp */; }; + 2AC7EB5C1C2330B300BDAA95 /* GUIWindowPVRTimerRules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7EB561C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp */; }; + 2AC7EB5D1C2330BC00BDAA95 /* GUIWindowPVRTimersBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC7EB581C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp */; }; 2F4564D51970129A00396109 /* GUIFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F4564D31970129A00396109 /* GUIFontCache.cpp */; }; 2F4564D61970129A00396109 /* GUIFontCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2F4564D31970129A00396109 /* GUIFontCache.cpp */; }; 32C631281423A90F00F18420 /* JpegIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 32C631261423A90F00F18420 /* JpegIO.cpp */; }; @@ -223,8 +227,8 @@ 39BD2AD91B845D40004A5A15 /* DialogHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39BD2AD71B845D40004A5A15 /* DialogHelper.cpp */; }; 39C38CCA1BBFF1EE000F59F5 /* InputCodingTableKorean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CC81BBFF1EE000F59F5 /* InputCodingTableKorean.cpp */; }; 39C38CCB1BBFF1EE000F59F5 /* InputCodingTableKorean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CC81BBFF1EE000F59F5 /* InputCodingTableKorean.cpp */; }; - 39C38CE11BCD600E000F59F5 /* FFmpegImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CDF1BCD600E000F59F5 /* FFmpegImage.cpp */; settings = {ASSET_TAGS = (); }; }; - 39C38CE21BCD600E000F59F5 /* FFmpegImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CDF1BCD600E000F59F5 /* FFmpegImage.cpp */; settings = {ASSET_TAGS = (); }; }; + 39C38CE11BCD600E000F59F5 /* FFmpegImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CDF1BCD600E000F59F5 /* FFmpegImage.cpp */; }; + 39C38CE21BCD600E000F59F5 /* FFmpegImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39C38CDF1BCD600E000F59F5 /* FFmpegImage.cpp */; }; 4260D5C71B67BB8F003F6F2D /* GUIWindowSplash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4260D5C51B67BB8F003F6F2D /* GUIWindowSplash.cpp */; }; 4260D5C81B67BB8F003F6F2D /* GUIWindowSplash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4260D5C51B67BB8F003F6F2D /* GUIWindowSplash.cpp */; }; 42DAC16E1A6E789E0066B4C8 /* PVRActionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 42DAC16C1A6E789E0066B4C8 /* PVRActionListener.cpp */; }; @@ -2521,6 +2525,10 @@ 2A1A5A6B1BDEAA6D0084702D /* xbmc_vis_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xbmc_vis_types.h; sourceTree = "<group>"; }; 2A7B2BDB1BD6F16600044BCD /* PVRSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PVRSettings.cpp; sourceTree = "<group>"; }; 2A7B2BDE1BD6F18B00044BCD /* PVRSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PVRSettings.h; sourceTree = "<group>"; }; + 2AC7EB561C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowPVRTimerRules.cpp; sourceTree = "<group>"; }; + 2AC7EB571C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowPVRTimerRules.h; sourceTree = "<group>"; }; + 2AC7EB581C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIWindowPVRTimersBase.cpp; sourceTree = "<group>"; }; + 2AC7EB591C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIWindowPVRTimersBase.h; sourceTree = "<group>"; }; 2F4564D31970129A00396109 /* GUIFontCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIFontCache.cpp; sourceTree = "<group>"; }; 2F4564D41970129A00396109 /* GUIFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIFontCache.h; sourceTree = "<group>"; }; 32C631261423A90F00F18420 /* JpegIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpegIO.cpp; sourceTree = "<group>"; }; @@ -6728,8 +6736,12 @@ C84828B9156CFCD8005A996F /* GUIWindowPVRRecordings.h */, C84828BA156CFCD8005A996F /* GUIWindowPVRSearch.cpp */, C84828BB156CFCD8005A996F /* GUIWindowPVRSearch.h */, + 2AC7EB561C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp */, + 2AC7EB571C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.h */, C84828BC156CFCD8005A996F /* GUIWindowPVRTimers.cpp */, C84828BD156CFCD8005A996F /* GUIWindowPVRTimers.h */, + 2AC7EB581C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp */, + 2AC7EB591C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.h */, ); path = windows; sourceTree = "<group>"; @@ -9573,6 +9585,7 @@ F5E56BA61082A675006E788A /* PosixMountProvider.cpp in Sources */, 7CAA25351085963B0096DE39 /* PasswordManager.cpp in Sources */, F599CD2B108E65370010EC2A /* IoSupport.cpp in Sources */, + 2AC7EB5A1C21F6BA00BDAA95 /* GUIWindowPVRTimerRules.cpp in Sources */, F599CD74108E6A7A0010EC2A /* DarwinStorageProvider.cpp in Sources */, E4A249F71095C880003D74C6 /* AutorunMediaJob.cpp in Sources */, F5A9D3091097C9370050490F /* AliasShortcutUtils.cpp in Sources */, @@ -10061,6 +10074,7 @@ 7C140992183224B8009F9411 /* SettingCategoryAccess.cpp in Sources */, 7C140995183224B8009F9411 /* SettingConditions.cpp in Sources */, 7C140998183224B8009F9411 /* SettingDependency.cpp in Sources */, + 2AC7EB5B1C21F6BA00BDAA95 /* GUIWindowPVRTimersBase.cpp in Sources */, 7C14099B183224B8009F9411 /* SettingRequirement.cpp in Sources */, 7C14099E183224B8009F9411 /* SettingSection.cpp in Sources */, 39C38CE11BCD600E000F59F5 /* FFmpegImage.cpp in Sources */, @@ -10670,6 +10684,7 @@ E4991323174E5DAD00741B6D /* JpegIO.cpp in Sources */, E4991325174E5DAD00741B6D /* LocalizeStrings.cpp in Sources */, 7C8E024A1BA35D0B0072E8B2 /* WeatherBuiltins.cpp in Sources */, + 2AC7EB5D1C2330BC00BDAA95 /* GUIWindowPVRTimersBase.cpp in Sources */, E4991326174E5DAD00741B6D /* MatrixGLES.cpp in Sources */, E4991327174E5DAD00741B6D /* Shader.cpp in Sources */, E4991328174E5DAD00741B6D /* Texture.cpp in Sources */, @@ -10771,6 +10786,7 @@ 3994425C1A8DD8D0006C39E9 /* ProgressJob.cpp in Sources */, E49913A9174E5F2100741B6D /* NetworkLinux.cpp in Sources */, E49913AA174E5F2100741B6D /* ZeroconfBrowserOSX.cpp in Sources */, + 2AC7EB5C1C2330B300BDAA95 /* GUIWindowPVRTimerRules.cpp in Sources */, E49913AB174E5F2100741B6D /* ZeroconfOSX.cpp in Sources */, E49913AC174E5F3300741B6D /* UPnP.cpp in Sources */, E49913AD174E5F3300741B6D /* UPnPInternal.cpp in Sources */, diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 55d0512518..aefb509e03 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -3600,11 +3600,7 @@ msgctxt "#841" msgid "Only this" msgstr "" -#. Label of the option to switch between hierarchical and flat timer view (in confluence sideblade). -#: skin.confluence -msgctxt "#842" -msgid "Group timers" -msgstr "" +#empty string with id 842 #. Label for a context menu entry to activate a currently inactive timer #: xbmc/pvr/windows/GUIWindowPVRTimers.cpp @@ -9046,7 +9042,11 @@ msgctxt "#19137" msgid "No groups defined. Please create a group first" msgstr "" -#empty string with id 19138 +#. Label of timer rules tv/radio home submenu item +#: skin.confluence +msgctxt "#19138" +msgid "Timer rules" +msgstr "" msgctxt "#19139" msgid "Name of the new group" diff --git a/addons/skin.confluence/720p/IncludesHomeMenuItems.xml b/addons/skin.confluence/720p/IncludesHomeMenuItems.xml index 30346dce9f..533635b046 100644 --- a/addons/skin.confluence/720p/IncludesHomeMenuItems.xml +++ b/addons/skin.confluence/720p/IncludesHomeMenuItems.xml @@ -268,15 +268,20 @@ </control> <control type="button" id="90146"> <include>ButtonHomeSubCommonValues</include> + <label>19138</label> + <onclick>ActivateWindow(TVTimerRules)</onclick> + </control> + <control type="button" id="90147"> + <include>ButtonHomeSubCommonValues</include> <label>19040</label> <onclick>ActivateWindow(TVTimers)</onclick> </control> - <control type="button" id="90147"> + <control type="button" id="90148"> <include>ButtonHomeSubCommonValues</include> <label>137</label> <onclick>ActivateWindow(TVSearch)</onclick> </control> - <control type="image" id="90148"> + <control type="image" id="90149"> <width>35</width> <height>35</height> <texture border="0,0,0,3">HomeSubEnd.png</texture> @@ -305,15 +310,20 @@ </control> <control type="button" id="90246"> <include>ButtonHomeSubCommonValues</include> + <label>19138</label> + <onclick>ActivateWindow(RadioTimerRules)</onclick> + </control> + <control type="button" id="90247"> + <include>ButtonHomeSubCommonValues</include> <label>19040</label> <onclick>ActivateWindow(RadioTimers)</onclick> </control> - <control type="button" id="90247"> + <control type="button" id="90248"> <include>ButtonHomeSubCommonValues</include> <label>137</label> <onclick>ActivateWindow(RadioSearch)</onclick> </control> - <control type="image" id="90248"> + <control type="image" id="90249"> <width>35</width> <height>35</height> <texture border="0,0,0,3">HomeSubEnd.png</texture> diff --git a/addons/skin.confluence/720p/IncludesPVR.xml b/addons/skin.confluence/720p/IncludesPVR.xml index 92bb15a85a..765451e54f 100644 --- a/addons/skin.confluence/720p/IncludesPVR.xml +++ b/addons/skin.confluence/720p/IncludesPVR.xml @@ -47,6 +47,11 @@ </control> <control type="label"> <include>WindowTitleCommons</include> + <label>[COLOR=blue] - [/COLOR]$LOCALIZE[19138]</label> + <visible>Window.IsActive(TVTimerRules) | Window.IsActive(RadioTimerRules)</visible> + </control> + <control type="label"> + <include>WindowTitleCommons</include> <label>[COLOR=blue] - [/COLOR]$LOCALIZE[19040]</label> <visible>Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)</visible> </control> @@ -123,6 +128,14 @@ <onclick condition="IsEmpty(Window.Property(IsRadio))">ActivateWindow(TVRecordings)</onclick> <onclick condition="!IsEmpty(Window.Property(IsRadio))">ActivateWindow(RadioRecordings)</onclick> </control> + <control type="button" id="105"> + <description>Timer Rules</description> + <textwidth>235</textwidth> + <include>ButtonCommonValues</include> + <label>19138</label> + <onclick condition="IsEmpty(Window.Property(IsRadio))">ActivateWindow(TVTimerRules)</onclick> + <onclick condition="!IsEmpty(Window.Property(IsRadio))">ActivateWindow(RadioTimerRules)</onclick> + </control> <control type="button" id="103"> <description>Timers</description> <textwidth>235</textwidth> @@ -217,18 +230,11 @@ <visible>Window.IsActive(TVRecordings) | Window.IsActive(RadioRecordings)</visible> </control> <control type="radiobutton" id="8"> - <description>Group timers</description> - <textwidth>235</textwidth> - <include>ButtonCommonValues</include> - <label>842</label> - <visible>Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)</visible> - </control> - <control type="radiobutton" id="9"> <description>Hide disabled timers</description> <textwidth>235</textwidth> <include>ButtonCommonValues</include> <label>19077</label> - <visible>Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)</visible> + <visible>Window.IsActive(TVTimers) | Window.IsActive(RadioTimers) | Window.IsActive(TVTimerRules) | Window.IsActive(RadioTimerRules)</visible> </control> <!-- Playback controls --> <include>CommonNowPlaying_Controls</include> diff --git a/addons/skin.confluence/720p/MyPVRTimers.xml b/addons/skin.confluence/720p/MyPVRTimers.xml index 87ca26bb81..e6ac977f3f 100644 --- a/addons/skin.confluence/720p/MyPVRTimers.xml +++ b/addons/skin.confluence/720p/MyPVRTimers.xml @@ -132,7 +132,8 @@ <height>330</height> <onup>50</onup> <ondown>50</ondown> - <onleft>103</onleft> + <onleft condition="Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)">103</onleft> + <onleft condition="Window.IsActive(TVTimerRules) | Window.IsActive(RadioTimerRules)">105</onleft> <onright>73</onright> <pagecontrol>73</pagecontrol> <scrolltime>200</scrolltime> @@ -323,7 +324,8 @@ <textureslidernib>ScrollBarNib.png</textureslidernib> <textureslidernibfocus>ScrollBarNib.png</textureslidernibfocus> <onleft>50</onleft> - <onright>103</onright> + <onright condition="Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)">103</onright> + <onright condition="Window.IsActive(TVTimerRules) | Window.IsActive(RadioTimerRules)">105</onright> <showonepage>false</showonepage> <orientation>vertical</orientation> </control> @@ -422,7 +424,24 @@ <control type="label"> <depth>DepthFooter</depth> <animation effect="slide" start="0,0" end="-90,0" time="0" condition="system.getbool(input.enablemouse)">Conditional</animation> - <description>Page Count Label</description> + <description>Page Count Label for Timer Rules</description> + <right>40</right> + <top>53r</top> + <width>500</width> + <height>20</height> + <font>font12</font> + <textcolor>grey</textcolor> + <scroll>false</scroll> + <align>right</align> + <aligny>center</aligny> + <label>([COLOR=blue]$INFO[Container(50).NumItems][/COLOR]) $LOCALIZE[19138] - $LOCALIZE[31024] ([COLOR=blue]$INFO[Container(50).CurrentPage]/$INFO[Container(50).NumPages][/COLOR])</label> + <visible>Window.IsActive(TVTimerRules) | Window.IsActive(RadioTimerRules)</visible> + <include>Window_OpenClose_Animation</include> + </control> + <control type="label"> + <depth>DepthFooter</depth> + <animation effect="slide" start="0,0" end="-90,0" time="0" condition="system.getbool(input.enablemouse)">Conditional</animation> + <description>Page Count Label for Timers</description> <right>40</right> <top>53r</top> <width>500</width> @@ -433,6 +452,7 @@ <align>right</align> <aligny>center</aligny> <label>([COLOR=blue]$INFO[Container(50).NumItems][/COLOR]) $LOCALIZE[19040] - $LOCALIZE[31024] ([COLOR=blue]$INFO[Container(50).CurrentPage]/$INFO[Container(50).NumPages][/COLOR])</label> + <visible>Window.IsActive(TVTimers) | Window.IsActive(RadioTimers)</visible> <include>Window_OpenClose_Animation</include> </control> </control> diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj index 567698cf30..115019e97a 100644 --- a/project/VS2010Express/XBMC.vcxproj +++ b/project/VS2010Express/XBMC.vcxproj @@ -817,7 +817,9 @@ <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRGuide.cpp" /> <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRRecordings.cpp" /> <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRSearch.cpp" /> + <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimerRules.cpp" /> <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimers.cpp" /> + <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimersBase.cpp" /> <ClCompile Include="..\..\xbmc\rendering\dx\GUIWindowTestPatternDX.cpp" /> <ClCompile Include="..\..\xbmc\rendering\dx\RenderSystemDX.cpp" /> <ClCompile Include="..\..\xbmc\rendering\RenderSystem.cpp" /> @@ -1130,6 +1132,8 @@ <ClInclude Include="..\..\xbmc\profiles\windows\GUIWindowSettingsProfile.h" /> <ClInclude Include="..\..\xbmc\pvr\PVRSettings.h" /> <ClInclude Include="..\..\xbmc\pvr\timers\PVRTimerType.h" /> + <ClInclude Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimerRules.h" /> + <ClInclude Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimersBase.h" /> <ClInclude Include="..\..\xbmc\settings\AudioDSPSettings.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPManager.h" /> <ClInclude Include="..\..\xbmc\settings\dialogs\GUIDialogAudioDSPSettings.h" /> diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters index bc00b36012..24f2691f34 100644 --- a/project/VS2010Express/XBMC.vcxproj.filters +++ b/project/VS2010Express/XBMC.vcxproj.filters @@ -3249,6 +3249,12 @@ <ClCompile Include="..\..\xbmc\guilib\FFmpegImage.cpp"> <Filter>guilib</Filter> </ClCompile> + <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimerRules.cpp"> + <Filter>pvr\windows</Filter> + </ClCompile> + <ClCompile Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimersBase.cpp"> + <Filter>pvr\windows</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\xbmc\win32\pch.h"> @@ -6291,6 +6297,12 @@ <ClInclude Include="..\..\xbmc\guilib\FFmpegImage.h"> <Filter>guilib</Filter> </ClInclude> + <ClInclude Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimerRules.h"> + <Filter>pvr\windows</Filter> + </ClInclude> + <ClInclude Include="..\..\xbmc\pvr\windows\GUIWindowPVRTimersBase.h"> + <Filter>pvr\windows</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc"> diff --git a/system/settings/settings.xml b/system/settings/settings.xml index 75823ca497..5cba545208 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -1628,10 +1628,6 @@ </category> <category id="pvrtimers" label="" help=""> <group id="1"> - <setting id="pvrtimers.timertypefilter" type="boolean" label="" help=""> - <level>4</level> - <default>true</default> - </setting> <setting id="pvrtimers.hidedisabledtimers" type="boolean" label="" help=""> <default>false</default> <level>4</level> diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp index 455feac391..76ff33fd10 100644 --- a/xbmc/guilib/GUIWindowManager.cpp +++ b/xbmc/guilib/GUIWindowManager.cpp @@ -120,6 +120,7 @@ #include "pvr/windows/GUIWindowPVRRecordings.h" #include "pvr/windows/GUIWindowPVRGuide.h" #include "pvr/windows/GUIWindowPVRTimers.h" +#include "pvr/windows/GUIWindowPVRTimerRules.h" #include "pvr/windows/GUIWindowPVRSearch.h" #include "pvr/dialogs/GUIDialogPVRChannelManager.h" #include "pvr/dialogs/GUIDialogPVRChannelsOSD.h" @@ -250,11 +251,13 @@ void CGUIWindowManager::CreateWindows() Add(new CGUIWindowPVRRecordings(false)); Add(new CGUIWindowPVRGuide(false)); Add(new CGUIWindowPVRTimers(false)); + Add(new CGUIWindowPVRTimerRules(false)); Add(new CGUIWindowPVRSearch(false)); Add(new CGUIWindowPVRChannels(true)); Add(new CGUIWindowPVRRecordings(true)); Add(new CGUIWindowPVRGuide(true)); Add(new CGUIWindowPVRTimers(true)); + Add(new CGUIWindowPVRTimerRules(true)); Add(new CGUIDialogPVRRadioRDSInfo); Add(new CGUIWindowPVRSearch(true)); Add(new CGUIDialogPVRGuideInfo); @@ -342,11 +345,13 @@ bool CGUIWindowManager::DestroyWindows() Delete(WINDOW_TV_RECORDINGS); Delete(WINDOW_TV_GUIDE); Delete(WINDOW_TV_TIMERS); + Delete(WINDOW_TV_TIMER_RULES); Delete(WINDOW_TV_SEARCH); Delete(WINDOW_RADIO_CHANNELS); Delete(WINDOW_RADIO_RECORDINGS); Delete(WINDOW_RADIO_GUIDE); Delete(WINDOW_RADIO_TIMERS); + Delete(WINDOW_RADIO_TIMER_RULES); Delete(WINDOW_RADIO_SEARCH); Delete(WINDOW_DIALOG_PVR_GUIDE_INFO); Delete(WINDOW_DIALOG_PVR_RECORDING_INFO); diff --git a/xbmc/guilib/WindowIDs.h b/xbmc/guilib/WindowIDs.h index 58d6ddb9b5..d50f24d6dc 100644 --- a/xbmc/guilib/WindowIDs.h +++ b/xbmc/guilib/WindowIDs.h @@ -137,6 +137,8 @@ #define WINDOW_RADIO_SEARCH 10624 #define WINDOW_FULLSCREEN_RADIO 10625 // virtual window for PVR radio specific keymaps with fallback to WINDOW_VISUALISATION #define WINDOW_DIALOG_PVR_RADIO_RDS_INFO 10626 +#define WINDOW_TV_TIMER_RULES 10627 +#define WINDOW_RADIO_TIMER_RULES 10628 //#define WINDOW_VIRTUAL_KEYBOARD 11000 // WINDOW_ID's from 11100 to 11199 reserved for Skins diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index 0efbddae58..a495d02ab9 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -393,7 +393,9 @@ static const ActionMapping windows[] = { "extendedprogressdialog" , WINDOW_DIALOG_EXT_PROGRESS }, { "mediafilter" , WINDOW_DIALOG_MEDIA_FILTER }, { "addon" , WINDOW_ADDON_START }, - { "eventlog" , WINDOW_EVENT_LOG} + { "eventlog" , WINDOW_EVENT_LOG}, + { "tvtimerrules" , WINDOW_TV_TIMER_RULES}, + { "radiotimerrules" , WINDOW_RADIO_TIMER_RULES} }; static const ActionMapping mousekeys[] = diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp index b35105aa79..18022f4e22 100644 --- a/xbmc/pvr/PVRManager.cpp +++ b/xbmc/pvr/PVRManager.cpp @@ -71,17 +71,19 @@ using namespace KODI::MESSAGING; using KODI::MESSAGING::HELPERS::DialogResponse; -int CPVRManager::m_pvrWindowIds[10] = { +int CPVRManager::m_pvrWindowIds[12] = { WINDOW_TV_CHANNELS, WINDOW_TV_GUIDE, WINDOW_TV_RECORDINGS, WINDOW_TV_SEARCH, WINDOW_TV_TIMERS, + WINDOW_TV_TIMER_RULES, WINDOW_RADIO_CHANNELS, WINDOW_RADIO_GUIDE, WINDOW_RADIO_RECORDINGS, WINDOW_RADIO_SEARCH, - WINDOW_RADIO_TIMERS + WINDOW_RADIO_TIMERS, + WINDOW_RADIO_TIMER_RULES }; CPVRManager::CPVRManager(void) : @@ -237,11 +239,13 @@ bool CPVRManager::IsPVRWindowActive(void) const g_windowManager.IsWindowActive(WINDOW_TV_GUIDE) || g_windowManager.IsWindowActive(WINDOW_TV_RECORDINGS) || g_windowManager.IsWindowActive(WINDOW_TV_TIMERS) || + g_windowManager.IsWindowActive(WINDOW_TV_TIMER_RULES) || g_windowManager.IsWindowActive(WINDOW_TV_SEARCH) || g_windowManager.IsWindowActive(WINDOW_RADIO_CHANNELS) || g_windowManager.IsWindowActive(WINDOW_RADIO_GUIDE) || g_windowManager.IsWindowActive(WINDOW_RADIO_RECORDINGS) || g_windowManager.IsWindowActive(WINDOW_RADIO_TIMERS) || + g_windowManager.IsWindowActive(WINDOW_RADIO_TIMER_RULES) || g_windowManager.IsWindowActive(WINDOW_RADIO_SEARCH) || g_windowManager.IsWindowActive(WINDOW_DIALOG_PVR_CHANNEL_MANAGER) || g_windowManager.IsWindowActive(WINDOW_DIALOG_PVR_OSD_CHANNELS) || @@ -260,11 +264,13 @@ bool CPVRManager::IsPVRWindow(int windowId) windowId == WINDOW_TV_RECORDINGS || windowId == WINDOW_TV_SEARCH || windowId == WINDOW_TV_TIMERS || + windowId == WINDOW_TV_TIMER_RULES || windowId == WINDOW_RADIO_CHANNELS || windowId == WINDOW_RADIO_GUIDE || windowId == WINDOW_RADIO_RECORDINGS || windowId == WINDOW_RADIO_SEARCH || - windowId == WINDOW_RADIO_TIMERS); + windowId == WINDOW_RADIO_TIMERS || + windowId == WINDOW_RADIO_TIMER_RULES); } bool CPVRManager::InstallAddonAllowed(const std::string& strAddonId) const diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h index 3824a6034e..6f6541f132 100644 --- a/xbmc/pvr/PVRManager.h +++ b/xbmc/pvr/PVRManager.h @@ -680,7 +680,7 @@ namespace PVR ManagerState m_managerState; CStopWatch *m_parentalTimer; std::vector<std::string> m_outdatedAddons; - static int m_pvrWindowIds[10]; + static int m_pvrWindowIds[12]; }; class CPVREpgsCreateJob : public CJob diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp index e26dda57e8..2b780095c5 100644 --- a/xbmc/pvr/timers/PVRTimers.cpp +++ b/xbmc/pvr/timers/PVRTimers.cpp @@ -412,8 +412,8 @@ bool CPVRTimers::GetRootDirectory(const CPVRTimersPath &path, CFileItemList &ite item->SetSpecialSort(SortSpecialOnTop); items.Add(item); - bool bRadio = path.IsRadio(); - bool bGrouped = path.IsGrouped(); + bool bRadio = path.IsRadio(); + bool bRules = path.IsRules(); bool bHideDisabled = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS); @@ -423,7 +423,7 @@ bool CPVRTimers::GetRootDirectory(const CPVRTimersPath &path, CFileItemList &ite for (const auto &timer : *tagsEntry.second) { if ((bRadio == timer->m_bIsRadio) && - (!bGrouped || (timer->m_iParentClientIndex == PVR_TIMER_NO_PARENT)) && + (bRules == timer->IsRepeating()) && (!bHideDisabled || (timer->m_state != PVR_TIMER_STATE_DISABLED))) { item.reset(new CFileItem(timer)); @@ -865,8 +865,8 @@ CPVRTimersPath::CPVRTimersPath(const std::string &strPath, int iClientId, unsign { /* set/replace client and parent id. */ m_path = StringUtils::Format("pvr://timers/%s/%s/%d/%d", - m_bRadio ? "radio" : "tv", - m_bGrouped ? "grouped" : "all", + m_bRadio ? "radio" : "tv", + m_bTimerRules ? "rules" : "timers", iClientId, iParentId); m_iClientId = iClientId; @@ -875,13 +875,13 @@ CPVRTimersPath::CPVRTimersPath(const std::string &strPath, int iClientId, unsign } } -CPVRTimersPath::CPVRTimersPath(bool bRadio, bool bGrouped) : +CPVRTimersPath::CPVRTimersPath(bool bRadio, bool bTimerRules) : m_path(StringUtils::Format( - "pvr://timers/%s/%s", bRadio ? "radio" : "tv", bGrouped ? "grouped" : "all")), + "pvr://timers/%s/%s", bRadio ? "radio" : "tv", bTimerRules ? "rules" : "timers")), m_bValid(true), m_bRoot(true), m_bRadio(bRadio), - m_bGrouped(bGrouped), + m_bTimerRules(bTimerRules), m_iClientId(-1), m_iParentId(0) { @@ -898,10 +898,10 @@ bool CPVRTimersPath::Init(const std::string &strPath) m_bValid = (((segments.size() == 4) || (segments.size() == 6)) && (segments.at(1) == "timers") && ((segments.at(2) == "radio") || (segments.at(2) == "tv"))&& - ((segments.at(3) == "grouped") || (segments.at(3) == "all"))); + ((segments.at(3) == "rules") || (segments.at(3) == "timers"))); m_bRoot = (m_bValid && (segments.size() == 4)); m_bRadio = (m_bValid && (segments.at(2) == "radio")); - m_bGrouped = (m_bValid && (segments.at(3) == "grouped")); + m_bTimerRules = (m_bValid && (segments.at(3) == "rules")); if (!m_bValid || m_bRoot) { diff --git a/xbmc/pvr/timers/PVRTimers.h b/xbmc/pvr/timers/PVRTimers.h index 7ba84183ee..03dd88d647 100644 --- a/xbmc/pvr/timers/PVRTimers.h +++ b/xbmc/pvr/timers/PVRTimers.h @@ -211,7 +211,7 @@ namespace PVR CPVRTimersPath(const std::string &strPath); CPVRTimersPath(const std::string &strPath, int iClientId, unsigned int iParentId); - CPVRTimersPath(bool bRadio, bool bGrouped); + CPVRTimersPath(bool bRadio, bool bTimerRules); bool IsValid() const { return m_bValid; } @@ -219,7 +219,7 @@ namespace PVR bool IsTimersRoot() const { return m_bRoot; } bool IsTimerSchedule() const { return !IsTimersRoot(); } bool IsRadio() const { return m_bRadio; } - bool IsGrouped() const { return m_bGrouped; } + bool IsRules() const { return m_bTimerRules; } int GetClientId() const { return m_iClientId; } unsigned int GetParentId() const { return m_iParentId; } @@ -230,7 +230,7 @@ namespace PVR bool m_bValid; bool m_bRoot; bool m_bRadio; - bool m_bGrouped; + bool m_bTimerRules; int m_iClientId; unsigned int m_iParentId; }; diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.h b/xbmc/pvr/windows/GUIWindowPVRBase.h index eae24e722e..4cdab99dd1 100644 --- a/xbmc/pvr/windows/GUIWindowPVRBase.h +++ b/xbmc/pvr/windows/GUIWindowPVRBase.h @@ -28,8 +28,7 @@ #define CONTROL_BTNGROUPITEMS 5 #define CONTROL_BTNSHOWHIDDEN 6 #define CONTROL_BTNSHOWDELETED 7 -#define CONTROL_BTNTIMERTYPEFILTER 8 -#define CONTROL_BTNHIDEDISABLEDTIMERS 9 +#define CONTROL_BTNHIDEDISABLEDTIMERS 8 #define CONTROL_BTNCHANNELGROUPS 28 #define CONTROL_BTNFILTERCHANNELS 31 @@ -85,7 +84,7 @@ namespace PVR protected: CGUIWindowPVRBase(bool bRadio, int id, const std::string &xmlFile); - virtual std::string GetDirectoryPath(void) { return ""; }; + virtual std::string GetDirectoryPath(void) = 0; virtual CPVRChannelGroupPtr GetGroup(void); virtual void SetGroup(CPVRChannelGroupPtr group); diff --git a/xbmc/pvr/windows/GUIWindowPVRChannels.h b/xbmc/pvr/windows/GUIWindowPVRChannels.h index 049e518394..94da6b6459 100644 --- a/xbmc/pvr/windows/GUIWindowPVRChannels.h +++ b/xbmc/pvr/windows/GUIWindowPVRChannels.h @@ -39,7 +39,7 @@ namespace PVR bool OnAction(const CAction &action); protected: - std::string GetDirectoryPath(void); + virtual std::string GetDirectoryPath(void) override; private: bool OnContextButtonAdd(CFileItem *item, CONTEXT_BUTTON button); diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.h b/xbmc/pvr/windows/GUIWindowPVRGuide.h index d06b636c89..1830f9eb67 100644 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.h +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.h @@ -45,6 +45,7 @@ namespace PVR protected: void UpdateSelectedItemPath(); + virtual std::string GetDirectoryPath(void) override { return ""; } virtual bool GetDirectory(const std::string &strDirectory, CFileItemList &items); private: diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.h b/xbmc/pvr/windows/GUIWindowPVRRecordings.h index 5ada74c539..41b62ac27d 100644 --- a/xbmc/pvr/windows/GUIWindowPVRRecordings.h +++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.h @@ -45,7 +45,7 @@ namespace PVR void ResetObservers(void); protected: - std::string GetDirectoryPath(void); + virtual std::string GetDirectoryPath(void) override; void OnPrepareFileItems(CFileItemList &items); private: diff --git a/xbmc/pvr/windows/GUIWindowPVRSearch.h b/xbmc/pvr/windows/GUIWindowPVRSearch.h index a7bd311c52..a401c2c28d 100644 --- a/xbmc/pvr/windows/GUIWindowPVRSearch.h +++ b/xbmc/pvr/windows/GUIWindowPVRSearch.h @@ -38,6 +38,7 @@ namespace PVR protected: void OnPrepareFileItems(CFileItemList &items); + virtual std::string GetDirectoryPath(void) override { return ""; } private: bool OnContextButtonClear(CFileItem *item, CONTEXT_BUTTON button); diff --git a/xbmc/pvr/windows/GUIWindowPVRTimerRules.cpp b/xbmc/pvr/windows/GUIWindowPVRTimerRules.cpp new file mode 100644 index 0000000000..6f90614fe3 --- /dev/null +++ b/xbmc/pvr/windows/GUIWindowPVRTimerRules.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2012-2013 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "utils/StringUtils.h" +#include "pvr/timers/PVRTimers.h" + +#include "GUIWindowPVRTimerRules.h" + +using namespace PVR; + +CGUIWindowPVRTimerRules::CGUIWindowPVRTimerRules(bool bRadio) : + CGUIWindowPVRTimersBase(bRadio, bRadio ? WINDOW_RADIO_TIMER_RULES : WINDOW_TV_TIMER_RULES, "MyPVRTimers.xml") +{ +} + +std::string CGUIWindowPVRTimerRules::GetDirectoryPath(void) +{ + const std::string basePath(CPVRTimersPath(m_bRadio, true).GetPath()); + return StringUtils::StartsWith(m_vecItems->GetPath(), basePath) ? m_vecItems->GetPath() : basePath; +} diff --git a/xbmc/pvr/windows/GUIWindowPVRTimerRules.h b/xbmc/pvr/windows/GUIWindowPVRTimerRules.h new file mode 100644 index 0000000000..49a4cef126 --- /dev/null +++ b/xbmc/pvr/windows/GUIWindowPVRTimerRules.h @@ -0,0 +1,37 @@ +#pragma once +/* + * Copyright (C) 2012-2013 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "GUIWindowPVRTimersBase.h" + +#include <string> + +namespace PVR +{ + class CGUIWindowPVRTimerRules : public CGUIWindowPVRTimersBase + { + public: + CGUIWindowPVRTimerRules(bool bRadio); + virtual ~CGUIWindowPVRTimerRules(void) {}; + + protected: + virtual std::string GetDirectoryPath(void) override; + }; +} diff --git a/xbmc/pvr/windows/GUIWindowPVRTimers.cpp b/xbmc/pvr/windows/GUIWindowPVRTimers.cpp index c7d050af2b..1765d34de5 100644 --- a/xbmc/pvr/windows/GUIWindowPVRTimers.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRTimers.cpp @@ -18,408 +18,20 @@ * */ -#include "ContextMenuManager.h" -#include "GUIInfoManager.h" -#include "dialogs/GUIDialogOK.h" -#include "dialogs/GUIDialogYesNo.h" -#include "guilib/GUIKeyboardFactory.h" -#include "guilib/GUIWindowManager.h" -#include "input/Key.h" -#include "settings/Settings.h" -#include "threads/SingleLock.h" #include "utils/StringUtils.h" -#include "utils/Variant.h" - -#include "pvr/PVRManager.h" -#include "pvr/dialogs/GUIDialogPVRTimerSettings.h" #include "pvr/timers/PVRTimers.h" -#include "pvr/addons/PVRClients.h" #include "GUIWindowPVRTimers.h" using namespace PVR; CGUIWindowPVRTimers::CGUIWindowPVRTimers(bool bRadio) : - CGUIWindowPVRBase(bRadio, bRadio ? WINDOW_RADIO_TIMERS : WINDOW_TV_TIMERS, "MyPVRTimers.xml") -{ -} - -void CGUIWindowPVRTimers::UnregisterObservers(void) -{ - CSingleLock lock(m_critSection); - if (g_PVRTimers) - g_PVRTimers->UnregisterObserver(this); - g_infoManager.UnregisterObserver(this); -} - -void CGUIWindowPVRTimers::ResetObservers(void) + CGUIWindowPVRTimersBase(bRadio, bRadio ? WINDOW_RADIO_TIMERS : WINDOW_TV_TIMERS, "MyPVRTimers.xml") { - CSingleLock lock(m_critSection); - UnregisterObservers(); - g_PVRTimers->RegisterObserver(this); - g_infoManager.RegisterObserver(this); } std::string CGUIWindowPVRTimers::GetDirectoryPath(void) { - const std::string basePath( - CPVRTimersPath(m_bRadio, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_TIMERTYPEFILTER)).GetPath()); + const std::string basePath(CPVRTimersPath(m_bRadio, false).GetPath()); return StringUtils::StartsWith(m_vecItems->GetPath(), basePath) ? m_vecItems->GetPath() : basePath; } - -void CGUIWindowPVRTimers::GetContextButtons(int itemNumber, CContextButtons &buttons) -{ - if (itemNumber < 0 || itemNumber >= m_vecItems->Size()) - return; - CFileItemPtr pItem = m_vecItems->Get(itemNumber); - - if (!URIUtils::PathEquals(pItem->GetPath(), CPVRTimersPath::PATH_ADDTIMER)) - { - CPVRTimerInfoTagPtr timer(pItem->GetPVRTimerInfoTag()); - if (timer) - { - if (timer->HasEpgInfoTag()) - buttons.Add(CONTEXT_BUTTON_INFO, 19047); /* Programme information */ - - CPVRTimerTypePtr timerType(timer->GetTimerType()); - if (timerType) - { - if (timerType->SupportsEnableDisable()) - { - if (timer->m_state == PVR_TIMER_STATE_DISABLED) - buttons.Add(CONTEXT_BUTTON_ACTIVATE, 843); /* Activate */ - else - buttons.Add(CONTEXT_BUTTON_ACTIVATE, 844); /* Deactivate */ - } - - if (!timerType->IsReadOnly()) - { - buttons.Add(CONTEXT_BUTTON_EDIT, 21450); /* Edit */ - - // As epg-based timers will get it's title from the epg tag, they should not be renamable. - if (timer->IsManual()) - buttons.Add(CONTEXT_BUTTON_RENAME, 118); /* Rename */ - - if (timer->IsRecording()) - buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19059); /* Stop recording */ - else - buttons.Add(CONTEXT_BUTTON_DELETE, 117); /* Delete */ - } - } - - if (g_PVRClients->HasMenuHooks(timer->m_iClientId, PVR_MENUHOOK_TIMER)) - buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195); /* PVR client specific action */ - } - } - - CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons); - CContextMenuManager::GetInstance().AddVisibleItems(pItem, buttons); -} - -bool CGUIWindowPVRTimers::OnAction(const CAction &action) -{ - if (action.GetID() == ACTION_PARENT_DIR || - action.GetID() == ACTION_NAV_BACK) - { - CPVRTimersPath path(m_vecItems->GetPath()); - if (path.IsValid() && path.IsTimerSchedule()) - { - m_currentFileItem.reset(); - GoParentFolder(); - return true; - } - } - return CGUIWindowPVRBase::OnAction(action); -} - -bool CGUIWindowPVRTimers::OnContextButton(int itemNumber, CONTEXT_BUTTON button) -{ - if (itemNumber < 0 || itemNumber >= m_vecItems->Size()) - return false; - CFileItemPtr pItem = m_vecItems->Get(itemNumber); - - return OnContextButtonActivate(pItem.get(), button) || - OnContextButtonAdd(pItem.get(), button) || - OnContextButtonDelete(pItem.get(), button) || - OnContextButtonStopRecord(pItem.get(), button) || - OnContextButtonEdit(pItem.get(), button) || - OnContextButtonRename(pItem.get(), button) || - OnContextButtonInfo(pItem.get(), button) || - CGUIWindowPVRBase::OnContextButton(itemNumber, button); -} - -bool CGUIWindowPVRTimers::Update(const std::string &strDirectory, bool updateFilterPath /* = true */) -{ - return CGUIWindowPVRBase::Update(strDirectory); -} - -void CGUIWindowPVRTimers::UpdateButtons(void) -{ - SET_CONTROL_SELECTED(GetID(), CONTROL_BTNTIMERTYPEFILTER, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_TIMERTYPEFILTER)); - SET_CONTROL_SELECTED(GetID(), CONTROL_BTNHIDEDISABLEDTIMERS, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS)); - - CGUIWindowPVRBase::UpdateButtons(); - - std::string strHeaderTitle; - if (m_currentFileItem && m_currentFileItem->HasPVRTimerInfoTag()) - { - CPVRTimerInfoTagPtr timer = m_currentFileItem->GetPVRTimerInfoTag(); - strHeaderTitle = timer->Title(); - } - - SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, strHeaderTitle); -} - -bool CGUIWindowPVRTimers::OnMessage(CGUIMessage &message) -{ - if (!IsValidMessage(message)) - return false; - - bool bReturn = false; - switch (message.GetMessage()) - { - case GUI_MSG_CLICKED: - if (message.GetSenderId() == m_viewControl.GetCurrentControl()) - { - int iItem = m_viewControl.GetSelectedItem(); - if (iItem >= 0 && iItem < m_vecItems->Size()) - { - bReturn = true; - switch (message.GetParam1()) - { - case ACTION_SHOW_INFO: - case ACTION_SELECT_ITEM: - case ACTION_MOUSE_LEFT_CLICK: - { - CFileItemPtr item(m_vecItems->Get(iItem)); - if (item->m_bIsFolder && (message.GetParam1() != ACTION_SHOW_INFO)) - { - m_currentFileItem = item; - bReturn = false; // folders are handled by base class - } - else - { - m_currentFileItem.reset(); - ActionShowTimer(item.get()); - } - break; - } - case ACTION_CONTEXT_MENU: - case ACTION_MOUSE_RIGHT_CLICK: - OnPopupMenu(iItem); - break; - case ACTION_DELETE_ITEM: - ActionDeleteTimer(m_vecItems->Get(iItem).get()); - break; - default: - bReturn = false; - break; - } - } - } - else if (message.GetSenderId() == CONTROL_BTNTIMERTYPEFILTER) - { - CSettings::GetInstance().ToggleBool(CSettings::SETTING_PVRTIMERS_TIMERTYPEFILTER); - CSettings::GetInstance().Save(); - Update(GetDirectoryPath()); - bReturn = true; - } - else if (message.GetSenderId() == CONTROL_BTNHIDEDISABLEDTIMERS) - { - CSettings::GetInstance().ToggleBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS); - CSettings::GetInstance().Save(); - Update(GetDirectoryPath()); - bReturn = true; - } - break; - case GUI_MSG_REFRESH_LIST: - switch(message.GetParam1()) - { - case ObservableMessageTimers: - case ObservableMessageEpg: - case ObservableMessageEpgContainer: - case ObservableMessageEpgActiveItem: - case ObservableMessageCurrentItem: - { - if (IsActive()) - SetInvalid(); - bReturn = true; - break; - } - case ObservableMessageTimersReset: - { - if (IsActive()) - Refresh(true); - bReturn = true; - break; - } - } - } - - return bReturn || CGUIWindowPVRBase::OnMessage(message); -} - -bool CGUIWindowPVRTimers::OnContextButtonActivate(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_ACTIVATE) - { - bReturn = true; - if (!item->HasPVRTimerInfoTag()) - return bReturn; - - CPVRTimerInfoTagPtr timer = item->GetPVRTimerInfoTag(); - if (timer->m_state == PVR_TIMER_STATE_DISABLED) - timer->m_state = PVR_TIMER_STATE_SCHEDULED; - else - timer->m_state = PVR_TIMER_STATE_DISABLED; - - g_PVRTimers->UpdateTimer(*item); - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonAdd(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_ADD) - bReturn = ShowNewTimerDialog(); - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonDelete(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_DELETE) - { - DeleteTimer(item); - bReturn = true; - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonStopRecord(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_STOP_RECORD) - { - StopRecordFile(item); - bReturn = true; - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonEdit(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_EDIT) - { - bReturn = true; - if (!item->HasPVRTimerInfoTag()) - return bReturn; - - if (ShowTimerSettings(item) && !item->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly()) - g_PVRTimers->UpdateTimer(*item); - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonRename(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_RENAME) - { - bReturn = true; - if (!item->HasPVRTimerInfoTag()) - return bReturn; - CPVRTimerInfoTagPtr timer = item->GetPVRTimerInfoTag(); - - std::string strNewName(timer->m_strTitle); - if (CGUIKeyboardFactory::ShowAndGetInput(strNewName, CVariant{g_localizeStrings.Get(19042)}, false)) - g_PVRTimers->RenameTimer(*item, strNewName); - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::OnContextButtonInfo(CFileItem *item, CONTEXT_BUTTON button) -{ - bool bReturn = false; - - if (button == CONTEXT_BUTTON_INFO) - { - ShowEPGInfo(item); - bReturn = true; - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::ActionDeleteTimer(CFileItem *item) -{ - bool bReturn = DeleteTimer(item); - - if (bReturn && (m_vecItems->GetObjectCount() == 0)) - { - /* go to the parent folder if we're in a subdirectory and just deleted the last item */ - CPVRTimersPath path(m_vecItems->GetPath()); - if (path.IsValid() && path.IsTimerSchedule()) - { - m_currentFileItem.reset(); - GoParentFolder(); - } - } - return bReturn; -} - -bool CGUIWindowPVRTimers::ActionShowTimer(CFileItem *item) -{ - bool bReturn = false; - - /* Check if "Add timer..." entry is pressed by OK, if yes - create a new timer and open settings dialog, otherwise - open settings for selected timer entry */ - if (URIUtils::PathEquals(item->GetPath(), CPVRTimersPath::PATH_ADDTIMER)) - { - bReturn = ShowNewTimerDialog(); - } - else - { - if (ShowTimerSettings(item) && !item->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly()) - { - /* Update timer on pvr backend */ - bReturn = g_PVRTimers->UpdateTimer(*item); - } - } - - return bReturn; -} - -bool CGUIWindowPVRTimers::ShowNewTimerDialog(void) -{ - bool bReturn(false); - - CPVRTimerInfoTagPtr newTimer(new CPVRTimerInfoTag(m_bRadio)); - CFileItem *newItem = new CFileItem(newTimer); - - if (ShowTimerSettings(newItem)) - { - /* Add timer to backend */ - bReturn = g_PVRTimers->AddTimer(newItem->GetPVRTimerInfoTag()); - } - - delete newItem; - - return bReturn; -} diff --git a/xbmc/pvr/windows/GUIWindowPVRTimers.h b/xbmc/pvr/windows/GUIWindowPVRTimers.h index e6dbd8a22c..8b0c157c9d 100644 --- a/xbmc/pvr/windows/GUIWindowPVRTimers.h +++ b/xbmc/pvr/windows/GUIWindowPVRTimers.h @@ -19,46 +19,19 @@ * */ -#include "GUIWindowPVRBase.h" +#include "GUIWindowPVRTimersBase.h" -#include <memory> - -class CFileItem; -typedef std::shared_ptr<CFileItem> CFileItemPtr; +#include <string> namespace PVR { - class CGUIWindowPVRTimers : public CGUIWindowPVRBase + class CGUIWindowPVRTimers : public CGUIWindowPVRTimersBase { public: CGUIWindowPVRTimers(bool bRadio); virtual ~CGUIWindowPVRTimers(void) {}; - bool OnMessage(CGUIMessage& message); - bool OnAction(const CAction &action); - void GetContextButtons(int itemNumber, CContextButtons &buttons); - bool OnContextButton(int itemNumber, CONTEXT_BUTTON button); - bool Update(const std::string &strDirectory, bool updateFilterPath = true); - void UpdateButtons(void); - void UnregisterObservers(void); - void ResetObservers(void); - protected: - std::string GetDirectoryPath(void); - - private: - bool ActionDeleteTimer(CFileItem *item); - bool ActionShowTimer(CFileItem *item); - bool ShowNewTimerDialog(void); - - bool OnContextButtonActivate(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonAdd(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonDelete(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonStopRecord(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonEdit(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonRename(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonInfo(CFileItem *item, CONTEXT_BUTTON button); - - CFileItemPtr m_currentFileItem; + virtual std::string GetDirectoryPath(void) override; }; } diff --git a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp new file mode 100644 index 0000000000..026332b170 --- /dev/null +++ b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2012-2013 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "ContextMenuManager.h" +#include "GUIInfoManager.h" +#include "dialogs/GUIDialogOK.h" +#include "dialogs/GUIDialogYesNo.h" +#include "guilib/GUIKeyboardFactory.h" +#include "guilib/GUIWindowManager.h" +#include "input/Key.h" +#include "settings/Settings.h" +#include "threads/SingleLock.h" +#include "utils/StringUtils.h" +#include "utils/Variant.h" + +#include "pvr/PVRManager.h" +#include "pvr/dialogs/GUIDialogPVRTimerSettings.h" +#include "pvr/timers/PVRTimers.h" +#include "pvr/addons/PVRClients.h" + +#include "GUIWindowPVRTimers.h" + +using namespace PVR; + +CGUIWindowPVRTimersBase::CGUIWindowPVRTimersBase(bool bRadio, int id, const std::string &xmlFile) : + CGUIWindowPVRBase(bRadio, id, xmlFile) +{ +} + +void CGUIWindowPVRTimersBase::UnregisterObservers(void) +{ + CSingleLock lock(m_critSection); + if (g_PVRTimers) + g_PVRTimers->UnregisterObserver(this); + g_infoManager.UnregisterObserver(this); +} + +void CGUIWindowPVRTimersBase::ResetObservers(void) +{ + CSingleLock lock(m_critSection); + UnregisterObservers(); + g_PVRTimers->RegisterObserver(this); + g_infoManager.RegisterObserver(this); +} + +void CGUIWindowPVRTimersBase::GetContextButtons(int itemNumber, CContextButtons &buttons) +{ + if (itemNumber < 0 || itemNumber >= m_vecItems->Size()) + return; + CFileItemPtr pItem = m_vecItems->Get(itemNumber); + + if (!URIUtils::PathEquals(pItem->GetPath(), CPVRTimersPath::PATH_ADDTIMER)) + { + CPVRTimerInfoTagPtr timer(pItem->GetPVRTimerInfoTag()); + if (timer) + { + if (timer->HasEpgInfoTag()) + buttons.Add(CONTEXT_BUTTON_INFO, 19047); /* Programme information */ + + CPVRTimerTypePtr timerType(timer->GetTimerType()); + if (timerType) + { + if (timerType->SupportsEnableDisable()) + { + if (timer->m_state == PVR_TIMER_STATE_DISABLED) + buttons.Add(CONTEXT_BUTTON_ACTIVATE, 843); /* Activate */ + else + buttons.Add(CONTEXT_BUTTON_ACTIVATE, 844); /* Deactivate */ + } + + if (!timerType->IsReadOnly()) + { + buttons.Add(CONTEXT_BUTTON_EDIT, 21450); /* Edit */ + + // As epg-based timers will get it's title from the epg tag, they should not be renamable. + if (timer->IsManual()) + buttons.Add(CONTEXT_BUTTON_RENAME, 118); /* Rename */ + + if (timer->IsRecording()) + buttons.Add(CONTEXT_BUTTON_STOP_RECORD, 19059); /* Stop recording */ + else + buttons.Add(CONTEXT_BUTTON_DELETE, 117); /* Delete */ + } + } + + if (g_PVRClients->HasMenuHooks(timer->m_iClientId, PVR_MENUHOOK_TIMER)) + buttons.Add(CONTEXT_BUTTON_MENU_HOOKS, 19195); /* PVR client specific action */ + } + } + + CGUIWindowPVRBase::GetContextButtons(itemNumber, buttons); + CContextMenuManager::GetInstance().AddVisibleItems(pItem, buttons); +} + +bool CGUIWindowPVRTimersBase::OnAction(const CAction &action) +{ + if (action.GetID() == ACTION_PARENT_DIR || + action.GetID() == ACTION_NAV_BACK) + { + CPVRTimersPath path(m_vecItems->GetPath()); + if (path.IsValid() && path.IsTimerSchedule()) + { + m_currentFileItem.reset(); + GoParentFolder(); + return true; + } + } + return CGUIWindowPVRBase::OnAction(action); +} + +bool CGUIWindowPVRTimersBase::OnContextButton(int itemNumber, CONTEXT_BUTTON button) +{ + if (itemNumber < 0 || itemNumber >= m_vecItems->Size()) + return false; + CFileItemPtr pItem = m_vecItems->Get(itemNumber); + + return OnContextButtonActivate(pItem.get(), button) || + OnContextButtonAdd(pItem.get(), button) || + OnContextButtonDelete(pItem.get(), button) || + OnContextButtonStopRecord(pItem.get(), button) || + OnContextButtonEdit(pItem.get(), button) || + OnContextButtonRename(pItem.get(), button) || + OnContextButtonInfo(pItem.get(), button) || + CGUIWindowPVRBase::OnContextButton(itemNumber, button); +} + +bool CGUIWindowPVRTimersBase::Update(const std::string &strDirectory, bool updateFilterPath /* = true */) +{ + return CGUIWindowPVRBase::Update(strDirectory); +} + +void CGUIWindowPVRTimersBase::UpdateButtons(void) +{ + SET_CONTROL_SELECTED(GetID(), CONTROL_BTNHIDEDISABLEDTIMERS, CSettings::GetInstance().GetBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS)); + + CGUIWindowPVRBase::UpdateButtons(); + + std::string strHeaderTitle; + if (m_currentFileItem && m_currentFileItem->HasPVRTimerInfoTag()) + { + CPVRTimerInfoTagPtr timer = m_currentFileItem->GetPVRTimerInfoTag(); + strHeaderTitle = timer->Title(); + } + + SET_CONTROL_LABEL(CONTROL_LABEL_HEADER1, strHeaderTitle); +} + +bool CGUIWindowPVRTimersBase::OnMessage(CGUIMessage &message) +{ + if (!IsValidMessage(message)) + return false; + + bool bReturn = false; + switch (message.GetMessage()) + { + case GUI_MSG_CLICKED: + if (message.GetSenderId() == m_viewControl.GetCurrentControl()) + { + int iItem = m_viewControl.GetSelectedItem(); + if (iItem >= 0 && iItem < m_vecItems->Size()) + { + bReturn = true; + switch (message.GetParam1()) + { + case ACTION_SHOW_INFO: + case ACTION_SELECT_ITEM: + case ACTION_MOUSE_LEFT_CLICK: + { + CFileItemPtr item(m_vecItems->Get(iItem)); + if (item->m_bIsFolder && (message.GetParam1() != ACTION_SHOW_INFO)) + { + m_currentFileItem = item; + bReturn = false; // folders are handled by base class + } + else + { + m_currentFileItem.reset(); + ActionShowTimer(item.get()); + } + break; + } + case ACTION_CONTEXT_MENU: + case ACTION_MOUSE_RIGHT_CLICK: + OnPopupMenu(iItem); + break; + case ACTION_DELETE_ITEM: + ActionDeleteTimer(m_vecItems->Get(iItem).get()); + break; + default: + bReturn = false; + break; + } + } + } + else if (message.GetSenderId() == CONTROL_BTNHIDEDISABLEDTIMERS) + { + CSettings::GetInstance().ToggleBool(CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS); + CSettings::GetInstance().Save(); + Update(GetDirectoryPath()); + bReturn = true; + } + break; + case GUI_MSG_REFRESH_LIST: + switch(message.GetParam1()) + { + case ObservableMessageTimers: + case ObservableMessageEpg: + case ObservableMessageEpgContainer: + case ObservableMessageEpgActiveItem: + case ObservableMessageCurrentItem: + { + if (IsActive()) + SetInvalid(); + bReturn = true; + break; + } + case ObservableMessageTimersReset: + { + if (IsActive()) + Refresh(true); + bReturn = true; + break; + } + } + } + + return bReturn || CGUIWindowPVRBase::OnMessage(message); +} + +bool CGUIWindowPVRTimersBase::OnContextButtonActivate(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_ACTIVATE) + { + bReturn = true; + if (!item->HasPVRTimerInfoTag()) + return bReturn; + + CPVRTimerInfoTagPtr timer = item->GetPVRTimerInfoTag(); + if (timer->m_state == PVR_TIMER_STATE_DISABLED) + timer->m_state = PVR_TIMER_STATE_SCHEDULED; + else + timer->m_state = PVR_TIMER_STATE_DISABLED; + + g_PVRTimers->UpdateTimer(*item); + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonAdd(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_ADD) + bReturn = ShowNewTimerDialog(); + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonDelete(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_DELETE) + { + DeleteTimer(item); + bReturn = true; + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonStopRecord(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_STOP_RECORD) + { + StopRecordFile(item); + bReturn = true; + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonEdit(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_EDIT) + { + bReturn = true; + if (!item->HasPVRTimerInfoTag()) + return bReturn; + + if (ShowTimerSettings(item) && !item->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly()) + g_PVRTimers->UpdateTimer(*item); + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonRename(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_RENAME) + { + bReturn = true; + if (!item->HasPVRTimerInfoTag()) + return bReturn; + CPVRTimerInfoTagPtr timer = item->GetPVRTimerInfoTag(); + + std::string strNewName(timer->m_strTitle); + if (CGUIKeyboardFactory::ShowAndGetInput(strNewName, CVariant{g_localizeStrings.Get(19042)}, false)) + g_PVRTimers->RenameTimer(*item, strNewName); + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::OnContextButtonInfo(CFileItem *item, CONTEXT_BUTTON button) +{ + bool bReturn = false; + + if (button == CONTEXT_BUTTON_INFO) + { + ShowEPGInfo(item); + bReturn = true; + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::ActionDeleteTimer(CFileItem *item) +{ + bool bReturn = DeleteTimer(item); + + if (bReturn && (m_vecItems->GetObjectCount() == 0)) + { + /* go to the parent folder if we're in a subdirectory and just deleted the last item */ + CPVRTimersPath path(m_vecItems->GetPath()); + if (path.IsValid() && path.IsTimerSchedule()) + { + m_currentFileItem.reset(); + GoParentFolder(); + } + } + return bReturn; +} + +bool CGUIWindowPVRTimersBase::ActionShowTimer(CFileItem *item) +{ + bool bReturn = false; + + /* Check if "Add timer..." entry is pressed by OK, if yes + create a new timer and open settings dialog, otherwise + open settings for selected timer entry */ + if (URIUtils::PathEquals(item->GetPath(), CPVRTimersPath::PATH_ADDTIMER)) + { + bReturn = ShowNewTimerDialog(); + } + else + { + if (ShowTimerSettings(item) && !item->GetPVRTimerInfoTag()->GetTimerType()->IsReadOnly()) + { + /* Update timer on pvr backend */ + bReturn = g_PVRTimers->UpdateTimer(*item); + } + } + + return bReturn; +} + +bool CGUIWindowPVRTimersBase::ShowNewTimerDialog(void) +{ + bool bReturn(false); + + CPVRTimerInfoTagPtr newTimer(new CPVRTimerInfoTag(m_bRadio)); + CFileItem *newItem = new CFileItem(newTimer); + + if (ShowTimerSettings(newItem)) + { + /* Add timer to backend */ + bReturn = g_PVRTimers->AddTimer(newItem->GetPVRTimerInfoTag()); + } + + delete newItem; + + return bReturn; +} diff --git a/xbmc/pvr/windows/GUIWindowPVRTimersBase.h b/xbmc/pvr/windows/GUIWindowPVRTimersBase.h new file mode 100644 index 0000000000..25cc70526f --- /dev/null +++ b/xbmc/pvr/windows/GUIWindowPVRTimersBase.h @@ -0,0 +1,61 @@ +#pragma once +/* + * Copyright (C) 2012-2013 Team XBMC + * http://xbmc.org + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with XBMC; see the file COPYING. If not, see + * <http://www.gnu.org/licenses/>. + * + */ + +#include "GUIWindowPVRBase.h" + +#include <memory> + +class CFileItem; +typedef std::shared_ptr<CFileItem> CFileItemPtr; + +namespace PVR +{ + class CGUIWindowPVRTimersBase : public CGUIWindowPVRBase + { + public: + CGUIWindowPVRTimersBase(bool bRadio, int id, const std::string &xmlFile); + virtual ~CGUIWindowPVRTimersBase(void) {}; + + bool OnMessage(CGUIMessage& message); + bool OnAction(const CAction &action); + void GetContextButtons(int itemNumber, CContextButtons &buttons); + bool OnContextButton(int itemNumber, CONTEXT_BUTTON button); + bool Update(const std::string &strDirectory, bool updateFilterPath = true); + void UpdateButtons(void); + void UnregisterObservers(void); + void ResetObservers(void); + + private: + bool ActionDeleteTimer(CFileItem *item); + bool ActionShowTimer(CFileItem *item); + bool ShowNewTimerDialog(void); + + bool OnContextButtonActivate(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonAdd(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonDelete(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonStopRecord(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonEdit(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonRename(CFileItem *item, CONTEXT_BUTTON button); + bool OnContextButtonInfo(CFileItem *item, CONTEXT_BUTTON button); + + CFileItemPtr m_currentFileItem; + }; +} diff --git a/xbmc/pvr/windows/Makefile b/xbmc/pvr/windows/Makefile index 386734ba89..49a3537a77 100644 --- a/xbmc/pvr/windows/Makefile +++ b/xbmc/pvr/windows/Makefile @@ -4,7 +4,9 @@ SRCS=GUIViewStatePVR.cpp \ GUIWindowPVRGuide.cpp \ GUIWindowPVRRecordings.cpp \ GUIWindowPVRSearch.cpp \ - GUIWindowPVRTimers.cpp + GUIWindowPVRTimersBase.cpp \ + GUIWindowPVRTimers.cpp \ + GUIWindowPVRTimerRules.cpp LIB=pvrwindows.a diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp index 39e3c1f364..f3b96af5e8 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -258,7 +258,6 @@ const std::string CSettings::SETTING_PVRPARENTAL_ENABLED = "pvrparental.enabled" const std::string CSettings::SETTING_PVRPARENTAL_PIN = "pvrparental.pin"; const std::string CSettings::SETTING_PVRPARENTAL_DURATION = "pvrparental.duration"; const std::string CSettings::SETTING_PVRCLIENT_MENUHOOK = "pvrclient.menuhook"; -const std::string CSettings::SETTING_PVRTIMERS_TIMERTYPEFILTER = "pvrtimers.timertypefilter"; const std::string CSettings::SETTING_PVRTIMERS_HIDEDISABLEDTIMERS = "pvrtimers.hidedisabledtimers"; const std::string CSettings::SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS = "musiclibrary.showcompilationartists"; const std::string CSettings::SETTING_MUSICLIBRARY_DOWNLOADINFO = "musiclibrary.downloadinfo"; diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index db107161ce..cd97cb9c55 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -215,7 +215,6 @@ public: static const std::string SETTING_PVRPARENTAL_PIN; static const std::string SETTING_PVRPARENTAL_DURATION; static const std::string SETTING_PVRCLIENT_MENUHOOK; - static const std::string SETTING_PVRTIMERS_TIMERTYPEFILTER; static const std::string SETTING_PVRTIMERS_HIDEDISABLEDTIMERS; static const std::string SETTING_MUSICLIBRARY_SHOWCOMPILATIONARTISTS; static const std::string SETTING_MUSICLIBRARY_DOWNLOADINFO; diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp index b3690669b2..220c292ec7 100644 --- a/xbmc/view/GUIViewState.cpp +++ b/xbmc/view/GUIViewState.cpp @@ -145,6 +145,9 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it if (windowId == WINDOW_TV_TIMERS) return new CGUIViewStateWindowPVRTimers(windowId, items); + if (windowId == WINDOW_TV_TIMER_RULES) + return new CGUIViewStateWindowPVRTimers(windowId, items); + if (windowId == WINDOW_TV_SEARCH) return new CGUIViewStateWindowPVRSearch(windowId, items); @@ -160,6 +163,9 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it if (windowId == WINDOW_RADIO_TIMERS) return new CGUIViewStateWindowPVRTimers(windowId, items); + if (windowId == WINDOW_RADIO_TIMER_RULES) + return new CGUIViewStateWindowPVRTimers(windowId, items); + if (windowId == WINDOW_RADIO_SEARCH) return new CGUIViewStateWindowPVRSearch(windowId, items); |