Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

peripherals: refresh settings on device addition/deletion #1203

Merged
1 commit merged into from Aug 3, 2012
Jump to file or symbol
Failed to load files and symbols.
+12 −0
Split
@@ -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());
}
@@ -233,6 +233,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:
{