Now listens to file/attribute changes.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6825 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -122,6 +122,8 @@ class HeaderView : public BView, public BInvoker {
|
||||
uint32 BlockSize() const { return fBlockSize; }
|
||||
void SetTo(off_t position, uint32 blockSize);
|
||||
|
||||
void UpdateIcon();
|
||||
|
||||
private:
|
||||
void FormatValue(char *buffer, size_t bufferSize, off_t value);
|
||||
void UpdatePositionViews(bool all = true);
|
||||
@@ -593,6 +595,13 @@ HeaderView::GetPreferredSize(float *_width, float *_height)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HeaderView::UpdateIcon()
|
||||
{
|
||||
fIconView->UpdateIcon();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HeaderView::FormatValue(char *buffer, size_t bufferSize, off_t value)
|
||||
{
|
||||
@@ -1721,14 +1730,32 @@ ProbeView::MessageReceived(BMessage *message)
|
||||
case B_NODE_MONITOR:
|
||||
{
|
||||
switch (message->FindInt32("opcode")) {
|
||||
case B_STAT_CHANGED:
|
||||
fEditor.ForceUpdate();
|
||||
break;
|
||||
case B_ATTR_CHANGED:
|
||||
{
|
||||
BMenuBar *bar = Window()->KeyMenuBar();
|
||||
if (bar != NULL) {
|
||||
BMenuItem *item = bar->FindItem("Attributes");
|
||||
if (item != NULL && item->Submenu() != NULL)
|
||||
UpdateAttributesMenu(item->Submenu());
|
||||
const char *name;
|
||||
if (message->FindString("attr", &name) != B_OK)
|
||||
break;
|
||||
|
||||
if (fEditor.IsAttribute()) {
|
||||
if (!strcmp(name, fEditor.Attribute()))
|
||||
fEditor.ForceUpdate();
|
||||
} else {
|
||||
BMenuBar *bar = Window()->KeyMenuBar();
|
||||
if (bar != NULL) {
|
||||
BMenuItem *item = bar->FindItem("Attributes");
|
||||
if (item != NULL && item->Submenu() != NULL)
|
||||
UpdateAttributesMenu(item->Submenu());
|
||||
}
|
||||
}
|
||||
|
||||
// There might be a new icon
|
||||
if (!strcmp(name, "BEOS:TYPE")
|
||||
|| !strcmp(name, "BEOS:M:STD_ICON")
|
||||
|| !strcmp(name, "BEOS:L:STD_ICON"))
|
||||
fHeaderView->UpdateIcon();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user