aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2016-05-01 11:58:28 +0200
committerRainer Hochecker <fernetmenta@online.de>2016-05-01 11:58:28 +0200
commitbee0201a5b2fd395648424bc7d6ce672d7040186 (patch)
treeeb7174aa76221913a7f66ec1a43c93a953f6700d
parent8b156394d5816166ca84c7eb07fbe7fff462b247 (diff)
parent0491dced6a9846983d2887ecce1970c57e791b21 (diff)
Merge pull request #9664 from FernetMenta/renderloop17.0a1-Krypton
guilib: only dialogs are allowed to call ProcessRenderLoop
-rw-r--r--Kodi.xcodeproj/project.pbxproj8
-rw-r--r--project/VS2010Express/XBMC.vcxproj2
-rw-r--r--project/VS2010Express/XBMC.vcxproj.filters6
-rw-r--r--xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp2
-rw-r--r--xbmc/dialogs/CMakeLists.txt2
-rw-r--r--xbmc/dialogs/GUIDialogBusy.cpp2
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardTouch.cpp99
-rw-r--r--xbmc/dialogs/GUIDialogKeyboardTouch.h49
-rw-r--r--xbmc/dialogs/GUIDialogProgress.cpp10
-rw-r--r--xbmc/dialogs/GUIDialogProgress.h1
-rw-r--r--xbmc/dialogs/Makefile1
-rw-r--r--xbmc/filesystem/Directory.cpp38
-rw-r--r--xbmc/filesystem/PluginDirectory.cpp9
-rw-r--r--xbmc/guilib/GUIDialog.cpp5
-rw-r--r--xbmc/guilib/GUIDialog.h2
-rw-r--r--xbmc/guilib/GUIKeyboardFactory.cpp19
-rw-r--r--xbmc/guilib/GUIWindowManager.cpp3
-rw-r--r--xbmc/guilib/GUIWindowManager.h7
-rw-r--r--xbmc/guilib/WindowIDs.h1
-rw-r--r--xbmc/network/upnp/UPnPPlayer.cpp21
-rw-r--r--xbmc/platform/darwin/ios/IOSKeyboard.h2
-rw-r--r--xbmc/platform/darwin/ios/IOSKeyboard.mm2
-rw-r--r--xbmc/platform/darwin/ios/IOSKeyboardView.mm8
-rw-r--r--xbmc/pvr/windows/GUIWindowPVRBase.cpp32
-rw-r--r--xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp6
-rw-r--r--xbmc/windows/GUIMediaWindow.cpp5
-rw-r--r--xbmc/windows/GUIMediaWindow.h2
27 files changed, 221 insertions, 123 deletions
diff --git a/Kodi.xcodeproj/project.pbxproj b/Kodi.xcodeproj/project.pbxproj
index 3d25c1758e..0fbe231070 100644
--- a/Kodi.xcodeproj/project.pbxproj
+++ b/Kodi.xcodeproj/project.pbxproj
@@ -685,6 +685,8 @@
7CE3FB8D1C9D3CCA00366A4C /* ServiceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE3FB8A1C9D3CCA00366A4C /* ServiceManager.cpp */; };
7CE3FB901C9D40EA00366A4C /* ServiceBroker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE3FB8E1C9D40EA00366A4C /* ServiceBroker.cpp */; };
7CE3FB911C9D40EA00366A4C /* ServiceBroker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE3FB8E1C9D40EA00366A4C /* ServiceBroker.cpp */; };
+ 7CE514AA1CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE514A81CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp */; };
+ 7CE514AB1CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE514A81CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp */; };
7CEBD8A80F33A0D800CAF6AD /* SpecialProtocolDirectory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CEBD8A60F33A0D800CAF6AD /* SpecialProtocolDirectory.cpp */; };
7CED59391CD340460093F573 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CED59381CD340460093F573 /* VideoToolbox.framework */; };
7CED593A1CD340460093F573 /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7CED59381CD340460093F573 /* VideoToolbox.framework */; };
@@ -3398,6 +3400,8 @@
7CE3FB8B1C9D3CCA00366A4C /* ServiceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ServiceManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
7CE3FB8E1C9D40EA00366A4C /* ServiceBroker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceBroker.cpp; sourceTree = "<group>"; };
7CE3FB8F1C9D40EA00366A4C /* ServiceBroker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceBroker.h; sourceTree = "<group>"; };
+ 7CE514A81CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GUIDialogKeyboardTouch.cpp; sourceTree = "<group>"; };
+ 7CE514A91CD5154A0046BC5C /* GUIDialogKeyboardTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GUIDialogKeyboardTouch.h; sourceTree = "<group>"; };
7CEBD8A60F33A0D800CAF6AD /* SpecialProtocolDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpecialProtocolDirectory.cpp; sourceTree = "<group>"; };
7CEBD8A70F33A0D800CAF6AD /* SpecialProtocolDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecialProtocolDirectory.h; sourceTree = "<group>"; };
7CED59381CD340460093F573 /* VideoToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoToolbox.framework; path = System/Library/Frameworks/VideoToolbox.framework; sourceTree = SDKROOT; };
@@ -5730,6 +5734,8 @@
E38A06CD0D95AA5500FF8227 /* GUIDialogKaiToast.h */,
DF830D0A15BB260C00602BE6 /* GUIDialogKeyboardGeneric.cpp */,
DF830D0B15BB260C00602BE6 /* GUIDialogKeyboardGeneric.h */,
+ 7CE514A81CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp */,
+ 7CE514A91CD5154A0046BC5C /* GUIDialogKeyboardTouch.h */,
36A95DA31624894400727135 /* GUIDialogMediaFilter.cpp */,
36A95DA41624894400727135 /* GUIDialogMediaFilter.h */,
E38E17B80D25F9FA00618676 /* GUIDialogMediaSource.cpp */,
@@ -9648,6 +9654,7 @@
E38E1F5A0D25F9FD00618676 /* emu_kernel32.cpp in Sources */,
E38E1F5C0D25F9FD00618676 /* emu_msvcrt.cpp in Sources */,
E38E1F6F0D25F9FD00618676 /* EmuFileWrapper.cpp in Sources */,
+ 7CE514AA1CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp in Sources */,
E38E1F710D25F9FD00618676 /* wrapper.c in Sources */,
E38E1F720D25F9FD00618676 /* ldt_keeper.c in Sources */,
E38E1F730D25F9FD00618676 /* LibraryLoader.cpp in Sources */,
@@ -10922,6 +10929,7 @@
E4991213174E5D5A00741B6D /* PAPlayer.cpp in Sources */,
E499121B174E5D5A00741B6D /* PlayerCoreFactory.cpp in Sources */,
E499121C174E5D5A00741B6D /* PlayerSelectionRule.cpp in Sources */,
+ 7CE514AB1CD5154A0046BC5C /* GUIDialogKeyboardTouch.cpp in Sources */,
E499121D174E5D5A00741B6D /* ConvolutionKernels.cpp in Sources */,
E499121E174E5D5A00741B6D /* VideoFilterShader.cpp in Sources */,
E499121F174E5D5A00741B6D /* YUV2RGBShader.cpp in Sources */,
diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj
index 560b852f7f..780b6029fb 100644
--- a/project/VS2010Express/XBMC.vcxproj
+++ b/project/VS2010Express/XBMC.vcxproj
@@ -334,6 +334,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)"</Command>
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogGamepad.cpp" />
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogKaiToast.cpp" />
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogKeyboardGeneric.cpp" />
+ <ClCompile Include="..\..\xbmc\dialogs\GUIDialogKeyboardTouch.cpp" />
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogMediaFilter.cpp" />
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogMediaSource.cpp" />
<ClCompile Include="..\..\xbmc\dialogs\GUIDialogNumeric.cpp" />
@@ -1089,6 +1090,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)"</Command>
<ClInclude Include="..\..\xbmc\cores\VideoPlayer\VideoRenderers\WinRenderer.h" />
<ClInclude Include="..\..\xbmc\dialogs\GUIDialogKeyboardGeneric.h" />
<ClInclude Include="..\..\xbmc\DbUrl.h" />
+ <ClInclude Include="..\..\xbmc\dialogs\GUIDialogKeyboardTouch.h" />
<ClInclude Include="..\..\xbmc\dialogs\GUIDialogMediaFilter.h" />
<ClInclude Include="..\..\xbmc\dialogs\GUIDialogSimpleMenu.h" />
<ClInclude Include="..\..\xbmc\epg\GUIEPGGridContainerModel.h" />
diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters
index 4f17fd1ee9..43758b2252 100644
--- a/project/VS2010Express/XBMC.vcxproj.filters
+++ b/project/VS2010Express/XBMC.vcxproj.filters
@@ -3462,6 +3462,9 @@
<ClCompile Include="..\..\xbmc\epg\GUIEPGGridContainerModel.cpp">
<Filter>epg</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\dialogs\GUIDialogKeyboardTouch.cpp">
+ <Filter>dialogs</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xbmc\win32\pch.h">
@@ -6723,6 +6726,9 @@
<ClInclude Include="..\..\xbmc\epg\GUIEPGGridContainerModel.h">
<Filter>epg</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\dialogs\GUIDialogKeyboardTouch.h">
+ <Filter>dialogs</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp
index 67fd5aa99d..335c62a260 100644
--- a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp
+++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp
@@ -339,7 +339,7 @@ void CGUIAddonWindowDialog::Show_Internal(bool show /* = true */)
m_renderOrder = RENDER_ORDER_DIALOG;
while (m_bRunning && !g_application.m_bStop)
{
- g_windowManager.ProcessRenderLoop();
+ ProcessRenderLoop();
}
}
else // hide
diff --git a/xbmc/dialogs/CMakeLists.txt b/xbmc/dialogs/CMakeLists.txt
index e780a89dcd..abdd6ee50e 100644
--- a/xbmc/dialogs/CMakeLists.txt
+++ b/xbmc/dialogs/CMakeLists.txt
@@ -9,6 +9,7 @@ set(SOURCES GUIDialogBoxBase.cpp
GUIDialogGamepad.cpp
GUIDialogKaiToast.cpp
GUIDialogKeyboardGeneric.cpp
+ GUIDialogKeyboardTouch.cpp
GUIDialogMediaFilter.cpp
GUIDialogMediaSource.cpp
GUIDialogNumeric.cpp
@@ -38,6 +39,7 @@ set(HEADERS GUIDialogBoxBase.h
GUIDialogGamepad.h
GUIDialogKaiToast.h
GUIDialogKeyboardGeneric.h
+ GUIDialogKeyboardTouch.h
GUIDialogMediaFilter.h
GUIDialogMediaSource.h
GUIDialogNumeric.h
diff --git a/xbmc/dialogs/GUIDialogBusy.cpp b/xbmc/dialogs/GUIDialogBusy.cpp
index 6816b45cc6..8ea5161637 100644
--- a/xbmc/dialogs/GUIDialogBusy.cpp
+++ b/xbmc/dialogs/GUIDialogBusy.cpp
@@ -71,7 +71,7 @@ bool CGUIDialogBusy::WaitOnEvent(CEvent &event, unsigned int displaytime /* = 10
while(!event.WaitMSec(1))
{
- g_windowManager.ProcessRenderLoop(false);
+ dialog->ProcessRenderLoop(false);
if (allowCancel && dialog->IsCanceled())
{
cancelled = true;
diff --git a/xbmc/dialogs/GUIDialogKeyboardTouch.cpp b/xbmc/dialogs/GUIDialogKeyboardTouch.cpp
new file mode 100644
index 0000000000..004c847e61
--- /dev/null
+++ b/xbmc/dialogs/GUIDialogKeyboardTouch.cpp
@@ -0,0 +1,99 @@
+/*
+ * 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 XBMC; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "GUIDialogKeyboardTouch.h"
+#if defined(TARGET_DARWIN_IOS)
+#include "platform/darwin/ios/IOSKeyboard.h"
+#endif
+
+CGUIDialogKeyboardTouch::CGUIDialogKeyboardTouch()
+: CGUIDialog(WINDOW_DIALOG_KEYBOARD_TOUCH, "")
+, CGUIKeyboard()
+, CThread("keyboard")
+, m_pCharCallback(NULL)
+{
+}
+
+bool CGUIDialogKeyboardTouch::ShowAndGetInput(char_callback_t pCallback, const std::string &initialString, std::string &typedString, const std::string &heading, bool bHiddenInput)
+{
+#if defined(TARGET_DARWIN_IOS)
+ m_keyboard.reset(new CIOSKeyboard());
+#endif
+
+ if (!m_keyboard)
+ return false;
+
+ m_pCharCallback = pCallback;
+ m_initialString = initialString;
+ m_typedString = typedString;
+ m_heading = heading;
+ m_bHiddenInput = bHiddenInput;
+
+ m_confirmed = false;
+ Initialize();
+ Open();
+
+ m_keyboard.reset();
+
+ if (m_confirmed)
+ {
+ typedString = m_typedString;
+ return true;
+ }
+
+ return false;
+}
+
+bool CGUIDialogKeyboardTouch::SetTextToKeyboard(const std::string &text, bool closeKeyboard)
+{
+ if (m_keyboard)
+ return m_keyboard->SetTextToKeyboard(text, closeKeyboard);
+
+ return false;
+}
+
+void CGUIDialogKeyboardTouch::Cancel()
+{
+ if (m_keyboard)
+ m_keyboard->Cancel();
+ return;
+}
+
+int CGUIDialogKeyboardTouch::GetWindowId() const
+{
+ return GetID();
+}
+
+void CGUIDialogKeyboardTouch::OnInitWindow()
+{
+ CGUIDialog::OnInitWindow();
+ m_windowLoaded = true;
+ m_active = true;
+ Create();
+}
+
+void CGUIDialogKeyboardTouch::Process()
+{
+ if (m_keyboard)
+ {
+ m_confirmed = m_keyboard->ShowAndGetInput(m_pCharCallback, m_initialString, m_typedString, m_heading, m_bHiddenInput);
+ }
+ Close();
+} \ No newline at end of file
diff --git a/xbmc/dialogs/GUIDialogKeyboardTouch.h b/xbmc/dialogs/GUIDialogKeyboardTouch.h
new file mode 100644
index 0000000000..e1cb5d83f1
--- /dev/null
+++ b/xbmc/dialogs/GUIDialogKeyboardTouch.h
@@ -0,0 +1,49 @@
+/*
+ * 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/>.
+ *
+ */
+#pragma once
+
+#include "guilib/GUIDialog.h"
+#include "guilib/GUIKeyboard.h"
+#include <atomic>
+#include <memory>
+
+class CGUIDialogKeyboardTouch : public CGUIDialog, public CGUIKeyboard, public CThread
+{
+public:
+ CGUIDialogKeyboardTouch();
+ bool ShowAndGetInput(char_callback_t pCallback, const std::string &initialString, std::string &typedString, const std::string &heading, bool bHiddenInput) override;
+ bool SetTextToKeyboard(const std::string &text, bool closeKeyboard = false) override;
+ void Cancel() override;
+ int GetWindowId() const override;
+
+protected:
+ void OnInitWindow() override;
+ void Process() override;
+
+ char_callback_t m_pCharCallback;
+ std::string m_initialString;
+ std::string m_typedString;
+ std::string m_heading;
+ bool m_bHiddenInput;
+
+ std::unique_ptr<CGUIKeyboard> m_keyboard;
+ std::atomic_bool m_active;
+ bool m_confirmed;
+};
diff --git a/xbmc/dialogs/GUIDialogProgress.cpp b/xbmc/dialogs/GUIDialogProgress.cpp
index dc1427150f..d405c81649 100644
--- a/xbmc/dialogs/GUIDialogProgress.cpp
+++ b/xbmc/dialogs/GUIDialogProgress.cpp
@@ -85,15 +85,7 @@ void CGUIDialogProgress::Progress()
{
if (m_active)
{
- g_windowManager.ProcessRenderLoop();
- }
-}
-
-void CGUIDialogProgress::ProgressKeys()
-{
- if (m_active)
- {
- g_application.FrameMove(true);
+ ProcessRenderLoop();
}
}
diff --git a/xbmc/dialogs/GUIDialogProgress.h b/xbmc/dialogs/GUIDialogProgress.h
index a654f92043..a9f0702326 100644
--- a/xbmc/dialogs/GUIDialogProgress.h
+++ b/xbmc/dialogs/GUIDialogProgress.h
@@ -35,7 +35,6 @@ public:
virtual bool OnBack(int actionID);
virtual void OnWindowLoaded();
void Progress();
- void ProgressKeys();
bool IsCanceled() const { return m_bCanceled; }
void SetPercentage(int iPercentage);
int GetPercentage() const { return m_percentage; };
diff --git a/xbmc/dialogs/Makefile b/xbmc/dialogs/Makefile
index 941847bb0a..5bb886970e 100644
--- a/xbmc/dialogs/Makefile
+++ b/xbmc/dialogs/Makefile
@@ -9,6 +9,7 @@ SRCS=GUIDialogBoxBase.cpp \
GUIDialogGamepad.cpp \
GUIDialogKaiToast.cpp \
GUIDialogKeyboardGeneric.cpp \
+ GUIDialogKeyboardTouch.cpp \
GUIDialogMediaFilter.cpp \
GUIDialogMediaSource.cpp \
GUIDialogNumeric.cpp \
diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp
index 0b3e394721..1a713dc0fe 100644
--- a/xbmc/filesystem/Directory.cpp
+++ b/xbmc/filesystem/Directory.cpp
@@ -88,6 +88,11 @@ public:
CJobManager::GetInstance().CancelJob(m_id);
}
+ CEvent& GetEvent()
+ {
+ return m_result->m_event;
+ }
+
bool Wait(unsigned int timeout)
{
return m_result->m_event.WaitMSec(timeout);
@@ -168,36 +173,13 @@ bool CDirectory::GetDirectory(const CURL& url, CFileItemList &items, const CHint
CSingleExit ex(g_graphicsContext);
CGetDirectory get(pDirectory, realURL, url);
- if(!get.Wait(TIME_TO_BUSY_DIALOG))
+
+ if (!CGUIDialogBusy::WaitOnEvent(get.GetEvent(), TIME_TO_BUSY_DIALOG))
{
- CGUIDialogBusy* dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
- if (dialog)
- {
- dialog->Open();
-
- while(!get.Wait(10))
- {
- CSingleLock lock(g_graphicsContext);
-
- // update progress
- float progress = pDirectory->GetProgress();
- if (progress > 0)
- dialog->SetProgress(progress);
-
- if (dialog->IsCanceled())
- {
- cancel = true;
- pDirectory->CancelDirectory();
- break;
- }
-
- lock.Leave(); // prevent an occasional deadlock on exit
- g_windowManager.ProcessRenderLoop(false);
- }
-
- dialog->Close();
- }
+ cancel = true;
+ pDirectory->CancelDirectory();
}
+
result = get.GetDirectory(items);
}
else
diff --git a/xbmc/filesystem/PluginDirectory.cpp b/xbmc/filesystem/PluginDirectory.cpp
index e8b63bf616..0987e3aa4e 100644
--- a/xbmc/filesystem/PluginDirectory.cpp
+++ b/xbmc/filesystem/PluginDirectory.cpp
@@ -36,7 +36,6 @@
#include "utils/JobManager.h"
#include "utils/StringUtils.h"
#include "messaging/ApplicationMessenger.h"
-#include "Application.h"
#include "URL.h"
using namespace XFILE;
@@ -457,7 +456,6 @@ bool CPluginDirectory::WaitOnScriptResult(const std::string &scriptPath, int scr
unsigned int startTime = XbmcThreads::SystemClockMillis();
CGUIDialogProgress *progressBar = NULL;
bool cancelled = false;
- bool inMainAppThread = g_application.IsCurrentThread();
CLog::Log(LOGDEBUG, "%s - waiting on the %s (id=%d) plugin...", __FUNCTION__, scriptName.c_str(), scriptId);
while (true)
@@ -513,17 +511,14 @@ bool CPluginDirectory::WaitOnScriptResult(const std::string &scriptPath, int scr
m_cancelled = true;
}
}
- else // if the progressBar exists and we call StartModal or Progress we get the
- // ProcessRenderLoop call anyway.
- if (inMainAppThread)
- g_windowManager.ProcessRenderLoop();
if (!cancelled && m_cancelled)
{
cancelled = true;
startTime = XbmcThreads::SystemClockMillis();
}
- if ((cancelled && XbmcThreads::SystemClockMillis() - startTime > timeToKillScript) || g_application.m_bStop)
+
+ if ((cancelled && XbmcThreads::SystemClockMillis() - startTime > timeToKillScript))
{ // cancel our script
if (scriptId != -1 && CScriptInvocationManager::GetInstance().IsRunning(scriptId))
{
diff --git a/xbmc/guilib/GUIDialog.cpp b/xbmc/guilib/GUIDialog.cpp
index d158af2bbb..24ffe8574f 100644
--- a/xbmc/guilib/GUIDialog.cpp
+++ b/xbmc/guilib/GUIDialog.cpp
@@ -242,3 +242,8 @@ void CGUIDialog::CancelAutoClose(void)
{
m_autoClosing = false;
}
+
+void CGUIDialog::ProcessRenderLoop(bool renderOnly)
+{
+ g_windowManager.ProcessRenderLoop(renderOnly);
+}
diff --git a/xbmc/guilib/GUIDialog.h b/xbmc/guilib/GUIDialog.h
index 06aa718b1a..5142bc7bc1 100644
--- a/xbmc/guilib/GUIDialog.h
+++ b/xbmc/guilib/GUIDialog.h
@@ -76,6 +76,8 @@ protected:
virtual void Open_Internal(bool bProcessRenderLoop, const std::string &param = "");
virtual void OnDeinitWindow(int nextWindowID);
+ void ProcessRenderLoop(bool renderOnly = false);
+
bool m_wasRunning; ///< \brief true if we were running during the last DoProcess()
bool m_autoClosing;
bool m_enableSound;
diff --git a/xbmc/guilib/GUIKeyboardFactory.cpp b/xbmc/guilib/GUIKeyboardFactory.cpp
index 2a0c532644..4c6ea497f0 100644
--- a/xbmc/guilib/GUIKeyboardFactory.cpp
+++ b/xbmc/guilib/GUIKeyboardFactory.cpp
@@ -32,8 +32,7 @@
#include "dialogs/GUIDialogKeyboardGeneric.h"
#if defined(TARGET_DARWIN_IOS)
-#include "platform/darwin/ios/IOSKeyboard.h"
-#include "windowing/WindowingFactory.h"
+#include "dialogs/GUIDialogKeyboardTouch.h"
#endif
using namespace KODI::MESSAGING;
@@ -88,7 +87,6 @@ bool CGUIKeyboardFactory::ShowAndGetInput(std::string& aTextString, CVariant hea
{
bool confirmed = false;
CGUIKeyboard *kb = NULL;
- bool needsFreeing = true;
//heading can be a string or a localization id
std::string headingStr;
if (heading.isString())
@@ -97,24 +95,17 @@ bool CGUIKeyboardFactory::ShowAndGetInput(std::string& aTextString, CVariant hea
headingStr = g_localizeStrings.Get((uint32_t)heading.asInteger());
#if defined(TARGET_DARWIN_IOS)
- if (g_Windowing.GetCurrentScreen() == 0)
- kb = new CIOSKeyboard();
+ kb = (CGUIDialogKeyboardTouch*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD_TOUCH);
+#else
+ kb = (CGUIDialogKeyboardGeneric*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD);
#endif
- if(!kb)
- {
- kb = (CGUIDialogKeyboardGeneric*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD);
- needsFreeing = false;
- }
-
- if(kb)
+ if (kb)
{
g_activedKeyboard = kb;
kb->startAutoCloseTimer(autoCloseMs);
confirmed = kb->ShowAndGetInput(keyTypedCB, aTextString, aTextString, headingStr, hiddenInput);
g_activedKeyboard = NULL;
- if(needsFreeing)
- delete kb;
}
if (confirmed)
diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp
index dc874f466d..9bf1c83ea5 100644
--- a/xbmc/guilib/GUIWindowManager.cpp
+++ b/xbmc/guilib/GUIWindowManager.cpp
@@ -87,6 +87,7 @@
#include "settings/dialogs/GUIDialogContentSettings.h"
#include "dialogs/GUIDialogBusy.h"
#include "dialogs/GUIDialogKeyboardGeneric.h"
+#include "dialogs/GUIDialogKeyboardTouch.h"
#include "dialogs/GUIDialogYesNo.h"
#include "dialogs/GUIDialogOK.h"
#include "dialogs/GUIDialogProgress.h"
@@ -199,6 +200,7 @@ void CGUIWindowManager::CreateWindows()
Add(new CGUIDialogProgress);
Add(new CGUIDialogExtendedProgressBar);
Add(new CGUIDialogKeyboardGeneric);
+ Add(new CGUIDialogKeyboardTouch);
Add(new CGUIDialogVolumeBar);
Add(new CGUIDialogSeekBar);
Add(new CGUIDialogSubMenu);
@@ -320,6 +322,7 @@ bool CGUIWindowManager::DestroyWindows()
Delete(WINDOW_DIALOG_SELECT);
Delete(WINDOW_DIALOG_OK);
Delete(WINDOW_DIALOG_KEYBOARD);
+ Delete(WINDOW_DIALOG_KEYBOARD_TOUCH);
Delete(WINDOW_FULLSCREEN_VIDEO);
Delete(WINDOW_DIALOG_PROFILE_SETTINGS);
Delete(WINDOW_DIALOG_LOCK_SETTINGS);
diff --git a/xbmc/guilib/GUIWindowManager.h b/xbmc/guilib/GUIWindowManager.h
index 76be88d298..27741d8e02 100644
--- a/xbmc/guilib/GUIWindowManager.h
+++ b/xbmc/guilib/GUIWindowManager.h
@@ -40,6 +40,8 @@
#include "utils/GlobalsHandling.h"
class CGUIDialog;
+class CGUIMediaWindow;
+
enum class DialogModalityType;
namespace KODI
@@ -58,6 +60,8 @@ namespace KODI
*/
class CGUIWindowManager : public KODI::MESSAGING::IMessageTarget
{
+ friend CGUIDialog;
+ friend CGUIMediaWindow;
public:
CGUIWindowManager(void);
virtual ~CGUIWindowManager(void);
@@ -140,7 +144,6 @@ public:
bool DestroyWindows();
CGUIWindow* GetWindow(int id) const;
- void ProcessRenderLoop(bool renderOnly = false);
void SetCallback(IWindowManagerCallback& callback);
void DeInitialize();
@@ -204,6 +207,8 @@ private:
*/
void ActivateWindow_Internal(int windowID, const std::vector<std::string> &params, bool swappingWindows, bool force = false);
+ void ProcessRenderLoop(bool renderOnly = false);
+
typedef std::map<int, CGUIWindow *> WindowMap;
WindowMap m_mapWindows;
std::vector <CGUIWindow*> m_vecCustomWindows;
diff --git a/xbmc/guilib/WindowIDs.h b/xbmc/guilib/WindowIDs.h
index dcaaaae2de..ae89f2b6a8 100644
--- a/xbmc/guilib/WindowIDs.h
+++ b/xbmc/guilib/WindowIDs.h
@@ -109,6 +109,7 @@
#define WINDOW_DIALOG_SUBTITLES 10153
#define WINDOW_DIALOG_AUDIO_DSP_MANAGER 10154
#define WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS 10155
+#define WINDOW_DIALOG_KEYBOARD_TOUCH 10156
#define WINDOW_MUSIC_PLAYLIST 10500
#define WINDOW_MUSIC_FILES 10501
diff --git a/xbmc/network/upnp/UPnPPlayer.cpp b/xbmc/network/upnp/UPnPPlayer.cpp
index 760e250a24..e0adea445d 100644
--- a/xbmc/network/upnp/UPnPPlayer.cpp
+++ b/xbmc/network/upnp/UPnPPlayer.cpp
@@ -193,25 +193,10 @@ static NPT_Result WaitOnEvent(CEvent& event, XbmcThreads::EndTime& timeout, CGUI
if(event.WaitMSec(0))
return NPT_SUCCESS;
- if(dialog == NULL) {
- dialog = (CGUIDialogBusy*)g_windowManager.GetWindow(WINDOW_DIALOG_BUSY);
- dialog->Open();
- }
-
- g_windowManager.ProcessRenderLoop(false);
-
- do {
- if(event.WaitMSec(100))
- return NPT_SUCCESS;
-
- g_windowManager.ProcessRenderLoop(false);
+ if (!CGUIDialogBusy::WaitOnEvent(event))
+ return NPT_FAILURE;
- if(dialog->IsCanceled())
- return NPT_FAILURE;
-
- } while(!timeout.IsTimePast());
-
- return NPT_FAILURE;
+ return NPT_SUCCESS;
}
int CUPnPPlayer::PlayFile(const CFileItem& file, const CPlayerOptions& options, CGUIDialogBusy*& dialog, XbmcThreads::EndTime& timeout)
diff --git a/xbmc/platform/darwin/ios/IOSKeyboard.h b/xbmc/platform/darwin/ios/IOSKeyboard.h
index c870a75002..9077006cfb 100644
--- a/xbmc/platform/darwin/ios/IOSKeyboard.h
+++ b/xbmc/platform/darwin/ios/IOSKeyboard.h
@@ -28,7 +28,7 @@ class CIOSKeyboard : public CGUIKeyboard
virtual bool ShowAndGetInput(char_callback_t pCallback, const std::string &initialString, std::string &typedString, const std::string &heading, bool bHiddenInput);
virtual void Cancel();
void fireCallback(const std::string &str);
- void invalidateCallback(){m_pCharCallback = NULL;}
+ void invalidateCallback() {m_pCharCallback = NULL;}
virtual bool SetTextToKeyboard(const std::string &text, bool closeKeyboard = false);
private:
diff --git a/xbmc/platform/darwin/ios/IOSKeyboard.mm b/xbmc/platform/darwin/ios/IOSKeyboard.mm
index 93e6e0b601..9b8fe77a66 100644
--- a/xbmc/platform/darwin/ios/IOSKeyboard.mm
+++ b/xbmc/platform/darwin/ios/IOSKeyboard.mm
@@ -66,7 +66,7 @@ bool CIOSKeyboard::ShowAndGetInput(char_callback_t pCallback, const std::string
if (!m_bCanceled)
{
[g_pIosKeyboard setCancelFlag:&m_bCanceled];
- [g_pIosKeyboard activate]; // blocks and loops our application loop (like a modal dialog)
+ [g_pIosKeyboard activate]; // blocks and shows keyboard
// user is done - get resulted text and confirmation
confirmed = g_pIosKeyboard.isConfirmed;
if (confirmed)
diff --git a/xbmc/platform/darwin/ios/IOSKeyboardView.mm b/xbmc/platform/darwin/ios/IOSKeyboardView.mm
index 4f1c9389d0..725d7d9d59 100644
--- a/xbmc/platform/darwin/ios/IOSKeyboardView.mm
+++ b/xbmc/platform/darwin/ios/IOSKeyboardView.mm
@@ -18,7 +18,6 @@
*
*/
#define BOOL XBMC_BOOL
-#include "guilib/GUIWindowManager.h"
#include "guilib/GUIKeyboardFactory.h"
#include "threads/Event.h"
#include "Application.h"
@@ -245,19 +244,14 @@ static CEvent keyboardFinishedEvent;
return;
}
- // emulate a modale dialog here
// we are waiting on the user finishing the keyboard
- // and have to process our app while doing that
- // basicall what our GUIDialog does if called modal
- while(!keyboardFinishedEvent.WaitMSec(500) && !g_application.m_bStop)
+ while(!keyboardFinishedEvent.WaitMSec(500))
{
if (NULL != _canceled && *_canceled)
{
[self deactivate];
_canceled = NULL;
}
- // if we are not in xbmc main thread, ProcessRenderLoop() is nop.
- g_windowManager.ProcessRenderLoop();
}
}
diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.cpp b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
index 988f762d33..58fac2fca3 100644
--- a/xbmc/pvr/windows/GUIWindowPVRBase.cpp
+++ b/xbmc/pvr/windows/GUIWindowPVRBase.cpp
@@ -141,37 +141,7 @@ void CGUIWindowPVRBase::OnInitWindow(void)
{
if (!g_PVRManager.IsStarted() || !g_PVRClients->HasCreatedClients())
{
- // wait until the PVR manager has been started
- CGUIDialogProgress* dialog = static_cast<CGUIDialogProgress*>(g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS));
- if (dialog)
- {
- dialog->SetHeading(CVariant{19235});
- dialog->SetText(CVariant{19045});
- dialog->ShowProgressBar(false);
- dialog->Open();
-
- // do not block the gfx context while waiting
- CSingleExit exit(g_graphicsContext);
-
- CEvent event(true);
- while(!event.WaitMSec(1))
- {
- if (g_PVRManager.IsStarted() && g_PVRClients->HasCreatedClients())
- event.Set();
-
- if (dialog->IsCanceled())
- {
- // return to previous window if canceled
- dialog->Close();
- g_windowManager.PreviousWindow();
- return;
- }
-
- g_windowManager.ProcessRenderLoop(false);
- }
-
- dialog->Close();
- }
+ return;
}
{
diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp
index f4873c2ba7..3ed99ad24c 100644
--- a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp
+++ b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp
@@ -730,7 +730,7 @@ void CGUIDialogAudioDSPManager::Update()
m_availableItems[iModeType]->Add(pItem);
}
}
- g_windowManager.ProcessRenderLoop(false);
+ ProcessRenderLoop(false);
}
m_availableItems[iModeType]->Sort(SortByLabel, SortOrderAscending);
@@ -850,7 +850,7 @@ bool CGUIDialogAudioDSPManager::UpdateDatabase(CGUIDialogBusy* pDlgBusy)
}
}
- g_windowManager.ProcessRenderLoop(false);
+ ProcessRenderLoop(false);
}
for (int iListPtr = 0; iListPtr < m_availableItems[i]->Size(); iListPtr++)
@@ -883,7 +883,7 @@ bool CGUIDialogAudioDSPManager::UpdateDatabase(CGUIDialogBusy* pDlgBusy)
}
}
- g_windowManager.ProcessRenderLoop(false);
+ ProcessRenderLoop(false);
}
}
db.Close();
diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp
index 5360581194..36b3d8163f 100644
--- a/xbmc/windows/GUIMediaWindow.cpp
+++ b/xbmc/windows/GUIMediaWindow.cpp
@@ -2002,3 +2002,8 @@ std::string CGUIMediaWindow::RemoveParameterFromPath(const std::string &strDirec
return strDirectory;
}
+
+void CGUIMediaWindow::ProcessRenderLoop(bool renderOnly)
+{
+ g_windowManager.ProcessRenderLoop(renderOnly);
+}
diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h
index 738fae4ee4..b1eb511624 100644
--- a/xbmc/windows/GUIMediaWindow.h
+++ b/xbmc/windows/GUIMediaWindow.h
@@ -179,6 +179,8 @@ protected:
*/
static std::string RemoveParameterFromPath(const std::string &strDirectory, const std::string &strParameter);
+ void ProcessRenderLoop(bool renderOnly = false);
+
XFILE::CVirtualDirectory m_rootDir;
CGUIViewControl m_viewControl;