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
+24 -1
View File
@@ -24,6 +24,8 @@
#include <SpaceLayoutItem.h> #include <SpaceLayoutItem.h>
#include <StringView.h> #include <StringView.h>
#include <support/Url.h>
#include "BitmapButton.h" #include "BitmapButton.h"
#include "BitmapView.h" #include "BitmapView.h"
#include "MarkupParser.h" #include "MarkupParser.h"
@@ -654,6 +656,27 @@ public:
Clear(); 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) void SetPackage(const PackageInfo& package)
{ {
fDescriptionView->SetText(package.ShortDescription(), fDescriptionView->SetText(package.ShortDescription(),
@@ -696,7 +719,7 @@ private:
SharedBitmap fWebsiteIcon; SharedBitmap fWebsiteIcon;
BitmapView* fWebsiteIconView; BitmapView* fWebsiteIconView;
BStringView* fWebsiteLinkView; LinkView* fWebsiteLinkView;
}; };