gnome-packagekit r268 - in trunk: . src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-packagekit r268 - in trunk: . src
- Date: Tue, 19 Aug 2008 16:58:58 +0000 (UTC)
Author: rhughes
Date: Tue Aug 19 16:58:58 2008
New Revision: 268
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=268&view=rev
Log:
from git
Modified:
trunk/NEWS
trunk/configure.ac
trunk/src/gpk-application.c
trunk/src/gpk-auto-refresh.c
trunk/src/gpk-backend-status.c
trunk/src/gpk-cell-renderer-uri.c
trunk/src/gpk-check-update.c
trunk/src/gpk-client.c
trunk/src/gpk-common.c
trunk/src/gpk-common.h
trunk/src/gpk-log.c
trunk/src/gpk-prefs.c
trunk/src/gpk-repo.c
trunk/src/gpk-update-viewer.c
trunk/src/gpk-watch.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue Aug 19 16:58:58 2008
@@ -1,3 +1,51 @@
+Version 0.3.0
+~~~~~~~~~~~~~~
+Released: 2008-08-18
+
+* Translations
+ - Updated Spanish translation (Daniel Mustieles)
+ - Updated Brazilian Portuguese translation (Igor Pires Soares)
+ - Updates Norwegian bokmÃl translation (Kjartan Maraas)
+ - Updated Russian translation (Leonid Kanter)
+ - Updated Hebrew translation (Mark Krapivner)
+ - Updates German Translation (Patrick Niklaus)
+ - Updated Polish translation (Piotr DrÄg)
+ - Updated Finnish translation (Ville-Pekka Vainio)
+ - Updated Polish translation (Wadim Dziedzic)
+ - Updated Occitan translation (Yannig Marchegay)
+
+New:
+ - Change the client tools to the updated 0.3.x API (Richard Hughes)
+ - Force a pre-cache of all the update detail at startup (Richard Hughes)
+ - Populate the package auto-completion box in gpk-application (Richard Hughes)
+ - Support the new fields in the update details (Richard Hughes)
+ - Allow gpk-install-file to install .pack files (Shishir Goel)
+
+Bugfix:
+ - Add a blocked update handler (Daniel Nicoletti)
+ - Make some of the glade labels non-translatable (Kjartan Maraas)
+ - Correct some typos found by Andre Klapper (Richard Hughes)
+ - Hide the refresh text if there was less than a day elapsed (Richard Hughes)
+ - Show a the spinner when return to the details, fixes rh#453250 (Richard Hughes)
+ - Stop repeat schedule of query-updates if policy is security (Richard Hughes)
+ - Don't crash if we click the help text in gpk-application (Richard Hughes)
+ - Unify the scrolling UI when installing and removing. Fixes rh#453917 (Richard Hughes)
+ - Limit the size of the balloon at startup about security updates. Fixes rh#453817 (Richard Hughes)
+ - Don't show the depends window when we have no depends (Richard Hughes)
+ - Set the interaction of the UI to always when we are using a helper (Richard Hughes)
+ - Sort the listview as the packages come in to avoid the double flicker (Richard Hughes)
+ - Don't put a window title on a GpkError dialog window (Richard Hughes)
+ - When dep resolving when removing, show the UI. Fixes rh#454399 (Richard Hughes)
+ - Properly parse the update detail so we bullet many more descriptions (Richard Hughes)
+ - Make the file list widget more HIG friendly (Richard Hughes)
+ - Handle GpkAnimatedIcon as a widget, not a GObject (Richard Hughes)
+ - Be more proactive about cancelling timers and animations (Richard Hughes)
+ - Fix 'move depends on uninitialised value' in gpk_client_finished_cb() (Richard Hughes)
+ - Don't show the error details in the libnotify popup (Richard Hughes)
+ - Copy files not readable by root into a shared location. Fixed rh#45609 (Richard Hughes)
+ - Sort out the icons, and use defines for the common ones (Richard Hughes)
+ - Don't hardcode the active, link and clicked-link colour. Fixes rh#458533 (Richard Hughes)
+
Version 0.2.2
~~~~~~~~~~~~~~
Released: 2008-06-05
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Tue Aug 19 16:58:58 2008
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(gnome-packagekit, 0.3.0)
+AC_INIT(gnome-packagekit, 0.3.1)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
Modified: trunk/src/gpk-application.c
==============================================================================
--- trunk/src/gpk-application.c (original)
+++ trunk/src/gpk-application.c Tue Aug 19 16:58:58 2008
@@ -104,10 +104,10 @@
gchar *group;
gchar *url;
GHashTable *repos;
- PkRoleEnum roles;
- PkFilterEnum filters;
- PkGroupEnum groups;
- PkFilterEnum filters_current;
+ PkBitfield roles;
+ PkBitfield filters;
+ PkBitfield groups;
+ PkBitfield filters_current;
gboolean has_package; /* if we got a package in the search */
PkSearchType search_type;
PkSearchMode search_mode;
@@ -192,7 +192,7 @@
GtkWidget *widget;
/* if we can't do it, then just make the button insensitive */
- if (!pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_CANCEL)) {
+ if (!pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_CANCEL)) {
widget = glade_xml_get_widget (application->priv->glade_xml, "button_cancel");
gtk_widget_set_sensitive (widget, FALSE);
}
@@ -1375,7 +1375,7 @@
package = gtk_entry_get_text (GTK_ENTRY (widget));
/* clear group selection if we have the tab */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
widget = glade_xml_get_widget (application->priv->glade_xml, "treeview_groups");
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
gtk_tree_selection_unselect_all (selection);
@@ -1891,7 +1891,7 @@
}
pk_debug ("icon_pos=%i", icon_pos);
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_NAME)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_NAME)) {
item = gtk_image_menu_item_new_with_mnemonic (_("Search by name"));
image = gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
@@ -1900,7 +1900,7 @@
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_DETAILS)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_DETAILS)) {
item = gtk_image_menu_item_new_with_mnemonic (_("Search by description"));
image = gtk_image_new_from_stock (GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
@@ -1909,7 +1909,7 @@
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
}
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_FILE)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_FILE)) {
item = gtk_image_menu_item_new_with_mnemonic (_("Search by file name"));
image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
@@ -2149,14 +2149,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_INSTALLED);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_INSTALLED);
}
/* refresh the search results */
@@ -2183,14 +2183,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_DEVELOPMENT);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_DEVELOPMENT);
}
/* refresh the search results */
@@ -2217,14 +2217,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_GUI);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_GUI);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_GUI);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_GUI);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_GUI);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_GUI);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_GUI);
}
/* refresh the search results */
@@ -2251,14 +2251,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_FREE);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_FREE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_FREE);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_FREE);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_FREE);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_FREE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_FREE);
}
/* refresh the search results */
@@ -2285,14 +2285,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_ARCH);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_ARCH);
}
/* refresh the search results */
@@ -2319,14 +2319,14 @@
/* set new filter */
if (g_str_has_suffix (name, "_yes")) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
} else if (g_str_has_suffix (name, "_no")) {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_SOURCE);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NOT_SOURCE);
}
/* refresh the sesource results */
@@ -2351,9 +2351,9 @@
/* change the filter */
if (enabled) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_BASENAME);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_BASENAME);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_BASENAME);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_BASENAME);
}
/* refresh the search results */
@@ -2378,9 +2378,9 @@
/* change the filter */
if (enabled) {
- pk_enums_add (application->priv->filters_current, PK_FILTER_ENUM_NEWEST);
+ pk_bitfield_add (application->priv->filters_current, PK_FILTER_ENUM_NEWEST);
} else {
- pk_enums_remove (application->priv->filters_current, PK_FILTER_ENUM_NEWEST);
+ pk_bitfield_remove (application->priv->filters_current, PK_FILTER_ENUM_NEWEST);
}
/* refresh the search results */
@@ -2549,7 +2549,7 @@
gtk_list_store_append (application->priv->packages_store, &iter);
/* enter something nice */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
welcome = _("Enter a package name and then click find, or click a group to get started.");
} else {
welcome = _("Enter a package name and then click find to get started.");
@@ -2668,7 +2668,7 @@
g_signal_connect (application->priv->client_files, "allow-cancel",
G_CALLBACK (gpk_application_allow_cancel_cb), application);
- /* get enums */
+ /* get bitfield */
application->priv->roles = pk_control_get_actions (application->priv->control);
application->priv->filters = pk_control_get_filters (application->priv->control);
application->priv->groups = pk_control_get_groups (application->priv->control);
@@ -2846,37 +2846,37 @@
G_CALLBACK (gpk_application_menu_filter_newest_cb), application);
/* Remove description/file list if needed. */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_DETAILS) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_DETAILS) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "scrolledwindow2");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_FILES) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_FILES) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_files");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_DEPENDS) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_DEPENDS) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_depends");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_REQUIRES) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_REQUIRES) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_requires");
gtk_widget_hide (widget);
}
/* hide the group selector if we don't support search-groups */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "scrolledwindow_groups");
gtk_widget_hide (widget);
}
/* hide the refresh cache button if we can't do it */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_REFRESH_CACHE) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_REFRESH_CACHE) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_refresh");
gtk_widget_hide (widget);
}
/* hide the software-sources button if we can't do it */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_REPO_LIST) == FALSE) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_REPO_LIST) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_sources");
gtk_widget_hide (widget);
}
@@ -2928,34 +2928,34 @@
G_CALLBACK (gpk_application_entry_text_icon_pressed_cb), application);
/* hide the filters we can't support */
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_INSTALLED) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_INSTALLED) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_installed");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_DEVELOPMENT) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_DEVELOPMENT) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_devel");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_GUI) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_GUI) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_gui");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_FREE) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_FREE) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_free");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_ARCH) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_ARCH) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_arch");
gtk_widget_hide (widget);
}
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_SOURCE) == FALSE) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_SOURCE) == FALSE) {
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_source");
gtk_widget_hide (widget);
}
/* BASENAME, use by default, or hide */
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_basename");
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_BASENAME)) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_BASENAME)) {
enabled = gconf_client_get_bool (application->priv->gconf_client,
GPK_CONF_APPLICATION_FILTER_BASENAME, NULL);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (widget), enabled);
@@ -2967,7 +2967,7 @@
/* NEWEST, use by default, or hide */
widget = glade_xml_get_widget (application->priv->glade_xml, "menuitem_newest");
- if (pk_enums_contain (application->priv->filters, PK_FILTER_ENUM_NEWEST)) {
+ if (pk_bitfield_contain (application->priv->filters, PK_FILTER_ENUM_NEWEST)) {
/* set from remembered state */
enabled = gconf_client_get_bool (application->priv->gconf_client,
GPK_CONF_APPLICATION_FILTER_NEWEST, NULL);
@@ -3019,7 +3019,7 @@
gpk_application_packages_add_columns (application);
/* add an "all" entry if we can GetPackages */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_PACKAGES)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_PACKAGES)) {
GtkTreeIter iter;
const gchar *icon_name;
gtk_list_store_append (application->priv->groups_store, &iter);
@@ -3040,8 +3040,8 @@
G_CALLBACK (gpk_application_groups_treeview_clicked_cb), application);
/* only if we can do both */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_GET_PACKAGES) &&
- pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_GET_PACKAGES) &&
+ pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
GtkTreeIter iter;
/* add a separator */
@@ -3056,13 +3056,13 @@
}
/* create group tree view if we can search by group */
- if (pk_enums_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
+ if (pk_bitfield_contain (application->priv->roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
/* add columns to the tree view */
gpk_application_groups_add_columns (GTK_TREE_VIEW (widget));
/* add all the groups supported */
- for (i=1; i<PK_GROUP_ENUM_UNKNOWN; i*=2) {
- if (pk_enums_contain (application->priv->groups, i)) {
+ for (i=0; i<PK_GROUP_ENUM_UNKNOWN; i++) {
+ if (pk_bitfield_contain (application->priv->groups, i)) {
gpk_application_group_add_data (application, i);
}
}
Modified: trunk/src/gpk-auto-refresh.c
==============================================================================
--- trunk/src/gpk-auto-refresh.c (original)
+++ trunk/src/gpk-auto-refresh.c Tue Aug 19 16:58:58 2008
@@ -365,7 +365,7 @@
{
g_return_if_fail (GPK_IS_AUTO_REFRESH (arefresh));
- arefresh->priv->network_active = pk_enums_contain (state, PK_NETWORK_ENUM_ONLINE);
+ arefresh->priv->network_active = (state == PK_NETWORK_ENUM_ONLINE);
pk_debug ("setting online %i", arefresh->priv->network_active);
gpk_auto_refresh_change_state (arefresh);
}
@@ -536,7 +536,7 @@
g_signal_connect (arefresh->priv->control, "network-state-changed",
G_CALLBACK (gpk_auto_refresh_network_status_changed_cb), arefresh);
state = pk_control_get_network_state (arefresh->priv->control);
- if (pk_enums_contain (state, PK_NETWORK_ENUM_ONLINE)) {
+ if (state == PK_NETWORK_ENUM_ONLINE) {
arefresh->priv->network_active = TRUE;
}
Modified: trunk/src/gpk-backend-status.c
==============================================================================
--- trunk/src/gpk-backend-status.c (original)
+++ trunk/src/gpk-backend-status.c Tue Aug 19 16:58:58 2008
@@ -72,7 +72,7 @@
gchar *name;
gchar *author;
PkRoleEnum roles;
- PkFilterEnum filters;
+ PkBitfield filters;
PkControl *control;
gboolean retval;
@@ -142,127 +142,127 @@
g_free (author);
/* actions */
- if (pk_enums_contain (roles, PK_ROLE_ENUM_CANCEL)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_CANCEL)) {
widget = glade_xml_get_widget (glade_xml, "image_cancel");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_DEPENDS)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_DEPENDS)) {
widget = glade_xml_get_widget (glade_xml, "image_get_depends");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_UPDATE_DETAIL)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_UPDATE_DETAIL)) {
widget = glade_xml_get_widget (glade_xml, "image_get_update_detail");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_DETAILS)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_DETAILS)) {
widget = glade_xml_get_widget (glade_xml, "image_get_description");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_FILES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_FILES)) {
widget = glade_xml_get_widget (glade_xml, "image_get_files");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_REQUIRES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_REQUIRES)) {
widget = glade_xml_get_widget (glade_xml, "image_get_requires");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_UPDATES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_UPDATES)) {
widget = glade_xml_get_widget (glade_xml, "image_get_updates");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_SEARCH_DETAILS)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_SEARCH_DETAILS)) {
widget = glade_xml_get_widget (glade_xml, "image_search_details");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_SEARCH_FILE)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_SEARCH_FILE)) {
widget = glade_xml_get_widget (glade_xml, "image_search_file");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_SEARCH_GROUP)) {
widget = glade_xml_get_widget (glade_xml, "image_search_group");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_SEARCH_NAME)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_SEARCH_NAME)) {
widget = glade_xml_get_widget (glade_xml, "image_search_name");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REFRESH_CACHE)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_REFRESH_CACHE)) {
widget = glade_xml_get_widget (glade_xml, "image_refresh_cache");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REMOVE_PACKAGES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_REMOVE_PACKAGES)) {
widget = glade_xml_get_widget (glade_xml, "image_package_remove");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_PACKAGES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_INSTALL_PACKAGES)) {
widget = glade_xml_get_widget (glade_xml, "image_package_install");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_FILES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_INSTALL_FILES)) {
widget = glade_xml_get_widget (glade_xml, "image_file_install");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_UPDATE_PACKAGES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_UPDATE_PACKAGES)) {
widget = glade_xml_get_widget (glade_xml, "image_package_update");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_UPDATE_SYSTEM)) {
widget = glade_xml_get_widget (glade_xml, "image_system_update");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_RESOLVE)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_RESOLVE)) {
widget = glade_xml_get_widget (glade_xml, "image_resolve");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_WHAT_PROVIDES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_WHAT_PROVIDES)) {
widget = glade_xml_get_widget (glade_xml, "image_what_provides");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_PACKAGES)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_PACKAGES)) {
widget = glade_xml_get_widget (glade_xml, "image_get_packages");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
/* repos */
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_REPO_LIST)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_REPO_LIST)) {
widget = glade_xml_get_widget (glade_xml, "image_get_repo_list");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REPO_ENABLE)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_REPO_ENABLE)) {
widget = glade_xml_get_widget (glade_xml, "image_repo_enable");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REPO_SET_DATA)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_REPO_SET_DATA)) {
widget = glade_xml_get_widget (glade_xml, "image_repo_set_data");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
/* filters */
- if (pk_enums_contain (filters, PK_FILTER_ENUM_INSTALLED)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_INSTALLED)) {
widget = glade_xml_get_widget (glade_xml, "image_installed");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_DEVELOPMENT)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_DEVELOPMENT)) {
widget = glade_xml_get_widget (glade_xml, "image_devel");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_GUI)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_GUI)) {
widget = glade_xml_get_widget (glade_xml, "image_gui");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_FREE)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_FREE)) {
widget = glade_xml_get_widget (glade_xml, "image_free");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_VISIBLE)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_VISIBLE)) {
widget = glade_xml_get_widget (glade_xml, "image_visible");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_SUPPORTED)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_SUPPORTED)) {
widget = glade_xml_get_widget (glade_xml, "image_supported");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
- if (pk_enums_contain (filters, PK_FILTER_ENUM_NEWEST)) {
+ if (pk_bitfield_contain (filters, PK_FILTER_ENUM_NEWEST)) {
widget = glade_xml_get_widget (glade_xml, "image_newest");
gtk_image_set_from_icon_name (GTK_IMAGE (widget), "gtk-apply", GTK_ICON_SIZE_MENU);
}
Modified: trunk/src/gpk-cell-renderer-uri.c
==============================================================================
--- trunk/src/gpk-cell-renderer-uri.c (original)
+++ trunk/src/gpk-cell-renderer-uri.c Tue Aug 19 16:58:58 2008
@@ -132,6 +132,37 @@
}
}
+/* we can't hardcode colours, so just make blue-er and purple-er */
+static void
+gpk_cell_renderer_uri_set_link_color (GdkColor *color, gboolean visited)
+{
+ const guint color_half = 65535/2;
+ const guint offset = 65535/3;
+
+ if (visited) {
+ if (color->red < color_half && color->blue < color_half) {
+ color->red += offset;
+ color->blue += offset;
+ return;
+ }
+ if (color->green > color_half) {
+ color->green -= offset;
+ return;
+ }
+ } else {
+ if (color->blue < color_half) {
+ color->blue += offset;
+ return;
+ }
+ if (color->red > color_half && color->green > color_half) {
+ color->red -= offset;
+ color->green -= offset;
+ return;
+ }
+ }
+ pk_debug ("cannot get color for %i,%i,%i", color->red, color->blue, color->green);
+}
+
static void
gpk_cell_renderer_uri_render (GtkCellRenderer *cell,
GdkWindow *window,
@@ -143,6 +174,9 @@
{
gboolean ret;
GdkCursor *cursor;
+ GtkStyle *style;
+ GdkColor *color;
+ gchar *color_string;
GpkCellRendererUri *cru = GPK_CELL_RENDERER_URI (cell);
/* set cursor */
@@ -155,18 +189,41 @@
gdk_cursor_destroy (cursor);
ret = gpk_cell_renderer_uri_is_clicked (cru);
+ /* get a copy of the widget color */
+ gtk_widget_ensure_style (GTK_WIDGET (widget));
+ style = gtk_rc_get_style (GTK_WIDGET (widget));
+
/* set colour */
if (cru->uri == NULL) {
- g_object_set (G_OBJECT (cell), "foreground", "#000000", NULL);
+ color = gdk_color_copy (&style->text[GTK_STATE_NORMAL]);
+ color_string = gdk_color_to_string (color);
+ g_object_set (G_OBJECT (cell), "foreground", color_string, NULL);
g_object_set (G_OBJECT (cru), "underline", PANGO_UNDERLINE_NONE, NULL);
} else if (ret) {
- g_object_set (G_OBJECT (cell), "foreground", "#840084", NULL);
+ /* if we defined this in our theme, else find a compromise */
+ gtk_widget_style_get (GTK_WIDGET (widget), "visited-link-color", &color, NULL);
+ if (color == NULL) {
+ color = gdk_color_copy (&style->text[GTK_STATE_NORMAL]);
+ gpk_cell_renderer_uri_set_link_color (color, TRUE);
+ }
+ color_string = gdk_color_to_string (color);
+ g_object_set (G_OBJECT (cell), "foreground", color_string, NULL);
g_object_set (G_OBJECT (cru), "underline", PANGO_UNDERLINE_SINGLE, NULL);
} else {
- g_object_set (G_OBJECT (cell), "foreground", "#0000ff", NULL);
+ /* if we defined this in our theme, else find a compromise */
+ gtk_widget_style_get (GTK_WIDGET (widget), "link-color", &color, NULL);
+ if (color == NULL) {
+ color = gdk_color_copy (&style->text[GTK_STATE_NORMAL]);
+ gpk_cell_renderer_uri_set_link_color (color, FALSE);
+ }
+ color_string = gdk_color_to_string (color);
+ g_object_set (G_OBJECT (cell), "foreground", color_string, NULL);
g_object_set (G_OBJECT (cru), "underline", PANGO_UNDERLINE_SINGLE, NULL);
}
+ gdk_color_free (color);
+ g_free (color_string);
+
/* we can click */
g_object_set (G_OBJECT (cru), "mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
Modified: trunk/src/gpk-check-update.c
==============================================================================
--- trunk/src/gpk-check-update.c (original)
+++ trunk/src/gpk-check-update.c Tue Aug 19 16:58:58 2008
@@ -497,14 +497,14 @@
}
/**
- * gpk_check_update_client_info_to_enums:
+ * gpk_check_update_client_info_to_bitfield:
**/
-static PkInfoEnum
-gpk_check_update_client_info_to_enums (GpkCheckUpdate *cupdate, PkPackageList *list)
+static PkBitfield
+gpk_check_update_client_info_to_bitfield (GpkCheckUpdate *cupdate, PkPackageList *list)
{
guint i;
guint length;
- PkInfoEnum infos = 0;
+ PkBitfield infos = 0;
const PkPackageObj *obj;
g_return_val_if_fail (GPK_IS_CHECK_UPDATE (cupdate), PK_INFO_ENUM_UNKNOWN);
@@ -523,7 +523,7 @@
break;
}
pk_debug ("%s %s", obj->id->name, pk_info_enum_to_text (obj->info));
- pk_enums_add (infos, obj->info);
+ pk_bitfield_add (infos, obj->info);
}
return infos;
}
@@ -535,16 +535,16 @@
gpk_check_update_get_best_update_icon (GpkCheckUpdate *cupdate, PkPackageList *list)
{
gint value;
- PkInfoEnum infos;
+ PkBitfield infos;
const gchar *icon;
g_return_val_if_fail (GPK_IS_CHECK_UPDATE (cupdate), NULL);
/* get an enumerated list with all the update types */
- infos = gpk_check_update_client_info_to_enums (cupdate, list);
+ infos = gpk_check_update_client_info_to_bitfield (cupdate, list);
/* get the most important icon */
- value = pk_enums_contain_priority (infos,
+ value = pk_bitfield_contain_priority (infos,
PK_INFO_ENUM_SECURITY,
PK_INFO_ENUM_IMPORTANT,
PK_INFO_ENUM_BUGFIX,
Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c (original)
+++ trunk/src/gpk-client.c Tue Aug 19 16:58:58 2008
@@ -29,7 +29,6 @@
#include "config.h"
#include <unistd.h>
-#include <sys/stat.h>
#include <string.h>
#include <glib/gi18n.h>
#include <glib/gprintf.h>
@@ -85,7 +84,7 @@
guint pulse_timer_id;
guint finished_timer_id;
PkControl *control;
- PkRoleEnum roles;
+ PkBitfield roles;
gboolean using_secondary_client;
gboolean retry_untrusted_value;
gboolean show_finished;
@@ -1006,45 +1005,6 @@
}
/**
- * gpk_client_check_permissions:
- * @filename: a filename to check
- * @euid: the effective user ID to check for, or the output of geteuid()
- * @egid: the effective group ID to check for, or the output of getegid()
- * @mode: bitfield of R_OK, W_OK, XOK
- *
- * Like, access but a bit more accurate - access will let root do anything.
- * Does not get read-only or no-exec filesystems right.
- *
- * Return value: %TRUE if the file has access perms
- **/
-static gboolean
-gpk_client_check_permissions (gchar *filename, guint euid, guint egid, guint mode)
-{
- struct stat statbuf;
-
- if (stat (filename, &statbuf) == 0) {
- if ((mode & R_OK) &&
- !((statbuf.st_mode & S_IROTH) ||
- ((statbuf.st_mode & S_IRUSR) && euid == statbuf.st_uid) ||
- ((statbuf.st_mode & S_IRGRP) && egid == statbuf.st_gid)))
- return FALSE;
- if ((mode & W_OK) &&
- !((statbuf.st_mode & S_IWOTH) ||
- ((statbuf.st_mode & S_IWUSR) && euid == statbuf.st_uid) ||
- ((statbuf.st_mode & S_IWGRP) && egid == statbuf.st_gid)))
- return FALSE;
- if ((mode & X_OK) &&
- !((statbuf.st_mode & S_IXOTH) ||
- ((statbuf.st_mode & S_IXUSR) && euid == statbuf.st_uid) ||
- ((statbuf.st_mode & S_IXGRP) && egid == statbuf.st_gid)))
- return FALSE;
-
- return TRUE;
- }
- return FALSE;
-}
-
-/**
* gpk_client_file_array_to_list:
*
* splits the files up nicely
@@ -1125,7 +1085,7 @@
array_missing = g_ptr_array_new ();
for (i=0; i<array->len; i++) {
data = (gchar *) g_ptr_array_index (array, i);
- ret = gpk_client_check_permissions (data, 0, 0, R_OK);
+ ret = pk_check_permissions (data, 0, 0, R_OK);
if (!ret)
g_ptr_array_add (array_missing, g_strdup (data));
}
@@ -1170,7 +1130,7 @@
GError *error = NULL;
data = (gchar *) g_ptr_array_index (array_new, i);
- ret = gpk_client_check_permissions (data, 0, 0, R_OK);
+ ret = pk_check_permissions (data, 0, 0, R_OK);
if (ret) {
/* just copy over the name */
g_ptr_array_add (array, g_strdup (data));
@@ -1445,7 +1405,7 @@
gpk_client_set_page (gclient, GPK_CLIENT_PAGE_PROGRESS);
/* are we dumb and can't check for depends? */
- if (!pk_enums_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_REQUIRES)) {
+ if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_REQUIRES)) {
pk_warning ("skipping depends check");
goto skip_checks;
}
@@ -1545,7 +1505,7 @@
gpk_client_set_page (gclient, GPK_CLIENT_PAGE_PROGRESS);
/* are we dumb and can't check for depends? */
- if (!pk_enums_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_DEPENDS)) {
+ if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_DEPENDS)) {
pk_warning ("skipping depends check");
goto skip_checks;
}
Modified: trunk/src/gpk-common.c
==============================================================================
--- trunk/src/gpk-common.c (original)
+++ trunk/src/gpk-common.c Tue Aug 19 16:58:58 2008
@@ -150,6 +150,9 @@
{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"},
{0, NULL}
};
@@ -164,9 +167,17 @@
static PkEnumMatch enum_message_icon_name[] = {
{PK_MESSAGE_ENUM_UNKNOWN, "help-browser"}, /* fall though value */
- {PK_MESSAGE_ENUM_NOTICE, "dialog-information"},
- {PK_MESSAGE_ENUM_WARNING, "dialog-warning"},
- {PK_MESSAGE_ENUM_DAEMON, "dialog-error"},
+ {PK_MESSAGE_ENUM_BROKEN_MIRROR, "dialog-error"},
+ {PK_MESSAGE_ENUM_CONNECTION_REFUSED, "dialog-error"},
+ {PK_MESSAGE_ENUM_PARAMETER_INVALID, "dialog-error"},
+ {PK_MESSAGE_ENUM_PRIORITY_INVALID, "dialog-error"},
+ {PK_MESSAGE_ENUM_BACKEND_ERROR, "dialog-error"},
+ {PK_MESSAGE_ENUM_DAEMON_ERROR, "dialog-error"},
+ {PK_MESSAGE_ENUM_CACHE_BEING_REBUILT, "dialog-information"},
+ {PK_MESSAGE_ENUM_UNTRUSTED_PACKAGE, "dialog-warning"},
+ {PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS, "dialog-information"},
+ {PK_MESSAGE_ENUM_COULD_NOT_FIND_PACKAGE,"dialog-error"},
+ {PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED, "dialog-information"},
{0, NULL}
};
@@ -646,6 +657,29 @@
}
/**
+ * gpk_update_state_enum_to_localised_text:
+ **/
+const gchar *
+gpk_update_state_enum_to_localised_text (PkUpdateStateEnum state)
+{
+ const gchar *text = NULL;
+ switch (state) {
+ case PK_UPDATE_STATE_ENUM_STABLE:
+ text = _("Stable");
+ break;
+ case PK_UPDATE_STATE_ENUM_UNSTABLE:
+ text = _("Unstable");
+ break;
+ case PK_UPDATE_STATE_ENUM_TESTING:
+ text = _("Testing");
+ break;
+ default:
+ pk_warning ("state unrecognised: %i", state);
+ }
+ return text;
+}
+
+/**
* gpk_message_enum_to_localised_text:
**/
const gchar *
@@ -653,14 +687,38 @@
{
const gchar *text = NULL;
switch (message) {
- case PK_MESSAGE_ENUM_NOTICE:
- text = _("PackageKit notice");
+ case PK_MESSAGE_ENUM_BROKEN_MIRROR:
+ text = _("A mirror is possibly broken");
+ break;
+ case PK_MESSAGE_ENUM_CONNECTION_REFUSED:
+ text = _("The connection was refused");
+ break;
+ case PK_MESSAGE_ENUM_PARAMETER_INVALID:
+ text = _("The parameter was invalid");
+ break;
+ case PK_MESSAGE_ENUM_PRIORITY_INVALID:
+ text = _("The priority was invalid");
+ break;
+ case PK_MESSAGE_ENUM_BACKEND_ERROR:
+ text = _("Generic backend error");
+ break;
+ case PK_MESSAGE_ENUM_DAEMON_ERROR:
+ text = _("Generic daemon error");
break;
- case PK_MESSAGE_ENUM_WARNING:
- text = _("PackageKit warning");
+ case PK_MESSAGE_ENUM_CACHE_BEING_REBUILT:
+ text = _("The package list cache is being rebuilt");
break;
- case PK_MESSAGE_ENUM_DAEMON:
- text = _("PackageKit daemon");
+ case PK_MESSAGE_ENUM_UNTRUSTED_PACKAGE:
+ text = _("An untrusted package was installed");
+ break;
+ case PK_MESSAGE_ENUM_NEWER_PACKAGE_EXISTS:
+ text = _("A newer package exists");
+ break;
+ case PK_MESSAGE_ENUM_COULD_NOT_FIND_PACKAGE:
+ text = _("Could not find package");
+ break;
+ case PK_MESSAGE_ENUM_CONFIG_FILES_CHANGED:
+ text = _("Configuration files were changed");
break;
default:
pk_warning ("message unrecognised: %i", message);
@@ -792,6 +850,9 @@
case PK_INFO_ENUM_ENHANCEMENT:
text = g_strdup_printf (ngettext ("%i enhancement update", "%i enhancement updates", number), number);
break;
+ case PK_INFO_ENUM_BLOCKED:
+ text = g_strdup_printf (ngettext ("%i bloked update", "%i blocked updates", number), number);
+ break;
default:
pk_warning ("update info unrecognised: %s", pk_info_enum_to_text (info));
}
@@ -1199,6 +1260,15 @@
case PK_GROUP_ENUM_REPOS:
text = _("Software sources");
break;
+// case PK_GROUP_ENUM_SCIENCE:
+// text = _("Science");
+// break;
+// case PK_GROUP_ENUM_DOCUMENTATION:
+// text = _("Documentation");
+// break;
+// case PK_GROUP_ENUM_ELECTRONICS:
+// text = _("Electronics");
+// break;
case PK_GROUP_ENUM_UNKNOWN:
text = _("Unknown group");
break;
@@ -1730,7 +1800,7 @@
**************** localised enums **************
************************************************************/
libst_title (test, "check we convert all the localised past role enums");
- for (i=1; i<PK_ROLE_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_ROLE_ENUM_UNKNOWN; i++) {
string = gpk_role_enum_to_localised_past (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1741,7 +1811,7 @@
/************************************************************/
libst_title (test, "check we convert all the localised present role enums");
- for (i=1; i<PK_ROLE_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_ROLE_ENUM_UNKNOWN; i++) {
string = gpk_role_enum_to_localised_present (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1752,7 +1822,7 @@
/************************************************************/
libst_title (test, "check we convert all the role icon name enums");
- for (i=1; i<PK_ROLE_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_ROLE_ENUM_UNKNOWN; i++) {
string = gpk_role_enum_to_icon_name (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1763,7 +1833,7 @@
/************************************************************/
libst_title (test, "check we convert all the info icon names enums");
- for (i=1; i<PK_INFO_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_INFO_ENUM_UNKNOWN; i++) {
string = gpk_info_enum_to_icon_name (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1774,7 +1844,7 @@
/************************************************************/
libst_title (test, "check we convert all the localised status enums");
- for (i=1; i<PK_STATUS_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_STATUS_ENUM_UNKNOWN; i++) {
string = gpk_status_enum_to_localised_text (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1785,7 +1855,7 @@
/************************************************************/
libst_title (test, "check we convert all the status icon names enums");
- for (i=1; i<PK_STATUS_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_STATUS_ENUM_UNKNOWN; i++) {
string = gpk_status_enum_to_icon_name (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1873,7 +1943,7 @@
/************************************************************/
libst_title (test, "check we convert all the localised group enums");
- for (i=1; i<PK_GROUP_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_GROUP_ENUM_UNKNOWN; i++) {
string = gpk_group_enum_to_localised_text (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
@@ -1884,7 +1954,7 @@
/************************************************************/
libst_title (test, "check we convert all the group icon name enums");
- for (i=1; i<PK_GROUP_ENUM_UNKNOWN; i*=2) {
+ for (i=0; i<PK_GROUP_ENUM_UNKNOWN; i++) {
string = gpk_group_enum_to_icon_name (i);
if (string == NULL) {
libst_failed (test, "failed to get %i", i);
Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h (original)
+++ trunk/src/gpk-common.h Tue Aug 19 16:58:58 2008
@@ -90,6 +90,8 @@
const gchar *gpk_error_enum_to_localised_message (PkErrorCodeEnum code);
const gchar *gpk_restart_enum_to_localised_text (PkRestartEnum restart)
G_GNUC_CONST;
+const gchar *gpk_update_state_enum_to_localised_text (PkUpdateStateEnum state)
+ G_GNUC_CONST;
const gchar *gpk_message_enum_to_icon_name (PkMessageEnum message);
const gchar *gpk_message_enum_to_localised_text (PkMessageEnum message)
G_GNUC_CONST;
Modified: trunk/src/gpk-log.c
==============================================================================
--- trunk/src/gpk-log.c (original)
+++ trunk/src/gpk-log.c Tue Aug 19 16:58:58 2008
@@ -333,7 +333,7 @@
GOptionContext *context;
GtkWidget *widget;
GtkTreeSelection *selection;
- PkRoleEnum roles;
+ PkBitfield roles;
PkControl *control;
LibUnique *libunique;
gboolean ret;
@@ -426,7 +426,7 @@
g_signal_connect (button_action, "activate", G_CALLBACK (gpk_log_button_rollback_cb), NULL);
/* hide the rollback button if we can't do the action */
- if (pk_enums_contain (roles, PK_ROLE_ENUM_ROLLBACK)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_ROLLBACK)) {
polkit_gnome_action_set_visible (button_action, TRUE);
} else {
polkit_gnome_action_set_visible (button_action, FALSE);
Modified: trunk/src/gpk-prefs.c
==============================================================================
--- trunk/src/gpk-prefs.c (original)
+++ trunk/src/gpk-prefs.c Tue Aug 19 16:58:58 2008
@@ -273,7 +273,7 @@
GOptionContext *context;
GtkWidget *main_window;
GtkWidget *widget;
- PkRoleEnum roles;
+ PkBitfield roles;
PkClient *client;
PkControl *control;
LibUnique *libunique;
Modified: trunk/src/gpk-repo.c
==============================================================================
--- trunk/src/gpk-repo.c (original)
+++ trunk/src/gpk-repo.c Tue Aug 19 16:58:58 2008
@@ -49,7 +49,7 @@
static GladeXML *glade_xml = NULL;
static GtkListStore *list_store = NULL;
static PkClient *client = NULL;
-static PkRoleEnum roles;
+static PkBitfield roles;
static GConfClient *gconf_client;
static gboolean show_details;
@@ -82,7 +82,7 @@
GError *error = NULL;
/* do we have the capability? */
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REPO_ENABLE) == FALSE) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_REPO_ENABLE) == FALSE) {
pk_debug ("can't change state");
return;
}
@@ -247,7 +247,7 @@
{
gboolean ret;
GError *error = NULL;
- PkFilterEnum filter;
+ PkBitfield filters;
pk_debug ("refreshing list");
gtk_list_store_clear (list_store);
@@ -259,11 +259,11 @@
}
if (!show_details) {
- filter = PK_FILTER_ENUM_NOT_DEVELOPMENT;
+ filters = pk_bitfield_value (PK_FILTER_ENUM_NOT_DEVELOPMENT);
} else {
- filter = PK_FILTER_ENUM_NONE;
+ filters = pk_bitfield_value (PK_FILTER_ENUM_NONE);
}
- ret = pk_client_get_repo_list (client, filter, &error);
+ ret = pk_client_get_repo_list (client, filters, &error);
if (!ret) {
pk_warning ("failed to get repo list: %s", error->message);
g_error_free (error);
@@ -439,7 +439,7 @@
widget = glade_xml_get_widget (glade_xml, "button_close");
gtk_widget_grab_focus (widget);
- if (pk_enums_contain (roles, PK_ROLE_ENUM_GET_REPO_LIST)) {
+ if (pk_bitfield_contain (roles, PK_ROLE_ENUM_GET_REPO_LIST)) {
/* get the update list */
gpk_repo_repo_list_refresh ();
} else {
Modified: trunk/src/gpk-update-viewer.c
==============================================================================
--- trunk/src/gpk-update-viewer.c (original)
+++ trunk/src/gpk-update-viewer.c Tue Aug 19 16:58:58 2008
@@ -849,6 +849,29 @@
/* translators: this is the update type, e.g. security */
gpk_update_viewer_add_description_item (_("Type"), info_text, NULL);
+ /* state */
+ if (obj->state != PK_UPDATE_STATE_ENUM_UNKNOWN) {
+ info_text = gpk_update_state_enum_to_localised_text (obj->state);
+ /* translators: this is a notice a restart might be required */
+ gpk_update_viewer_add_description_item (_("State"), info_text, NULL);
+ }
+
+ /* issued */
+ if (obj->issued != NULL) {
+ line = pk_iso8601_from_date (obj->issued);
+ /* translators: this is a notice a restart might be required */
+ gpk_update_viewer_add_description_item (_("Issued"), line, NULL);
+ g_free (line);
+ }
+
+ /* updated */
+ if (obj->updated != NULL) {
+ line = pk_iso8601_from_date (obj->updated);
+ /* translators: this is a notice a restart might be required */
+ gpk_update_viewer_add_description_item (_("Updated"), line, NULL);
+ g_free (line);
+ }
+
package_pretty = gpk_package_id_name_version (obj->id);
/* translators: this is the package version */
gpk_update_viewer_add_description_item (_("New version"), package_pretty, NULL);
@@ -881,6 +904,12 @@
g_free (line);
}
+ /* changelog */
+ if (!pk_strzero (obj->changelog)) {
+ /* translators: this is a list of CVE (security) URLs */
+ gpk_update_viewer_add_description_item (_("Changes"), obj->changelog, NULL);
+ }
+
/* add all the links */
if (!pk_strzero (obj->vendor_url)) {
/* translators: this is a list of vendor URLs */
@@ -1732,7 +1761,7 @@
GtkWidget *main_window;
GtkWidget *widget;
GtkTreeSelection *selection;
- PkRoleEnum roles;
+ PkBitfield roles;
gboolean ret;
GError *error = NULL;
LibUnique *libunique;
Modified: trunk/src/gpk-watch.c
==============================================================================
--- trunk/src/gpk-watch.c (original)
+++ trunk/src/gpk-watch.c Tue Aug 19 16:58:58 2008
@@ -153,14 +153,14 @@
}
/**
- * gpk_watch_task_list_to_status_enums:
+ * gpk_watch_task_list_to_status_bitfield:
**/
-static PkStatusEnum
-gpk_watch_task_list_to_status_enums (GpkWatch *watch)
+static PkBitfield
+gpk_watch_task_list_to_status_bitfield (GpkWatch *watch)
{
guint i;
guint length;
- PkStatusEnum status = 0;
+ PkBitfield status = 0;
PkTaskListItem *item;
g_return_val_if_fail (GPK_IS_WATCH (watch), PK_STATUS_ENUM_UNKNOWN);
@@ -179,7 +179,7 @@
break;
}
pk_debug ("%s %s", item->tid, pk_status_enum_to_text (item->status));
- pk_enums_add (status, item->status);
+ pk_bitfield_add (status, item->status);
}
out:
return status;
@@ -192,13 +192,13 @@
gpk_watch_refresh_icon (GpkWatch *watch)
{
const gchar *icon;
- PkStatusEnum status;
+ PkBitfield status;
gint value;
g_return_val_if_fail (GPK_IS_WATCH (watch), FALSE);
pk_debug ("rescan");
- status = gpk_watch_task_list_to_status_enums (watch);
+ status = gpk_watch_task_list_to_status_bitfield (watch);
/* nothing in the list */
if (status == 0) {
@@ -208,7 +208,7 @@
}
/* get the most important icon */
- value = pk_enums_contain_priority (status,
+ value = pk_bitfield_contain_priority (status,
PK_STATUS_ENUM_REFRESH_CACHE,
PK_STATUS_ENUM_CANCEL,
PK_STATUS_ENUM_INSTALL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]