aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-08-10 18:45:46 +0200
committerGitHub <noreply@github.com>2024-08-10 18:45:46 +0200
commit3dc226c26629fcf3d231a15c8503de003020f16b (patch)
tree2135974f9bcb0947801aedfca76cf038cd1a014d
parent7a1f1098bff2fbc1489932775268dba348bd62b3 (diff)
parent64447afb6201efa72b9b4e6d4a16e3832d1e444a (diff)
Merge pull request #25596 from ksooo/video-change-select-action-choose-omega
[Omega][video] Change select action choose implementation to open the full context menu of the item…
-rw-r--r--addons/resource.language.en_gb/resources/strings.po1
-rwxr-xr-xsystem/settings/settings.xml18
-rw-r--r--xbmc/favourites/GUIWindowFavourites.cpp2
-rw-r--r--xbmc/guilib/listproviders/DirectoryProvider.cpp2
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRRecordings.cpp2
-rw-r--r--xbmc/video/ContextMenus.cpp2
-rw-r--r--xbmc/video/guilib/VideoAction.h2
-rw-r--r--xbmc/video/guilib/VideoSelectActionProcessor.cpp38
-rw-r--r--xbmc/video/guilib/VideoSelectActionProcessor.h3
-rw-r--r--xbmc/video/windows/GUIWindowVideoBase.cpp2
10 files changed, 17 insertions, 55 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 056b1747a0..c99ae80f5d 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -15461,7 +15461,6 @@ msgstr ""
#. Label to denote that there is something 'more'
#. xbmc/favourites/ContextMenus.h
#: xbmc/guilib/listproviders/DirectoryProvider.cpp
-#: xbmc/video/guilib/VideoSelectActionProcessor.cpp
#: system/settings/settings.xml
msgctxt "#22082"
msgid "More..."
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index f771cea127..4067e92886 100755
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -1034,14 +1034,14 @@
<group id="1" label="593">
<setting id="myvideos.selectaction" type="integer" label="22079" help="36177">
<level>0</level>
- <default>1</default> <!-- SELECT_ACTION_PLAY_OR_RESUME -->
+ <default>1</default> <!-- ACTION_PLAY_OR_RESUME -->
<constraints>
<options>
- <option label="22080">0</option> <!-- SELECT_ACTION_CHOOSE -->
- <option label="208">1</option> <!-- SELECT_ACTION_PLAY_OR_RESUME -->
- <option label="13404">2</option> <!-- SELECT_ACTION_RESUME -->
- <option label="22081">3</option> <!-- SELECT_ACTION_INFO -->
- <option label="13347">7</option> <!-- SELECT_ACTION_QUEUE -->
+ <option label="22080">0</option> <!-- ACTION_CHOOSE -->
+ <option label="208">1</option> <!-- ACTION_PLAY_OR_RESUME -->
+ <option label="13404">2</option> <!-- ACTION_RESUME -->
+ <option label="22081">3</option> <!-- ACTION_INFO -->
+ <option label="13347">7</option> <!-- ACTION_QUEUE -->
</options>
</constraints>
<control type="list" format="string" />
@@ -1053,11 +1053,11 @@
</setting>
<setting id="myvideos.playaction" type="integer" label="22076" help="36204">
<level>0</level>
- <default>1</default> <!-- PLAY_ACTION_PLAY_OR_RESUME -->
+ <default>1</default> <!-- ACTION_PLAY_OR_RESUME -->
<constraints>
<options>
- <option label="22077">1</option> <!-- PLAY_ACTION_PLAY_OR_RESUME -->
- <option label="22078">2</option> <!-- PLAY_ACTION_RESUME -->
+ <option label="22077">1</option> <!-- ACTION_PLAY_OR_RESUME -->
+ <option label="22078">2</option> <!-- ACTION_RESUME -->
</options>
</constraints>
<control type="list" format="string" />
diff --git a/xbmc/favourites/GUIWindowFavourites.cpp b/xbmc/favourites/GUIWindowFavourites.cpp
index 1a139aec0a..78fe7af6eb 100644
--- a/xbmc/favourites/GUIWindowFavourites.cpp
+++ b/xbmc/favourites/GUIWindowFavourites.cpp
@@ -87,7 +87,7 @@ protected:
return UTILS::GUILIB::CGUIContentUtils::ShowInfoForItem(*m_item);
}
- bool OnMoreSelected() override
+ bool OnChooseSelected() override
{
CONTEXTMENU::ShowFor(m_item, CContextMenuManager::MAIN);
return true;
diff --git a/xbmc/guilib/listproviders/DirectoryProvider.cpp b/xbmc/guilib/listproviders/DirectoryProvider.cpp
index 8d035004b0..d6b3bc207d 100644
--- a/xbmc/guilib/listproviders/DirectoryProvider.cpp
+++ b/xbmc/guilib/listproviders/DirectoryProvider.cpp
@@ -511,7 +511,7 @@ protected:
return true;
}
- bool OnMoreSelected() override
+ bool OnChooseSelected() override
{
m_provider.OnContextMenu(m_item);
return true;
diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
index 3f545098de..12f5537063 100644
--- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp
@@ -267,7 +267,7 @@ protected:
return true;
}
- bool OnMoreSelected() override
+ bool OnChooseSelected() override
{
m_window.OnPopupMenu(m_itemIndex);
return true;
diff --git a/xbmc/video/ContextMenus.cpp b/xbmc/video/ContextMenus.cpp
index fa7f454136..4ebfb2b5bf 100644
--- a/xbmc/video/ContextMenus.cpp
+++ b/xbmc/video/ContextMenus.cpp
@@ -222,7 +222,7 @@ protected:
return true;
}
- bool OnMoreSelected() override
+ bool OnChooseSelected() override
{
CONTEXTMENU::ShowFor(m_item, CContextMenuManager::MAIN);
return true;
diff --git a/xbmc/video/guilib/VideoAction.h b/xbmc/video/guilib/VideoAction.h
index d2efd86d3c..f914699aa5 100644
--- a/xbmc/video/guilib/VideoAction.h
+++ b/xbmc/video/guilib/VideoAction.h
@@ -20,7 +20,7 @@ enum Action
ACTION_PLAY_OR_RESUME = 1, // if resume is possible, ask user. play from beginning otherwise
ACTION_RESUME = 2, // resume if possibly, play from beginning otherwise
ACTION_INFO = 3,
- ACTION_MORE = 4,
+ // 4 unused
ACTION_PLAY_FROM_BEGINNING = 5, // play from beginning, also if resume would be possible
ACTION_PLAYPART = 6,
ACTION_QUEUE = 7,
diff --git a/xbmc/video/guilib/VideoSelectActionProcessor.cpp b/xbmc/video/guilib/VideoSelectActionProcessor.cpp
index 507f59a1fd..90797e9742 100644
--- a/xbmc/video/guilib/VideoSelectActionProcessor.cpp
+++ b/xbmc/video/guilib/VideoSelectActionProcessor.cpp
@@ -10,7 +10,6 @@
#include "FileItem.h"
#include "ServiceBroker.h"
-#include "dialogs/GUIDialogContextMenu.h"
#include "dialogs/GUIDialogSelect.h"
#include "filesystem/Directory.h"
#include "guilib/GUIComponent.h"
@@ -20,7 +19,6 @@
#include "settings/SettingsComponent.h"
#include "utils/StringUtils.h"
#include "utils/Variant.h"
-#include "video/VideoInfoTag.h"
#include "video/VideoUtils.h"
using namespace VIDEO::GUILIB;
@@ -44,16 +42,7 @@ bool CVideoSelectActionProcessorBase::Process(Action action)
switch (action)
{
case ACTION_CHOOSE:
- {
- const Action selectedAction = ChooseVideoItemSelectAction();
- if (selectedAction < 0)
- {
- m_userCancelled = true;
- return true; // User cancelled the select menu. We're done.
- }
-
- return Process(selectedAction);
- }
+ return OnChooseSelected();
case ACTION_PLAYPART:
{
@@ -79,9 +68,6 @@ bool CVideoSelectActionProcessorBase::Process(Action action)
return OnInfoSelected();
}
- case ACTION_MORE:
- return OnMoreSelected();
-
default:
break;
}
@@ -110,25 +96,3 @@ unsigned int CVideoSelectActionProcessorBase::ChooseStackItemPartNumber() const
return dialog->GetSelectedItem() + 1; // part numbers are 1-based
}
-
-Action CVideoSelectActionProcessorBase::ChooseVideoItemSelectAction() const
-{
- CContextButtons choices;
-
- const std::string resumeString = VIDEO_UTILS::GetResumeString(*m_item);
- if (!resumeString.empty())
- {
- choices.Add(ACTION_RESUME, resumeString);
- choices.Add(ACTION_PLAY_FROM_BEGINNING, 12021); // Play from beginning
- }
- else
- {
- choices.Add(ACTION_PLAY_FROM_BEGINNING, 208); // Play
- }
-
- choices.Add(ACTION_INFO, 22081); // Show information
- choices.Add(ACTION_QUEUE, 13347); // Queue item
- choices.Add(ACTION_MORE, 22082); // More
-
- return static_cast<Action>(CGUIDialogContextMenu::ShowAndGetChoice(choices));
-}
diff --git a/xbmc/video/guilib/VideoSelectActionProcessor.h b/xbmc/video/guilib/VideoSelectActionProcessor.h
index 8a4e6ee80e..49287ca64c 100644
--- a/xbmc/video/guilib/VideoSelectActionProcessor.h
+++ b/xbmc/video/guilib/VideoSelectActionProcessor.h
@@ -37,11 +37,10 @@ protected:
virtual bool OnPlayPartSelected(unsigned int part) = 0;
virtual bool OnQueueSelected() = 0;
virtual bool OnInfoSelected() = 0;
- virtual bool OnMoreSelected() = 0;
+ virtual bool OnChooseSelected() = 0;
private:
CVideoSelectActionProcessorBase() = delete;
- Action ChooseVideoItemSelectAction() const;
unsigned int ChooseStackItemPartNumber() const;
};
} // namespace GUILIB
diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp
index e8ba199e19..702a056a08 100644
--- a/xbmc/video/windows/GUIWindowVideoBase.cpp
+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp
@@ -600,7 +600,7 @@ protected:
bool OnInfoSelected() override { return m_window.OnItemInfo(*m_item); }
- bool OnMoreSelected() override
+ bool OnChooseSelected() override
{
// window only shows the default version, so no window specific context menu items available
if (m_item->HasVideoVersions() && !m_item->GetVideoInfoTag()->IsDefaultVideoVersion())