aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-04-07 03:28:57 +0000
committerjmarshallnz <jmarshallnz@svn>2010-04-07 03:28:57 +0000
commit6de3383ec0e696695d3d585b9e59dd0071af3760 (patch)
tree38e21c1f7b6e8eb079e9faeab1c4136f66062d18
parentf884cf47d655721c9805174dd2303619e07b2d85 (diff)
cleanup: Move TranslateWindowString() to TranslateWindow() and use a lookup table for translation in both directions.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29098 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--guilib/GUIAudioManager.cpp2
-rw-r--r--guilib/GUIWindow.cpp2
-rw-r--r--guilib/Key.h4
-rw-r--r--xbmc/ButtonTranslator.cpp215
-rw-r--r--xbmc/ButtonTranslator.h14
-rw-r--r--xbmc/utils/Builtins.cpp10
-rw-r--r--xbmc/utils/GUIInfoManager.cpp12
7 files changed, 145 insertions, 114 deletions
diff --git a/guilib/GUIAudioManager.cpp b/guilib/GUIAudioManager.cpp
index ca9c317447..f5ec711afb 100644
--- a/guilib/GUIAudioManager.cpp
+++ b/guilib/GUIAudioManager.cpp
@@ -368,7 +368,7 @@ bool CGUIAudioManager::Load()
if (pIdNode)
{
if (pIdNode->FirstChild())
- id = CButtonTranslator::TranslateWindowString(pIdNode->FirstChild()->Value());
+ id = CButtonTranslator::TranslateWindow(pIdNode->FirstChild()->Value());
}
CWindowSounds sounds;
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp
index 1c98d5563d..be8ac3d72f 100644
--- a/guilib/GUIWindow.cpp
+++ b/guilib/GUIWindow.cpp
@@ -159,7 +159,7 @@ bool CGUIWindow::Load(TiXmlDocument &xmlDoc)
}
else if (strValue == "previouswindow" && pChild->FirstChild())
{
- m_previousWindow = CButtonTranslator::TranslateWindowString(pChild->FirstChild()->Value());
+ m_previousWindow = CButtonTranslator::TranslateWindow(pChild->FirstChild()->Value());
}
else if (strValue == "defaultcontrol" && pChild->FirstChild())
{
diff --git a/guilib/Key.h b/guilib/Key.h
index c81a072bca..8f3d337be6 100644
--- a/guilib/Key.h
+++ b/guilib/Key.h
@@ -309,9 +309,7 @@
#define WINDOW_SETTINGS_APPEARANCE 10019
#define WINDOW_SCRIPTS 10020
-#define WINDOW_VIDEO_GENRE 10021
-#define WINDOW_VIDEO_ACTOR 10022
-#define WINDOW_VIDEO_YEAR 10023
+
#define WINDOW_VIDEO_FILES 10024
#define WINDOW_VIDEO_NAV 10025
#define WINDOW_VIDEO_PLAYLIST 10028
diff --git a/xbmc/ButtonTranslator.cpp b/xbmc/ButtonTranslator.cpp
index c424ad54af..532e16610f 100644
--- a/xbmc/ButtonTranslator.cpp
+++ b/xbmc/ButtonTranslator.cpp
@@ -190,6 +190,100 @@ static const ActionMapping actions[] =
{"increasepar" , ACTION_INCREASE_PAR},
{"decreasepar" , ACTION_DECREASE_PAR}};
+static const ActionMapping windows[] =
+ {{"home" , WINDOW_HOME},
+ {"programs" , WINDOW_PROGRAMS},
+ {"pictures" , WINDOW_PICTURES},
+ {"filemanager" , WINDOW_FILES},
+ {"files" , WINDOW_FILES}, // backward compat
+ {"settings" , WINDOW_SETTINGS_MENU},
+ {"music" , WINDOW_MUSIC},
+ {"video" , WINDOW_VIDEOS},
+ {"videos" , WINDOW_VIDEOS}, // backward compat
+ {"systeminfo" , WINDOW_SYSTEM_INFORMATION},
+ {"testpattern" , WINDOW_TEST_PATTERN},
+ {"screencalibration" , WINDOW_SCREEN_CALIBRATION},
+ {"guicalibration" , WINDOW_SCREEN_CALIBRATION}, // backward compat
+ {"picturessettings" , WINDOW_SETTINGS_MYPICTURES},
+ {"programssettings" , WINDOW_SETTINGS_MYPROGRAMS},
+ {"weathersettings" , WINDOW_SETTINGS_MYWEATHER},
+ {"musicsettings" , WINDOW_SETTINGS_MYMUSIC},
+ {"systemsettings" , WINDOW_SETTINGS_SYSTEM},
+ {"videossettings" , WINDOW_SETTINGS_MYVIDEOS},
+ {"networksettings" , WINDOW_SETTINGS_NETWORK},
+ {"appearancesettings" , WINDOW_SETTINGS_APPEARANCE},
+ {"scripts" , WINDOW_SCRIPTS},
+ {"videofiles" , WINDOW_VIDEO_FILES},
+ {"videolibrary" , WINDOW_VIDEO_NAV},
+ {"videoplaylist" , WINDOW_VIDEO_PLAYLIST},
+ {"loginscreen" , WINDOW_LOGIN_SCREEN},
+ {"profiles" , WINDOW_SETTINGS_PROFILES},
+ {"addonbrowser" , WINDOW_ADDON_BROWSER},
+ {"yesnodialog" , WINDOW_DIALOG_YES_NO},
+ {"progressdialog" , WINDOW_DIALOG_PROGRESS},
+ {"virtualkeyboard" , WINDOW_DIALOG_KEYBOARD},
+ {"volumebar" , WINDOW_DIALOG_VOLUME_BAR},
+ {"submenu" , WINDOW_DIALOG_SUB_MENU},
+ {"favourites" , WINDOW_DIALOG_FAVOURITES},
+ {"contextmenu" , WINDOW_DIALOG_CONTEXT_MENU},
+ {"infodialog" , WINDOW_DIALOG_KAI_TOAST},
+ {"numericinput" , WINDOW_DIALOG_NUMERIC},
+ {"gamepadinput" , WINDOW_DIALOG_GAMEPAD},
+ {"shutdownmenu" , WINDOW_DIALOG_BUTTON_MENU},
+ {"musicscan" , WINDOW_DIALOG_MUSIC_SCAN},
+ {"mutebug" , WINDOW_DIALOG_MUTE_BUG},
+ {"playercontrols" , WINDOW_DIALOG_PLAYER_CONTROLS},
+ {"seekbar" , WINDOW_DIALOG_SEEK_BAR},
+ {"musicosd" , WINDOW_DIALOG_MUSIC_OSD},
+ {"addonsettings" , WINDOW_DIALOG_ADDON_SETTINGS},
+ {"visualisationsettings" , WINDOW_DIALOG_ADDON_SETTINGS}, // backward compat
+ {"visualisationpresetlist" , WINDOW_DIALOG_VIS_PRESET_LIST},
+ {"osdvideosettings" , WINDOW_DIALOG_VIDEO_OSD_SETTINGS},
+ {"osdaudiosettings" , WINDOW_DIALOG_AUDIO_OSD_SETTINGS},
+ {"videobookmarks" , WINDOW_DIALOG_VIDEO_BOOKMARKS},
+ {"filebrowser" , WINDOW_DIALOG_FILE_BROWSER},
+ {"networksetup" , WINDOW_DIALOG_NETWORK_SETUP},
+ {"mediasource" , WINDOW_DIALOG_MEDIA_SOURCE},
+ {"profilesettings" , WINDOW_DIALOG_PROFILE_SETTINGS},
+ {"locksettings" , WINDOW_DIALOG_LOCK_SETTINGS},
+ {"contentsettings" , WINDOW_DIALOG_CONTENT_SETTINGS},
+ {"videoscan" , WINDOW_DIALOG_VIDEO_SCAN},
+ {"favourites" , WINDOW_DIALOG_FAVOURITES},
+ {"songinformation" , WINDOW_DIALOG_SONG_INFO},
+ {"smartplaylisteditor" , WINDOW_DIALOG_SMART_PLAYLIST_EDITOR},
+ {"smartplaylistrule" , WINDOW_DIALOG_SMART_PLAYLIST_RULE},
+ {"busydialog" , WINDOW_DIALOG_BUSY},
+ {"pictureinfo" , WINDOW_DIALOG_PICTURE_INFO},
+ {"accesspoints" , WINDOW_DIALOG_ACCESS_POINTS},
+ {"fullscreeninfo" , WINDOW_DIALOG_FULLSCREEN_INFO},
+ {"karaokeselector" , WINDOW_DIALOG_KARAOKE_SONGSELECT},
+ {"karaokelargeselector" , WINDOW_DIALOG_KARAOKE_SELECTOR},
+ {"sliderdialog" , WINDOW_DIALOG_SLIDER},
+ {"musicplaylist" , WINDOW_MUSIC_PLAYLIST},
+ {"musicfiles" , WINDOW_MUSIC_FILES},
+ {"musiclibrary" , WINDOW_MUSIC_NAV},
+ {"musicplaylisteditor" , WINDOW_MUSIC_PLAYLIST_EDITOR},
+ {"teletext" , WINDOW_DIALOG_OSD_TELETEXT},
+ {"selectdialog" , WINDOW_DIALOG_SELECT},
+ {"musicinformation" , WINDOW_MUSIC_INFO},
+ {"okdialog" , WINDOW_DIALOG_OK},
+ {"movieinformation" , WINDOW_VIDEO_INFO},
+ {"scriptsdebuginfo" , WINDOW_SCRIPTS_INFO},
+ {"fullscreenvideo" , WINDOW_FULLSCREEN_VIDEO},
+ {"visualisation" , WINDOW_VISUALISATION},
+ {"slideshow" , WINDOW_SLIDESHOW},
+ {"filestackingdialog" , WINDOW_DIALOG_FILESTACKING},
+ {"karaoke" , WINDOW_KARAOKELYRICS},
+ {"weather" , WINDOW_WEATHER},
+ {"screensaver" , WINDOW_SCREENSAVER},
+ {"videoosd" , WINDOW_OSD},
+ {"videomenu" , WINDOW_VIDEO_MENU},
+ {"musicoverlay" , WINDOW_MUSIC_OVERLAY},
+ {"videooverlay" , WINDOW_VIDEO_OVERLAY},
+ {"startwindow" , WINDOW_START},
+ {"startup" , WINDOW_STARTUP_ANIM}};
+
+
CButtonTranslator& CButtonTranslator::GetInstance()
{
static CButtonTranslator sl_instance;
@@ -296,7 +390,7 @@ bool CButtonTranslator::LoadKeymap(const CStdString &keymapPath)
if (strcmpi(szWindow, "global") == 0)
windowID = -1;
else
- windowID = TranslateWindowString(szWindow);
+ windowID = TranslateWindow(szWindow);
}
MapWindowActions(pWindow, windowID);
}
@@ -795,11 +889,20 @@ bool CButtonTranslator::TranslateActionString(const char *szAction, int &action)
return true;
}
-int CButtonTranslator::TranslateWindowString(const char *szWindow)
+CStdString CButtonTranslator::TranslateWindow(int windowID)
+{
+ for (unsigned int index = 0; index < sizeof(windows) / sizeof(windows[0]); ++index)
+ {
+ if (windows[index].action == windowID)
+ return windows[index].name;
+ }
+ return "";
+}
+
+int CButtonTranslator::TranslateWindow(const CStdString &window)
{
- int windowID = WINDOW_INVALID;
- CStdString strWindow = szWindow;
- if (strWindow.IsEmpty()) return windowID;
+ CStdString strWindow(window);
+ if (strWindow.IsEmpty()) return WINDOW_INVALID;
strWindow.ToLower();
// eliminate .xml
if (strWindow.Mid(strWindow.GetLength() - 4) == ".xml" )
@@ -815,99 +918,19 @@ int CButtonTranslator::TranslateWindowString(const char *szWindow)
// allow a full window id or a delta id
int iWindow = atoi(strWindow.c_str());
if (iWindow > WINDOW_INVALID)
- windowID = iWindow;
- else
- windowID = WINDOW_HOME + iWindow;
+ return iWindow;
+ return WINDOW_HOME + iWindow;
+ }
+
+ // run through the window structure
+ for (unsigned int index = 0; index < sizeof(windows) / sizeof(windows[0]); ++index)
+ {
+ if (strWindow.Equals(windows[index].name))
+ return windows[index].action;
}
- else if (strWindow.Equals("home")) windowID = WINDOW_HOME;
- else if (strWindow.Equals("programs")) windowID = WINDOW_PROGRAMS;
- else if (strWindow.Equals("pictures")) windowID = WINDOW_PICTURES;
- else if (strWindow.Equals("files") || strWindow.Equals("filemanager")) windowID = WINDOW_FILES;
- else if (strWindow.Equals("settings")) windowID = WINDOW_SETTINGS_MENU;
- else if (strWindow.Equals("music")) windowID = WINDOW_MUSIC;
- else if (strWindow.Equals("musicfiles")) windowID = WINDOW_MUSIC_FILES;
- else if (strWindow.Equals("musiclibrary")) windowID = WINDOW_MUSIC_NAV;
- else if (strWindow.Equals("musicplaylist")) windowID = WINDOW_MUSIC_PLAYLIST;
- else if (strWindow.Equals("musicplaylisteditor")) windowID = WINDOW_MUSIC_PLAYLIST_EDITOR;
- else if (strWindow.Equals("musicinformation")) windowID = WINDOW_MUSIC_INFO;
- else if (strWindow.Equals("video") || strWindow.Equals("videos")) windowID = WINDOW_VIDEOS;
- else if (strWindow.Equals("videofiles")) windowID = WINDOW_VIDEO_FILES;
- else if (strWindow.Equals("videolibrary")) windowID = WINDOW_VIDEO_NAV;
- else if (strWindow.Equals("videoplaylist")) windowID = WINDOW_VIDEO_PLAYLIST;
- else if (strWindow.Equals("addonbrowser")) windowID = WINDOW_ADDON_BROWSER;
- else if (strWindow.Equals("systeminfo")) windowID = WINDOW_SYSTEM_INFORMATION;
- else if (strWindow.Equals("teletext")) windowID = WINDOW_DIALOG_OSD_TELETEXT;
- else if (strWindow.Equals("guicalibration")) windowID = WINDOW_SCREEN_CALIBRATION;
- else if (strWindow.Equals("screencalibration")) windowID = WINDOW_SCREEN_CALIBRATION;
- else if (strWindow.Equals("testpattern")) windowID = WINDOW_TEST_PATTERN;
- else if (strWindow.Equals("picturessettings")) windowID = WINDOW_SETTINGS_MYPICTURES;
- else if (strWindow.Equals("programssettings")) windowID = WINDOW_SETTINGS_MYPROGRAMS;
- else if (strWindow.Equals("weathersettings")) windowID = WINDOW_SETTINGS_MYWEATHER;
- else if (strWindow.Equals("musicsettings")) windowID = WINDOW_SETTINGS_MYMUSIC;
- else if (strWindow.Equals("systemsettings")) windowID = WINDOW_SETTINGS_SYSTEM;
- else if (strWindow.Equals("videossettings")) windowID = WINDOW_SETTINGS_MYVIDEOS;
- else if (strWindow.Equals("networksettings")) windowID = WINDOW_SETTINGS_NETWORK;
- else if (strWindow.Equals("appearancesettings")) windowID = WINDOW_SETTINGS_APPEARANCE;
- else if (strWindow.Equals("scripts")) windowID = WINDOW_SCRIPTS;
- else if (strWindow.Equals("profiles")) windowID = WINDOW_SETTINGS_PROFILES;
- else if (strWindow.Equals("yesnodialog")) windowID = WINDOW_DIALOG_YES_NO;
- else if (strWindow.Equals("progressdialog")) windowID = WINDOW_DIALOG_PROGRESS;
- else if (strWindow.Equals("virtualkeyboard")) windowID = WINDOW_DIALOG_KEYBOARD;
- else if (strWindow.Equals("volumebar")) windowID = WINDOW_DIALOG_VOLUME_BAR;
- else if (strWindow.Equals("submenu")) windowID = WINDOW_DIALOG_SUB_MENU;
- else if (strWindow.Equals("favourites")) windowID = WINDOW_DIALOG_FAVOURITES;
- else if (strWindow.Equals("contextmenu")) windowID = WINDOW_DIALOG_CONTEXT_MENU;
- else if (strWindow.Equals("infodialog")) windowID = WINDOW_DIALOG_KAI_TOAST;
- else if (strWindow.Equals("numericinput")) windowID = WINDOW_DIALOG_NUMERIC;
- else if (strWindow.Equals("gamepadinput")) windowID = WINDOW_DIALOG_GAMEPAD;
- else if (strWindow.Equals("shutdownmenu")) windowID = WINDOW_DIALOG_BUTTON_MENU;
- else if (strWindow.Equals("scandialog")) windowID = WINDOW_DIALOG_MUSIC_SCAN;
- else if (strWindow.Equals("mutebug")) windowID = WINDOW_DIALOG_MUTE_BUG;
- else if (strWindow.Equals("playercontrols")) windowID = WINDOW_DIALOG_PLAYER_CONTROLS;
- else if (strWindow.Equals("seekbar")) windowID = WINDOW_DIALOG_SEEK_BAR;
- else if (strWindow.Equals("musicosd")) windowID = WINDOW_DIALOG_MUSIC_OSD;
- else if (strWindow.Equals("visualisationpresetlist")) windowID = WINDOW_DIALOG_VIS_PRESET_LIST;
- else if (strWindow.Equals("osdvideosettings")) windowID = WINDOW_DIALOG_VIDEO_OSD_SETTINGS;
- else if (strWindow.Equals("osdaudiosettings")) windowID = WINDOW_DIALOG_AUDIO_OSD_SETTINGS;
- else if (strWindow.Equals("videobookmarks")) windowID = WINDOW_DIALOG_VIDEO_BOOKMARKS;
- else if (strWindow.Equals("profilesettings")) windowID = WINDOW_DIALOG_PROFILE_SETTINGS;
- else if (strWindow.Equals("locksettings")) windowID = WINDOW_DIALOG_LOCK_SETTINGS;
- else if (strWindow.Equals("contentsettings")) windowID = WINDOW_DIALOG_CONTENT_SETTINGS;
- else if (strWindow.Equals("networksetup")) windowID = WINDOW_DIALOG_NETWORK_SETUP;
- else if (strWindow.Equals("mediasource")) windowID = WINDOW_DIALOG_MEDIA_SOURCE;
- else if (strWindow.Equals("smartplaylisteditor")) windowID = WINDOW_DIALOG_SMART_PLAYLIST_EDITOR;
- else if (strWindow.Equals("smartplaylistrule")) windowID = WINDOW_DIALOG_SMART_PLAYLIST_RULE;
- else if (strWindow.Equals("selectdialog")) windowID = WINDOW_DIALOG_SELECT;
- else if (strWindow.Equals("okdialog")) windowID = WINDOW_DIALOG_OK;
- else if (strWindow.Equals("movieinformation")) windowID = WINDOW_VIDEO_INFO;
- else if (strWindow.Equals("scriptsdebuginfo")) windowID = WINDOW_SCRIPTS_INFO;
- else if (strWindow.Equals("fullscreenvideo")) windowID = WINDOW_FULLSCREEN_VIDEO;
- else if (strWindow.Equals("visualisation")) windowID = WINDOW_VISUALISATION;
- else if (strWindow.Equals("slideshow")) windowID = WINDOW_SLIDESHOW;
- else if (strWindow.Equals("filestackingdialog")) windowID = WINDOW_DIALOG_FILESTACKING;
- else if (strWindow.Equals("weather")) windowID = WINDOW_WEATHER;
- else if (strWindow.Equals("screensaver")) windowID = WINDOW_SCREENSAVER;
- else if (strWindow.Equals("videoosd")) windowID = WINDOW_OSD;
- else if (strWindow.Equals("videomenu")) windowID = WINDOW_VIDEO_MENU;
- else if (strWindow.Equals("filebrowser")) windowID = WINDOW_DIALOG_FILE_BROWSER;
- else if (strWindow.Equals("startup")) windowID = WINDOW_STARTUP_ANIM;
- else if (strWindow.Equals("startwindow")) windowID = WINDOW_START;
- else if (strWindow.Equals("loginscreen")) windowID = WINDOW_LOGIN_SCREEN;
- else if (strWindow.Equals("musicoverlay")) windowID = WINDOW_MUSIC_OVERLAY;
- else if (strWindow.Equals("videooverlay")) windowID = WINDOW_VIDEO_OVERLAY;
- else if (strWindow.Equals("pictureinfo")) windowID = WINDOW_DIALOG_PICTURE_INFO;
- else if (strWindow.Equals("addonsettings") || strWindow.Equals("visualisationsettings")) windowID = WINDOW_DIALOG_ADDON_SETTINGS;
- else if (strWindow.Equals("fullscreeninfo")) windowID = WINDOW_DIALOG_FULLSCREEN_INFO;
- else if (strWindow.Equals("karaokeselector")) windowID = WINDOW_DIALOG_KARAOKE_SONGSELECT;
- else if (strWindow.Equals("karaokelargeselector")) windowID = WINDOW_DIALOG_KARAOKE_SELECTOR;
- else if (strWindow.Equals("sliderdialog")) windowID = WINDOW_DIALOG_SLIDER;
- else if (strWindow.Equals("songinformation")) windowID = WINDOW_DIALOG_SONG_INFO;
- else if (strWindow.Equals("busydialog")) windowID = WINDOW_DIALOG_BUSY;
- else
- CLog::Log(LOGERROR, "Window Translator: Can't find window %s", strWindow.c_str());
- //CLog::Log(LOGDEBUG,"CButtonTranslator::TranslateWindowString(%s) returned Window ID (%i)", szWindow, windowID);
- return windowID;
+ CLog::Log(LOGERROR, "Window Translator: Can't find window %s", strWindow.c_str());
+ return WINDOW_INVALID;
}
uint32_t CButtonTranslator::TranslateGamepadString(const char *szButton)
diff --git a/xbmc/ButtonTranslator.h b/xbmc/ButtonTranslator.h
index 366f467bf4..13ea0454cb 100644
--- a/xbmc/ButtonTranslator.h
+++ b/xbmc/ButtonTranslator.h
@@ -71,8 +71,18 @@ public:
CAction GetAction(int window, const CKey &key, bool fallback = true);
- //static helpers
- static int TranslateWindowString(const char *szWindow);
+ /*! \brief Translate between a window name and it's id
+ \param window name of the window
+ \return id of the window, or WINDOW_INVALID if not found
+ */
+ static int TranslateWindow(const CStdString &window);
+
+ /*! \brief Translate between a window id and it's name
+ \param window id of the window
+ \return name of the window, or an empty string if not found
+ */
+ static CStdString TranslateWindow(int window);
+
static bool TranslateActionString(const char *szAction, int &action);
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
diff --git a/xbmc/utils/Builtins.cpp b/xbmc/utils/Builtins.cpp
index 79213ade98..6f5f3c10e5 100644
--- a/xbmc/utils/Builtins.cpp
+++ b/xbmc/utils/Builtins.cpp
@@ -306,7 +306,7 @@ int CBuiltins::Execute(const CStdString& execString)
}
// confirm the window destination is valid prior to switching
- int iWindow = CButtonTranslator::TranslateWindowString(strWindow.c_str());
+ int iWindow = CButtonTranslator::TranslateWindow(strWindow);
if (iWindow != WINDOW_INVALID)
{
// disable the screensaver
@@ -992,7 +992,7 @@ int CBuiltins::Execute(const CStdString& execString)
}
else
{
- int id = CButtonTranslator::TranslateWindowString(params[0]);
+ int id = CButtonTranslator::TranslateWindow(params[0]);
CGUIWindow *window = (CGUIWindow *)g_windowManager.GetWindow(id);
if (window && window->IsDialog())
((CGUIDialog *)window)->Close(bForce);
@@ -1222,7 +1222,7 @@ int CBuiltins::Execute(const CStdString& execString)
else if (execute.Equals("control.message") && params.size() >= 2)
{
int controlID = atoi(params[0].c_str());
- int windowID = (params.size() == 3) ? CButtonTranslator::TranslateWindowString(params[2].c_str()) : g_windowManager.GetActiveWindow();
+ int windowID = (params.size() == 3) ? CButtonTranslator::TranslateWindow(params[2]) : g_windowManager.GetActiveWindow();
if (params[1] == "moveup")
g_windowManager.SendMessage(GUI_MSG_MOVE_OFFSET, windowID, controlID, 1);
else if (params[1] == "movedown")
@@ -1239,7 +1239,7 @@ int CBuiltins::Execute(const CStdString& execString)
if (params.size() == 2)
{
// have a window - convert it
- int windowID = CButtonTranslator::TranslateWindowString(params[0].c_str());
+ int windowID = CButtonTranslator::TranslateWindow(params[0]);
CGUIMessage message(GUI_MSG_CLICKED, atoi(params[1].c_str()), windowID);
g_windowManager.SendMessage(message);
}
@@ -1255,7 +1255,7 @@ int CBuiltins::Execute(const CStdString& execString)
int actionID;
if (CButtonTranslator::TranslateActionString(params[0].c_str(), actionID))
{
- int windowID = params.size() == 2 ? CButtonTranslator::TranslateWindowString(params[1].c_str()) : WINDOW_INVALID;
+ int windowID = params.size() == 2 ? CButtonTranslator::TranslateWindow(params[1]) : WINDOW_INVALID;
g_application.getApplicationMessenger().SendAction(CAction(actionID), windowID);
}
}
diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp
index 6e488208f1..05143367fa 100644
--- a/xbmc/utils/GUIInfoManager.cpp
+++ b/xbmc/utils/GUIInfoManager.cpp
@@ -759,7 +759,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
if (strTest.Left(7).Equals("window("))
{
CStdString window(strTest.Mid(7, strTest.Find(")", 7) - 7).ToLower());
- winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ winID = CButtonTranslator::TranslateWindow(window);
}
if (winID != WINDOW_INVALID)
{
@@ -772,7 +772,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
CStdString window(strTest.Mid(16, strTest.GetLength() - 17).ToLower());
if (window.Find("xml") >= 0)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_ACTIVE : WINDOW_IS_ACTIVE, 0, ConditionalStringParameter(window)));
- int winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ int winID = CButtonTranslator::TranslateWindow(window);
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_ACTIVE : WINDOW_IS_ACTIVE, winID, 0));
}
@@ -782,7 +782,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
CStdString window(strTest.Mid(17, strTest.GetLength() - 18).ToLower());
if (window.Find("xml") >= 0)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_TOPMOST : WINDOW_IS_TOPMOST, 0, ConditionalStringParameter(window)));
- int winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ int winID = CButtonTranslator::TranslateWindow(window);
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_TOPMOST : WINDOW_IS_TOPMOST, winID, 0));
}
@@ -791,7 +791,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
CStdString window(strTest.Mid(17, strTest.GetLength() - 18).ToLower());
if (window.Find("xml") >= 0)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_VISIBLE : WINDOW_IS_VISIBLE, 0, ConditionalStringParameter(window)));
- int winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ int winID = CButtonTranslator::TranslateWindow(window);
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_IS_VISIBLE : WINDOW_IS_VISIBLE, winID, 0));
}
@@ -800,7 +800,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
CStdString window(strTest.Mid(16, strTest.GetLength() - 17).ToLower());
if (window.Find("xml") >= 0)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_PREVIOUS : WINDOW_PREVIOUS, 0, ConditionalStringParameter(window)));
- int winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ int winID = CButtonTranslator::TranslateWindow(window);
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_PREVIOUS : WINDOW_PREVIOUS, winID, 0));
}
@@ -809,7 +809,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
CStdString window(strTest.Mid(12, strTest.GetLength() - 13).ToLower());
if (window.Find("xml") >= 0)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_NEXT : WINDOW_NEXT, 0, ConditionalStringParameter(window)));
- int winID = CButtonTranslator::TranslateWindowString(window.c_str());
+ int winID = CButtonTranslator::TranslateWindow(window);
if (winID != WINDOW_INVALID)
return AddMultiInfo(GUIInfo(bNegate ? -WINDOW_NEXT : WINDOW_NEXT, winID, 0));
}