HaikuDepot: Implement publisher hyperlink handling.

- Clicking the publisher link now actually attempts to open the site
  in the browser.
This commit is contained in:
Rene Gollent 2013-09-18 22:32:45 +02:00
parent b3a05eede6
commit 976b547224

View File

@ -24,6 +24,8 @@
#include <SpaceLayoutItem.h>
#include <StringView.h>
#include <support/Url.h>
#include "BitmapButton.h"
#include "BitmapView.h"
#include "MarkupParser.h"
@ -654,6 +656,27 @@ public:
Clear();
}
virtual void AttachedToWindow()
{
fWebsiteLinkView->SetTarget(this);
}
virtual void MessageReceived(BMessage* message)
{
switch(message->what) {
case MSG_VISIT_PUBLISHER_WEBSITE:
{
BPrivate::Support::BUrl url(fWebsiteLinkView->Text());
url.OpenWithPreferredApplication();
break;
}
default:
BView::MessageReceived(message);
break;
}
}
void SetPackage(const PackageInfo& package)
{
fDescriptionView->SetText(package.ShortDescription(),
@ -696,7 +719,7 @@ private:
SharedBitmap fWebsiteIcon;
BitmapView* fWebsiteIconView;
BStringView* fWebsiteLinkView;
LinkView* fWebsiteLinkView;
};