[packagekit] pk_backend_message enums
Richard Hughes
hughsient at gmail.com
Tue Aug 19 09:00:52 PDT 2008
On Tue, 2008-08-19 at 12:48 +0200, Duncan Mac-Vicar Prett wrote:
> If we detect that a repo may be outdated, we want to tell the user. May
> be in the future there will be new features that require some custom
> message to the user.
Sounds sane. There's been an item in TODO for aaages about this.
> - add the enums, and handle the texts in the client. This allows for
> different texts per client.
> In this case I would question if errors should be separated from
> messages then...
Yes, as messages can be queued up and shown to the user after the
transaction, but a error is always fatal.
> And in this case, I would request an enum for my use case
> PK_MESSAGE_WARNING_MAYBE_BROKEN_MIRROR ?
No problem. I've audited all the users of pk_backend_message() and added
constants where it made sense. I've added so far:
PK_MESSAGE_ENUM_BROKEN_MIRROR
PK_MESSAGE_ENUM_CONNECTION_REFUSED
PK_MESSAGE_ENUM_PARAMETER_INVALID
PK_MESSAGE_ENUM_PRIORITY_INVALID
PK_MESSAGE_ENUM_BACKEND_ERROR
PK_MESSAGE_ENUM_DAEMON_ERROR
PK_MESSAGE_ENUM_CACHE_BEING_REBUILT
PK_MESSAGE_ENUM_UNTRUSTED_PACKAGE
PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS
PK_MESSAGE_ENUM_COULD_NOT_FIND_PACKAGE
PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED
Yell if there's any others you'll need in the near-future and I'll do it
before 0.3.1. Diffstat is here:
TODO | 4 ----
backends/apt/aptDBUSBackend.py | 2 +-
backends/poldek/pk-backend-poldek.c | 2 +-
backends/yum/helpers/yumBackend.py | 8 ++++----
backends/yum2/helpers/yumDBUSBackend.py | 18 +++++++++---------
backends/zypp/pk-backend-zypp.cpp | 6 +++---
libpackagekit/pk-client.c | 2 +-
libpackagekit/pk-enum.c | 14 +++++++++++---
libpackagekit/pk-enum.h | 14 +++++++++++---
libpackagekit/pk-task-list.c | 2 +-
python/packagekit/backend.py | 2 +-
src/pk-backend-dbus.c | 6 +++---
src/pk-backend-spawn.c | 18 +++++++++---------
src/pk-backend.c | 20 ++++++++++----------
src/pk-transaction.c | 7 ++++---
So, probably a good idea you check your backend, although I'm usually
pretty careful. :-)
Richard.
More information about the PackageKit
mailing list