From 9ac6fee13ad6aa1638f058d8791ac7bc1c64ae89 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 18 Apr 2012 22:02:43 -0400 Subject: [PATCH] Rename "deskbar_rt_" back to "Status". Siarzhuk Zharski informed me that KeymapSwitcher depends on this view being named "Status" to work, so, renamed it back to that. Instead of sending the message by name to the replicant tray view, since the view name "Status" is not very unique and I fear that there could be collisions, resend the message to BarView which then passes the message on to the replicant tray which updates the clock and reflows the icons. This being said, KeymapSwitcher should probably not send a message hardcoded to the name of the replicant tray view and instead send the message to Deskbar and allow it to pass the message on to the appropriate view. --- src/apps/deskbar/BarApp.cpp | 9 ++++----- src/apps/deskbar/BarView.cpp | 5 +++++ src/apps/deskbar/StatusView.cpp | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp index ae9b45c6a1..a12cf60d8f 100644 --- a/src/apps/deskbar/BarApp.cpp +++ b/src/apps/deskbar/BarApp.cpp @@ -634,11 +634,10 @@ TBarApp::MessageReceived(BMessage* message) if (message->FindBool("filesys", &localize) == B_OK) gLocalizedNamePreferred = localize; - BMessenger(fBarWindow->FindView("_deskbar_rt_")).SendMessage( - message); - // Notify the replicant tray that the time interval has - // changed and it should update the time view and reflow - // the tray icons. + fStatusViewMessenger.SendMessage(message); + // Notify the replicant tray (through BarView) that the time + // interval has changed and it should update the time view + // and reflow the tray icons. break; } diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index 2fe13a6e06..f18d2be440 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -44,6 +44,7 @@ All rights reserved. #include #include #include +#include #include #include #include @@ -154,6 +155,10 @@ void TBarView::MessageReceived(BMessage* message) { switch (message->what) { + case B_LOCALE_CHANGED: + fReplicantTray->MessageReceived(message); + break; + case B_REFS_RECEIVED: // received when an item is selected during DnD // message is targeted here from Be menu diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp index 3747b415e6..dd95966717 100644 --- a/src/apps/deskbar/StatusView.cpp +++ b/src/apps/deskbar/StatusView.cpp @@ -125,7 +125,7 @@ DumpList(BList* itemlist) TReplicantTray::TReplicantTray(TBarView* parent, bool vertical) : - BView(BRect(0, 0, 1, 1), "_deskbar_rt_", B_FOLLOW_LEFT | B_FOLLOW_TOP, + BView(BRect(0, 0, 1, 1), "Status", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_FRAME_EVENTS), fTime(NULL), fBarView(parent),