aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalPT <CrystalPT@svn>2010-07-02 03:40:21 +0000
committerCrystalPT <CrystalPT@svn>2010-07-02 03:40:21 +0000
commitfae8a5645a0905b9a6dd4ace823485aa7630fcb3 (patch)
tree6a637e2aa56c2192e285d6274d8083ffdd69d476
parent3b671395457d7495e57ea83eb0d200c74f8ab5bc (diff)
changed: Refresh Rate Spinner - show only in standalone mode
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@31552 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/GUISettings.cpp3
-rw-r--r--xbmc/GUIWindowSettingsCategory.cpp59
2 files changed, 34 insertions, 28 deletions
diff --git a/xbmc/GUISettings.cpp b/xbmc/GUISettings.cpp
index bb78381ff2..866248bafe 100644
--- a/xbmc/GUISettings.cpp
+++ b/xbmc/GUISettings.cpp
@@ -371,8 +371,7 @@ void CGUISettings::Initialize()
#else
AddInt(vs, "videoscreen.resolution", 169, -1, 0, 1, INT_MAX, SPIN_CONTROL_TEXT);
#endif
-//TODO: attach to vs in standalone mode only
- AddString(vs, "videoscreen.screenmode", 243, "DESKTOP", SPIN_CONTROL_TEXT);
+ AddString(g_application.IsStandAlone() ? vs : NULL, "videoscreen.screenmode", 243, "DESKTOP", SPIN_CONTROL_TEXT);
#if defined(_WIN32) || defined (__APPLE__)
// We prefer a fake fullscreen mode (window covering the screen rather than dedicated fullscreen)
diff --git a/xbmc/GUIWindowSettingsCategory.cpp b/xbmc/GUIWindowSettingsCategory.cpp
index 5f09604b10..410168d6a1 100644
--- a/xbmc/GUIWindowSettingsCategory.cpp
+++ b/xbmc/GUIWindowSettingsCategory.cpp
@@ -2334,56 +2334,63 @@ void CGUIWindowSettingsCategory::FillInResolutions(CStdString strSetting, Displa
}
else
{
- // selecting a value is done outside of this function for UserChange = false
+ // selecting a value is done outside of this function when UserChange = false
}
}
void CGUIWindowSettingsCategory::FillInRefreshRates(CStdString strSetting, RESOLUTION res, bool UserChange)
{
// The only meaningful parts of res here are iScreen, iWidth, iHeight
- CBaseSettingControl *control = GetSetting(strSetting);
- control->SetDelayed();
- CGUISpinControlEx *pControl = (CGUISpinControlEx *)GetControl(control->GetID());
- pControl->Clear();
vector<REFRESHRATE> refreshrates;
+ if (res > RES_WINDOW)
+ refreshrates = g_Windowing.RefreshRates(g_settings.m_ResInfo[res].iScreen, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
- // Populate the list
- if (res == RES_WINDOW)
- {
- pControl->AddLabel(g_localizeStrings.Get(242), RES_WINDOW);
- }
- else
+ // The control setting doesn't exist when not in standalone mode, don't manipulate it
+ CBaseSettingControl *control = GetSetting(strSetting);
+ CGUISpinControlEx *pControl= NULL;
+
+ // Populate
+ if (control)
{
- refreshrates = g_Windowing.RefreshRates(g_settings.m_ResInfo[res].iScreen, g_settings.m_ResInfo[res].iWidth, g_settings.m_ResInfo[res].iHeight);
+ control->SetDelayed();
+ pControl = (CGUISpinControlEx *)GetControl(control->GetID());
+ pControl->Clear();
- for (unsigned int idx = 0; idx < refreshrates.size(); idx++)
+ if (res == RES_WINDOW)
{
- CStdString strRR;
- strRR.Format("%.02f%s", refreshrates[idx].RefreshRate, refreshrates[idx].Interlaced ? "i" : "");
- pControl->AddLabel(strRR, refreshrates[idx].ResInfo_Index);
+ pControl->AddLabel(g_localizeStrings.Get(242), RES_WINDOW);
+ }
+ else
+ {
+ for (unsigned int idx = 0; idx < refreshrates.size(); idx++)
+ {
+ CStdString strRR;
+ strRR.Format("%.02f%s", refreshrates[idx].RefreshRate, refreshrates[idx].Interlaced ? "i" : "");
+ pControl->AddLabel(strRR, refreshrates[idx].ResInfo_Index);
+ }
}
}
// Select a rate
if (UserChange)
{
+ RESOLUTION newresolution;
if (res == RES_WINDOW)
- {
- OnRefreshRateChanged(RES_WINDOW);
- }
+ newresolution = RES_WINDOW;
else
- {
- REFRESHRATE rr = g_Windowing.DefaultRefreshRate(g_settings.m_ResInfo[res].iScreen, refreshrates);
- pControl->SetValue(rr.ResInfo_Index);
- OnRefreshRateChanged((RESOLUTION)rr.ResInfo_Index);
- }
+ newresolution = (RESOLUTION) g_Windowing.DefaultRefreshRate(g_settings.m_ResInfo[res].iScreen, refreshrates).ResInfo_Index;
+
+ if (pControl)
+ pControl->SetValue(newresolution);
+
+ OnRefreshRateChanged(newresolution);
}
else
{
- pControl->SetValue(res);
+ if (pControl)
+ pControl->SetValue(res);
}
-
}
void CGUIWindowSettingsCategory::OnRefreshRateChanged(RESOLUTION nextRes)