Network: added BNetworkSettingsListener.

* Same as the configuration listener, just for SettingsUpdated().
* This is now broadcasted to all list items, too.
This commit is contained in:
Axel Dörfler 2015-03-16 18:19:04 +00:00
parent f7ccc9af85
commit d26777c4e4
2 changed files with 16 additions and 1 deletions

View File

@ -42,7 +42,14 @@ public:
};
class BNetworkSettingsItem : public BNetworkConfigurationListener {
class BNetworkSettingsListener {
public:
virtual void SettingsUpdated(uint32 type) = 0;
};
class BNetworkSettingsItem : public BNetworkConfigurationListener,
BNetworkSettingsListener {
public:
BNetworkSettingsItem();
virtual ~BNetworkSettingsItem();

View File

@ -477,6 +477,14 @@ NetworkWindow::_SelectItem(BListItem* listItem)
void
NetworkWindow::_BroadcastSettingsUpdate(uint32 type)
{
for (int32 index = 0; index < fListView->FullListCountItems(); index++) {
BNetworkSettingsListener* listener
= dynamic_cast<BNetworkSettingsListener*>(
fListView->FullListItemAt(index));
if (listener != NULL)
listener->SettingsUpdated(type);
}
SettingsMap::const_iterator iterator = fSettingsMap.begin();
for (; iterator != fSettingsMap.end(); iterator++)
iterator->second->SettingsUpdated(type);