gnome-packagekit r139 - in trunk: . data src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-packagekit r139 - in trunk: . data src
- Date: Sat, 29 Mar 2008 12:29:57 +0000 (GMT)
Author: rhughes
Date: Sat Mar 29 12:29:57 2008
New Revision: 139
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=139&view=rev
Log:
from git
Modified:
trunk/NEWS
trunk/configure.ac
trunk/data/pk-backend-status.glade
trunk/data/pk-transaction-viewer.desktop.in
trunk/data/pk-update-viewer.glade
trunk/src/pk-application.c
trunk/src/pk-backend-status.c
trunk/src/pk-notify.c
trunk/src/pk-progress.c
trunk/src/pk-repo.c
trunk/src/pk-statusbar.c
trunk/src/pk-transaction-viewer.c
trunk/src/pk-update-viewer.c
trunk/src/pk-watch.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Mar 29 12:29:57 2008
@@ -1,3 +1,56 @@
+Version 0.1.10
+~~~~~~~~~~~~~~
+Released: 2008-03-28
+
+* Translations
+ - Updated Polish translation (Artur Flinta)
+ - Updated British English translation (Philip Withnall)
+ - Updated Spanish translation (Daniel Mustieles)
+ - Updated Catalan translation (Gil Forcada)
+ - Updated polish translation (Wadim Dziedzic)
+ - Updated French translation (Robert-Andrà Mauchin and StÃphane Raimbault)
+ - Added Greek translation (Nikos Charonitakis)
+ - Added Finnish translation (Ville-Pekka Vainio)
+
+* New features:
+ - Make the restart computer buttons actually work (Richard Hughes, Matthias Clasen)
+ - Make the package lists sorted in a all applications (Richard Hughes)
+ - Show a status icon when we need to reboot (Richard Hughes)
+ - Convert applications to use PolKitGnomeAction for privileged operations (Matthias Clasen)
+ - Rework the update viewer UI to be a bit friendlier (Matthias Clasen)
+ - Add the time we last updated and since last refresh in pk-update-viewer (Richard Hughes)
+ - Add a boat load of unit tests and fix up all the issues (Richard Hughes)
+ - Add a message if no results were found in pk-application (Richard Hughes)
+ - Add the filters in a menubar for pk-application (Richard Hughes)
+ - Move 'Refresh' button and add a 'View History' button (Matthias Clasen)
+ - Do the GetUpdates in pk-update-viewer when the update list changes (Richard Hughes)
+ - Rewrite pk-install-file to be a more streamlined UI (Matthias Clasen)
+ - Make the refresh cache button actually work in pk-application (Richard Hughes)
+ - Show the status in a statusbar in pk-repo (Richard Hughes)
+ - Redo the search in pk-application if we change a filter setting (Richard Hughes)
+ - Use two lines to show the package summary in the progress dialog (Matthias Clasen)
+ - Add another mimetype, as apache is sending us a different mimetype for skype (Richard Hughes)
+
+* Bugfixes:
+ - Show the same number of updates in the tooltip as the viewer (Richard Hughes)
+ - Make the checkboxes work in pk-update-viewer (Richard Hughes)
+ - Show the skipped packages in the PkNotify UI when we have finished (Richard Hughes)
+ - Fix packing so long author list in pk-backend-status (Scott Reeves)
+ - Don't stretch the pk-update-viewer information pane (Debarshi Ray)
+ - Apply some fixes suggested by sparse (Richard Hughes)
+ - Hide helpless help buttons in applications (Matthias Clasen)
+ - Don't use a non-standard Tango-only icons (Matthias Clasen)
+ - Add progress indication to actions in pk-update-vewer (Matthias Clasen)
+ - Make 'only update security packages' actually do what it should (Richard Hughes)
+ - Give a meaningful errors when we are missing privileges to install local packages (Matthias Clasen)
+ - Rework the pk-update-viewer sequence for installing selected updates (Matthias Clasen)
+ - Make 'don't warn again' buttons in bubbles effective (Matthias Clasen)
+ - Allow the pk-application description to be resized to fix rh#439329 (Richard Hughes)
+ - Don't show Software Transaction Viewer in the menu (Richard Hughes)
+ - Refresh the repo list in pk-repo when we have RepolistChanged (Richard Hughes)
+ - Make the package label ellipsize to avoid continuous window resizing (Matthias Clasen)
+ - Make the cancel button insensitive if it's not going to work in pk-application (Richard Hughes)
+
Version 0.1.9
~~~~~~~~~~~~~
Released: 2008-03-04
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat Mar 29 12:29:57 2008
@@ -1,6 +1,6 @@
AC_PREREQ(2.52)
-AC_INIT(gnome-packagekit, 0.1.10)
+AC_INIT(gnome-packagekit, 0.1.11)
AC_CONFIG_SRCDIR(src)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
@@ -41,7 +41,7 @@
dnl ---------------------------------------------------------------------------
dnl - Library dependencies
dnl ---------------------------------------------------------------------------
-PACKAGEKIT_REQUIRED=0.1.10
+PACKAGEKIT_REQUIRED=0.1.11
GLIB_REQUIRED=2.14.0
GTK_REQUIRED=2.12.0
DBUS_REQUIRED=1.1.2
Modified: trunk/data/pk-backend-status.glade
==============================================================================
--- trunk/data/pk-backend-status.glade (original)
+++ trunk/data/pk-backend-status.glade Sat Mar 29 12:29:57 2008
@@ -764,10 +764,32 @@
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">2</property>
- <property name="n_columns">6</property>
+ <property name="n_columns">8</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">7</property>
+ <property name="right_attach">8</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">6</property>
+ <property name="right_attach">7</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkImage" id="image_supported">
<property name="visible">True</property>
<property name="icon_name">gtk-dialog-error</property>
@@ -921,6 +943,30 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <widget class="GtkImage" id="image_newest">
+ <property name="visible">True</property>
+ <property name="icon_name">gtk-dialog-error</property>
+ </widget>
+ <packing>
+ <property name="left_attach">7</property>
+ <property name="right_attach">8</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Newest:</property>
+ </widget>
+ <packing>
+ <property name="left_attach">6</property>
+ <property name="right_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
Modified: trunk/data/pk-transaction-viewer.desktop.in
==============================================================================
--- trunk/data/pk-transaction-viewer.desktop.in (original)
+++ trunk/data/pk-transaction-viewer.desktop.in Sat Mar 29 12:29:57 2008
@@ -8,6 +8,6 @@
Terminal=false
Type=Application
Categories=GNOME;GTK;System;X-Red-Hat-Base;
-NotShowIn=GNOME;KDE;XFCE;
+NoDisplay=true
StartupNotify=true
Modified: trunk/data/pk-update-viewer.glade
==============================================================================
--- trunk/data/pk-update-viewer.glade (original)
+++ trunk/data/pk-update-viewer.glade Sat Mar 29 12:29:57 2008
@@ -580,9 +580,9 @@
<widget class="GtkHBox" id="hbox17">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label16">
+ <widget class="GtkLabel" id="label_update_title">
<property name="visible">True</property>
- <property name="label" translatable="yes"><b>System Update Completed</b></property>
+ <property name="label"><b>System Update Completed</b></property>
<property name="use_markup">True</property>
</widget>
<packing>
@@ -599,9 +599,9 @@
<widget class="GtkHBox" id="hbox18">
<property name="visible">True</property>
<child>
- <widget class="GtkLabel" id="label20">
+ <widget class="GtkLabel" id="label_update_notice">
<property name="visible">True</property>
- <property name="label" translatable="yes">All selected updates have been successfully installed</property>
+ <property name="label">All selected updates have been successfully installed</property>
</widget>
<packing>
<property name="expand">False</property>
Modified: trunk/src/pk-application.c
==============================================================================
--- trunk/src/pk-application.c (original)
+++ trunk/src/pk-application.c Sat Mar 29 12:29:57 2008
@@ -182,17 +182,28 @@
PkApplication *application)
{
gboolean ret;
+ GError *error = NULL;
g_return_if_fail (application != NULL);
g_return_if_fail (PK_IS_APPLICATION (application));
pk_debug ("install %s", application->priv->package);
- pk_client_reset (application->priv->client_action, NULL);
+
+ ret = pk_client_reset (application->priv->client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* do the install */
ret = pk_client_install_package (application->priv->client_action,
application->priv->package, NULL);
- /* ick, we failed so pretend we didn't do the action */
- if (ret == FALSE) {
- pk_application_error_message (application, _("The package could not be installed"), NULL);
+ if (!ret) {
+ pk_warning ("failed to install package: %s", error->message);
+ /* ick, we failed so pretend we didn't do the action */
+ pk_application_error_message (application, _("The package could not be installed"), error->message);
+ g_error_free (error);
}
}
@@ -215,18 +226,29 @@
pk_application_remove_only (PkApplication *application, gboolean force)
{
gboolean ret;
+ GError *error = NULL;
g_return_val_if_fail (application != NULL, FALSE);
g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
pk_debug ("remove %s", application->priv->package);
- pk_client_reset (application->priv->client_action, NULL);
+
+ ret = pk_client_reset (application->priv->client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
+ /* do the remove */
ret = pk_client_remove_package (application->priv->client_action,
- application->priv->package, force, FALSE, NULL);
- /* ick, we failed so pretend we didn't do the action */
- if (ret == FALSE) {
+ application->priv->package, force, FALSE, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ /* ick, we failed so pretend we didn't do the action */
pk_application_error_message (application,
- _("The package could not be removed"), NULL);
+ _("The package could not be removed"), error->message);
+ g_error_free (error);
}
return ret;
}
@@ -317,7 +339,9 @@
pk_application_remove_cb (PolKitGnomeAction *action,
PkApplication *application)
{
+ gboolean ret;
PkClient *client;
+ GError *error = NULL;
g_return_if_fail (application != NULL);
g_return_if_fail (PK_IS_APPLICATION (application));
@@ -334,8 +358,14 @@
pk_client_set_use_buffer (client, TRUE, NULL);
g_signal_connect (client, "finished",
G_CALLBACK (pk_application_requires_finished_cb), application);
+
+ /* do the requires */
pk_debug ("getting requires for %s", application->priv->package);
- pk_client_get_requires (client, "installed", application->priv->package, TRUE, NULL);
+ ret = pk_client_get_requires (client, "installed", application->priv->package, TRUE, &error);
+ if (!ret) {
+ pk_warning ("failed to get requires: %s", error->message);
+ g_error_free (error);
+ }
}
/**
@@ -561,7 +591,7 @@
gtk_list_store_clear (application->priv->packages_store);
ret = pk_client_requeue (application->priv->client_search, &error);
- if (ret == FALSE) {
+ if (!ret) {
pk_warning ("failed to requeue the search: %s", error->message);
g_error_free (error);
return FALSE;
@@ -684,9 +714,6 @@
GError *error = NULL;
gboolean ret;
- /* do we need to cancel a running search? */
- pk_client_cancel (application->priv->client_search, NULL);
-
widget = glade_xml_get_widget (application->priv->glade_xml, "entry_text");
package = gtk_entry_get_text (GTK_ENTRY (widget));
@@ -697,7 +724,7 @@
}
ret = pk_strvalidate (package);
- if (ret == FALSE) {
+ if (!ret) {
pk_debug ("invalid input text, will fail");
/* TODO - make the dialog turn red... */
pk_application_error_message (application, _("Invalid search text"),
@@ -710,24 +737,27 @@
filter_all = pk_enum_list_to_string (application->priv->current_filter);
pk_debug ("filter = %s", filter_all);
+ /* reset */
+ ret = pk_client_reset (application->priv->client_search, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+
+ /* do the search */
if (application->priv->search_type == PK_SEARCH_NAME) {
- pk_client_reset (application->priv->client_search, NULL);
- pk_client_set_name_filter (application->priv->client_search, TRUE, NULL);
ret = pk_client_search_name (application->priv->client_search, filter_all, package, &error);
} else if (application->priv->search_type == PK_SEARCH_DETAILS) {
- pk_client_reset (application->priv->client_search, NULL);
- pk_client_set_name_filter (application->priv->client_search, TRUE, NULL);
ret = pk_client_search_details (application->priv->client_search, filter_all, package, &error);
} else if (application->priv->search_type == PK_SEARCH_FILE) {
- pk_client_reset (application->priv->client_search, NULL);
- pk_client_set_name_filter (application->priv->client_search, TRUE, NULL);
ret = pk_client_search_file (application->priv->client_search, filter_all, package, &error);
} else {
pk_warning ("invalid search type");
return FALSE;
}
- if (ret == FALSE) {
+ if (!ret) {
pk_application_error_message (application,
_("The search could not be completed"), error->message);
g_error_free (error);
@@ -773,13 +803,31 @@
static gboolean
pk_application_quit (PkApplication *application)
{
+ gboolean ret;
+ GError *error = NULL;
+
g_return_val_if_fail (application != NULL, FALSE);
g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
/* we might have visual stuff running, close them down */
- pk_client_cancel (application->priv->client_search, NULL);
- pk_client_cancel (application->priv->client_description, NULL);
- pk_client_cancel (application->priv->client_files, NULL);
+ ret = pk_client_cancel (application->priv->client_search, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ ret = pk_client_cancel (application->priv->client_description, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ ret = pk_client_cancel (application->priv->client_files, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
pk_debug ("emitting action-close");
g_signal_emit (application, signals [ACTION_CLOSE], 0);
@@ -918,8 +966,13 @@
pk_debug ("filter = %s", filter);
/* cancel this, we don't care about old results that are pending */
- pk_client_cancel (application->priv->client_search, NULL);
- pk_client_reset (application->priv->client_search, NULL);
+ ret = pk_client_reset (application->priv->client_search, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
ret = pk_client_search_group (application->priv->client_search, filter, id, &error);
g_free (filter);
/* ick, we failed so pretend we didn't do the action */
@@ -949,6 +1002,7 @@
GtkWidget *widget;
GtkWidget *child;
gint potential;
+ GError *error = NULL;
g_return_val_if_fail (application != NULL, FALSE);
g_return_val_if_fail (PK_IS_APPLICATION (application), FALSE);
@@ -979,15 +1033,21 @@
gtk_widget_hide (widget);
/* cancel any previous request */
- ret = pk_client_cancel (application->priv->client_description, NULL);
- if (ret == FALSE) {
- pk_debug ("failed to cancel, and adding to queue");
+ ret = pk_client_reset (application->priv->client_description, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel, and adding to queue: %s", error->message);
+ g_error_free (error);
+ return FALSE;
}
+
/* get the description */
- pk_client_reset (application->priv->client_description, NULL);
- pk_client_get_description (application->priv->client_description,
- application->priv->package, NULL);
- return TRUE;
+ ret = pk_client_get_description (application->priv->client_description,
+ application->priv->package, &error);
+ if (!ret) {
+ pk_warning ("failed to get description: %s", error->message);
+ g_error_free (error);
+ }
+ return ret;
}
/* are we description? */
@@ -1000,16 +1060,21 @@
pk_application_set_text_buffer (widget, NULL);
/* cancel any previous request */
- ret = pk_client_cancel (application->priv->client_files, NULL);
- if (ret == FALSE) {
- pk_debug ("failed to cancel, and adding to queue");
+ ret = pk_client_reset (application->priv->client_files, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel, and adding to queue: %s", error->message);
+ g_error_free (error);
+ return FALSE;
}
- /* get the filelist */
- pk_client_reset (application->priv->client_files, NULL);
- pk_client_get_files (application->priv->client_files,
- application->priv->package, NULL);
- return TRUE;
+ /* get the filelist */
+ ret = pk_client_get_files (application->priv->client_files,
+ application->priv->package, &error);
+ if (!ret) {
+ pk_warning ("failed to det depends: %s", error->message);
+ g_error_free (error);
+ }
+ return ret;
}
/* are we depends? */
@@ -1022,17 +1087,21 @@
pk_application_set_text_buffer (widget, NULL);
/* cancel any previous request */
- ret = pk_client_cancel (application->priv->client_files, NULL);
- if (ret == FALSE) {
- pk_debug ("failed to cancel, and adding to queue");
+ ret = pk_client_reset (application->priv->client_files, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel, and adding to queue: %s", error->message);
+ g_error_free (error);
+ return FALSE;
}
- /* get the filelist */
- pk_client_reset (application->priv->client_files, NULL);
- pk_client_set_use_buffer (application->priv->client_files, TRUE, NULL);
- pk_client_get_depends (application->priv->client_files, "none",
- application->priv->package, FALSE, NULL);
+ /* get the depends */
+ ret = pk_client_get_depends (application->priv->client_files, "none",
+ application->priv->package, FALSE, &error);
- return TRUE;
+ if (!ret) {
+ pk_warning ("failed to det depends: %s", error->message);
+ g_error_free (error);
+ }
+ return ret;
}
/* are we requires? */
@@ -1045,17 +1114,21 @@
pk_application_set_text_buffer (widget, NULL);
/* cancel any previous request */
- ret = pk_client_cancel (application->priv->client_files, NULL);
- if (ret == FALSE) {
- pk_debug ("failed to cancel, and adding to queue");
+ ret = pk_client_reset (application->priv->client_files, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel, and adding to queue: %s", error->message);
+ g_error_free (error);
+ return FALSE;
}
- /* get the filelist */
- pk_client_reset (application->priv->client_files, NULL);
- pk_client_set_use_buffer (application->priv->client_files, TRUE, NULL);
- pk_client_get_requires (application->priv->client_files, "none",
- application->priv->package, TRUE, NULL);
+ /* get the requires */
+ ret = pk_client_get_requires (application->priv->client_files, "none",
+ application->priv->package, TRUE, &error);
- return TRUE;
+ if (!ret) {
+ pk_warning ("failed to det depends: %s", error->message);
+ g_error_free (error);
+ }
+ return ret;
}
pk_warning ("unknown tab %i!", page);
return FALSE;
@@ -1384,7 +1457,7 @@
ret = gdk_spawn_command_line_on_screen (gscreen, cmdline, &error);
g_free (cmdline);
- if (ret == FALSE) {
+ if (!ret) {
error_dialog = gtk_message_dialog_new (GTK_WINDOW (about),
GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
@@ -1484,7 +1557,7 @@
/* can we cancel what we are doing? */
ret = pk_client_reset (application->priv->client_action, &error);
- if (ret == FALSE) {
+ if (!ret) {
pk_application_error_message (application, _("Package list could not be refreshed"), error->message);
g_error_free (error);
return;
@@ -1492,7 +1565,7 @@
/* try to refresh the cache */
ret = pk_client_refresh_cache (application->priv->client_action, FALSE, &error);
- if (ret == FALSE) {
+ if (!ret) {
pk_application_error_message (application, _("The package could not be installed"), error->message);
g_error_free (error);
return;
@@ -1512,7 +1585,7 @@
g_return_if_fail (PK_IS_APPLICATION (application));
ret = g_spawn_command_line_async ("pk-repo", NULL);
- if (ret == FALSE) {
+ if (!ret) {
pk_warning ("spawn of pk-repo failed");
}
}
@@ -1702,9 +1775,9 @@
/* single checkbox */
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (widget))) {
-// pk_enum_list_append (application->priv->current_filter, PK_FILTER_ENUM_NEWEST);
+ pk_enum_list_append (application->priv->current_filter, PK_FILTER_ENUM_NEWEST);
} else {
-// pk_enum_list_remove (application->priv->current_filter, PK_FILTER_ENUM_NEWEST);
+ pk_enum_list_remove (application->priv->current_filter, PK_FILTER_ENUM_NEWEST);
}
/* refresh the search results */
@@ -1866,7 +1939,7 @@
/* Hide window first so that the dialogue resizes itself without redrawing */
gtk_widget_hide (main_window);
- gtk_window_set_icon_name (GTK_WINDOW (main_window), "PK_STOCK_APP_ICON");
+ gtk_window_set_icon_name (GTK_WINDOW (main_window), PK_STOCK_APP_ICON);
/* Get the main window quit */
g_signal_connect (main_window, "delete_event",
Modified: trunk/src/pk-backend-status.c
==============================================================================
--- trunk/src/pk-backend-status.c (original)
+++ trunk/src/pk-backend-status.c Sat Mar 29 12:29:57 2008
@@ -259,6 +259,10 @@
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_enum_list_contains (filter_list, 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);
+ }
g_object_unref (glade_xml);
g_object_unref (client);
Modified: trunk/src/pk-notify.c
==============================================================================
--- trunk/src/pk-notify.c (original)
+++ trunk/src/pk-notify.c Sat Mar 29 12:29:57 2008
@@ -387,10 +387,7 @@
}
pk_smart_icon_notify_button (notify->priv->sicon, PK_NOTIFY_BUTTON_DO_NOT_SHOW_AGAIN, PK_CONF_NOTIFY_RESTART);
pk_smart_icon_notify_show (notify->priv->sicon);
-
- pk_debug ("resetting client %p", client);
g_string_free (message_text, TRUE);
- pk_client_reset (client, NULL);
}
/**
@@ -857,6 +854,8 @@
static gboolean
pk_notify_query_updates (PkNotify *notify)
{
+ gboolean ret;
+ GError *error = NULL;
PkClient *client;
g_return_val_if_fail (notify != NULL, FALSE);
@@ -873,8 +872,14 @@
g_signal_connect (client, "error-code",
G_CALLBACK (pk_notify_error_code_cb), notify);
pk_client_set_use_buffer (client, TRUE, NULL);
- pk_client_get_updates (client, "basename", NULL);
- return TRUE;
+
+ /* get updates */
+ ret = pk_client_get_updates (client, "basename", &error);
+ if (!ret) {
+ pk_warning ("failed to get updates: %s", error->message);
+ g_error_free (error);
+ }
+ return ret;
}
/**
Modified: trunk/src/pk-progress.c
==============================================================================
--- trunk/src/pk-progress.c (original)
+++ trunk/src/pk-progress.c Sat Mar 29 12:29:57 2008
@@ -145,8 +145,15 @@
pk_progress_cancel_cb (GtkWidget *widget,
PkProgress *progress)
{
+ gboolean ret;
+ GError *error = NULL;
+
pk_debug ("emitting cancel");
- pk_client_cancel (progress->priv->client, NULL);
+ ret = pk_client_cancel (progress->priv->client, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ }
}
/**
Modified: trunk/src/pk-repo.c
==============================================================================
--- trunk/src/pk-repo.c (original)
+++ trunk/src/pk-repo.c Sat Mar 29 12:29:57 2008
@@ -104,7 +104,12 @@
/* do this to the repo */
pk_debug ("setting %s to %i", repo_id, installed);
- pk_client_reset (client, NULL);
+ ret = pk_client_reset (client, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
ret = pk_client_repo_enable (client, repo_id, installed, &error);
if (!ret) {
pk_warning ("could not set repo enabled state: %s", error->message);
@@ -238,10 +243,23 @@
static void
pk_repo_repo_list_changed_cb (PkClient *client, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
+
pk_debug ("refreshing list");
gtk_list_store_clear (list_store);
- pk_client_reset (client, NULL);
- pk_client_get_repo_list (client, NULL);
+ ret = pk_client_reset (client, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ ret = pk_client_get_repo_list (client, &error);
+ if (!ret) {
+ pk_warning ("failed to get repo list: %s", error->message);
+ g_error_free (error);
+ }
}
/**
@@ -251,12 +269,14 @@
main (int argc, char *argv[])
{
GMainLoop *loop;
+ gboolean ret;
gboolean verbose = FALSE;
gboolean program_version = FALSE;
GOptionContext *context;
GtkWidget *main_window;
GtkWidget *widget;
GtkTreeSelection *selection;
+ GError *error = NULL;
const GOptionEntry options[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
@@ -352,7 +372,11 @@
if (pk_enum_list_contains (role_list, PK_ROLE_ENUM_GET_REPO_LIST)) {
/* get the update list */
- pk_client_get_repo_list (client, NULL);
+ ret = pk_client_get_repo_list (client, &error);
+ if (!ret) {
+ pk_warning ("failed to get repo list: %s", error->message);
+ g_error_free (error);
+ }
} else {
pk_repo_detail_cb (client, "default",
_("Getting repository list not supported by backend"), FALSE, NULL);
Modified: trunk/src/pk-statusbar.c
==============================================================================
--- trunk/src/pk-statusbar.c (original)
+++ trunk/src/pk-statusbar.c Sat Mar 29 12:29:57 2008
@@ -201,7 +201,7 @@
/* don't hide, else the status bar will collapse */
if (remaining == 0) {
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (sbar->priv->statusbar->label), "");
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (sbar->priv->progressbar), "");
return TRUE;
}
@@ -211,7 +211,7 @@
/* print remaining time */
time = pk_time_to_localised_string (remaining);
text = g_strdup_printf (_("Remaining time: %s"), time);
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (sbar->priv->statusbar->label), text);
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (sbar->priv->progressbar), text);
g_free (time);
g_free (text);
Modified: trunk/src/pk-transaction-viewer.c
==============================================================================
--- trunk/src/pk-transaction-viewer.c (original)
+++ trunk/src/pk-transaction-viewer.c Sat Mar 29 12:29:57 2008
@@ -82,8 +82,17 @@
static void
pk_button_rollback_cb (PolKitGnomeAction *action, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
GMainLoop *loop = (GMainLoop *) data;
- pk_client_rollback (client, transaction_id, NULL);
+
+ /* rollback */
+ ret = pk_client_rollback (client, transaction_id, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ }
+
g_main_loop_quit (loop);
}
Modified: trunk/src/pk-update-viewer.c
==============================================================================
--- trunk/src/pk-update-viewer.c (original)
+++ trunk/src/pk-update-viewer.c Sat Mar 29 12:29:57 2008
@@ -50,7 +50,8 @@
static GtkListStore *list_store_preview = NULL;
static GtkListStore *list_store_details = NULL;
static GtkListStore *list_store_description = NULL;
-static PkClient *client = NULL;
+static PkClient *client_action = NULL;
+static PkClient *client_query = NULL;
static PkTaskList *tlist = NULL;
static gchar *cached_package_id = NULL;
@@ -123,6 +124,7 @@
{
GList *list, *l;
GtkWidget *widget;
+ GtkRequisition req;
guint i;
widget = glade_xml_get_widget (glade_xml, "hbox_hidden");
@@ -139,6 +141,13 @@
widget = glade_xml_get_widget (glade_xml, "window_updates");
if (page == PAGE_DETAILS || page == PAGE_PROGRESS) {
gtk_window_set_resizable (GTK_WINDOW (widget), TRUE);
+ if (page == PAGE_PROGRESS) {
+ /* use the natural size unless it's really big */
+ gtk_widget_size_request (widget, &req);
+ gtk_window_resize (GTK_WINDOW (widget),
+ (req.width < 500) ? req.width : 500,
+ (req.height < 400) ? req.height : 400);
+ }
} else {
gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
}
@@ -147,6 +156,8 @@
static void
pk_updates_update_system_cb (PolKitGnomeAction *action, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
GtkWidget *widget;
pk_debug ("Doing the system update");
@@ -157,8 +168,20 @@
/* set correct view */
pk_updates_set_page (PAGE_PROGRESS);
- pk_client_reset (client, NULL);
- pk_client_update_system (client, NULL);
+ /* reset */
+ ret = pk_client_reset (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* update system */
+ ret = pk_client_update_system (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to update system: %s", error->message);
+ g_error_free (error);
+ }
}
/**
@@ -220,17 +243,24 @@
widget = glade_xml_get_widget (glade_xml, "button_overview2");
if (selected_all) {
gtk_widget_hide (widget);
- }
- else {
+ } else {
gtk_widget_show (widget);
}
/* set correct view */
pk_updates_set_page (PAGE_PROGRESS);
-
package_ids = pk_package_ids_from_array (array);
- pk_client_reset (client, NULL);
- ret = pk_client_update_packages_strv (client, package_ids, &error);
+
+ /* reset */
+ ret = pk_client_reset (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+
+ /* update a list */
+ ret = pk_client_update_packages_strv (client_action, package_ids, &error);
if (!ret) {
pk_error_modal_dialog ("Individual updates failed", error->message);
g_error_free (error);
@@ -455,13 +485,17 @@
pk_updates_refresh_cb (PolKitGnomeAction *action, gpointer data)
{
gboolean ret;
- GError *error;
+ GError *error = NULL;
GtkWidget *widget;
/* we can't click this if we havn't finished */
- pk_client_reset (client, NULL);
- error = NULL;
- ret = pk_client_refresh_cache (client, TRUE, &error);
+ ret = pk_client_reset (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+ ret = pk_client_refresh_cache (client_action, TRUE, &error);
if (ret == FALSE) {
pk_error_modal_dialog (_("Failed to refresh"), error->message);
g_error_free (error);
@@ -501,8 +535,21 @@
static void
pk_button_cancel_cb (GtkWidget *widget, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
+
/* we might have a transaction running */
- pk_client_cancel (client, NULL);
+ ret = pk_client_cancel (client_query, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ error = NULL;
+ }
+ ret = pk_client_cancel (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ }
}
/**
@@ -511,10 +558,17 @@
static void
pk_button_close_and_cancel_cb (GtkWidget *widget, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
+
GMainLoop *loop = (GMainLoop *) data;
/* we might have a transaction running */
- pk_client_cancel (client, NULL);
+ ret = pk_client_cancel (client_action, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
+ }
g_main_loop_quit (loop);
}
@@ -934,6 +988,8 @@
GtkTreeIter iter;
gchar *package_id;
GtkWidget *widget;
+ GError *error = NULL;
+ gboolean ret;
widget = glade_xml_get_widget (glade_xml, "scrolledwindow_description");
@@ -959,9 +1015,21 @@
gtk_widget_hide (widget);
pk_debug ("selected row is: %s", cached_package_id);
- /* get the decription */
- pk_client_reset (client, NULL);
- pk_client_get_update_detail (client, cached_package_id, NULL);
+
+ /* reset */
+ ret = pk_client_reset (client_query, &error);
+ if (!ret) {
+ pk_warning ("failed to reset: %s", error->message);
+ g_error_free (error);
+ }
+
+ /* get the description */
+ error = NULL;
+ ret = pk_client_get_update_detail (client_query, cached_package_id, &error);
+ if (!ret) {
+ pk_warning ("failed to get update detail: %s", error->message);
+ g_error_free (error);
+ }
} else {
pk_debug ("no row selected");
}
@@ -1075,6 +1143,61 @@
static void populate_preview (void);
/**
+ *pk_updates_check_blocked_packages:
+ **/
+static void
+pk_updates_check_blocked_packages (PkClient *client)
+{
+ guint i;
+ guint length;
+ PkPackageItem *item;
+ GString *string;
+ gboolean exists = FALSE;
+ gchar *text;
+ GtkWidget *widget;
+
+ string = g_string_new ("");
+
+ /* find any that are blocked */
+ length = pk_client_package_buffer_get_size (client);
+ for (i=0;i<length;i++) {
+ item = pk_client_package_buffer_get_item (client, i);
+ if (item->info == PK_INFO_ENUM_BLOCKED) {
+ text = pk_package_id_pretty_oneline (item->package_id, item->summary);
+ g_string_append_printf (string, "%s\n", text);
+ g_free (text);
+ exists = TRUE;
+ }
+ }
+
+ /* trim off extra newlines */
+ if (string->len != 0) {
+ g_string_set_size (string, string->len-1);
+ }
+
+ /* convert to a normal gchar */
+ text = g_string_free (string, FALSE);
+
+ /* set the widget text */
+ if (exists) {
+ widget = glade_xml_get_widget (glade_xml, "label_update_title");
+ gtk_label_set_markup (GTK_LABEL (widget), _("<b>Some updates were not updated</b>"));
+
+ widget = glade_xml_get_widget (glade_xml, "label_update_notice");
+ gtk_label_set_markup (GTK_LABEL (widget), text);
+ gtk_widget_show (widget);
+ } else {
+ widget = glade_xml_get_widget (glade_xml, "label_update_title");
+ gtk_label_set_markup (GTK_LABEL (widget), _("<b>System Update Completed</b>"));
+
+ widget = glade_xml_get_widget (glade_xml, "label_update_notice");
+ gtk_widget_hide (widget);
+ }
+
+ g_free (text);
+}
+
+/**
* pk_updates_finished_cb:
**/
static void
@@ -1090,7 +1213,8 @@
if (role == PK_ROLE_ENUM_REFRESH_CACHE) {
/* update last time in the UI */
pk_update_update_last_refreshed_time (client);
- } else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM || role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
+ } else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
+ role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
pk_update_update_last_updated_time (client);
}
@@ -1111,6 +1235,12 @@
polkit_gnome_action_set_sensitive (refresh_action, TRUE);
polkit_gnome_action_set_sensitive (update_system_action, TRUE);
+ /* check if we need to display infomation about blocked packages */
+ if (role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
+ role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
+ pk_updates_check_blocked_packages (client);
+ }
+
/* hide the cancel */
if (role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
widget = glade_xml_get_widget (glade_xml, "button_cancel");
@@ -1149,16 +1279,28 @@
static void
pk_button_more_installs_cb (GtkWidget *button, gpointer data)
{
+ gboolean ret;
+ GError *error = NULL;
+
/* clear existing list */
gtk_list_store_clear (list_store_details);
/* set correct view */
- pk_updates_set_page (PAGE_PREVIEW);
+ pk_updates_set_page (PAGE_DETAILS);
/* get the new update list */
- pk_client_reset (client, NULL);
- pk_client_set_use_buffer (client, TRUE, NULL);
- pk_client_get_updates (client, "basename", NULL);
+ ret = pk_client_reset (client_query, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+ ret = pk_client_get_updates (client_query, "basename", &error);
+ if (!ret) {
+ pk_warning ("failed to get updates: %s", error->message);
+ g_error_free (error);
+ return;
+ }
populate_preview ();
}
@@ -1172,7 +1314,7 @@
/* clear existing lists */
gtk_list_store_clear (list_store_preview);
- length = pk_client_package_buffer_get_size (client);
+ length = pk_client_package_buffer_get_size (client_query);
if (length == 0) {
/* put a message in the listbox */
pk_updates_add_preview_item ("dialog-information", _("There are no updates available!"), TRUE);
@@ -1195,7 +1337,7 @@
gchar *text;
for (i=0;i<length;i++) {
- item = pk_client_package_buffer_get_item (client, i);
+ item = pk_client_package_buffer_get_item (client_query, i);
if (item->info == PK_INFO_ENUM_LOW) {
num_low++;
} else if (item->info == PK_INFO_ENUM_IMPORTANT) {
@@ -1344,9 +1486,13 @@
GError *error = NULL;
/* get the update list */
- pk_client_reset (client, NULL);
- pk_client_set_use_buffer (client, TRUE, NULL);
- ret = pk_client_get_updates (client, "basename", &error);
+ ret = pk_client_reset (client_query, &error);
+ if (!ret) {
+ pk_warning ("failed to reset client: %s", error->message);
+ g_error_free (error);
+ return;
+ }
+ ret = pk_client_get_updates (client_query, "basename", &error);
if (!ret) {
pk_warning ("failed to get new list: %s", error->message);
g_error_free (error);
@@ -1371,11 +1517,11 @@
GtkTreeSelection *selection;
PkConnection *pconnection;
PkEnumList *role_list;
- PkRoleEnum role;
gboolean ret;
GtkSizeGroup *size_group;
GtkWidget *button;
PolKitAction *pk_action;
+ GError *error = NULL;
const GOptionEntry options[] = {
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
@@ -1417,27 +1563,43 @@
loop = g_main_loop_new (NULL, FALSE);
- client = pk_client_new ();
- pk_client_set_use_buffer (client, TRUE, NULL);
- g_signal_connect (client, "package",
+ /* this is stuff we don't care about */
+ client_query = pk_client_new ();
+ pk_client_set_use_buffer (client_query, TRUE, NULL);
+ g_signal_connect (client_query, "package",
G_CALLBACK (pk_updates_package_cb), NULL);
- g_signal_connect (client, "finished",
+ g_signal_connect (client_query, "finished",
G_CALLBACK (pk_updates_finished_cb), NULL);
- g_signal_connect (client, "progress-changed",
+ g_signal_connect (client_query, "progress-changed",
G_CALLBACK (pk_updates_progress_changed_cb), NULL);
- g_signal_connect (client, "update-detail",
+ g_signal_connect (client_query, "update-detail",
G_CALLBACK (pk_updates_update_detail_cb), NULL);
- g_signal_connect (client, "status-changed",
+ g_signal_connect (client_query, "status-changed",
G_CALLBACK (pk_updates_status_changed_cb), NULL);
- g_signal_connect (client, "error-code",
+ g_signal_connect (client_query, "error-code",
G_CALLBACK (pk_updates_error_code_cb), NULL);
- g_signal_connect (client, "allow-cancel",
+ g_signal_connect (client_query, "allow-cancel",
G_CALLBACK (pk_updates_allow_cancel_cb), NULL);
- g_signal_connect (client, "updates-changed",
+
+ client_action = pk_client_new ();
+ pk_client_set_use_buffer (client_action, TRUE, NULL);
+ g_signal_connect (client_action, "package",
+ G_CALLBACK (pk_updates_package_cb), NULL);
+ g_signal_connect (client_action, "finished",
+ G_CALLBACK (pk_updates_finished_cb), NULL);
+ g_signal_connect (client_action, "progress-changed",
+ G_CALLBACK (pk_updates_progress_changed_cb), NULL);
+ g_signal_connect (client_action, "status-changed",
+ G_CALLBACK (pk_updates_status_changed_cb), NULL);
+ g_signal_connect (client_action, "error-code",
+ G_CALLBACK (pk_updates_error_code_cb), NULL);
+ g_signal_connect (client_action, "allow-cancel",
+ G_CALLBACK (pk_updates_allow_cancel_cb), NULL);
+ g_signal_connect (client_action, "updates-changed",
G_CALLBACK (pk_updates_changed_cb), NULL);
/* get actions */
- role_list = pk_client_get_actions (client);
+ role_list = pk_client_get_actions (client_query);
pconnection = pk_connection_new ();
g_signal_connect (pconnection, "connection-changed",
@@ -1650,8 +1812,8 @@
gtk_widget_set_sensitive (widget, FALSE);
/* set the last updated text */
- pk_update_update_last_refreshed_time (client);
- pk_update_update_last_updated_time (client);
+ pk_update_update_last_refreshed_time (client_query);
+ pk_update_update_last_updated_time (client_query);
/* set the labels blank until we get a package */
widget = glade_xml_get_widget (glade_xml, "progress_part_label");
@@ -1660,7 +1822,7 @@
gtk_label_set_label (GTK_LABEL (widget), "");
/* get the update list */
- ret = pk_client_get_updates (client, "basename", NULL);
+ ret = pk_client_get_updates (client_query, "basename", NULL);
if (ret) {
/* only show this if we succeeded */
pk_updates_preview_animation_start ();
@@ -1670,17 +1832,18 @@
g_main_loop_unref (loop);
/* we might have visual stuff running, close it down */
- pk_client_get_role (client, &role, NULL, NULL);
- if (role == PK_ROLE_ENUM_GET_UPDATES ||
- role == PK_ROLE_ENUM_GET_UPDATE_DETAIL) {
- pk_client_cancel (client, NULL);
+ ret = pk_client_cancel (client_query, &error);
+ if (!ret) {
+ pk_warning ("failed to cancel client: %s", error->message);
+ g_error_free (error);
}
g_object_unref (glade_xml);
g_object_unref (list_store_preview);
g_object_unref (list_store_description);
g_object_unref (list_store_details);
- g_object_unref (client);
+ g_object_unref (client_query);
+ g_object_unref (client_action);
g_object_unref (pconnection);
g_object_unref (role_list);
g_free (cached_package_id);
Modified: trunk/src/pk-watch.c
==============================================================================
--- trunk/src/pk-watch.c (original)
+++ trunk/src/pk-watch.c Sat Mar 29 12:29:57 2008
@@ -58,6 +58,7 @@
static void pk_watch_finalize (GObject *object);
#define PK_WATCH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_WATCH, PkWatchPrivate))
+#define PK_WATCH_MAXIMUM_TOOLTIP_LINES 10
struct PkWatchPrivate
{
@@ -126,6 +127,12 @@
g_string_append_printf (status, "%s: %s\n", localised_status, text);
g_free (text);
}
+ /* don't fill the screen with a giant tooltip */
+ if (i > PK_WATCH_MAXIMUM_TOOLTIP_LINES) {
+ g_string_append_printf (status, _("(%i more transactions)\n"),
+ i - PK_WATCH_MAXIMUM_TOOLTIP_LINES);
+ break;
+ }
}
if (status->len == 0) {
g_string_append (status, "Doing something...");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]