Package daemon notifications
* Sentence casing * Localize notification texts in the package kit * Have "Package daemon" as group name and "Warning" as title * Use ::BPrivate in Bitmap.h to solve an ambiguity (as pointed out by PulkoMandy). Though not needed for my changes any more, since a the icon of the notifying app is now shown by default. Fixes #13590.
This commit is contained in:
@@ -114,7 +114,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class BView;
|
friend class BView;
|
||||||
friend class BApplication;
|
friend class BApplication;
|
||||||
friend class BPrivate::BPrivateScreen;
|
friend class ::BPrivate::BPrivateScreen;
|
||||||
friend class Private;
|
friend class Private;
|
||||||
|
|
||||||
virtual status_t Perform(perform_code d, void* arg);
|
virtual status_t Perform(perform_code d, void* arg);
|
||||||
|
|||||||
@@ -143,3 +143,9 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HaikuSubInclude solver ;
|
HaikuSubInclude solver ;
|
||||||
|
|
||||||
|
DoCatalogs libpackage.so
|
||||||
|
x-vnd.Haiku-libpackage
|
||||||
|
:
|
||||||
|
PackageManager.cpp
|
||||||
|
;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <package/manager/PackageManager.h>
|
#include <package/manager/PackageManager.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <package/CommitTransactionResult.h>
|
#include <package/CommitTransactionResult.h>
|
||||||
#include <package/DownloadFileRequest.h>
|
#include <package/DownloadFileRequest.h>
|
||||||
@@ -32,6 +33,9 @@
|
|||||||
|
|
||||||
#include "PackageManagerUtils.h"
|
#include "PackageManagerUtils.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PackageManagerKit"
|
||||||
|
|
||||||
|
|
||||||
using BPackageKit::BPrivate::FetchFileJob;
|
using BPackageKit::BPrivate::FetchFileJob;
|
||||||
using BPackageKit::BPrivate::ValidateChecksumJob;
|
using BPackageKit::BPrivate::ValidateChecksumJob;
|
||||||
@@ -126,7 +130,7 @@ BPackageManager::Init(uint32 flags)
|
|||||||
error = roster.GetRepositoryNames(repositoryNames);
|
error = roster.GetRepositoryNames(repositoryNames);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
fUserInteractionHandler->Warn(error,
|
fUserInteractionHandler->Warn(error,
|
||||||
"Failed to get repository names");
|
B_TRANSLATE("Failed to get repository names"));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 repositoryNameCount = repositoryNames.CountStrings();
|
int32 repositoryNameCount = repositoryNames.CountStrings();
|
||||||
@@ -619,7 +623,7 @@ BPackageManager::_CommitPackageChanges(Transaction& transaction)
|
|||||||
.GetEntry(&transactionDirectoryEntry)) != B_OK
|
.GetEntry(&transactionDirectoryEntry)) != B_OK
|
||||||
|| (error = transactionDirectoryEntry.Remove()) != B_OK) {
|
|| (error = transactionDirectoryEntry.Remove()) != B_OK) {
|
||||||
fUserInteractionHandler->Warn(error,
|
fUserInteractionHandler->Warn(error,
|
||||||
"Failed to remove transaction directory");
|
B_TRANSLATE("Failed to remove transaction directory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
fUserInteractionHandler->ProgressApplyingChangesDone(
|
fUserInteractionHandler->ProgressApplyingChangesDone(
|
||||||
@@ -669,8 +673,8 @@ BPackageManager::_FindBasePackage(const PackageList& packages,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (basePackage == NULL) {
|
if (basePackage == NULL) {
|
||||||
fUserInteractionHandler->Warn(B_OK, "Package %s-%s doesn't have a "
|
fUserInteractionHandler->Warn(B_OK, B_TRANSLATE("Package %s-%s "
|
||||||
"matching requires for its base package \"%s\"",
|
"doesn't have a matching requires for its base package \"%s\""),
|
||||||
info.Name().String(), info.Version().ToString().String(),
|
info.Name().String(), info.Version().ToString().String(),
|
||||||
info.BasePackage().String());
|
info.BasePackage().String());
|
||||||
return -1;
|
return -1;
|
||||||
@@ -711,16 +715,16 @@ BPackageManager::_AddRemoteRepository(BPackageRoster& roster, const char* name,
|
|||||||
BRepositoryConfig config;
|
BRepositoryConfig config;
|
||||||
status_t error = roster.GetRepositoryConfig(name, &config);
|
status_t error = roster.GetRepositoryConfig(name, &config);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
fUserInteractionHandler->Warn(error,
|
fUserInteractionHandler->Warn(error, B_TRANSLATE(
|
||||||
"Failed to get config for repository \"%s\". Skipping.", name);
|
"Failed to get config for repository \"%s\". Skipping."), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BRepositoryCache cache;
|
BRepositoryCache cache;
|
||||||
error = _GetRepositoryCache(roster, config, refresh, cache);
|
error = _GetRepositoryCache(roster, config, refresh, cache);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
fUserInteractionHandler->Warn(error,
|
fUserInteractionHandler->Warn(error, B_TRANSLATE(
|
||||||
"Failed to get cache for repository \"%s\". Skipping.", name);
|
"Failed to get cache for repository \"%s\". Skipping."), name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -744,8 +748,8 @@ BPackageManager::_GetRepositoryCache(BPackageRoster& roster,
|
|||||||
|
|
||||||
status_t error = RefreshRepository(config);
|
status_t error = RefreshRepository(config);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
fUserInteractionHandler->Warn(error,
|
fUserInteractionHandler->Warn(error, B_TRANSLATE(
|
||||||
"Refreshing repository \"%s\" failed", config.Name().String());
|
"Refreshing repository \"%s\" failed"), config.Name().String());
|
||||||
}
|
}
|
||||||
|
|
||||||
return roster.GetRepositoryCache(config.Name(), &_cache);
|
return roster.GetRepositoryCache(config.Name(), &_cache);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ Server package_daemon
|
|||||||
DoCatalogs package_daemon :
|
DoCatalogs package_daemon :
|
||||||
x-vnd.haiku-package_daemon
|
x-vnd.haiku-package_daemon
|
||||||
:
|
:
|
||||||
|
PackageManager.cpp
|
||||||
ProblemWindow.cpp
|
ProblemWindow.cpp
|
||||||
ResultWindow.cpp
|
ResultWindow.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "PackageManager.h"
|
#include "PackageManager.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Notification.h>
|
#include <Notification.h>
|
||||||
#include <package/DownloadFileRequest.h>
|
#include <package/DownloadFileRequest.h>
|
||||||
#include <package/RefreshRepositoryRequest.h>
|
#include <package/RefreshRepositoryRequest.h>
|
||||||
@@ -24,12 +25,13 @@
|
|||||||
#include "Root.h"
|
#include "Root.h"
|
||||||
#include "Volume.h"
|
#include "Volume.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PackageManager"
|
||||||
|
|
||||||
using BPackageKit::BManager::BPrivate::BAbortedByUserException;
|
using BPackageKit::BManager::BPrivate::BAbortedByUserException;
|
||||||
using BPackageKit::BManager::BPrivate::BFatalErrorException;
|
using BPackageKit::BManager::BPrivate::BFatalErrorException;
|
||||||
using BPackageKit::BManager::BPrivate::BRepositoryBuilder;
|
using BPackageKit::BManager::BPrivate::BRepositoryBuilder;
|
||||||
|
|
||||||
|
|
||||||
PackageManager::PackageManager(Root* root, Volume* volume)
|
PackageManager::PackageManager(Root* root, Volume* volume)
|
||||||
:
|
:
|
||||||
BPackageManager(volume->Location(), this, this),
|
BPackageManager(volume->Location(), this, this),
|
||||||
@@ -306,7 +308,8 @@ PackageManager::Warn(status_t error, const char* format, ...)
|
|||||||
message << BString().SetToFormat(": %s", strerror(error));
|
message << BString().SetToFormat(": %s", strerror(error));
|
||||||
|
|
||||||
BNotification notification(B_ERROR_NOTIFICATION);
|
BNotification notification(B_ERROR_NOTIFICATION);
|
||||||
notification.SetTitle("Package Daemon");
|
notification.SetGroup(B_TRANSLATE("Package daemon"));
|
||||||
|
notification.SetTitle(B_TRANSLATE("Warning"));
|
||||||
notification.SetContent(message);
|
notification.SetContent(message);
|
||||||
notification.Send();
|
notification.Send();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user