diff --git a/src/apps/haiku-depot/MainWindow.cpp b/src/apps/haiku-depot/MainWindow.cpp index 225a24baabb..28629007167 100644 --- a/src/apps/haiku-depot/MainWindow.cpp +++ b/src/apps/haiku-depot/MainWindow.cpp @@ -156,11 +156,15 @@ MainWindow::_InitDummyModel() BitmapRef(new SharedBitmap(601), true), "WonderBrush", "2.1.2", + PublisherInfo( + BitmapRef(), + "YellowBites", + "superstippi@gmx.de", + "http://www.yellowbites.com"), "A vector based graphics editor.", "WonderBrush is YellowBites' software for doing graphics design " "on Haiku. It combines many great under-the-hood features with " "powerful tools and an efficient and intuitive interface.", - "superstippi@gmx.de", "http://www.yellowbites.com", "2.1.2 - Initial Haiku release."); wonderbrush.AddUserRating( UserRating(UserInfo("humdinger"), 4.5f, @@ -176,12 +180,16 @@ MainWindow::_InitDummyModel() BitmapRef(new SharedBitmap(602), true), "Paladin", "1.2.0", + PublisherInfo( + BitmapRef(), + "DarkWyrm", + "bpmagic@columbus.rr.com", + "http://darkwyrm-haiku.blogspot.com"), "A C/C++ IDE based on Pe.", "If you like BeIDE, you'll like Paladin even better. " "The interface is streamlined, it has some features sorely " "missing from BeIDE, like running a project in the Terminal, " "and has a bundled text editor based upon Pe.", - "bpmagic@columbus.rr.com", "http://darkwyrm-haiku.blogspot.com", ""); paladin.AddUserRating( UserRating(UserInfo("stippi"), 3.5f, diff --git a/src/apps/haiku-depot/PackageInfo.cpp b/src/apps/haiku-depot/PackageInfo.cpp index cc3e0201479..b0fee9808b3 100644 --- a/src/apps/haiku-depot/PackageInfo.cpp +++ b/src/apps/haiku-depot/PackageInfo.cpp @@ -275,6 +275,68 @@ UserRating::operator!=(const UserRating& other) const } +// #pragma mark - PublisherInfo + + +PublisherInfo::PublisherInfo() + : + fLogo(), + fName(), + fEmail(), + fWebsite() +{ +} + + +PublisherInfo::PublisherInfo(const BitmapRef& logo, const BString& name, + const BString& email, const BString& website) + : + fLogo(logo), + fName(name), + fEmail(email), + fWebsite(website) +{ +} + + +PublisherInfo::PublisherInfo(const PublisherInfo& other) + : + fLogo(other.fLogo), + fName(other.fName), + fEmail(other.fEmail), + fWebsite(other.fWebsite) +{ +} + + +PublisherInfo& +PublisherInfo::operator=(const PublisherInfo& other) +{ + fLogo = other.fLogo; + fName = other.fName; + fEmail = other.fEmail; + fWebsite = other.fWebsite; + return *this; +} + + +bool +PublisherInfo::operator==(const PublisherInfo& other) const +{ + return fLogo == other.fLogo + && fName == other.fName + && fEmail == other.fEmail + && fWebsite == other.fWebsite; +} + + +bool +PublisherInfo::operator!=(const PublisherInfo& other) const +{ + return !(*this == other); +} + + // #pragma mark - PackageInfo @@ -283,10 +345,9 @@ PackageInfo::PackageInfo() fIcon(), fTitle(), fVersion(), + fPublisher(), fShortDescription(), fFullDescription(), - fPublisherEmail(), - fPublisherWebsite(), fChangelog(), fUserRatings() { @@ -294,17 +355,16 @@ PackageInfo::PackageInfo() PackageInfo::PackageInfo(const BitmapRef& icon, const BString& title, - const BString& version, const BString& shortDescription, - const BString& fullDescription, const BString& publisherEmail, - const BString& publisherWebsite, const BString& changelog) + const BString& version, const PublisherInfo& publisher, + const BString& shortDescription, const BString& fullDescription, + const BString& changelog) : fIcon(icon), fTitle(title), fVersion(version), + fPublisher(publisher), fShortDescription(shortDescription), fFullDescription(fullDescription), - fPublisherEmail(publisherEmail), - fPublisherWebsite(publisherWebsite), fChangelog(changelog), fUserRatings() { @@ -316,10 +376,9 @@ PackageInfo::PackageInfo(const PackageInfo& other) fIcon(other.fIcon), fTitle(other.fTitle), fVersion(other.fVersion), + fPublisher(other.fPublisher), fShortDescription(other.fShortDescription), fFullDescription(other.fFullDescription), - fPublisherEmail(other.fPublisherEmail), - fPublisherWebsite(other.fPublisherWebsite), fChangelog(other.fChangelog), fUserRatings(other.fUserRatings) { @@ -332,10 +391,9 @@ PackageInfo::operator=(const PackageInfo& other) fIcon = other.fIcon; fTitle = other.fTitle; fVersion = other.fVersion; + fPublisher = other.fPublisher; fShortDescription = other.fShortDescription; fFullDescription = other.fFullDescription; - fPublisherEmail = other.fPublisherEmail; - fPublisherWebsite = other.fPublisherWebsite; fChangelog = other.fChangelog; fUserRatings = other.fUserRatings; return *this; @@ -348,10 +406,9 @@ PackageInfo::operator==(const PackageInfo& other) const return fIcon == other.fIcon && fTitle == other.fTitle && fVersion == other.fVersion + && fPublisher == other.fPublisher && fShortDescription == other.fShortDescription && fFullDescription == other.fFullDescription - && fPublisherEmail == other.fPublisherEmail - && fPublisherWebsite == other.fPublisherWebsite && fChangelog == other.fChangelog && fUserRatings == other.fUserRatings; } diff --git a/src/apps/haiku-depot/PackageInfo.h b/src/apps/haiku-depot/PackageInfo.h index 44aa33a3538..c50254e82c4 100644 --- a/src/apps/haiku-depot/PackageInfo.h +++ b/src/apps/haiku-depot/PackageInfo.h @@ -104,16 +104,45 @@ class UserRating { typedef List UserRatingList; +class PublisherInfo { +public: + PublisherInfo(); + PublisherInfo(const BitmapRef& logo, + const BString& name, + const BString& email, + const BString& website); + PublisherInfo(const PublisherInfo& other); + + PublisherInfo& operator=(const PublisherInfo& other); + bool operator==(const PublisherInfo& other) const; + bool operator!=(const PublisherInfo& other) const; + + const BitmapRef& Logo() const + { return fLogo; } + const BString& Name() const + { return fName; } + const BString& Email() const + { return fEmail; } + const BString& Website() const + { return fWebsite; } + +private: + BitmapRef fLogo; + BString fName; + BString fEmail; + BString fWebsite; +}; + + class PackageInfo { public: PackageInfo(); PackageInfo(const BitmapRef& icon, const BString& title, const BString& version, + const PublisherInfo& publisher, const BString& shortDescription, const BString& fullDescription, - const BString& publisherEmail, - const BString& publisherWebsite, const BString& changelog); PackageInfo(const PackageInfo& other); @@ -131,10 +160,8 @@ class PackageInfo { { return fShortDescription; } const BString& FullDescription() const { return fFullDescription; } - const BString& PublisherEmail() const - { return fPublisherEmail; } - const BString& PublisherWebsite() const - { return fPublisherWebsite; } + const PublisherInfo& Publisher() const + { return fPublisher; } const BString& Changelog() const { return fChangelog; } @@ -144,10 +171,9 @@ class PackageInfo { BitmapRef fIcon; BString fTitle; BString fVersion; + PublisherInfo fPublisher; BString fShortDescription; BString fFullDescription; - BString fPublisherEmail; - BString fPublisherWebsite; BString fChangelog; UserRatingList fUserRatings; }; diff --git a/src/apps/haiku-depot/PackageInfoView.cpp b/src/apps/haiku-depot/PackageInfoView.cpp index f3d12ad9cca..30f0de524e7 100644 --- a/src/apps/haiku-depot/PackageInfoView.cpp +++ b/src/apps/haiku-depot/PackageInfoView.cpp @@ -203,9 +203,9 @@ class AboutView : public BView { { fDescriptionView->SetText(package.FullDescription()); fEmailIconView->SetBitmap(fEmailIcon.Bitmap(SharedBitmap::SIZE_16)); - fEmailLinkView->SetText(package.PublisherEmail()); + fEmailLinkView->SetText(package.Publisher().Email()); fWebsiteIconView->SetBitmap(fWebsiteIcon.Bitmap(SharedBitmap::SIZE_16)); - fWebsiteLinkView->SetText(package.PublisherWebsite()); + fWebsiteLinkView->SetText(package.Publisher().Website()); } void Clear()