* When an icon changes, the MimeTypeListView updates the type now.

* Selecting "None" as preferred application didn't work.
* Forgot to implement changing a MIME type's long description.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16422 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-02-16 13:48:00 +00:00
parent f8499e9aac
commit 9786c1ecf9
2 changed files with 21 additions and 3 deletions

View File

@ -658,7 +658,7 @@ FileTypesWindow::FileTypesWindow(BRect frame)
box->AddChild(fSelectButton);
menu = new BPopUpMenu("preferred");
menu->AddItem(item = new BMenuItem("None", NULL));
menu->AddItem(item = new BMenuItem("None", new BMessage(kMsgPreferredAppChosen)));
item->SetMarked(true);
innerRect.right = innerRect.left - 6.0f;
@ -1237,13 +1237,21 @@ FileTypesWindow::MessageReceived(BMessage* message)
break;
}
case kMsgDescriptionEntered:
{
fCurrentType.SetLongDescription(fDescriptionControl->Text());
break;
}
// Preferred Application group
case kMsgPreferredAppChosen:
{
const char* signature;
if (message->FindString("signature", &signature) == B_OK)
fCurrentType.SetPreferredApp(signature);
if (message->FindString("signature", &signature) != B_OK)
signature = NULL;
fCurrentType.SetPreferredApp(signature);
break;
}

View File

@ -512,6 +512,16 @@ MimeTypeListView::MessageReceived(BMessage* message)
}
break;
}
case B_PREFERRED_APP_CHANGED:
case B_ICON_CHANGED:
// TODO: take B_ICON_FOR_TYPE_CHANGED into account, too
if (fShowIcons) {
// refresh item
MimeTypeItem* item = FindItem(type);
if (item != NULL)
InvalidateItem(IndexOf(item));
}
break;
default:
break;