aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2021-05-03 20:04:59 +0200
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2021-05-04 08:31:17 +0200
commitea9481f502281e1b4e42d1af8914dd36db5f1cbb (patch)
treeac75369e61afae1913adfab34e80b92244b33a24
parentbd16fd173ad2456f51edc9742bb949f112132b72 (diff)
[PVR] Channel Manager: Do not allow renumbering channels if backend channel numbers or backend channel order shall be used.
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp12
-rw-r--r--xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
index 813676da44..d6c54e43ae 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
+++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp
@@ -163,6 +163,12 @@ void CGUIDialogPVRChannelManager::OnInitWindow()
m_bMovingMode = false;
m_bContainsChanges = false;
m_bAllowNewChannel = false;
+
+ // prevent resorting channels if backend channel numbers or backend channel order shall be used
+ const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
+ m_bAllowRenumber = !settings->GetBool(CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER) &&
+ !settings->GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS);
+
SetProperty("IsRadio", "");
Update();
@@ -594,7 +600,8 @@ bool CGUIDialogPVRChannelManager::OnPopupMenu(int iItem)
if (!pItem)
return false;
- buttons.Add(CONTEXT_BUTTON_MOVE, 116); /* Move channel up or down */
+ if (m_bAllowRenumber)
+ buttons.Add(CONTEXT_BUTTON_MOVE, 116); /* Move channel up or down */
if (pItem->GetProperty("SupportsSettings").asBoolean())
{
@@ -846,6 +853,9 @@ void CGUIDialogPVRChannelManager::SetItemsUnchanged()
void CGUIDialogPVRChannelManager::Renumber()
{
+ if (!m_bAllowRenumber)
+ return;
+
int iNextChannelNumber(0);
std::string strNumber;
CFileItemPtr pItem;
diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h
index 1abe2dd9b4..cead000c4f 100644
--- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h
+++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h
@@ -75,6 +75,7 @@ namespace PVR
bool m_bMovingMode = false;
bool m_bContainsChanges = false;
bool m_bAllowNewChannel = false;
+ bool m_bAllowRenumber = false;
std::shared_ptr<CFileItem> m_initialSelection;
int m_iSelected = 0;