diff --git a/docs/userguide/en/applications/haikudepot.html b/docs/userguide/en/applications/haikudepot.html index 494c81a552..0dec11551e 100644 --- a/docs/userguide/en/applications/haikudepot.html +++ b/docs/userguide/en/applications/haikudepot.html @@ -105,6 +105,7 @@
: The package exists in that repository and can be downloaded and installed. If there are any dependencies on other packages, you'll be informed of that while installing and get the choice of downloading/installing all that's necessary.
: Pending is shown for a package that is queued for download/installation. While a package is downloaded, the progress is shown as percentage.
The date column shows when the server system recorded the specific version of the package. Owing to possible delays in the publishing process, this date may not be entirely accurate.
You can grab the dotted line between the packages list and the info area to vertically resize the packages list.
diff --git a/src/apps/haikudepot/model/PackageInfo.cpp b/src/apps/haikudepot/model/PackageInfo.cpp
index e045cc10a2..2040bf0c6a 100644
--- a/src/apps/haikudepot/model/PackageInfo.cpp
+++ b/src/apps/haikudepot/model/PackageInfo.cpp
@@ -455,7 +455,8 @@ PackageInfo::PackageInfo()
fDepotName(""),
fViewed(false),
fIsCollatingChanges(false),
- fCollatedChanges(0)
+ fCollatedChanges(0),
+ fVersionCreateTimestamp(0)
{
}
@@ -486,7 +487,8 @@ PackageInfo::PackageInfo(const BPackageInfo& info)
fDepotName(""),
fViewed(false),
fIsCollatingChanges(false),
- fCollatedChanges(0)
+ fCollatedChanges(0),
+ fVersionCreateTimestamp(0)
{
BString publisherURL;
if (info.URLList().CountStrings() > 0)
@@ -533,7 +535,8 @@ PackageInfo::PackageInfo(const BString& name,
fDepotName(""),
fViewed(false),
fIsCollatingChanges(false),
- fCollatedChanges(0)
+ fCollatedChanges(0),
+ fVersionCreateTimestamp(0)
{
}
@@ -566,7 +569,8 @@ PackageInfo::PackageInfo(const PackageInfo& other)
fDepotName(other.fDepotName),
fViewed(other.fViewed),
fIsCollatingChanges(false),
- fCollatedChanges(0)
+ fCollatedChanges(0),
+ fVersionCreateTimestamp(other.fVersionCreateTimestamp)
{
}
@@ -599,6 +603,7 @@ PackageInfo::operator=(const PackageInfo& other)
fSize = other.fSize;
fDepotName = other.fDepotName;
fViewed = other.fViewed;
+ fVersionCreateTimestamp = other.fVersionCreateTimestamp;
return *this;
}
@@ -628,7 +633,8 @@ PackageInfo::operator==(const PackageInfo& other) const
&& fArchitecture == other.fArchitecture
&& fLocalFilePath == other.fLocalFilePath
&& fFileName == other.fFileName
- && fSize == other.fSize;
+ && fSize == other.fSize
+ && fVersionCreateTimestamp == other.fVersionCreateTimestamp;
}
@@ -1007,6 +1013,13 @@ PackageInfo::SetViewed()
}
+void
+PackageInfo::SetVersionCreateTimestamp(uint64 value)
+{
+ fVersionCreateTimestamp = value;
+}
+
+
void
PackageInfo::SetDepotName(const BString& depotName)
{
@@ -1315,5 +1328,6 @@ const char* package_state_to_string(PackageState state)
return "PENDING";
default:
debugger("unknown package state");
+ return "???";
}
}
diff --git a/src/apps/haikudepot/model/PackageInfo.h b/src/apps/haikudepot/model/PackageInfo.h
index f45fc47d99..ddaef5780a 100644
--- a/src/apps/haikudepot/model/PackageInfo.h
+++ b/src/apps/haikudepot/model/PackageInfo.h
@@ -345,6 +345,10 @@ public:
bool Viewed() const
{ return fViewed; }
+ void SetVersionCreateTimestamp(uint64 value);
+ uint64 VersionCreateTimestamp() const
+ { return fVersionCreateTimestamp; }
+
void SetDepotName(const BString& depotName);
const BString& DepotName() const
{ return fDepotName; }
@@ -400,6 +404,9 @@ private:
bool fIsCollatingChanges;
uint32 fCollatedChanges;
+
+ uint64 fVersionCreateTimestamp;
+ // milliseconds since epoc
};
diff --git a/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.cpp b/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.cpp
index 4c3e471d28..ab23aa95e8 100644
--- a/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.cpp
+++ b/src/apps/haikudepot/server/ServerPkgDataUpdateProcess.cpp
@@ -111,6 +111,9 @@ PackageFillingPkgListener::ConsumePackage(const PackageInfoRef& package,
if (!pkgVersion->PayloadLengthIsNull())
package->SetSize(pkgVersion->PayloadLength());
+
+ if (!pkgVersion->CreateTimestampIsNull())
+ package->SetVersionCreateTimestamp(pkgVersion->CreateTimestamp());
}
int32 countPkgCategories = pkg->CountPkgCategories();
diff --git a/src/apps/haikudepot/server/schema/dumpexportpkg.json b/src/apps/haikudepot/server/schema/dumpexportpkg.json
index 653d76fa41..7dc224df8b 100644
--- a/src/apps/haikudepot/server/schema/dumpexportpkg.json
+++ b/src/apps/haikudepot/server/schema/dumpexportpkg.json
@@ -8,6 +8,9 @@
"name": {
"type": "string"
},
+ "createTimestamp": {
+ "type": "integer"
+ },
"modifyTimestamp": {
"type": "integer"
},
@@ -62,6 +65,12 @@
"type": "object",
"javaType": "org.haiku.haikudepotserver.pkg.model.dumpexport.DumpExportPkgVersion",
"properties": {
+ "createTimestamp": {
+ "type": "integer"
+ },
+ "modifyTimestamp": {
+ "type": "integer"
+ },
"major": {
"type": "string"
},
@@ -96,4 +105,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
index f94c7536b1..dedcc4410e 100644
--- a/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
+++ b/src/apps/haikudepot/ui/FeaturedPackagesView.cpp
@@ -22,6 +22,7 @@
#include "BitmapView.h"
#include "HaikuDepotConstants.h"
+#include "LocaleUtils.h"
#include "Logger.h"
#include "MainWindow.h"
#include "MarkupTextView.h"
@@ -41,8 +42,9 @@
#define X_POSITION_RATING 350.0f
#define X_POSITION_SUMMARY 500.0f
#define WIDTH_RATING 100.0f
-#define Y_PROPORTION_TITLE 0.4f
-#define Y_PROPORTION_PUBLISHER 0.7f
+#define Y_PROPORTION_TITLE 0.35f
+#define Y_PROPORTION_PUBLISHER 0.60f
+#define Y_PROPORTION_CHRONOLOGICAL_DATA 0.75f
#define PADDING 8.0f
@@ -407,6 +409,7 @@ public:
_DrawPackageIcon(updateRect, pkg, y, selected);
_DrawPackageTitle(updateRect, pkg, y, selected);
_DrawPackagePublisher(updateRect, pkg, y, selected);
+ _DrawPackageCronologicalInfo(updateRect, pkg, y, selected);
_DrawPackageRating(updateRect, pkg, y, selected);
_DrawPackageSummary(updateRect, pkg, y, selected);
}
@@ -468,8 +471,8 @@ public:
}
- void _DrawPackagePublisher(BRect updateRect, PackageInfoRef pkg, float y,
- bool selected)
+ void _DrawPackageGenericTextSlug(BRect updateRect, PackageInfoRef pkg,
+ const BString& text, float y, float yProportion, bool selected)
{
static BFont* sFont = NULL;
@@ -488,11 +491,33 @@ public:
SetFont(sFont);
float maxTextWidth = (X_POSITION_RATING - HEIGHT_PACKAGE) - PADDING;
- BString publisherName(pkg->Publisher().Name());
- TruncateString(&publisherName, B_TRUNCATE_END, maxTextWidth);
+ BString renderedText(text);
+ TruncateString(&renderedText, B_TRUNCATE_END, maxTextWidth);
- DrawString(publisherName, BPoint(HEIGHT_PACKAGE,
- y + (HEIGHT_PACKAGE * Y_PROPORTION_PUBLISHER)));
+ DrawString(renderedText, BPoint(HEIGHT_PACKAGE,
+ y + (HEIGHT_PACKAGE * yProportion)));
+ }
+
+
+ void _DrawPackagePublisher(BRect updateRect, PackageInfoRef pkg, float y,
+ bool selected)
+ {
+ _DrawPackageGenericTextSlug(updateRect, pkg, pkg->Publisher().Name(), y,
+ Y_PROPORTION_PUBLISHER, selected);
+ }
+
+
+ void _DrawPackageCronologicalInfo(BRect updateRect, PackageInfoRef pkg,
+ float y, bool selected)
+ {
+ BString versionCreateTimestampPresentation
+ = B_TRANSLATE("%VersionCreateDate%");
+ versionCreateTimestampPresentation.ReplaceAll("%VersionCreateDate%",
+ LocaleUtils::TimestampToDateString(
+ pkg->VersionCreateTimestamp()));
+ _DrawPackageGenericTextSlug(updateRect, pkg,
+ versionCreateTimestampPresentation, y,
+ Y_PROPORTION_CHRONOLOGICAL_DATA, selected);
}
diff --git a/src/apps/haikudepot/ui/PackageListView.cpp b/src/apps/haikudepot/ui/PackageListView.cpp
index b720b37dae..159e45d1da 100644
--- a/src/apps/haikudepot/ui/PackageListView.cpp
+++ b/src/apps/haikudepot/ui/PackageListView.cpp
@@ -22,6 +22,7 @@
#include