From 6463044ee7867e256bb409283a463a0055979769 Mon Sep 17 00:00:00 2001 From: stippi Date: Mon, 22 Mar 2010 18:10:49 +0000 Subject: [PATCH] Add the value to the notification message as well. git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@339 94f232f2-1747-11df-bad5-a5bfde151594 --- src/apps/webpositive/DownloadWindow.h | 5 ++++- src/apps/webpositive/support/SettingsMessage.cpp | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/apps/webpositive/DownloadWindow.h b/src/apps/webpositive/DownloadWindow.h index c901b2dda7..be0e84da6b 100644 --- a/src/apps/webpositive/DownloadWindow.h +++ b/src/apps/webpositive/DownloadWindow.h @@ -34,11 +34,13 @@ class BButton; class BFile; class BGroupLayout; class BWebDownload; +class SettingsMessage; class DownloadWindow : public BWindow { public: - DownloadWindow(BRect frame, bool visible); + DownloadWindow(BRect frame, bool visible, + SettingsMessage* settings); virtual ~DownloadWindow(); virtual void MessageReceived(BMessage* message); @@ -55,6 +57,7 @@ private: private: BGroupLayout* fDownloadViewsLayout; BButton* fRemoveFinishedButton; + SettingsMessage* fSettings; }; diff --git a/src/apps/webpositive/support/SettingsMessage.cpp b/src/apps/webpositive/support/SettingsMessage.cpp index d96ceb1e64..de17c8d3a4 100644 --- a/src/apps/webpositive/support/SettingsMessage.cpp +++ b/src/apps/webpositive/support/SettingsMessage.cpp @@ -475,6 +475,16 @@ SettingsMessage::_NotifyValueChanged(const char* name) const { BMessage message(MSG_SETTINGS_VALUE_CHANGED); message.AddString("name", name); + + // Add the value of that name to the notification. + type_code type; + if (GetInfo(name, &type) == B_OK) { + const void* data; + ssize_t numBytes; + if (FindData(name, type, &data, &numBytes) == B_OK) + message.AddData("value", type, data, numBytes); + } + int32 count = fListeners.CountItems(); for (int32 i = 0; i < count; i++) { BMessenger* listener = reinterpret_cast(