Permalink
Browse files

Merge pull request #1203 from pieh/peripherals_update_settings

peripherals: refresh settings on device addition/deletion
  • Loading branch information...
2 parents 8621a9d + 9bed4de commit c5848116d398c024fa772eb743246ab80da86bb6 Arne Morten Kvarving committed Aug 3, 2012
Showing with 12 additions and 0 deletions.
  1. +9 −0 xbmc/peripherals/Peripherals.cpp
  2. +3 −0 xbmc/settings/GUIWindowSettingsCategory.cpp
@@ -40,6 +40,7 @@
#include "guilib/GUIWindowManager.h"
#include "guilib/LocalizeStrings.h"
#include "dialogs/GUIDialogKaiToast.h"
+#include "GUIUserMessages.h"
#include "utils/StringUtils.h"
#include "Util.h"
#include "guilib/Key.h"
@@ -311,6 +312,10 @@ void CPeripherals::OnDeviceAdded(const CPeripheralBus &bus, const CPeripheral &p
if (dialog && dialog->IsActive())
dialog->Update();
+ // refresh settings (peripherals manager could be enabled now)
+ CGUIMessage msg(GUI_MSG_UPDATE, WINDOW_SETTINGS_SYSTEM, 0);
+ g_windowManager.SendThreadMessage(msg, WINDOW_SETTINGS_SYSTEM);
+
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(35005), peripheral.DeviceName());
}
@@ -320,6 +325,10 @@ void CPeripherals::OnDeviceDeleted(const CPeripheralBus &bus, const CPeripheral
if (dialog && dialog->IsActive())
dialog->Update();
+ // refresh settings (peripherals manager could be disabled now)
+ CGUIMessage msg(GUI_MSG_UPDATE, WINDOW_SETTINGS_SYSTEM, 0);
+ g_windowManager.SendThreadMessage(msg, WINDOW_SETTINGS_SYSTEM);
+
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, g_localizeStrings.Get(35006), peripheral.DeviceName());
}
@@ -231,6 +231,9 @@ bool CGUIWindowSettingsCategory::OnMessage(CGUIMessage &message)
m_delayedSetting = NULL;
return true;
}
+ case GUI_MSG_UPDATE:
+ if (HasID(message.GetSenderId()))
+ UpdateSettings();
break;
case GUI_MSG_NOTIFY_ALL:
{

0 comments on commit c584811

Please sign in to comment.