gnome-packagekit r304 - trunk/src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-packagekit r304 - trunk/src
- Date: Fri, 26 Sep 2008 09:49:36 +0000 (UTC)
Author: rhughes
Date: Fri Sep 26 09:49:36 2008
New Revision: 304
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=304&view=rev
Log:
from git
Removed:
trunk/src/gpk-interface.h
Modified:
trunk/src/gpk-common.c
trunk/src/gpk-dbus.c
trunk/src/gpk-enum.c
trunk/src/gpk-enum.h
Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c (original)
+++ trunk/src/gpk-common.c Fri Sep 26 09:49:36 2008
@@ -237,39 +237,14 @@
const gchar *name = NULL;
guint delay = 0;
- /* choose icon */
- if (status == PK_STATUS_ENUM_REFRESH_CACHE ||
- status == PK_STATUS_ENUM_DOWNLOAD_REPOSITORY ||
- status == PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST ||
- status == PK_STATUS_ENUM_DOWNLOAD_FILELIST ||
- status == PK_STATUS_ENUM_DOWNLOAD_CHANGELOG ||
- status == PK_STATUS_ENUM_DOWNLOAD_GROUP ||
- status == PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO ||
- status == PK_STATUS_ENUM_GENERATE_PACKAGE_LIST ||
- status == PK_STATUS_ENUM_LOADING_CACHE ||
- status == PK_STATUS_ENUM_REPACKAGING) {
- name = "pk-action-refresh-cache";
- delay = 150;
- } else if (status == PK_STATUS_ENUM_DOWNLOAD) {
- name = "pk-action-download";
- delay = 150;
- } else if (status == PK_STATUS_ENUM_INSTALL ||
- status == PK_STATUS_ENUM_UPDATE) {
- name = "pk-action-installing";
- delay = 150;
- } else if (status == PK_STATUS_ENUM_QUERY ||
- status == PK_STATUS_ENUM_SCAN_APPLICATIONS) {
- name = "pk-action-searching";
- delay = 150;
- } else if (status == PK_STATUS_ENUM_WAIT) {
- name = "pk-action-waiting";
+ /* see if there is an animation */
+ name = gpk_status_enum_to_animation (status);
+
+ /* get the timing */
+ if (g_str_has_prefix (name, "pk-action-"))
delay = 150;
- } else if (status == PK_STATUS_ENUM_INFO) {
- name = "process-working";
+ else if (g_str_has_prefix (name, "process-working"))
delay = 50;
- } else {
- name = gpk_status_enum_to_icon_name (status);
- }
/* animate or set static */
if (delay != 0) {
Modified: trunk/src/gpk-dbus.c
==============================================================================
--- trunk/src/gpk-dbus.c (original)
+++ trunk/src/gpk-dbus.c Fri Sep 26 09:49:36 2008
@@ -41,14 +41,19 @@
#include <polkit/polkit.h>
#include <polkit-dbus/polkit-dbus.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+#include <X11/Xatom.h>
+
#include <pk-common.h>
#include <pk-package-id.h>
#include <pk-package-ids.h>
#include <pk-client.h>
#include <pk-enum.h>
-#include "egg-debug.h"
#include <pk-package-list.h>
+#include "egg-debug.h"
+
#include "gpk-dbus.h"
#include "gpk-client.h"
@@ -215,6 +220,85 @@
}
/**
+ * gpk_dbus_get_user_time_for_xid:
+ **/
+static guint32
+gpk_dbus_get_user_time_for_xid (guint xid)
+{
+ guint32 timestamp = 0;
+ GdkWindow *window;
+ GdkDisplay *display;
+ Atom atom_window = None;
+ Atom atom_time = None;
+ guchar *data;
+ Atom type_return;
+ gint format_return;
+ gulong nitems_return;
+ gulong bytes_after_return;
+ Window *win = NULL;
+
+ /* check we have a foreign window */
+ if (xid == 0) {
+ g_message ("no XID, so cannot work with focus stealing prevention");
+ goto out;
+ }
+
+ /* use gdk where possible */
+ display = gdk_display_get_default ();
+ window = gdk_window_foreign_new_for_display (display, xid);
+
+ /* get _NET_WM_USER_TIME_WINDOW which points to a window on which you can find the _NET_WM_USER_TIME property */
+ atom_window = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME_WINDOW");
+ if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), atom_window,
+ 0, G_MAXLONG, False, XA_WINDOW, &type_return,
+ &format_return, &nitems_return, &bytes_after_return,
+ &data) == Success) {
+ if ((type_return == XA_WINDOW) && (format_return == 32) && (data)) {
+ win = (Window *)data;
+ g_message ("got window %p", win);
+ }
+ }
+
+ /* nothing found */
+ if (win == NULL) {
+ g_warning ("could not find window");
+ goto out;
+ }
+
+ /* get _NET_WM_USER_TIME so we can get the user time */
+ atom_time = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME");
+ if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), *win, atom_time,
+ 0, G_MAXLONG, False, XA_CARDINAL, &type_return,
+ &format_return, &nitems_return, &bytes_after_return,
+ &data) == Success) {
+ if ((type_return == XA_CARDINAL) && (format_return == 32) && (data)) {
+ timestamp = (guint32 )data;
+ g_message ("got timestamp %i", timestamp);
+ }
+ }
+
+out:
+ return timestamp;
+}
+
+/**
+ * gpk_dbus_set_parent_window:
+ **/
+void
+gpk_dbus_set_parent_window (GpkDbus *dbus, guint32 xid, guint32 timestamp)
+{
+ /* set the parent window */
+ gpk_client_set_parent_xid (dbus->priv->gclient, xid);
+
+ /* try to get the user time of the window if not provided */
+ if (timestamp == 0)
+ timestamp = gpk_dbus_get_user_time_for_xid (xid);
+
+ /* set the last interaction */
+ gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+}
+
+/**
* gpk_dbus_install_local_file:
**/
void
@@ -237,8 +321,7 @@
/* just convert from char* to char** */
full_paths = g_strsplit (full_path, "|", 1);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
@@ -280,8 +363,7 @@
sender = dbus_g_method_get_sender (context);
egg_debug ("sender=%s", sender);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
@@ -325,8 +407,7 @@
/* just convert from char* to char** */
package_names = g_strsplit (package_name, "|", 1);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
@@ -369,8 +450,7 @@
sender = dbus_g_method_get_sender (context);
egg_debug ("sender=%s", sender);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
@@ -420,8 +500,7 @@
sender = dbus_g_method_get_sender (context);
egg_debug ("sender=%s", sender);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
@@ -483,8 +562,7 @@
sender = dbus_g_method_get_sender (context);
egg_debug ("sender=%s", sender);
- gpk_client_set_parent_xid (dbus->priv->gclient, xid);
- gpk_client_update_timestamp (dbus->priv->gclient, timestamp);
+ gpk_dbus_set_parent_window (dbus, xid, timestamp);
/* get the program name and set */
application = gpk_dbus_get_application_for_sender (dbus, sender);
Modified: trunk/src/gpk-enum.c
==============================================================================
--- trunk/src/gpk-enum.c (original)
+++ trunk/src/gpk-enum.c Fri Sep 26 09:49:36 2008
@@ -56,63 +56,105 @@
static const PkEnumMatch enum_status_icon_name[] = {
{PK_STATUS_ENUM_UNKNOWN, "help-browser"}, /* fall though value */
- {PK_STATUS_ENUM_WAIT, "pk-wait"},
- {PK_STATUS_ENUM_SETUP, "pk-setup"},
- {PK_STATUS_ENUM_RUNNING, "pk-setup"},
- {PK_STATUS_ENUM_QUERY, "pk-package-search"},
- {PK_STATUS_ENUM_INFO, "pk-package-info"},
- {PK_STATUS_ENUM_REFRESH_CACHE, "pk-refresh-cache"},
- {PK_STATUS_ENUM_REMOVE, "pk-package-delete"},
- {PK_STATUS_ENUM_DOWNLOAD, "pk-package-download"},
- {PK_STATUS_ENUM_INSTALL, "pk-package-add"},
- {PK_STATUS_ENUM_UPDATE, "pk-package-update"},
+ {PK_STATUS_ENUM_CANCEL, "pk-package-cleanup"}, /* TODO: need better icon */
{PK_STATUS_ENUM_CLEANUP, "pk-package-cleanup"},
- {PK_STATUS_ENUM_OBSOLETE, "pk-package-cleanup"},
- {PK_STATUS_ENUM_DEP_RESOLVE, "pk-package-info"}, /* TODO: need better icon */
- {PK_STATUS_ENUM_ROLLBACK, "pk-package-info"}, /* TODO: need better icon */
{PK_STATUS_ENUM_COMMIT, "pk-setup"}, /* TODO: need better icon */
- {PK_STATUS_ENUM_REQUEST, "pk-package-search"},
- {PK_STATUS_ENUM_FINISHED, "pk-package-cleanup"}, /* TODO: need better icon */
- {PK_STATUS_ENUM_CANCEL, "pk-package-cleanup"}, /* TODO: need better icon */
- {PK_STATUS_ENUM_DOWNLOAD_REPOSITORY, "pk-refresh-cache"},
- {PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST, "pk-refresh-cache"},
- {PK_STATUS_ENUM_DOWNLOAD_FILELIST, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_DEP_RESOLVE, "pk-package-info"}, /* TODO: need better icon */
{PK_STATUS_ENUM_DOWNLOAD_CHANGELOG, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_FILELIST, "pk-refresh-cache"},
{PK_STATUS_ENUM_DOWNLOAD_GROUP, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD, "pk-package-download"},
+ {PK_STATUS_ENUM_DOWNLOAD_REPOSITORY, "pk-refresh-cache"},
{PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO, "pk-refresh-cache"},
- {PK_STATUS_ENUM_REPACKAGING, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_FINISHED, "pk-package-cleanup"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_GENERATE_PACKAGE_LIST, "pk-refresh-cache"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_INFO, "pk-package-info"},
+ {PK_STATUS_ENUM_INSTALL, "pk-package-add"},
{PK_STATUS_ENUM_LOADING_CACHE, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_OBSOLETE, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_QUERY, "pk-package-search"},
+ {PK_STATUS_ENUM_REFRESH_CACHE, "pk-refresh-cache"},
+ {PK_STATUS_ENUM_REMOVE, "pk-package-delete"},
+ {PK_STATUS_ENUM_REPACKAGING, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_REQUEST, "pk-package-search"},
+ {PK_STATUS_ENUM_ROLLBACK, "pk-package-info"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_RUNNING, "pk-setup"},
{PK_STATUS_ENUM_SCAN_APPLICATIONS, "pk-package-search"}, /* TODO: need better icon */
- {PK_STATUS_ENUM_GENERATE_PACKAGE_LIST, "pk-refresh-cache"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_SETUP, "pk-setup"},
+ {PK_STATUS_ENUM_SIG_CHECK, "pk-package-info"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_TEST_COMMIT, "pk-package-info"}, /* TODO: need better icon */
+ {PK_STATUS_ENUM_UPDATE, "pk-package-update"},
+ {PK_STATUS_ENUM_WAIT, "pk-wait"},
+ {0, NULL}
+};
+
+static const PkEnumMatch enum_status_animation[] = {
+ {PK_STATUS_ENUM_UNKNOWN, "help-browser"},
+ {PK_STATUS_ENUM_CANCEL, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_CLEANUP, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_COMMIT, "pk-setup"},
+ {PK_STATUS_ENUM_DEP_RESOLVE, "pk-action-testing"},
+ {PK_STATUS_ENUM_DOWNLOAD_CHANGELOG, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_FILELIST, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_GROUP, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD, "pk-action-download"},
+ {PK_STATUS_ENUM_DOWNLOAD_REPOSITORY, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_FINISHED, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_GENERATE_PACKAGE_LIST, "pk-action-searching"},
+ {PK_STATUS_ENUM_INFO, "process-working"},
+ {PK_STATUS_ENUM_INSTALL, "pk-action-installing"},
+ {PK_STATUS_ENUM_LOADING_CACHE, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_OBSOLETE, "pk-package-cleanup"},
+ {PK_STATUS_ENUM_QUERY, "pk-action-searching"},
+ {PK_STATUS_ENUM_REFRESH_CACHE, "pk-action-refresh-cache"},
+ {PK_STATUS_ENUM_REMOVE, "pk-package-delete"},
+ {PK_STATUS_ENUM_REPACKAGING, "pk-package-info"},
+ {PK_STATUS_ENUM_REQUEST, "process-working"},
+ {PK_STATUS_ENUM_ROLLBACK, "pk-package-info"},
+ {PK_STATUS_ENUM_RUNNING, "pk-setup"},
+ {PK_STATUS_ENUM_SCAN_APPLICATIONS, "pk-action-searching"},
+ {PK_STATUS_ENUM_SETUP, "pk-package-info"},
+ {PK_STATUS_ENUM_SIG_CHECK, "pk-package-info"},
+ {PK_STATUS_ENUM_TEST_COMMIT, "pk-action-testing"},
+ {PK_STATUS_ENUM_UPDATE, "pk-action-installing"},
+ {PK_STATUS_ENUM_WAIT, "pk-action-waiting"},
{0, NULL}
};
static const PkEnumMatch enum_role_icon_name[] = {
{PK_ROLE_ENUM_UNKNOWN, "help-browser"}, /* fall though value */
- {PK_ROLE_ENUM_CANCEL, "process-stop.svg"},
- {PK_ROLE_ENUM_RESOLVE, "pk-package-search"},
- {PK_ROLE_ENUM_ROLLBACK, "pk-rollback"},
+ {PK_ROLE_ENUM_ACCEPT_EULA, "pk-package-info"},
+ {PK_ROLE_ENUM_CANCEL, "process-stop"},
+ {PK_ROLE_ENUM_DOWNLOAD_PACKAGES, "pk-package-download"},
{PK_ROLE_ENUM_GET_DEPENDS, "pk-package-info"},
- {PK_ROLE_ENUM_GET_UPDATE_DETAIL, "pk-package-info"},
{PK_ROLE_ENUM_GET_DETAILS, "pk-package-info"},
+ {PK_ROLE_ENUM_GET_DISTRO_UPGRADES, "pk-package-info"},
+ {PK_ROLE_ENUM_GET_FILES, "pk-package-search"},
+ {PK_ROLE_ENUM_GET_PACKAGES, "pk-package-search"},
+ {PK_ROLE_ENUM_GET_REPO_LIST, "pk-package-sources"},
{PK_ROLE_ENUM_GET_REQUIRES, "pk-package-info"},
+ {PK_ROLE_ENUM_GET_UPDATE_DETAIL, "pk-package-info"},
{PK_ROLE_ENUM_GET_UPDATES, "pk-package-info"},
+ {PK_ROLE_ENUM_INSTALL_FILES, "pk-package-add"},
+ {PK_ROLE_ENUM_INSTALL_PACKAGES, "pk-package-add"},
+ {PK_ROLE_ENUM_INSTALL_SIGNATURE, "emblem-system"},
+ {PK_ROLE_ENUM_REFRESH_CACHE, "pk-refresh-cache"},
+ {PK_ROLE_ENUM_REMOVE_PACKAGES, "pk-package-delete"},
+ {PK_ROLE_ENUM_REPO_ENABLE, "pk-package-sources"},
+ {PK_ROLE_ENUM_REPO_SET_DATA, "pk-package-sources"},
+ {PK_ROLE_ENUM_RESOLVE, "pk-package-search"},
+ {PK_ROLE_ENUM_ROLLBACK, "pk-rollback"},
{PK_ROLE_ENUM_SEARCH_DETAILS, "pk-package-search"},
{PK_ROLE_ENUM_SEARCH_FILE, "pk-package-search"},
{PK_ROLE_ENUM_SEARCH_GROUP, "pk-package-search"},
{PK_ROLE_ENUM_SEARCH_NAME, "pk-package-search"},
- {PK_ROLE_ENUM_REFRESH_CACHE, "pk-refresh-cache"},
- {PK_ROLE_ENUM_REMOVE_PACKAGES, "pk-package-delete"},
- {PK_ROLE_ENUM_INSTALL_PACKAGES, "pk-package-add"},
- {PK_ROLE_ENUM_INSTALL_FILES, "pk-package-add"},
- {PK_ROLE_ENUM_UPDATE_PACKAGES, "pk-package-update"},
{PK_ROLE_ENUM_SERVICE_PACK, "pk-package-update"},
+ {PK_ROLE_ENUM_UPDATE_PACKAGES, "pk-package-update"},
{PK_ROLE_ENUM_UPDATE_SYSTEM, "system-software-update"},
- {PK_ROLE_ENUM_GET_REPO_LIST, "pk-package-sources"},
- {PK_ROLE_ENUM_REPO_ENABLE, "pk-package-sources"},
- {PK_ROLE_ENUM_REPO_SET_DATA, "pk-package-sources"},
- {PK_ROLE_ENUM_INSTALL_SIGNATURE, "emblem-system"},
- {PK_ROLE_ENUM_GET_PACKAGES, "pk-package-search"},
+ {PK_ROLE_ENUM_WHAT_PROVIDES, "pk-package-search"},
{0, NULL}
};
@@ -120,36 +162,36 @@
{PK_GROUP_ENUM_UNKNOWN, "help-browser"}, /* fall though value */
{PK_GROUP_ENUM_ACCESSIBILITY, "preferences-desktop-accessibility"},
{PK_GROUP_ENUM_ACCESSORIES, "applications-accessories"},
+ {PK_GROUP_ENUM_ADMIN_TOOLS, "system-lock-screen"},
+ {PK_GROUP_ENUM_COLLECTIONS, "pk-collection-installed"},
+ {PK_GROUP_ENUM_COMMUNICATION, "folder-remote"},
+ {PK_GROUP_ENUM_DESKTOP_GNOME, "pk-desktop-gnome"},
+ {PK_GROUP_ENUM_DESKTOP_KDE, "pk-desktop-kde"},
+ {PK_GROUP_ENUM_DESKTOP_OTHER, "user-desktop"},
+ {PK_GROUP_ENUM_DESKTOP_XFCE, "pk-desktop-xfce"},
+ {PK_GROUP_ENUM_DOCUMENTATION, "x-office-address-book"},
{PK_GROUP_ENUM_EDUCATION, "utilities-system-monitor"},
+ {PK_GROUP_ENUM_ELECTRONICS, "video-display"},
+ {PK_GROUP_ENUM_FONTS, "preferences-desktop-font"},
{PK_GROUP_ENUM_GAMES, "applications-games"},
{PK_GROUP_ENUM_GRAPHICS, "applications-graphics"},
{PK_GROUP_ENUM_INTERNET, "applications-internet"},
+ {PK_GROUP_ENUM_LEGACY, "media-floppy"},
+ {PK_GROUP_ENUM_LOCALIZATION, "preferences-desktop-locale"},
+ {PK_GROUP_ENUM_MAPS, "applications-multimedia"},
+ {PK_GROUP_ENUM_MULTIMEDIA, "applications-multimedia"},
+ {PK_GROUP_ENUM_NETWORK, "network-wired"},
{PK_GROUP_ENUM_OFFICE, "applications-office"},
{PK_GROUP_ENUM_OTHER, "applications-other"},
+ {PK_GROUP_ENUM_POWER_MANAGEMENT, "battery"},
{PK_GROUP_ENUM_PROGRAMMING, "applications-development"},
- {PK_GROUP_ENUM_MULTIMEDIA, "applications-multimedia"},
- {PK_GROUP_ENUM_SYSTEM, "applications-system"},
- {PK_GROUP_ENUM_DESKTOP_GNOME, "pk-desktop-gnome"},
- {PK_GROUP_ENUM_DESKTOP_KDE, "pk-desktop-kde"},
- {PK_GROUP_ENUM_DESKTOP_XFCE, "pk-desktop-xfce"},
- {PK_GROUP_ENUM_DESKTOP_OTHER, "user-desktop"},
{PK_GROUP_ENUM_PUBLISHING, "accessories-dictionary"},
- {PK_GROUP_ENUM_SERVERS, "network-server"},
- {PK_GROUP_ENUM_FONTS, "preferences-desktop-font"},
- {PK_GROUP_ENUM_ADMIN_TOOLS, "system-lock-screen"},
- {PK_GROUP_ENUM_LEGACY, "media-floppy"},
- {PK_GROUP_ENUM_LOCALIZATION, "preferences-desktop-locale"},
- {PK_GROUP_ENUM_VIRTUALIZATION, "computer"},
- {PK_GROUP_ENUM_SECURITY, "network-wireless-encrypted"},
- {PK_GROUP_ENUM_POWER_MANAGEMENT, "battery"},
- {PK_GROUP_ENUM_COMMUNICATION, "folder-remote"},
- {PK_GROUP_ENUM_NETWORK, "network-wired"},
- {PK_GROUP_ENUM_MAPS, "applications-multimedia"},
{PK_GROUP_ENUM_REPOS, "system-file-manager"},
{PK_GROUP_ENUM_SCIENCE, "application-certificate"},
- {PK_GROUP_ENUM_DOCUMENTATION, "x-office-address-book"},
- {PK_GROUP_ENUM_ELECTRONICS, "video-display"},
- {PK_GROUP_ENUM_COLLECTIONS, "pk-collection-installed"},
+ {PK_GROUP_ENUM_SECURITY, "network-wireless-encrypted"},
+ {PK_GROUP_ENUM_SERVERS, "network-server"},
+ {PK_GROUP_ENUM_SYSTEM, "applications-system"},
+ {PK_GROUP_ENUM_VIRTUALIZATION, "computer"},
{0, NULL}
};
@@ -1285,6 +1327,15 @@
}
/**
+ * gpk_status_enum_to_animation:
+ **/
+const gchar *
+gpk_status_enum_to_animation (PkStatusEnum status)
+{
+ return pk_enum_find_string (enum_status_animation, status);
+}
+
+/**
* gpk_role_enum_to_icon_name:
**/
const gchar *
@@ -1364,8 +1415,19 @@
egg_test_title (test, "check we convert all the role icon name enums");
for (i=0; i<PK_ROLE_ENUM_UNKNOWN; i++) {
string = gpk_role_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_role_enum_to_text (i));
+ break;
+ }
+ }
+ egg_test_success (test, NULL);
+
+ /************************************************************/
+ egg_test_title (test, "check we convert all the status animation enums");
+ for (i=0; i<PK_ROLE_ENUM_UNKNOWN; i++) {
+ string = gpk_status_enum_to_animation (i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_role_enum_to_text (i));
break;
}
}
@@ -1375,8 +1437,8 @@
egg_test_title (test, "check we convert all the info icon names enums");
for (i=0; i<PK_INFO_ENUM_UNKNOWN; i++) {
string = gpk_info_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_info_enum_to_text (i));
break;
}
}
@@ -1397,8 +1459,8 @@
egg_test_title (test, "check we convert all the status icon names enums");
for (i=0; i<PK_STATUS_ENUM_UNKNOWN; i++) {
string = gpk_status_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_status_enum_to_text (i));
break;
}
}
@@ -1408,8 +1470,8 @@
egg_test_title (test, "check we convert all the restart icon names enums");
for (i=0; i<PK_RESTART_ENUM_UNKNOWN; i++) {
string = gpk_restart_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_restart_enum_to_text (i));
break;
}
}
@@ -1452,8 +1514,8 @@
egg_test_title (test, "check we convert all the message icon name enums");
for (i=0; i<PK_MESSAGE_ENUM_UNKNOWN; i++) {
string = gpk_message_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_message_enum_to_text (i));
break;
}
}
@@ -1496,8 +1558,8 @@
egg_test_title (test, "check we convert all the group icon name enums");
for (i=0; i<PK_GROUP_ENUM_UNKNOWN; i++) {
string = gpk_group_enum_to_icon_name (i);
- if (string == NULL) {
- egg_test_failed (test, "failed to get %i", i);
+ if (string == NULL || egg_strequal (string, "help-browser")) {
+ egg_test_failed (test, "failed to get %s", pk_group_enum_to_text (i));
break;
}
}
Modified: trunk/src/gpk-enum.h
==============================================================================
--- trunk/src/gpk-enum.h (original)
+++ trunk/src/gpk-enum.h Fri Sep 26 09:49:36 2008
@@ -72,6 +72,7 @@
const gchar *gpk_status_enum_to_localised_text (PkStatusEnum status)
G_GNUC_CONST;
const gchar *gpk_status_enum_to_icon_name (PkStatusEnum status);
+const gchar *gpk_status_enum_to_animation (PkStatusEnum status);
const gchar *gpk_restart_enum_to_icon_name (PkRestartEnum restart);
const gchar *gpk_error_enum_to_localised_text (PkErrorCodeEnum code)
G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]