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.
This commit is contained in:
John Scipione 2012-04-18 22:02:43 -04:00
parent f4647825e7
commit 9ac6fee13a
3 changed files with 10 additions and 6 deletions

View File

@ -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;
}

View File

@ -44,6 +44,7 @@ All rights reserved.
#include <AppFileInfo.h>
#include <Bitmap.h>
#include <Directory.h>
#include <LocaleRoster.h>
#include <NodeInfo.h>
#include <Roster.h>
#include <Screen.h>
@ -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

View File

@ -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),