aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Brown <garbearucla@gmail.com>2013-09-12 13:57:12 -0700
committerGarrett Brown <themagnificentmrb@gmail.com>2016-12-01 18:08:30 -0800
commit07ddecd1118d645673e73554520fdb51fda48e63 (patch)
treec202b8bfde077145a932a477de43f9187d28bc98
parent5a3be439dad1ee32d79b2c4fdd85782ee67254df (diff)
[retroplayer] MyGames window
-rw-r--r--Kodi.xcodeproj/project.pbxproj24
-rw-r--r--Makefile.in1
-rw-r--r--addons/resource.language.en_gb/resources/strings.po6
-rw-r--r--addons/skin.estuary/extras/home-images/games.jpgbin0 -> 164999 bytes
-rw-r--r--addons/skin.estuary/language/resource.language.en_gb/strings.po7
-rw-r--r--addons/skin.estuary/media/icons/sidemenu/games.pngbin0 -> 4794 bytes
-rw-r--r--addons/skin.estuary/xml/Custom_1100_AddonLauncher.xml18
-rw-r--r--addons/skin.estuary/xml/Home.xml46
-rw-r--r--addons/skin.estuary/xml/MyGames.xml84
-rw-r--r--addons/skin.estuary/xml/Settings.xml1
-rw-r--r--addons/skin.estuary/xml/SkinSettings.xml7
-rw-r--r--addons/skin.estuary/xml/VideoOSD.xml2
-rw-r--r--addons/skin.estuary/xml/View_50_List.xml2
-rw-r--r--project/cmake/treedata/common/games.txt1
-rw-r--r--xbmc/GUIPassword.cpp11
-rw-r--r--xbmc/dialogs/GUIDialogMediaSource.cpp8
-rw-r--r--xbmc/games/windows/CMakeLists.txt7
-rw-r--r--xbmc/games/windows/GUIViewStateWindowGames.cpp128
-rw-r--r--xbmc/games/windows/GUIViewStateWindowGames.h40
-rw-r--r--xbmc/games/windows/GUIWindowGames.cpp335
-rw-r--r--xbmc/games/windows/GUIWindowGames.h54
-rw-r--r--xbmc/games/windows/Makefile7
-rw-r--r--xbmc/guilib/GUIWindowManager.cpp3
-rw-r--r--xbmc/input/ButtonTranslator.cpp1
-rw-r--r--xbmc/profiles/Profile.cpp3
-rw-r--r--xbmc/profiles/Profile.h2
-rw-r--r--xbmc/settings/MediaSourceSettings.cpp5
-rw-r--r--xbmc/settings/MediaSourceSettings.h1
-rw-r--r--xbmc/view/GUIViewState.cpp6
-rw-r--r--xbmc/view/ViewStateSettings.cpp1
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp4
31 files changed, 808 insertions, 7 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj
index 7ca98c7295..3532efb69a 100644
--- a/Kodi.xcodeproj/project.pbxproj
+++ b/Kodi.xcodeproj/project.pbxproj
@@ -325,6 +325,10 @@
6890C27C1DDBDFD900F8F362 /* RetroPlayerAudio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2721DDBDFD900F8F362 /* RetroPlayerAudio.cpp */; };
6890C27D1DDBDFD900F8F362 /* RetroPlayerVideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2751DDBDFD900F8F362 /* RetroPlayerVideo.cpp */; };
6890C27E1DDBDFD900F8F362 /* RetroPlayerVideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2751DDBDFD900F8F362 /* RetroPlayerVideo.cpp */; };
+ 6890C2841DDBE03900F8F362 /* GUIViewStateWindowGames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2801DDBE03900F8F362 /* GUIViewStateWindowGames.cpp */; };
+ 6890C2851DDBE03900F8F362 /* GUIViewStateWindowGames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2801DDBE03900F8F362 /* GUIViewStateWindowGames.cpp */; };
+ 6890C2861DDBE03900F8F362 /* GUIWindowGames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2821DDBE03900F8F362 /* GUIWindowGames.cpp */; };
+ 6890C2871DDBE03900F8F362 /* GUIWindowGames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6890C2821DDBE03900F8F362 /* GUIWindowGames.cpp */; };
68AE5BA51C92412900C4D527 /* AddonCallbacksPeripheral.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 68AE5BA31C92412900C4D527 /* AddonCallbacksPeripheral.cpp */; };
68AE5BA61C92412900C4D527 /* AddonCallbacksPeripheral.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 68AE5BA31C92412900C4D527 /* AddonCallbacksPeripheral.cpp */; };
68AE5BBD1C9241DF00C4D527 /* DefaultJoystick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 68AE5BAC1C9241DF00C4D527 /* DefaultJoystick.cpp */; };
@@ -2937,6 +2941,10 @@
6890C2741DDBDFD900F8F362 /* RetroPlayerDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RetroPlayerDefines.h; path = RetroPlayer/RetroPlayerDefines.h; sourceTree = "<group>"; };
6890C2751DDBDFD900F8F362 /* RetroPlayerVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RetroPlayerVideo.cpp; path = RetroPlayer/RetroPlayerVideo.cpp; sourceTree = "<group>"; };
6890C2761DDBDFD900F8F362 /* RetroPlayerVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RetroPlayerVideo.h; path = RetroPlayer/RetroPlayerVideo.h; sourceTree = "<group>"; };
+ 6890C2801DDBE03900F8F362 /* GUIViewStateWindowGames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GUIViewStateWindowGames.cpp; path = games/windows/GUIViewStateWindowGames.cpp; sourceTree = "<group>"; };
+ 6890C2811DDBE03900F8F362 /* GUIViewStateWindowGames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GUIViewStateWindowGames.h; path = games/windows/GUIViewStateWindowGames.h; sourceTree = "<group>"; };
+ 6890C2821DDBE03900F8F362 /* GUIWindowGames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GUIWindowGames.cpp; path = games/windows/GUIWindowGames.cpp; sourceTree = "<group>"; };
+ 6890C2831DDBE03900F8F362 /* GUIWindowGames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GUIWindowGames.h; path = games/windows/GUIWindowGames.h; sourceTree = "<group>"; };
68AE5BA01C923E5300C4D527 /* kodi_vfs_utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = kodi_vfs_utils.hpp; path = "kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp"; sourceTree = "<group>"; };
68AE5BA31C92412900C4D527 /* AddonCallbacksPeripheral.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddonCallbacksPeripheral.cpp; path = addons/binary/interfaces/api1/Peripheral/AddonCallbacksPeripheral.cpp; sourceTree = "<group>"; };
68AE5BA41C92412900C4D527 /* AddonCallbacksPeripheral.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddonCallbacksPeripheral.h; path = addons/binary/interfaces/api1/Peripheral/AddonCallbacksPeripheral.h; sourceTree = "<group>"; };
@@ -6478,6 +6486,17 @@
name = RetroPlayer;
sourceTree = "<group>";
};
+ 6890C27F1DDBE01C00F8F362 /* windows */ = {
+ isa = PBXGroup;
+ children = (
+ 6890C2801DDBE03900F8F362 /* GUIViewStateWindowGames.cpp */,
+ 6890C2811DDBE03900F8F362 /* GUIViewStateWindowGames.h */,
+ 6890C2821DDBE03900F8F362 /* GUIWindowGames.cpp */,
+ 6890C2831DDBE03900F8F362 /* GUIWindowGames.h */,
+ );
+ name = windows;
+ sourceTree = "<group>";
+ };
68AE5BA21C92410300C4D527 /* Peripheral */ = {
isa = PBXGroup;
children = (
@@ -6564,6 +6583,7 @@
6890C2311DDBDD3500F8F362 /* dialogs */,
6890C23A1DDBDD4E00F8F362 /* ports */,
68D77D141CD1C6C7004C1735 /* tags */,
+ 6890C27F1DDBE01C00F8F362 /* windows */,
68D77CFD1CD1C5E4004C1735 /* GameSettings.cpp */,
68D77CFE1CD1C5E4004C1735 /* GameSettings.h */,
6890C22C1DDBDD2D00F8F362 /* GameTypes.h */,
@@ -10198,6 +10218,7 @@
68AE5C1D1C92438E00C4D527 /* GUIFeatureButton.cpp in Sources */,
E38E1F9D0D25F9FD00618676 /* DVDInputStreamMemory.cpp in Sources */,
E38E1F9E0D25F9FD00618676 /* DVDInputStreamNavigator.cpp in Sources */,
+ 6890C2861DDBE03900F8F362 /* GUIWindowGames.cpp in Sources */,
E38E1F9F0D25F9FD00618676 /* DVDStateSerializer.cpp in Sources */,
E38E1FA10D25F9FD00618676 /* DVDMessage.cpp in Sources */,
E38E1FA20D25F9FD00618676 /* DVDMessageQueue.cpp in Sources */,
@@ -10992,6 +11013,7 @@
36A95DA51624894400727135 /* GUIDialogMediaFilter.cpp in Sources */,
7CC30DB116291A5C003E7579 /* MusicThumbLoader.cpp in Sources */,
7CC30DC016291C2C003E7579 /* VideoThumbLoader.cpp in Sources */,
+ 6890C2841DDBE03900F8F362 /* GUIViewStateWindowGames.cpp in Sources */,
DF00492D162DAEA200A971AD /* PVROperations.cpp in Sources */,
DFD928F316384B6800709DAE /* Timer.cpp in Sources */,
DFB25D2F163D4743006C4A48 /* Addon.cpp in Sources */,
@@ -11347,6 +11369,7 @@
E4991166174E5CC300741B6D /* rar.cpp in Sources */,
E4991167174E5CC300741B6D /* rarvm.cpp in Sources */,
E4991168174E5CC300741B6D /* rawread.cpp in Sources */,
+ 6890C2871DDBE03900F8F362 /* GUIWindowGames.cpp in Sources */,
E4991169174E5CC300741B6D /* rdwrfn.cpp in Sources */,
68AE5C1C1C92438E00C4D527 /* GUIControllerButton.cpp in Sources */,
E499116A174E5CC300741B6D /* recvol.cpp in Sources */,
@@ -11460,6 +11483,7 @@
E49911E9174E5D3E00741B6D /* DVDSubtitleParserSSA.cpp in Sources */,
E49911EA174E5D3E00741B6D /* DVDSubtitlesLibass.cpp in Sources */,
E49911EB174E5D3E00741B6D /* DVDSubtitleParserMicroDVD.cpp in Sources */,
+ 6890C2851DDBE03900F8F362 /* GUIViewStateWindowGames.cpp in Sources */,
E49911EC174E5D3E00741B6D /* DVDSubtitleParserMPL2.cpp in Sources */,
E49911ED174E5D3E00741B6D /* DVDSubtitleParserSami.cpp in Sources */,
E49911EE174E5D3E00741B6D /* DVDFactorySubtitle.cpp in Sources */,
diff --git a/Makefile.in b/Makefile.in
index a8c1f63a8d..366031cb7d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -66,6 +66,7 @@ DIRECTORY_ARCHIVES=$(VideoPlayer_ARCHIVES) \
xbmc/games/games.a \
xbmc/games/ports/gameports.a \
xbmc/games/tags/gameinfotags.a \
+ xbmc/games/windows/gamewindows.a \
xbmc/guilib/guilib.a \
xbmc/input/input.a \
xbmc/interfaces/builtins/builtins.a \
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 427f88e605..ee23166f00 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -930,6 +930,7 @@ msgstr ""
#: xbmc/pvr/windows/PVRGUIWindowRecordings.cpp
#: xbmc/dialogs/GUIDialogPlayEject.cpp
+#: xbmc/games/windows/GUIWindowGames.cpp
#: system/settings/settings.xml
msgctxt "#208"
msgid "Play"
@@ -4971,6 +4972,7 @@ msgctxt "#10139"
msgid "Pictures / Info"
msgstr ""
+#: addons/skin.estuary/1080i/MyGames.xml
#: xbmc/guilib/WindowIDs.h
msgctxt "#10140"
msgid "Add-on settings"
@@ -9141,6 +9143,7 @@ msgstr ""
#: xbmc/pvr/windows/GUIWindowPVRBase.cpp
#: addons/skin.estuary/1080i/View_50_List.xml
#: addons/skin.estuary/1080i/DialogMusicInfo.xml
+#: addons/skin.estuary/1080i/MyGames.xml
#: addons/skin.estuary/1080i/MyPics.xml
#: addons/skin.estuary/1080i/MyVideoNav.xml
#: addons/skin.estuary/1080i/Includes_PVR.xml
@@ -13144,6 +13147,7 @@ msgstr ""
#: addons/skin.estuary/1080i/MyVideoNav.xml
#: addons/skin.estuary/1080i/MyPics.xml
#: addons/skin.estuary/1080i/MyMusicNav.xml
+#: addons/skin.estuary/1080i/MyGames.xml
msgctxt "#21452"
msgid "Get more..."
msgstr ""
@@ -13893,6 +13897,7 @@ msgid "Add-on options"
msgstr ""
#: xbmc/addons/ContextMenus.h
+#: xbmc/games/windows/GUIWindowGames.cpp
msgctxt "#24003"
msgid "Add-on information"
msgstr ""
@@ -16071,6 +16076,7 @@ msgstr ""
#. Name of game add-ons category
#: xbmc/addons/Addon.cpp
+#: xbmc/games/windows/GUIViewStateWindowGames.cpp
msgctxt "#35049"
msgid "Game add-ons"
msgstr ""
diff --git a/addons/skin.estuary/extras/home-images/games.jpg b/addons/skin.estuary/extras/home-images/games.jpg
new file mode 100644
index 0000000000..a6f02fb445
--- /dev/null
+++ b/addons/skin.estuary/extras/home-images/games.jpg
Binary files differ
diff --git a/addons/skin.estuary/language/resource.language.en_gb/strings.po b/addons/skin.estuary/language/resource.language.en_gb/strings.po
index da1756d8e6..b3a08bd47c 100644
--- a/addons/skin.estuary/language/resource.language.en_gb/strings.po
+++ b/addons/skin.estuary/language/resource.language.en_gb/strings.po
@@ -673,3 +673,10 @@ msgstr ""
msgctxt "#31161"
msgid "Numeric pad"
msgstr ""
+
+#empty strings from id 31148 to 31198
+
+#: /1080i/Home.xml
+msgctxt "#31199"
+msgid "Play your personal games or download one of the many game add-ons from the official repository."
+msgstr ""
diff --git a/addons/skin.estuary/media/icons/sidemenu/games.png b/addons/skin.estuary/media/icons/sidemenu/games.png
new file mode 100644
index 0000000000..c55a8eef8d
--- /dev/null
+++ b/addons/skin.estuary/media/icons/sidemenu/games.png
Binary files differ
diff --git a/addons/skin.estuary/xml/Custom_1100_AddonLauncher.xml b/addons/skin.estuary/xml/Custom_1100_AddonLauncher.xml
index 2d1c7918e9..eccd1de075 100644
--- a/addons/skin.estuary/xml/Custom_1100_AddonLauncher.xml
+++ b/addons/skin.estuary/xml/Custom_1100_AddonLauncher.xml
@@ -37,6 +37,14 @@
<param name="imagewidget_image" value="special://skin/extras/home-images/music.jpg" />
</include>
<include content="AddonLauncherPanel">
+ <param name="group_id" value="509" />
+ <param name="id" value="game" />
+ <param name="container_path" value="addons://sources/game/" />
+ <param name="container_target" value="games" />
+ <param name="imagewidget_onclick" value="ActivateWindow(addonbrowser,addons://all/category.standalonegames,return)" />
+ <param name="imagewidget_image" value="special://skin/extras/home-images/games.jpg" />
+ </include>
+ <include content="AddonLauncherPanel">
<param name="group_id" value="502" />
<param name="id" value="addons" />
<param name="container_path" value="addons://sources/executable/" />
@@ -166,6 +174,16 @@
<property name="menu_id">$NUMBER[501]</property>
<!-- <visible>Integer.IsGreater(Container(501).NumItems,0)</visible> -->
</item>
+ <item id="8">
+ <label>$LOCALIZE[35049]</label>
+ <visible>System.GetBool(gamesgeneral.enable)</visible>
+ <onclick>ActivateWindow(games,addons://sources/game/,return)</onclick>
+ <thumb>icons/sidemenu/games.png</thumb>
+ <property name="id">game</property>
+ <property name="path">addons://sources/game/</property>
+ <property name="menu_id">$NUMBER[509]</property>
+ <!-- <visible>Integer.IsGreater(Container(509).NumItems,0)</visible> -->
+ </item>
<item id="3">
<label>$LOCALIZE[1043]</label>
<onclick>ActivateWindow(programs,addons://sources/executable/,return)</onclick>
diff --git a/addons/skin.estuary/xml/Home.xml b/addons/skin.estuary/xml/Home.xml
index f72d1200b9..26057769b2 100644
--- a/addons/skin.estuary/xml/Home.xml
+++ b/addons/skin.estuary/xml/Home.xml
@@ -275,6 +275,16 @@
<param name="sortorder" value="descending"/>
<param name="list_id" value="8200"/>
<param name="fallback_icon" value="DefaultAddon.png"/>
+
+ </include>
+ <include content="WidgetListSquare">
+ <param name="content_path" value="addons://sources/game/"/>
+ <param name="widget_header" value="$LOCALIZE[35049]"/>
+ <param name="widget_target" value="games"/>
+ <param name="sortby" value="lastused"/>
+ <param name="sortorder" value="descending"/>
+ <param name="list_id" value="8700"/>
+ <param name="fallback_icon" value="DefaultAddon.png"/>
</include>
<include content="WidgetListSquare">
<param name="content_path" value="addons://sources/executable/"/>
@@ -722,6 +732,34 @@
</include>
</control>
</control>
+ <control type="group" id="17000">
+ <visible>String.IsEqual(Container(9000).ListItem.Property(id),games)</visible>
+ <include content="Visible_Right_Delayed">
+ <param name="id" value="games"/>
+ </include>
+ <include content="ImageWidget">
+ <param name="image_path" value="special://skin/extras/home-images/games.jpg"/>
+ <param name="text_label" value="$LOCALIZE[31199]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(games)"/>
+ <param name="button_id" value="17100"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoGamesButton)"/>
+ </include>
+ <!--
+ <control type="grouplist" id="17001">
+ <include>WidgetGroupListCommon</include>
+ <include content="ImageWidget">
+ <param name="image_path" value="special://skin/extras/home-images/games.jpg"/>
+ <param name="text_label" value="$LOCALIZE[31199]" />
+ <param name="button_label" value="$LOCALIZE[31110]" />
+ <param name="button_onclick" value="ActivateWindow(games)"/>
+ <param name="button_id" value="17100"/>
+ <param name="visible" value="true"/>
+ <param name="button2_onclick" value="Skin.SetBool(HomeMenuNoGamesButton)"/>
+ </include>
+ </control>
+ -->
+ </control>
</control>
<control type="group">
<depth>DepthContentPanel</depth>
@@ -858,6 +896,14 @@
<visible>!Skin.HasSetting(HomeMenuNoRadioButton)</visible>
</item>
<item>
+ <label>$LOCALIZE[15016]</label>
+ <property name="menu_id">$NUMBER[17000]</property>
+ <onclick>ActivateWindow(Games)</onclick>
+ <thumb>icons/sidemenu/games.png</thumb>
+ <property name="id">games</property>
+ <visible>System.GetBool(gamesgeneral.enable) + !Skin.HasSetting(HomeMenuNoGamesButton)</visible>
+ </item>
+ <item>
<label>$LOCALIZE[24001]</label>
<property name="menu_id">$NUMBER[8000]</property>
<onclick>ActivateWindow(1100)</onclick>
diff --git a/addons/skin.estuary/xml/MyGames.xml b/addons/skin.estuary/xml/MyGames.xml
new file mode 100644
index 0000000000..a8854f5f48
--- /dev/null
+++ b/addons/skin.estuary/xml/MyGames.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<window>
+ <defaultcontrol always="true">50</defaultcontrol>
+ <backgroundcolor>background</backgroundcolor>
+ <views>50,52,53,54,55,500</views>
+ <menucontrol>9000</menucontrol>
+ <controls>`
+ <include>DefaultBackground</include>
+ <control type="group">
+ <animation effect="fade" start="100" end="0" time="200" tween="sine" condition="$EXP[infodialog_active]">Conditional</animation>
+ <include>View_50_List</include>
+ <include>View_52_IconWall</include>
+ <include>View_53_Shift</include>
+ <control type="group">
+ <left>50</left>
+ <include>View_54_InfoWall</include>
+ </control>
+ <include>View_55_WideList</include>
+ <include>View_500_Wall</include>
+ <include>CommonScrollbars</include>
+ <control type="group">
+ <include>OpenClose_Left</include>
+ <visible>Control.Isvisible(54)</visible>
+ <include>Visible_Left</include>
+ <visible>Container.Content(games)</visible>
+ <include content="ContentPanel">
+ <param name="width" value="656" />
+ </include>
+ <control type="textbox">
+ <left>40</left>
+ <top>360</top>
+ <width>529</width>
+ <height>413</height>
+ <align>center</align>
+ <aligny>center</aligny>
+ <font>font27</font>
+ <textcolor>80FFFFFF</textcolor>
+ <label>$LOCALIZE[19055]</label>
+ <visible>!ListItem.IsParentFolder + ListItem.IsFolder</visible>
+ </control>
+ </control>
+ <control type="group">
+ <include>OpenClose_Left</include>
+ <visible>Control.IsVisible(50) | Control.IsVisible(55)</visible>
+ <include>Visible_Left</include>
+ <include>ListThumbInfoPanel</include>
+ </control>
+ <include content="TopBar">
+ <param name="breadcrumbs_label" value="$LOCALIZE[15016]" />
+ </include>
+ <include content="BottomBar">
+ <param name="info_visible" value="true" />
+ </include>
+ <include>MediaMenuMouseOverlay</include>
+ <control type="group">
+ <include>MediaMenuCommon</include>
+ <control type="grouplist" id="9000">
+ <top>50</top>
+ <include>MediaMenuListCommon</include>
+ <control type="label" id="203">
+ <description>Actions</description>
+ <include>MediaMenuLabelCommon</include>
+ <label>$LOCALIZE[31020]</label>
+ <visible>Control.IsVisible(621) | Control.IsVisible(624)</visible>
+ </control>
+ <control type="button" id="624">
+ <include>MediaMenuItemsCommon</include>
+ <label>$LOCALIZE[10140]</label>
+ <onclick>Addon.OpenSettings($INFO[Container.PluginName])</onclick>
+ <visible>!String.IsEmpty(Container.PluginName)</visible>
+ </control>
+ <control type="button" id="621">
+ <description>Get more</description>
+ <include>MediaMenuItemsCommon</include>
+ <label>$LOCALIZE[21452]</label>
+ <onclick>ActivateWindow(addonbrowser,addons://more/game/,return)</onclick>
+ <visible>Container.Content(addons)</visible>
+ </control>
+ <include>MediaMenuNowPlaying</include>
+ </control>
+ </control>
+ </control>
+ </controls>
+</window>
diff --git a/addons/skin.estuary/xml/Settings.xml b/addons/skin.estuary/xml/Settings.xml
index b47d7b0661..d3e20a7a8e 100644
--- a/addons/skin.estuary/xml/Settings.xml
+++ b/addons/skin.estuary/xml/Settings.xml
@@ -130,6 +130,7 @@
</item>
<item>
<label>$LOCALIZE[15016]</label>
+ <visible>System.GetBool(gamesgeneral.enable)</visible>
<onclick>ActivateWindow(GameSettings)</onclick>
<icon>icons/settings/games.png</icon>
</item>
diff --git a/addons/skin.estuary/xml/SkinSettings.xml b/addons/skin.estuary/xml/SkinSettings.xml
index 07083bc378..469d2ece6f 100644
--- a/addons/skin.estuary/xml/SkinSettings.xml
+++ b/addons/skin.estuary/xml/SkinSettings.xml
@@ -199,6 +199,13 @@
<selected>!Skin.HasSetting(HomeMenuNoVideosButton)</selected>
<onclick>Skin.ToggleSetting(HomeMenuNoVideosButton)</onclick>
</control>
+ <control type="radiobutton" id="620">
+ <label>$LOCALIZE[15016]</label>
+ <visible>System.GetBool(gamesgeneral.enable)</visible>
+ <include>DefaultSettingButton</include>
+ <selected>!Skin.HasSetting(HomeMenuNoGamesButton)</selected>
+ <onclick>Skin.ToggleSetting(HomeMenuNoGamesButton)</onclick>
+ </control>
<control type="radiobutton" id="6160">
<label>$LOCALIZE[10134]</label>
<include>DefaultSettingButton</include>
diff --git a/addons/skin.estuary/xml/VideoOSD.xml b/addons/skin.estuary/xml/VideoOSD.xml
index d2c578550f..0f2f8d3afe 100644
--- a/addons/skin.estuary/xml/VideoOSD.xml
+++ b/addons/skin.estuary/xml/VideoOSD.xml
@@ -154,7 +154,7 @@
<include content="OSDButton">
<param name="texture" value="osd/fullscreen/buttons/bookmarks.png"/>
</include>
- <onclick>ActivateWindow(videobookmarks)</onclick>
+ <onclick>ActivateWindow(VideoBookmarks)</onclick>
<visible>!VideoPlayer.Content(livetv)</visible>
</control>
<control type="radiobutton" id="703">
diff --git a/addons/skin.estuary/xml/View_50_List.xml b/addons/skin.estuary/xml/View_50_List.xml
index 123ae81355..4864511e97 100644
--- a/addons/skin.estuary/xml/View_50_List.xml
+++ b/addons/skin.estuary/xml/View_50_List.xml
@@ -68,7 +68,7 @@
<onup>$PARAM[list_id]</onup>
<ondown>$PARAM[list_id]</ondown>
<viewtype label="$PARAM[viewtype_label]">list</viewtype>
- <visible>Container.Content(movies) | Container.Content(sets) | Container.Content(tvshows) | Container.Content(seasons) | Window.IsActive(MyPlaylist.xml)</visible>
+ <visible>Container.Content(movies) | Container.Content(sets) | Container.Content(tvshows) | Container.Content(seasons) | Container.Content(games) | Window.IsActive(MyPlaylist.xml)</visible>
<focusedlayout height="list_item_height" width="list_width">
<control type="image">
<left>0</left>
diff --git a/project/cmake/treedata/common/games.txt b/project/cmake/treedata/common/games.txt
index 4a0e37bdb8..03d42bc29f 100644
--- a/project/cmake/treedata/common/games.txt
+++ b/project/cmake/treedata/common/games.txt
@@ -9,3 +9,4 @@ xbmc/games/controllers/windows games/controllers/windows
xbmc/games/dialogs games/dialogs
xbmc/games/ports games/ports
xbmc/games/tags games/tags
+xbmc/games/windows games/windows
diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp
index 2c6de4889e..b8d202e3a6 100644
--- a/xbmc/GUIPassword.cpp
+++ b/xbmc/GUIPassword.cpp
@@ -404,6 +404,9 @@ bool CGUIPassword::CheckMenuLock(int iWindowID)
case WINDOW_PICTURES: // Pictures
bCheckPW = CProfilesManager::GetInstance().GetCurrentProfile().picturesLocked();
break;
+ case WINDOW_GAMES: // Games
+ bCheckPW = CProfilesManager::GetInstance().GetCurrentProfile().gamesLocked();
+ break;
case WINDOW_SETTINGS_PROFILES:
bCheckPW = true;
break;
@@ -442,8 +445,8 @@ bool CGUIPassword::LockSource(const std::string& strType, const std::string& str
void CGUIPassword::LockSources(bool lock)
{
// lock or unlock all sources (those with locks)
- const char* strType[5] = {"programs","music","video","pictures","files"};
- for (int i=0;i<5;++i)
+ const char* strType[] = {"programs", "music", "video", "pictures", "files", "games"};
+ for (unsigned int i = 0; i < sizeof(strType) / sizeof(*strType); ++i)
{
VECSOURCES *shares = CMediaSourceSettings::GetInstance().GetSources(strType[i]);
for (IVECSOURCES it=shares->begin();it != shares->end();++it)
@@ -457,8 +460,8 @@ void CGUIPassword::LockSources(bool lock)
void CGUIPassword::RemoveSourceLocks()
{
// remove lock from all sources
- const char* strType[5] = {"programs","music","video","pictures","files"};
- for (int i=0;i<5;++i)
+ const char* strType[] = {"programs", "music", "video", "pictures", "files", "games"};
+ for (unsigned int i = 0; i < sizeof(strType) / sizeof(*strType); ++i)
{
VECSOURCES *shares = CMediaSourceSettings::GetInstance().GetSources(strType[i]);
for (IVECSOURCES it=shares->begin();it != shares->end();++it)
diff --git a/xbmc/dialogs/GUIDialogMediaSource.cpp b/xbmc/dialogs/GUIDialogMediaSource.cpp
index 27dde9dfff..94bf1ee6d1 100644
--- a/xbmc/dialogs/GUIDialogMediaSource.cpp
+++ b/xbmc/dialogs/GUIDialogMediaSource.cpp
@@ -341,6 +341,10 @@ void CGUIDialogMediaSource::OnPathBrowse(int item)
extraShares.push_back(share1);
}
}
+ else if (m_type == "games")
+ {
+ // nothing to add
+ }
else if (m_type == "programs")
{
// nothing to add
@@ -476,6 +480,8 @@ void CGUIDialogMediaSource::SetTypeOfMedia(const std::string &type, bool editNot
heading = g_localizeStrings.Get(10054);
else if (type == "pictures")
heading = g_localizeStrings.Get(10055);
+ else if (type == "games")
+ heading = g_localizeStrings.Get(35252); // "Edit game source"
else if (type == "programs")
heading = g_localizeStrings.Get(10056);
else
@@ -489,6 +495,8 @@ void CGUIDialogMediaSource::SetTypeOfMedia(const std::string &type, bool editNot
heading = g_localizeStrings.Get(10049);
else if (type == "pictures")
heading = g_localizeStrings.Get(10050);
+ else if (type == "games")
+ heading = g_localizeStrings.Get(35251); // "Add game source"
else if (type == "programs")
heading = g_localizeStrings.Get(10051);
else
diff --git a/xbmc/games/windows/CMakeLists.txt b/xbmc/games/windows/CMakeLists.txt
new file mode 100644
index 0000000000..314608c620
--- /dev/null
+++ b/xbmc/games/windows/CMakeLists.txt
@@ -0,0 +1,7 @@
+set(SOURCES GUIViewStateWindowGames.cpp
+ GUIWindowGames.cpp)
+
+set(HEADERS GUIViewStateWindowGames.h
+ GUIWindowGames.h)
+
+core_add_library(gameswindows)
diff --git a/xbmc/games/windows/GUIViewStateWindowGames.cpp b/xbmc/games/windows/GUIViewStateWindowGames.cpp
new file mode 100644
index 0000000000..40454f6b77
--- /dev/null
+++ b/xbmc/games/windows/GUIViewStateWindowGames.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2012-2016 Team Kodi
+ * http://kodi.tv
+ *
+ * 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 this Program; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "GUIViewStateWindowGames.h"
+#include "addons/BinaryAddonCache.h"
+#include "games/addons/GameClient.h"
+#include "games/GameUtils.h"
+#include "guilib/GraphicContext.h" // include before ViewState.h
+#include "guilib/LocalizeStrings.h"
+#include "guilib/WindowIDs.h"
+#include "input/Key.h"
+#include "settings/MediaSourceSettings.h"
+#include "settings/Settings.h"
+#include "utils/StringUtils.h"
+#include "view/ViewState.h"
+#include "view/ViewStateSettings.h"
+#include "FileItem.h"
+#include "ServiceBroker.h"
+
+#include <assert.h>
+#include <set>
+
+using namespace GAME;
+
+CGUIViewStateWindowGames::CGUIViewStateWindowGames(const CFileItemList& items) :
+ CGUIViewState(items)
+{
+ if (items.IsVirtualDirectoryRoot())
+ {
+ AddSortMethod(SortByLabel, 551, LABEL_MASKS());
+ AddSortMethod(SortByDriveType, 564, LABEL_MASKS());
+ SetSortMethod(SortByLabel);
+ SetSortOrder(SortOrderAscending);
+ SetViewAsControl(DEFAULT_VIEW_ICONS);
+ }
+ else
+ {
+ AddSortMethod(SortByFile, 561, LABEL_MASKS("%F", "%I", "%L", "")); // Filename, Size | Label, empty
+ AddSortMethod(SortBySize, 553, LABEL_MASKS("%L", "%I", "%L", "%I")); // Filename, Size | Label, Size
+
+ const CViewState *viewState = CViewStateSettings::GetInstance().Get("games");
+ if (viewState)
+ {
+ SetSortMethod(viewState->m_sortDescription);
+ SetViewAsControl(viewState->m_viewMode);
+ SetSortOrder(viewState->m_sortDescription.sortOrder);
+ }
+ }
+
+ LoadViewState(items.GetPath(), WINDOW_GAMES);
+}
+
+std::string CGUIViewStateWindowGames::GetLockType()
+{
+ return "games";
+}
+
+std::string CGUIViewStateWindowGames::GetExtensions()
+{
+ using namespace ADDON;
+
+ std::set<std::string> exts = CGameUtils::GetGameExtensions();
+
+ // Ensure .zip appears
+ if (std::find(exts.begin(), exts.end(), ".zip") == exts.end())
+ exts.insert(".zip");
+
+ return StringUtils::Join(exts, "|");
+}
+
+VECSOURCES& CGUIViewStateWindowGames::GetSources()
+{
+ VECSOURCES *pGameSources = CMediaSourceSettings::GetInstance().GetSources("games");
+
+ // Guard against source type not existing
+ if (pGameSources == nullptr)
+ {
+ static VECSOURCES empty;
+ return empty;
+ }
+
+ // Game add-ons
+ AddAddonsSource("game", g_localizeStrings.Get(35049), "DefaultAddonGame.png");
+
+ // Global sources
+ AddOrReplace(*pGameSources, CGUIViewState::GetSources());
+
+ return *pGameSources;
+ /*
+ m_sources.clear();
+
+ // Files
+ {
+ CMediaSource share;
+ share.strPath = "sources://games/";
+ share.strName = g_localizeStrings.Get(744); // Files
+ share.m_iDriveType = CMediaSource::SOURCE_TYPE_LOCAL;
+ share.m_strThumbnailImage = "DefaultFolder.png";
+ m_sources.push_back(share);
+ }
+
+ // Add-ons
+ AddAddonsSource("game", g_localizeStrings.Get(27016), "DefaultAddonGame.png"); // Game Add-ons
+ return CGUIViewState::GetSources();
+ */
+}
+
+void CGUIViewStateWindowGames::SaveViewState()
+{
+ SaveViewToDb(m_items.GetPath(), WINDOW_GAMES, CViewStateSettings::GetInstance().Get("games"));
+}
diff --git a/xbmc/games/windows/GUIViewStateWindowGames.h b/xbmc/games/windows/GUIViewStateWindowGames.h
new file mode 100644
index 0000000000..3523b8641b
--- /dev/null
+++ b/xbmc/games/windows/GUIViewStateWindowGames.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2012-2016 Team Kodi
+ * http://kodi.tv
+ *
+ * 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 this Program; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+#pragma once
+
+#include "view/GUIViewState.h"
+
+namespace GAME
+{
+ class CGUIViewStateWindowGames : public CGUIViewState
+ {
+ public:
+ CGUIViewStateWindowGames(const CFileItemList& items);
+
+ // implementation of CGUIViewState
+ virtual std::string GetLockType() override;
+ virtual std::string GetExtensions() override;
+ virtual VECSOURCES& GetSources() override;
+
+ protected:
+ // implementation of CGUIViewState
+ virtual void SaveViewState() override;
+ };
+}
diff --git a/xbmc/games/windows/GUIWindowGames.cpp b/xbmc/games/windows/GUIWindowGames.cpp
new file mode 100644
index 0000000000..e34774e35a
--- /dev/null
+++ b/xbmc/games/windows/GUIWindowGames.cpp
@@ -0,0 +1,335 @@
+/*
+ * Copyright (C) 2012-2016 Team Kodi
+ * http://kodi.tv
+ *
+ * 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 this Program; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "GUIWindowGames.h"
+#include "addons/GUIDialogAddonInfo.h"
+#include "Application.h"
+#include "dialogs/GUIDialogContextMenu.h"
+#include "dialogs/GUIDialogMediaSource.h"
+#include "dialogs/GUIDialogProgress.h"
+#include "FileItem.h"
+#include "games/tags/GameInfoTag.h"
+#include "games/addons/GameClient.h"
+#include "games/addons/savestates/SavestateDatabase.h"
+#include "guilib/GUIWindowManager.h"
+#include "guilib/WindowIDs.h"
+#include "GUIPassword.h"
+#include "input/Key.h"
+#include "settings/MediaSourceSettings.h"
+#include "settings/Settings.h"
+#include "URL.h"
+#include "Util.h"
+#include "utils/StringUtils.h"
+
+#include <algorithm>
+
+using namespace GAME;
+
+#define CONTROL_BTNVIEWASICONS 2
+#define CONTROL_BTNSORTBY 3
+#define CONTROL_BTNSORTASC 4
+
+CGUIWindowGames::CGUIWindowGames() :
+ CGUIMediaWindow(WINDOW_GAMES, "MyGames.xml"),
+ m_dlgProgress(nullptr)
+{
+}
+
+bool CGUIWindowGames::OnMessage(CGUIMessage& message)
+{
+ switch (message.GetMessage())
+ {
+ case GUI_MSG_WINDOW_INIT:
+ {
+ m_rootDir.AllowNonLocalSources(true); //! @todo
+
+ // Is this the first time the window is opened?
+ if (m_vecItems->GetPath() == "?" && message.GetStringParam().empty())
+ message.SetStringParam(CMediaSourceSettings::GetInstance().GetDefaultSource("games"));
+
+ //! @todo
+ m_dlgProgress = dynamic_cast<CGUIDialogProgress*>(g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS));
+
+ break;
+ }
+ case GUI_MSG_CLICKED:
+ {
+ if (OnClickMsg(message.GetSenderId(), message.GetParam1()))
+ return true;
+ break;
+ }
+ default:
+ break;
+ }
+ return CGUIMediaWindow::OnMessage(message);
+}
+
+bool CGUIWindowGames::OnClickMsg(int controlId, int actionId)
+{
+ if (!m_viewControl.HasControl(controlId)) // list/thumb control
+ return false;
+
+ const int iItem = m_viewControl.GetSelectedItem();
+
+ CFileItemPtr pItem = m_vecItems->Get(iItem);
+ if (!pItem)
+ return false;
+
+ switch (actionId)
+ {
+ case ACTION_DELETE_ITEM:
+ {
+ // Is delete allowed?
+ if (CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION))
+ {
+ OnDeleteItem(iItem);
+ return true;
+ }
+ break;
+ }
+ case ACTION_PLAYER_PLAY:
+ {
+ if (OnClick(iItem))
+ return true;
+ break;
+ }
+ case ACTION_SHOW_INFO:
+ {
+ if (!m_vecItems->IsPlugin())
+ {
+ if (pItem->HasAddonInfo())
+ {
+ CGUIDialogAddonInfo::ShowForItem(pItem);
+ return true;
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ return false;
+}
+
+void CGUIWindowGames::SetupShares()
+{
+ CGUIMediaWindow::SetupShares();
+
+ // Don't convert zip files to directories. Otherwise, the files will be
+ // opened and scanned for games with a valid extension. If none are found,
+ // the .zip won't be shown.
+ //
+ // This is a problem for MAME roms, because the files inside the .zip don't
+ // have standard extensions.
+ //
+ m_rootDir.SetFlags(XFILE::DIR_FLAG_NO_FILE_DIRS);
+}
+
+bool CGUIWindowGames::OnClick(int iItem, const std::string &player /* = "" */)
+{
+ CFileItemPtr item = m_vecItems->Get(iItem);
+ if (item)
+ {
+ // Compensate for DIR_FLAG_NO_FILE_DIRS flag
+ if (URIUtils::IsArchive(item->GetPath()))
+ {
+ bool bIsGame = false;
+
+ // If zip file contains no games, assume it is a game
+ CFileItemList items;
+ if (m_rootDir.GetDirectory(CURL(item->GetPath()), items))
+ {
+ if (items.Size() == 0)
+ bIsGame = true;
+ }
+
+ if (!bIsGame)
+ item->m_bIsFolder = true;
+ }
+
+ if (!item->m_bIsFolder)
+ {
+ PlayGame(*item);
+ return true;
+ }
+ }
+
+ return CGUIMediaWindow::OnClick(iItem, player);
+}
+
+void CGUIWindowGames::GetContextButtons(int itemNumber, CContextButtons &buttons)
+{
+ CFileItemPtr item = m_vecItems->Get(itemNumber);
+
+ if (item && !item->GetProperty("pluginreplacecontextitems").asBoolean())
+ {
+ if (m_vecItems->IsVirtualDirectoryRoot() || m_vecItems->IsSourcesPath())
+ {
+ // Context buttons for a sources path, like "Add source", "Remove Source", etc.
+ CGUIDialogContextMenu::GetContextButtons("games", item, buttons);
+ }
+ else
+ {
+ if (item->IsGame())
+ {
+ buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208); // Play
+ }
+
+ if (!m_vecItems->IsPlugin() && item->HasAddonInfo())
+ buttons.Add(CONTEXT_BUTTON_INFO, 24003); // Add-on information
+
+ if (CSettings::GetInstance().GetBool("filelists.allowfiledeletion") && !item->IsReadOnly())
+ {
+ buttons.Add(CONTEXT_BUTTON_DELETE, 117);
+ buttons.Add(CONTEXT_BUTTON_RENAME, 118);
+ }
+ }
+ }
+
+ CGUIMediaWindow::GetContextButtons(itemNumber, buttons);
+}
+
+bool CGUIWindowGames::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
+{
+ CFileItemPtr item = m_vecItems->Get(itemNumber);
+ if (item)
+ {
+ if (m_vecItems->IsVirtualDirectoryRoot() || m_vecItems->IsSourcesPath())
+ {
+ if (CGUIDialogContextMenu::OnContextButton("games", item, button))
+ {
+ Update(m_vecItems->GetPath());
+ return true;
+ }
+ }
+ switch (button)
+ {
+ case CONTEXT_BUTTON_PLAY_ITEM:
+ PlayGame(*item);
+ return true;
+ case CONTEXT_BUTTON_INFO:
+ CGUIDialogAddonInfo::ShowForItem(item);
+ return true;
+ case CONTEXT_BUTTON_DELETE:
+ OnDeleteItem(itemNumber);
+ return true;
+ case CONTEXT_BUTTON_RENAME:
+ OnRenameItem(itemNumber);
+ return true;
+ default:
+ break;
+ }
+ }
+ return CGUIMediaWindow::OnContextButton(itemNumber, button);
+}
+
+bool CGUIWindowGames::OnAddMediaSource()
+{
+ return CGUIDialogMediaSource::ShowAndAddMediaSource("games");
+}
+
+bool CGUIWindowGames::GetDirectory(const std::string &strDirectory, CFileItemList& items)
+{
+ if (!CGUIMediaWindow::GetDirectory(strDirectory, items))
+ return false;
+
+ // Set label
+ std::string label;
+ if (items.GetLabel().empty())
+ m_rootDir.IsSource(items.GetPath(), CMediaSourceSettings::GetInstance().GetSources("games"), &label);
+
+ if (!label.empty())
+ items.SetLabel(label);
+
+ // Set content
+ std::string content;
+ if (items.GetContent().empty())
+ {
+ if (!items.IsVirtualDirectoryRoot() && // Don't set content for root directory
+ !items.IsPlugin()) // Don't set content for plugins
+ {
+ content = "games";
+ }
+ }
+
+ if (!content.empty())
+ items.SetContent(content);
+
+ return true;
+}
+
+std::string CGUIWindowGames::GetStartFolder(const std::string &dir)
+{
+ // From CGUIWindowPictures::GetStartFolder()
+
+ if (StringUtils::EqualsNoCase(dir, "plugins") ||
+ StringUtils::EqualsNoCase(dir, "addons"))
+ {
+ return "addons://sources/game/";
+ }
+
+ SetupShares();
+ VECSOURCES shares;
+ m_rootDir.GetSources(shares);
+ bool bIsSourceName = false;
+ int iIndex = CUtil::GetMatchingSource(dir, shares, bIsSourceName);
+ if (iIndex >= 0)
+ {
+ if (iIndex < (int)shares.size() && shares[iIndex].m_iHasLock == 2)
+ {
+ CFileItem item(shares[iIndex]);
+ if (!g_passwordManager.IsItemUnlocked(&item, "games"))
+ return "";
+ }
+ if (bIsSourceName)
+ return shares[iIndex].strPath;
+ return dir;
+ }
+ return CGUIMediaWindow::GetStartFolder(dir);
+}
+
+void CGUIWindowGames::OnItemInfo(int itemNumber)
+{
+ CFileItemPtr item = m_vecItems->Get(itemNumber);
+ if (!item)
+ return;
+
+ if (!m_vecItems->IsPlugin())
+ {
+ if (item->IsPlugin() || item->IsScript())
+ CGUIDialogAddonInfo::ShowForItem(item);
+ }
+
+ //! @todo
+ /*
+ CGUIDialogGameInfo* gameInfo = dynamic_cast<CGUIDialogGameInfo*>(g_windowManager.GetWindow(WINDOW_DIALOG_PICTURE_INFO));
+ if (gameInfo)
+ {
+ gameInfo->SetGame(item);
+ gameInfo->Open();
+ }
+ */
+}
+
+bool CGUIWindowGames::PlayGame(const CFileItem &item)
+{
+ return g_application.PlayFile(item, "") == PLAYBACK_OK;
+}
diff --git a/xbmc/games/windows/GUIWindowGames.h b/xbmc/games/windows/GUIWindowGames.h
new file mode 100644
index 0000000000..d919726ff7
--- /dev/null
+++ b/xbmc/games/windows/GUIWindowGames.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012-2016 Team Kodi
+ * http://kodi.tv
+ *
+ * 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 this Program; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+#pragma once
+
+#include "games/GameTypes.h"
+#include "windows/GUIMediaWindow.h"
+
+class CGUIDialogProgress;
+
+namespace GAME
+{
+ class CGUIWindowGames : public CGUIMediaWindow
+ {
+ public:
+ CGUIWindowGames();
+ virtual ~CGUIWindowGames() { }
+
+ // implementation of CGUIControl via CGUIMediaWindow
+ virtual bool OnMessage(CGUIMessage& message) override;
+
+ protected:
+ // implementation of CGUIMediaWindow
+ virtual void SetupShares() override;
+ virtual bool OnClick(int iItem, const std::string &player = "") override;
+ virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) override;
+ virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
+ virtual bool OnAddMediaSource() override;
+ virtual bool GetDirectory(const std::string &strDirectory, CFileItemList &items) override;
+ virtual std::string GetStartFolder(const std::string &dir) override;
+
+ bool OnClickMsg(int controlId, int actionId);
+ void OnItemInfo(int itemNumber);
+ bool PlayGame(const CFileItem &item);
+
+ CGUIDialogProgress *m_dlgProgress;
+ };
+}
diff --git a/xbmc/games/windows/Makefile b/xbmc/games/windows/Makefile
new file mode 100644
index 0000000000..f800574d0b
--- /dev/null
+++ b/xbmc/games/windows/Makefile
@@ -0,0 +1,7 @@
+SRCS=GUIViewStateWindowGames.cpp \
+ GUIWindowGames.cpp \
+
+LIB=gamewindows.a
+
+include ../../../Makefile.include
+-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS)))
diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index 53aec7e604..9f2969192d 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -149,6 +149,7 @@
/* Game related include files */
#include "games/controllers/windows/GUIControllerWindow.h"
+#include "games/windows/GUIWindowGames.h"
using namespace PVR;
using namespace PERIPHERALS;
@@ -301,6 +302,7 @@ void CGUIWindowManager::CreateWindows()
Add(new CGUIWindowEventLog);
Add(new GAME::CGUIControllerWindow);
+ Add(new GAME::CGUIWindowGames);
}
bool CGUIWindowManager::DestroyWindows()
@@ -405,6 +407,7 @@ bool CGUIWindowManager::DestroyWindows()
Delete(WINDOW_PICTURES);
Delete(WINDOW_WEATHER);
Delete(WINDOW_DIALOG_GAME_CONTROLLERS);
+ Delete(WINDOW_GAMES);
Remove(WINDOW_SETTINGS_SERVICE);
Remove(WINDOW_SETTINGS_MYPVR);
diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp
index 06a0ec3ab1..cbd7062094 100644
--- a/xbmc/input/ButtonTranslator.cpp
+++ b/xbmc/input/ButtonTranslator.cpp
@@ -313,6 +313,7 @@ static const ActionMapping windows[] =
{ "radiotimers" , WINDOW_RADIO_TIMERS },
{ "radiosearch" , WINDOW_RADIO_SEARCH },
{ "gamecontrollers" , WINDOW_DIALOG_GAME_CONTROLLERS },
+ { "games" , WINDOW_GAMES },
{ "pvrguideinfo" , WINDOW_DIALOG_PVR_GUIDE_INFO },
{ "pvrrecordinginfo" , WINDOW_DIALOG_PVR_RECORDING_INFO },
{ "pvrradiordsinfo" , WINDOW_DIALOG_PVR_RADIO_RDS_INFO },
diff --git a/xbmc/profiles/Profile.cpp b/xbmc/profiles/Profile.cpp
index 49af2a7380..a8b2f1d87b 100644
--- a/xbmc/profiles/Profile.cpp
+++ b/xbmc/profiles/Profile.cpp
@@ -32,6 +32,7 @@ CProfile::CLock::CLock(LockType type, const std::string &password):
music = false;
settings = LOCK_LEVEL::NONE;
addonManager = false;
+ games = false;
mode = type;
}
@@ -90,6 +91,7 @@ void CProfile::Load(const TiXmlNode *node, int nextIdProfile)
XMLUtils::GetBoolean(node, "lockvideo", m_locks.video);
XMLUtils::GetBoolean(node, "lockpictures", m_locks.pictures);
XMLUtils::GetBoolean(node, "lockprograms", m_locks.programs);
+ XMLUtils::GetBoolean(node, "lockgames", m_locks.games);
int lockMode = m_locks.mode;
XMLUtils::GetInt(node, "lockmode", lockMode);
@@ -121,6 +123,7 @@ void CProfile::Save(TiXmlNode *root) const
XMLUtils::SetBoolean(node, "lockvideo", m_locks.video);
XMLUtils::SetBoolean(node, "lockpictures", m_locks.pictures);
XMLUtils::SetBoolean(node, "lockprograms", m_locks.programs);
+ XMLUtils::SetBoolean(node, "lockgames", m_locks.games);
XMLUtils::SetInt(node, "lockmode", m_locks.mode);
XMLUtils::SetString(node,"lockcode", m_locks.code);
diff --git a/xbmc/profiles/Profile.h b/xbmc/profiles/Profile.h
index 6cf7f8995c..3244fc650d 100644
--- a/xbmc/profiles/Profile.h
+++ b/xbmc/profiles/Profile.h
@@ -46,6 +46,7 @@ public:
bool files;
bool pictures;
bool programs;
+ bool games;
};
CProfile(const std::string &directory = "", const std::string &name = "", const int id = -1);
@@ -78,6 +79,7 @@ public:
bool picturesLocked() const { return m_locks.pictures; }
bool filesLocked() const { return m_locks.files; }
bool programsLocked() const { return m_locks.programs; }
+ bool gamesLocked() const { return m_locks.games; }
const CLock &GetLocks() const { return m_locks; }
void setName(const std::string& name) {m_name = name;}
diff --git a/xbmc/settings/MediaSourceSettings.cpp b/xbmc/settings/MediaSourceSettings.cpp
index eabe0dfd21..484bbc46b1 100644
--- a/xbmc/settings/MediaSourceSettings.cpp
+++ b/xbmc/settings/MediaSourceSettings.cpp
@@ -107,6 +107,7 @@ bool CMediaSourceSettings::Load(const std::string &file)
GetSources(pRootElement, "pictures", m_pictureSources, m_defaultPictureSource);
GetSources(pRootElement, "files", m_fileSources, m_defaultFileSource);
GetSources(pRootElement, "music", m_musicSources, m_defaultMusicSource);
+ GetSources(pRootElement, "games", m_gameSources, dummy);
return true;
}
@@ -131,6 +132,7 @@ bool CMediaSourceSettings::Save(const std::string &file) const
SetSources(pRoot, "music", m_musicSources, m_defaultMusicSource);
SetSources(pRoot, "pictures", m_pictureSources, m_defaultPictureSource);
SetSources(pRoot, "files", m_fileSources, m_defaultFileSource);
+ SetSources(pRoot, "games", m_gameSources, "");
CWakeOnAccess::GetInstance().QueueMACDiscoveryForAllRemotes();
@@ -144,6 +146,7 @@ void CMediaSourceSettings::Clear()
m_fileSources.clear();
m_musicSources.clear();
m_videoSources.clear();
+ m_gameSources.clear();
}
VECSOURCES* CMediaSourceSettings::GetSources(const std::string &type)
@@ -158,6 +161,8 @@ VECSOURCES* CMediaSourceSettings::GetSources(const std::string &type)
return &m_videoSources;
else if (type == "pictures")
return &m_pictureSources;
+ else if (type == "games")
+ return &m_gameSources;
return NULL;
}
diff --git a/xbmc/settings/MediaSourceSettings.h b/xbmc/settings/MediaSourceSettings.h
index a7568e2479..15add512e7 100644
--- a/xbmc/settings/MediaSourceSettings.h
+++ b/xbmc/settings/MediaSourceSettings.h
@@ -67,6 +67,7 @@ private:
VECSOURCES m_fileSources;
VECSOURCES m_musicSources;
VECSOURCES m_videoSources;
+ VECSOURCES m_gameSources;
std::string m_defaultProgramSource;
std::string m_defaultMusicSource;
diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp
index 08e3135a5d..a8e356977c 100644
--- a/xbmc/view/GUIViewState.cpp
+++ b/xbmc/view/GUIViewState.cpp
@@ -27,6 +27,7 @@
#include "pictures/GUIViewStatePictures.h"
#include "profiles/ProfilesManager.h"
#include "programs/GUIViewStatePrograms.h"
+#include "games/windows/GUIViewStateWindowGames.h"
#include "PlayListPlayer.h"
#include "utils/URIUtils.h"
#include "URL.h"
@@ -165,7 +166,10 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it
if (windowId == WINDOW_PROGRAMS)
return new CGUIViewStateWindowPrograms(items);
-
+
+ if (windowId == WINDOW_GAMES)
+ return new GAME::CGUIViewStateWindowGames(items);
+
if (windowId == WINDOW_ADDON_BROWSER)
return new CGUIViewStateAddonBrowser(items);
diff --git a/xbmc/view/ViewStateSettings.cpp b/xbmc/view/ViewStateSettings.cpp
index a608a82140..8d9d31f36c 100644
--- a/xbmc/view/ViewStateSettings.cpp
+++ b/xbmc/view/ViewStateSettings.cpp
@@ -62,6 +62,7 @@ CViewStateSettings::CViewStateSettings()
AddViewState("pictures", DEFAULT_VIEW_AUTO);
AddViewState("videofiles", DEFAULT_VIEW_AUTO);
AddViewState("musicfiles", DEFAULT_VIEW_AUTO);
+ AddViewState("games", DEFAULT_VIEW_AUTO);
Clear();
}
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index aaa956b0a1..e7bca86462 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -792,6 +792,8 @@ bool CGUIMediaWindow::Update(const std::string &strDirectory, bool updateFilterP
showLabel = 997;
else if (iWindow == WINDOW_FILES)
showLabel = 1026;
+ else if (iWindow == WINDOW_GAMES)
+ showLabel = 35250; // "Add games..."
}
if (m_vecItems->IsPath("sources://video/"))
showLabel = 999;
@@ -801,6 +803,8 @@ bool CGUIMediaWindow::Update(const std::string &strDirectory, bool updateFilterP
showLabel = 997;
else if (m_vecItems->IsPath("sources://files/"))
showLabel = 1026;
+ else if (m_vecItems->IsPath("sources://games/"))
+ showLabel = 35250; // "Add games..."
if (showLabel && (m_vecItems->Size() == 0 || !m_guiState->DisableAddSourceButtons())) // add 'add source button'
{
std::string strLabel = g_localizeStrings.Get(showLabel);