added 1 changeset to branch 'refs/remotes/HaikuPM-github/package-management' old head: b3a05eede68d2b0881e5372c2002df639b2236b4 new head: 976b547224ff78d2f15a4df1413f790cba9bc98f overview: https://github.com/haiku/HaikuPM/compare/b3a05ee...976b547 ---------------------------------------------------------------------------- 976b547: HaikuDepot: Implement publisher hyperlink handling. - Clicking the publisher link now actually attempts to open the site in the browser. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- Commit: 976b547224ff78d2f15a4df1413f790cba9bc98f Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Wed Sep 18 20:32:45 2013 UTC ---------------------------------------------------------------------------- 1 file changed, 24 insertions(+), 1 deletion(-) src/apps/haiku-depot/PackageInfoView.cpp | 25 ++++++++++++++++++++++++- ---------------------------------------------------------------------------- diff --git a/src/apps/haiku-depot/PackageInfoView.cpp b/src/apps/haiku-depot/PackageInfoView.cpp index 64bd2fb..85c9eaa 100644 --- a/src/apps/haiku-depot/PackageInfoView.cpp +++ b/src/apps/haiku-depot/PackageInfoView.cpp @@ -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; };