gnome-packagekit r291 - in trunk: data po src
- From: rhughes svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-packagekit r291 - in trunk: data po src
- Date: Thu, 18 Sep 2008 10:55:08 +0000 (UTC)
Author: rhughes
Date: Thu Sep 18 10:55:08 2008
New Revision: 291
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=291&view=rev
Log:
from git
Removed:
trunk/src/gpk-client-depends.c
trunk/src/gpk-client-depends.h
trunk/src/gpk-client-requires.c
trunk/src/gpk-client-requires.h
trunk/src/gpk-client-resolve.c
trunk/src/gpk-client-resolve.h
Modified:
trunk/data/gnome-packagekit.schemas.in
trunk/data/gpk-client.glade
trunk/po/POTFILES.in
trunk/src/Makefile.am
trunk/src/gpk-client-chooser.c
trunk/src/gpk-client-dialog.c
trunk/src/gpk-client-dialog.h
trunk/src/gpk-client.c
trunk/src/gpk-common.h
trunk/src/gpk-dbus.c
trunk/src/gpk-interface.h
trunk/src/gpk-self-test.c
trunk/src/gpk-update-viewer.c
trunk/src/gpk-watch.c
Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in (original)
+++ trunk/data/gnome-packagekit.schemas.in Thu Sep 18 10:55:08 2008
@@ -277,6 +277,54 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/gnome-packagekit/update_viewer/precache_details</key>
+ <applyto>/apps/gnome-packagekit/update_viewer/precache_details</applyto>
+ <owner>gnome-packagekit</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>If we should precache all update details in the update viewer</short>
+ <long>If we should precache all update details in the update viewer</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnome-packagekit/interface/enable_font_helper</key>
+ <applyto>/apps/gnome-packagekit/interface/enable_font_helper</applyto>
+ <owner>gnome-packagekit</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>If we should allow applications to invoke the font installer</short>
+ <long>If we should allow applications to invoke the font installer</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnome-packagekit/interface/enable_codec_helper</key>
+ <applyto>/apps/gnome-packagekit/interface/enable_codec_helper</applyto>
+ <owner>gnome-packagekit</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>If we should allow applications to invoke the codec installer</short>
+ <long>If we should allow applications to invoke the codec installer</long>
+ </locale>
+ </schema>
+
+ <schema>
+ <key>/schemas/apps/gnome-packagekit/interface/enable_mime_type_helper</key>
+ <applyto>/apps/gnome-packagekit/interface/enable_mime_type_helper</applyto>
+ <owner>gnome-packagekit</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>If we should allow applications to invoke the mime type installer</short>
+ <long>If we should allow applications to invoke the mime type installer</long>
+ </locale>
+ </schema>
+
</schemalist>
</gconfschemafile>
Modified: trunk/data/gpk-client.glade
==============================================================================
--- trunk/data/gpk-client.glade (original)
+++ trunk/data/gpk-client.glade Thu Sep 18 10:55:08 2008
@@ -123,6 +123,26 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow_packages">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <child>
+ <widget class="GtkTreeView" id="treeview_packages">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_clickable">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">6</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">1</property>
Modified: trunk/po/POTFILES.in
==============================================================================
--- trunk/po/POTFILES.in (original)
+++ trunk/po/POTFILES.in Thu Sep 18 10:55:08 2008
@@ -26,11 +26,8 @@
src/gpk-check-update.c
src/gpk-client.c
src/gpk-client-chooser.c
-src/gpk-client-depends.c
src/gpk-client-dialog.c
src/gpk-client-eula.c
-src/gpk-client-requires.c
-src/gpk-client-resolve.c
src/gpk-client-run.c
src/gpk-client-signature.c
src/gpk-client-untrusted.c
Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am (original)
+++ trunk/src/Makefile.am Thu Sep 18 10:55:08 2008
@@ -61,17 +61,10 @@
gpk-dialog.h \
gpk-client.c \
gpk-client.h \
- gpk-client-private.h \
gpk-client-dialog.c \
gpk-client-dialog.h \
gpk-client-eula.c \
gpk-client-eula.h \
- gpk-client-resolve.c \
- gpk-client-resolve.h \
- gpk-client-depends.c \
- gpk-client-depends.h \
- gpk-client-requires.c \
- gpk-client-requires.h \
gpk-client-signature.c \
gpk-client-signature.h \
gpk-client-untrusted.c \
Modified: trunk/src/gpk-client-chooser.c
==============================================================================
--- trunk/src/gpk-client-chooser.c (original)
+++ trunk/src/gpk-client-chooser.c Thu Sep 18 10:55:08 2008
@@ -111,9 +111,8 @@
gchar *string1, gchar *string2,
gint int1, gint int2, gpointer user_data)
{
- if (egg_strequal (name, "button_action")) {
+ if (egg_strequal (name, "button_action"))
return polkit_gnome_action_create_button (button_action);
- }
egg_warning ("name unknown=%s", name);
return NULL;
}
@@ -153,7 +152,7 @@
{
PolKitAction *pk_action;
pk_action = polkit_action_new ();
- polkit_action_set_action_id (pk_action, "org.freedesktop.packagekit.install");
+ polkit_action_set_action_id (pk_action, "org.freedesktop.packagekit.package-install");
button_action = polkit_gnome_action_new_default ("install", pk_action, _("_Install"), NULL);
g_object_set (button_action,
"no-icon-name", GTK_STOCK_FLOPPY,
@@ -213,6 +212,7 @@
/* make modal if window set */
if (window != NULL) {
+ gtk_window_set_modal (GTK_WINDOW (widget), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (widget), window);
}
@@ -254,15 +254,15 @@
/* check icon actually exists and is valid in this theme */
ret = gpk_check_icon_valid (icon_name);
- if (!ret) {
+ if (!ret)
icon_name = gpk_info_enum_to_icon_name (obj->info);
- }
package_id = pk_package_id_to_string (obj->id);
gtk_list_store_set (list_store, &iter,
GPK_CHOOSER_COLUMN_TEXT, text,
GPK_CHOOSER_COLUMN_ID, package_id, -1);
g_free (package_id);
+ package_id = NULL;
gtk_list_store_set (list_store, &iter, GPK_CHOOSER_COLUMN_ICON, icon_name, -1);
g_free (text);
}
@@ -277,9 +277,8 @@
gtk_main ();
/* hide window */
- if (GTK_IS_WIDGET (widget)) {
+ if (GTK_IS_WIDGET (widget))
gtk_widget_hide (widget);
- }
g_object_unref (glade_xml);
return package_id;
@@ -296,9 +295,8 @@
{
EggTest *test = (EggTest *) data;
- if (egg_test_start (test, "GpkClientEula") == FALSE) {
+ if (egg_test_start (test, "GpkClientChooser") == FALSE)
return;
- }
egg_test_end (test);
}
#endif
Modified: trunk/src/gpk-client-dialog.c
==============================================================================
--- trunk/src/gpk-client-dialog.c (original)
+++ trunk/src/gpk-client-dialog.c Thu Sep 18 10:55:08 2008
@@ -38,6 +38,8 @@
#include <pk-common.h>
#include <pk-client.h>
+#include <pk-package-list.h>
+#include <pk-extra.h>
#include <pk-enum.h>
#include "egg-debug.h"
@@ -62,6 +64,7 @@
gboolean has_parent;
GMainLoop *loop;
GtkResponseType response;
+ GtkListStore *store;
};
enum {
@@ -73,16 +76,38 @@
LAST_SIGNAL
};
+enum {
+ GPK_CLIENT_DIALOG_STORE_IMAGE,
+ GPK_CLIENT_DIALOG_STORE_ID,
+ GPK_CLIENT_DIALOG_STORE_TEXT,
+ GPK_CLIENT_DIALOG_STORE_LAST
+};
+
static guint signals [LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (GpkClientDialog, gpk_client_dialog, G_TYPE_OBJECT)
/**
+ * gpk_client_dialog_show_widget:
+ **/
+static void
+gpk_client_dialog_show_widget (GpkClientDialog *dialog, const gchar *name, gboolean enabled)
+{
+ GtkWidget *widget;
+ widget = glade_xml_get_widget (dialog->priv->glade_xml, name);
+ if (enabled)
+ gtk_widget_show (widget);
+ else
+ gtk_widget_hide (widget);
+}
+
+/**
* gpk_client_dialog_show_page:
**/
gboolean
-gpk_client_dialog_show_page (GpkClientDialog *dialog, GpkClientDialogPage page, guint32 timestamp)
+gpk_client_dialog_show_page (GpkClientDialog *dialog, GpkClientDialogPage page, PkBitfield options, guint32 timestamp)
{
GtkWidget *widget;
+ PkBitfield bitfield = 0;
g_return_val_if_fail (GPK_IS_CLIENT_DIALOG (dialog), FALSE);
@@ -91,47 +116,53 @@
widget = glade_xml_get_widget (dialog->priv->glade_xml, "image_status");
gtk_widget_show (widget);
- egg_debug ("setting page: %i", page);
+ /* helper */
if (page == GPK_CLIENT_DIALOG_PAGE_CONFIRM) {
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "progressbar_percent");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_cancel");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_close");
- gtk_widget_show (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_action");
- gtk_widget_show (widget);
- gtk_widget_grab_focus (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_help");
- gtk_widget_show (widget);
+ gpk_client_dialog_set_image (dialog, "dialog-question");
+ bitfield = pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_ACTION,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_HELP,
+ GPK_CLIENT_DIALOG_WIDGET_MESSAGE,
+ -1);
+ } else if (page == GPK_CLIENT_DIALOG_PAGE_FINISHED) {
+ gpk_client_dialog_set_image (dialog, "dialog-information");
+ bitfield = pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_MESSAGE,
+ -1);
+ } else if (page == GPK_CLIENT_DIALOG_PAGE_CONFIRM) {
+ gpk_client_dialog_set_image (dialog, "dialog-question");
+ bitfield = pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_ACTION,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_HELP,
+ GPK_CLIENT_DIALOG_WIDGET_MESSAGE,
+ -1);
+ } else if (page == GPK_CLIENT_DIALOG_PAGE_WARNING) {
+ gpk_client_dialog_set_image (dialog, "dialog-warning");
+ bitfield = pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_MESSAGE,
+ -1);
} else if (page == GPK_CLIENT_DIALOG_PAGE_PROGRESS) {
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "progressbar_percent");
- gtk_widget_show (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_cancel");
- gtk_widget_show (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_close");
- gtk_widget_show (widget);
- gtk_widget_grab_focus (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_action");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_help");
- gtk_widget_show (widget);
- } else if (page == GPK_CLIENT_DIALOG_PAGE_FINISHED || page == GPK_CLIENT_DIALOG_PAGE_WARNING) {
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "progressbar_percent");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_cancel");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_close");
- gtk_widget_show (widget);
- gtk_widget_grab_focus (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_action");
- gtk_widget_hide (widget);
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_help");
- gtk_widget_hide (widget);
- } else {
- egg_error ("unknown contant");
+ gpk_client_dialog_set_image (dialog, "dialog-warning");
+ bitfield = pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_CANCEL,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_HELP,
+ GPK_CLIENT_DIALOG_WIDGET_PROGRESS_BAR,
+ -1);
}
+ /* we can specify extras */
+ bitfield += options;
+
+ gpk_client_dialog_show_widget (dialog, "button_help", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_BUTTON_HELP));
+ gpk_client_dialog_show_widget (dialog, "button_cancel", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_BUTTON_CANCEL));
+ gpk_client_dialog_show_widget (dialog, "button_close", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE));
+ gpk_client_dialog_show_widget (dialog, "button_action", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_BUTTON_ACTION));
+ gpk_client_dialog_show_widget (dialog, "progressbar_percent", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_PROGRESS_BAR));
+ gpk_client_dialog_show_widget (dialog, "label_message", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_MESSAGE));
+ gpk_client_dialog_show_widget (dialog, "scrolledwindow_packages", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_PACKAGE_LIST));
+ gpk_client_dialog_show_widget (dialog, "label_force_width", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_PADDING));
+ gpk_client_dialog_show_widget (dialog, "label_force_height", pk_bitfield_contain (bitfield, GPK_CLIENT_DIALOG_WIDGET_PADDING));
+
/* show */
widget = glade_xml_get_widget (dialog->priv->glade_xml, "window_client");
gtk_widget_realize (widget);
@@ -155,7 +186,9 @@
/* not sure what to do here, should probably unparent somehow */
if (window == NULL) {
- egg_warning ("parent set NULL when already modal with another window!");
+ egg_warning ("parent set NULL when already modal with another window, setting non-modal");
+ widget = glade_xml_get_widget (dialog->priv->glade_xml, "window_client");
+ gtk_window_set_modal (GTK_WINDOW(widget), FALSE);
return FALSE;
}
@@ -237,10 +270,6 @@
g_return_val_if_fail (GPK_IS_CLIENT_DIALOG (dialog), FALSE);
g_return_val_if_fail (message != NULL, FALSE);
- /* infer we want to show by setting this */
- if (!egg_strzero (message))
- gpk_client_dialog_set_show_message (dialog, TRUE);
-
/* ignore this if it's uninteresting */
if (!dialog->priv->show_progress_files)
return FALSE;
@@ -396,29 +425,6 @@
}
/**
- * gpk_client_dialog_set_show_message:
- **/
-gboolean
-gpk_client_dialog_set_show_message (GpkClientDialog *dialog, gboolean show_message)
-{
- GtkWidget *widget;
-
- g_return_val_if_fail (GPK_IS_CLIENT_DIALOG (dialog), FALSE);
-
- egg_debug ("showing message: %i", show_message);
-
- /* if we're never going to show it, hide the allocation */
- widget = glade_xml_get_widget (dialog->priv->glade_xml, "hbox_message");
- if (!show_message)
- gtk_widget_hide (widget);
- else
- gtk_widget_show (widget);
- dialog->priv->show_progress_files = show_message;
-
- return TRUE;
-}
-
-/**
* gpk_client_dialog_run:
**/
GtkResponseType
@@ -545,6 +551,102 @@
}
/**
+ * gpk_client_dialog_set_package_list:
+ **/
+gboolean
+gpk_client_dialog_set_package_list (GpkClientDialog *dialog, const PkPackageList *list)
+{
+ GtkTreeIter iter;
+ const PkPackageObj *obj;
+ PkExtra *extra;
+ const gchar *icon;
+ gchar *package_id;
+ gchar *text;
+ guint length;
+ guint i;
+ gboolean valid;
+ GtkWidget *widget;
+
+ gtk_list_store_clear (dialog->priv->store);
+
+ length = pk_package_list_get_size (list);
+ widget = glade_xml_get_widget (dialog->priv->glade_xml, "scrolledwindow_packages");
+ if (length > 5)
+ gtk_widget_set_size_request (widget, -1, 300);
+ else if (length > 1)
+ gtk_widget_set_size_request (widget, -1, 150);
+
+ extra = pk_extra_new ();
+ length = pk_package_list_get_size (list);
+
+ /* add each well */
+ for (i=0; i<length; i++) {
+ obj = pk_package_list_get_obj (list, i);
+ text = gpk_package_id_format_twoline (obj->id, obj->summary);
+ package_id = pk_package_id_to_string (obj->id);
+
+ /* get the icon */
+ icon = pk_extra_get_icon_name (extra, obj->id->name);
+ valid = gpk_check_icon_valid (icon);
+ if (!valid)
+ icon = gpk_info_enum_to_icon_name (PK_INFO_ENUM_INSTALLED);
+
+ gtk_list_store_append (dialog->priv->store, &iter);
+ gtk_list_store_set (dialog->priv->store, &iter,
+ GPK_CLIENT_DIALOG_STORE_IMAGE, icon,
+ GPK_CLIENT_DIALOG_STORE_ID, package_id,
+ GPK_CLIENT_DIALOG_STORE_TEXT, text,
+ -1);
+ g_free (text);
+ g_free (package_id);
+ }
+
+ g_object_unref (extra);
+
+ return TRUE;
+}
+
+
+/**
+ * gpk_dialog_treeview_for_package_list:
+ **/
+static gboolean
+gpk_dialog_treeview_for_package_list (GpkClientDialog *dialog)
+{
+ GtkTreeView *treeview;
+ GtkWidget *widget;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GtkTreeSelection *selection;
+
+ widget = glade_xml_get_widget (dialog->priv->glade_xml, "treeview_packages");
+ treeview = GTK_TREE_VIEW (widget);
+
+ /* column for images */
+ column = gtk_tree_view_column_new ();
+ renderer = gtk_cell_renderer_pixbuf_new ();
+ g_object_set (renderer, "stock-size", GTK_ICON_SIZE_DND, NULL);
+ gtk_tree_view_column_pack_start (column, renderer, FALSE);
+ gtk_tree_view_column_add_attribute (column, renderer, "icon-name", GPK_CLIENT_DIALOG_STORE_IMAGE);
+ gtk_tree_view_append_column (treeview, column);
+
+ /* column for name */
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes (_("Name"), renderer,
+ "markup", GPK_CLIENT_DIALOG_STORE_TEXT, NULL);
+ gtk_tree_view_column_set_sort_column_id (column, GPK_CLIENT_DIALOG_STORE_TEXT);
+ gtk_tree_view_append_column (treeview, column);
+
+ /* set some common options */
+ gtk_tree_view_set_headers_visible (treeview, FALSE);
+ selection = gtk_tree_view_get_selection (treeview);
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_NONE);
+ gtk_tree_selection_unselect_all (selection);
+
+ return TRUE;
+}
+
+/**
* gpk_client_dialog_class_init:
* @klass: The GpkClientDialogClass
**/
@@ -605,6 +707,15 @@
dialog->priv->show_progress_files = TRUE;
dialog->priv->has_parent = FALSE;
+ dialog->priv->store = gtk_list_store_new (GPK_CLIENT_DIALOG_STORE_LAST,
+ G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
+
+ gpk_dialog_treeview_for_package_list (dialog);
+
+ widget = glade_xml_get_widget (dialog->priv->glade_xml, "treeview_packages");
+ gtk_tree_view_set_model (GTK_TREE_VIEW (widget),
+ GTK_TREE_MODEL (dialog->priv->store));
+
/* common stuff */
widget = glade_xml_get_widget (dialog->priv->glade_xml, "window_client");
g_signal_connect (widget, "delete_event", G_CALLBACK (gpk_client_dialog_window_delete_cb), dialog);
@@ -649,6 +760,7 @@
g_main_loop_quit (dialog->priv->loop);
}
+ g_object_unref (dialog->priv->store);
g_object_unref (dialog->priv->glade_xml);
g_main_loop_unref (dialog->priv->loop);
@@ -679,6 +791,8 @@
{
GtkResponseType button;
GpkClientDialog *dialog = NULL;
+ PkPackageList *list;
+ PkPackageId *id;
if (!egg_test_start (test, "GpkClientDialog"))
return;
@@ -691,13 +805,22 @@
else
egg_test_failed (test, NULL);
+ /* set some packages */
+ list = pk_package_list_new ();
+ id = pk_package_id_new_from_list ("totem", "0.0.1", "i386", "fedora-newkey");
+ pk_package_list_add (list, PK_INFO_ENUM_INSTALLED, id, "Totem is a music player for GNOME");
+ pk_package_list_add (list, PK_INFO_ENUM_AVAILABLE, id, "Amarok is a music player for KDE");
+ gpk_client_dialog_set_package_list (dialog, list);
+ pk_package_id_free (id);
+ g_object_unref (list);
+
/************************************************************/
egg_test_title (test, "help button");
gpk_client_dialog_set_window_title (dialog, "PackageKit self test");
gpk_client_dialog_set_title (dialog, "Button press test");
gpk_client_dialog_set_message (dialog, "Please press close");
gpk_client_dialog_set_image (dialog, "dialog-warning");
- gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0);
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
button = gpk_client_dialog_run (dialog);
if (button == GTK_RESPONSE_CLOSE)
egg_test_success (test, NULL);
@@ -710,7 +833,7 @@
gpk_client_dialog_set_message (dialog, "Please press Uninstall\n\nThis is a really really, really,\nreally long title <i>with formatting</i>");
gpk_client_dialog_set_image (dialog, "dialog-information");
gpk_client_dialog_set_action (dialog, _("Uninstall"));
- gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0);
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0, 0);
button = gpk_client_dialog_run (dialog);
if (button == GTK_RESPONSE_OK)
egg_test_success (test, NULL);
@@ -721,9 +844,8 @@
egg_test_title (test, "no message");
gpk_client_dialog_set_title (dialog, "Refresh cache");
gpk_client_dialog_set_image_status (dialog, PK_STATUS_ENUM_REFRESH_CACHE);
- gpk_client_dialog_set_show_message (dialog, FALSE);
gpk_client_dialog_set_percentage (dialog, 101);
- gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
gpk_client_dialog_run (dialog);
egg_test_success (test, NULL);
@@ -733,7 +855,7 @@
gpk_client_dialog_set_message (dialog, "Please press cancel");
gpk_client_dialog_set_image_status (dialog, PK_STATUS_ENUM_RUNNING);
gpk_client_dialog_set_percentage (dialog, 50);
- gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
button = gpk_client_dialog_run (dialog);
if (button == GTK_RESPONSE_CANCEL)
egg_test_success (test, NULL);
@@ -746,13 +868,26 @@
gpk_client_dialog_set_message (dialog, "Please press close");
gpk_client_dialog_set_image_status (dialog, PK_STATUS_ENUM_INSTALL);
gpk_client_dialog_set_percentage (dialog, 101);
- gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_MESSAGE, -1), 0);
button = gpk_client_dialog_run (dialog);
if (button == GTK_RESPONSE_CLOSE)
egg_test_success (test, NULL);
else
egg_test_failed (test, "got id %i", button);
+ /************************************************************/
+ egg_test_title (test, "confirm install button");
+ gpk_client_dialog_set_title (dialog, "Button press test");
+ gpk_client_dialog_set_message (dialog, "Please press Install if you can see the package list");
+ gpk_client_dialog_set_image (dialog, "dialog-information");
+ gpk_client_dialog_set_action (dialog, _("Install"));
+ gpk_client_dialog_show_page (dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, GPK_CLIENT_DIALOG_PACKAGE_LIST, 0);
+ button = gpk_client_dialog_run (dialog);
+ if (button == GTK_RESPONSE_OK)
+ egg_test_success (test, NULL);
+ else
+ egg_test_failed (test, "got id %i", button);
+
gpk_client_dialog_close (dialog);
g_object_unref (dialog);
Modified: trunk/src/gpk-client-dialog.h
==============================================================================
--- trunk/src/gpk-client-dialog.h (original)
+++ trunk/src/gpk-client-dialog.h Thu Sep 18 10:55:08 2008
@@ -25,6 +25,8 @@
#include <glib-object.h>
#include <gtk/gtk.h>
#include <pk-enum.h>
+#include <pk-bitfield.h>
+#include <pk-package-list.h>
G_BEGIN_DECLS
@@ -46,9 +48,30 @@
GPK_CLIENT_DIALOG_PAGE_PROGRESS,
GPK_CLIENT_DIALOG_PAGE_FINISHED,
GPK_CLIENT_DIALOG_PAGE_WARNING,
+ GPK_CLIENT_DIALOG_PAGE_CUSTOM,
GPK_CLIENT_DIALOG_PAGE_UNKNOWN
} GpkClientDialogPage;
+/**
+ * GpkClientDialogWidgets:
+ */
+typedef enum
+{
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_HELP,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_CANCEL,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_CLOSE,
+ GPK_CLIENT_DIALOG_WIDGET_BUTTON_ACTION,
+ GPK_CLIENT_DIALOG_WIDGET_PADDING,
+ GPK_CLIENT_DIALOG_WIDGET_PACKAGE_LIST,
+ GPK_CLIENT_DIALOG_WIDGET_PROGRESS_BAR,
+ GPK_CLIENT_DIALOG_WIDGET_MESSAGE,
+ GPK_CLIENT_DIALOG_WIDGET_UNKNOWN
+} GpkClientDialogWidgets;
+
+/* helpers */
+#define GPK_CLIENT_DIALOG_PACKAGE_PADDING pk_bitfield_from_enums (GPK_CLIENT_DIALOG_WIDGET_PADDING, GPK_CLIENT_DIALOG_WIDGET_MESSAGE, -1)
+#define GPK_CLIENT_DIALOG_PACKAGE_LIST pk_bitfield_value (GPK_CLIENT_DIALOG_WIDGET_PACKAGE_LIST)
+
typedef struct _GpkClientDialogPrivate GpkClientDialogPrivate;
typedef struct _GpkClientDialog GpkClientDialog;
typedef struct _GpkClientDialogClass GpkClientDialogClass;
@@ -70,7 +93,10 @@
gboolean gpk_client_dialog_show_page (GpkClientDialog *dialog,
GpkClientDialogPage page,
+ PkBitfield options,
guint32 timestamp);
+gboolean gpk_client_dialog_set_package_list (GpkClientDialog *dialog,
+ const PkPackageList *list);
gboolean gpk_client_dialog_set_parent (GpkClientDialog *dialog,
GdkWindow *window);
gboolean gpk_client_dialog_set_window_title (GpkClientDialog *dialog,
@@ -91,8 +117,6 @@
PkStatusEnum status);
gboolean gpk_client_dialog_set_allow_cancel (GpkClientDialog *dialog,
gboolean can_cancel);
-gboolean gpk_client_dialog_set_show_message (GpkClientDialog *dialog,
- gboolean show_message);
GtkWindow *gpk_client_dialog_get_window (GpkClientDialog *dialog);
GtkResponseType gpk_client_dialog_run (GpkClientDialog *dialog);
gboolean gpk_client_dialog_close (GpkClientDialog *dialog);
Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c (original)
+++ trunk/src/gpk-client.c Thu Sep 18 10:55:08 2008
@@ -56,15 +56,13 @@
#include <gpk-client-signature.h>
#include <gpk-client-untrusted.h>
#include <gpk-client-chooser.h>
-#include <gpk-client-resolve.h>
-#include <gpk-client-depends.h>
-#include <gpk-client-requires.h>
#include <gpk-common.h>
#include <gpk-gnome.h>
#include <gpk-error.h>
#include "gpk-consolekit.h"
#include "gpk-animated-icon.h"
#include "gpk-client-dialog.h"
+#include "gpk-dialog.h"
static void gpk_client_class_init (GpkClientClass *klass);
static void gpk_client_init (GpkClient *gclient);
@@ -360,7 +358,7 @@
if (exit == PK_EXIT_ENUM_SUCCESS &&
gclient->priv->show_finished) {
gpk_client_dialog_set_message (gclient->priv->dialog, "");
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_FINISHED, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_FINISHED, 0, 0);
gclient->priv->finished_timer_id = g_timeout_add_seconds (GPK_CLIENT_FINISHED_AUTOCLOSE_DELAY,
gpk_install_finished_timeout, gclient);
} else {
@@ -379,7 +377,7 @@
/**
* gpk_client_set_status:
**/
-gboolean
+static gboolean
gpk_client_set_status (GpkClient *gclient, PkStatusEnum status)
{
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
@@ -394,7 +392,7 @@
status == PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO ||
status == PK_STATUS_ENUM_REFRESH_CACHE) {
gclient->priv->show_progress = TRUE;
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
}
}
@@ -424,16 +422,6 @@
}
/**
- * gpk_client_set_title:
- **/
-gboolean
-gpk_client_set_title (GpkClient *gclient, const gchar *title)
-{
- gpk_client_dialog_set_window_title (gclient->priv->dialog, title);
- return TRUE;
-}
-
-/**
* gpk_client_progress_changed_cb:
**/
static void
@@ -614,9 +602,31 @@
* gpk_client_error_msg:
**/
static void
-gpk_client_error_msg (GpkClient *gclient, const gchar *title, const gchar *message, const gchar *details)
+gpk_client_error_msg (GpkClient *gclient, const gchar *title, GError *error)
{
GtkWindow *window;
+ const gchar *message = _("Unknown error. Please refer to the detailed report and report in bugzilla.");
+ const gchar *details = NULL;
+
+ /* print a proper error if we have it */
+ if (error != NULL) {
+ if (error->code == PK_CLIENT_ERROR_FAILED_AUTH ||
+ g_str_has_prefix (error->message, "org.freedesktop.packagekit."))
+ message = _("You don't have the necessary privileges to perform this action");
+ else if (error->code == PK_CLIENT_ERROR_CANNOT_START_DAEMON)
+ message = _("The packagekitd service could not be started");
+ else
+ details = error->message;
+ }
+
+ /* it's a normal UI, not a backtrace so keep in the UI */
+ if (details == NULL) {
+ gpk_client_dialog_set_title (gclient->priv->dialog, title);
+ gpk_client_dialog_set_message (gclient->priv->dialog, message);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ return;
+ }
/* hide the main window */
window = gpk_client_dialog_get_window (gclient->priv->dialog);
@@ -670,14 +680,13 @@
{
gboolean ret;
GError *error_local = NULL;
- gchar *text;
guint length;
const gchar *title;
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset resolve"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
@@ -691,19 +700,10 @@
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
- /* check if we got a permission denied */
- if (g_str_has_prefix (error_local->message, "org.freedesktop.packagekit.")) {
- gpk_client_error_msg (gclient, _("Failed to install files"),
- _("You don't have the necessary privileges to install local files"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- } else {
- text = g_markup_escape_text (error_local->message, -1);
- length = g_strv_length (files_rel);
- title = ngettext ("Failed to install file", "Failed to install files", length);
- gpk_client_error_msg (gclient, title, text, error_local->message);
- g_free (text);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- }
+ length = g_strv_length (files_rel);
+ title = ngettext ("Failed to install file", "Failed to install files", length);
+ gpk_client_error_msg (gclient, title, error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
}
@@ -870,7 +870,7 @@
gpk_client_dialog_set_message (gclient->priv->dialog, message);
gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-warning");
gpk_client_dialog_set_action (gclient->priv->dialog, _("Copy file"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0, gclient->priv->timestamp);
g_free (message);
@@ -942,8 +942,7 @@
/* show UI */
gpk_client_dialog_set_title (gclient->priv->dialog, title);
gpk_client_dialog_set_message (gclient->priv->dialog, "");
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-warning");
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "files not copied");
ret = FALSE;
@@ -977,9 +976,8 @@
/* show UI */
gpk_client_dialog_set_title (gclient->priv->dialog, title);
gpk_client_dialog_set_message (gclient->priv->dialog, message);
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-question");
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0, gclient->priv->timestamp);
button = gpk_client_dialog_run (gclient->priv->dialog);
g_free (message);
@@ -989,8 +987,7 @@
_("The files were not installed"), array->len);
gpk_client_dialog_set_title (gclient->priv->dialog, title);
gpk_client_dialog_set_message (gclient->priv->dialog, "");
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-warning");
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "Aborted");
ret = FALSE;
@@ -1041,8 +1038,7 @@
/* show UI */
gpk_client_dialog_set_title (gclient->priv->dialog, title);
gpk_client_dialog_set_message (gclient->priv->dialog, message);
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-warning");
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
gpk_client_dialog_run (gclient->priv->dialog);
g_free (message);
@@ -1073,8 +1069,10 @@
/* get localised name and icon if available */
if (gclient->priv->application != NULL) {
application_localised = pk_extra_get_summary (gclient->priv->extra, gclient->priv->application);
- if (application_localised == NULL)
+ if (application_localised == NULL) {
+ egg_debug ("did not get localised description for %s", gclient->priv->application);
application_localised = gclient->priv->application;
+ }
icon = pk_extra_get_icon_name (gclient->priv->extra, gclient->priv->application);
}
@@ -1090,7 +1088,7 @@
gpk_client_dialog_set_title (gclient->priv->dialog, title_name);
gpk_client_dialog_set_message (gclient->priv->dialog, message);
gpk_client_dialog_set_image (gclient->priv->dialog, icon);
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0, gclient->priv->timestamp);
g_free (title_name);
@@ -1150,9 +1148,9 @@
goto out;
/* set title */
+ gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Installing files"));
gpk_client_dialog_set_title (gclient->priv->dialog, _("Install local file"));
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_FINISHED, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_FINISHED, 0, 0);
/* wait */
g_main_loop_run (gclient->priv->loop);
@@ -1189,18 +1187,23 @@
{
gboolean ret;
GError *error_local = NULL;
- gchar *text = NULL;
+ GtkResponseType button;
+ PkPackageList *list;
+ guint length;
+ gchar *title;
+ gchar *message;
+ gchar *name;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (package_ids != NULL, FALSE);
/* set title */
+ gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Removing packages"));
gpk_client_dialog_set_title (gclient->priv->dialog, _("Remove packages"));
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* are we dumb and can't check for depends? */
if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_REQUIRES)) {
@@ -1208,11 +1211,67 @@
goto skip_checks;
}
- ret = gpk_client_requires_show (gclient, package_ids);
- /* did we click no or exit the window? */
+ /* get the packages we depend on */
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Finding packages we require"));
+
+ /* reset */
+ ret = pk_client_reset (gclient->priv->client_resolve, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to remove package"), _("Additional packages were also not removed"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "user did not agree to additional requires");
+ gpk_client_error_msg (gclient, _("Failed to reset resolve client"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ g_error_free (error_local);
+ ret = FALSE;
+ goto out;
+ }
+
+ /* find out if this would force removal of other packages */
+ ret = pk_client_get_requires (gclient->priv->client_resolve, pk_bitfield_value (PK_FILTER_ENUM_INSTALLED), package_ids, TRUE, &error_local);
+ if (!ret) {
+ gpk_client_error_msg (gclient, _("Could not work out what packages would also be removed"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ g_error_free (error_local);
+ ret = FALSE;
+ goto out;
+ }
+
+ /* these are the new packages */
+ list = pk_client_get_package_list (gclient->priv->client_resolve);
+
+ /* no deps */
+ length = pk_package_list_get_size (list);
+ if (length == 0)
+ goto skip_checks;
+
+ /* sort by package_id */
+ pk_package_list_sort (list);
+
+ /* title */
+ title = g_strdup_printf (ngettext ("%i additional package also has to be removed",
+ "%i additional packages also have to be removed",
+ length), length);
+
+ /* message */
+ name = gpk_dialog_package_id_name_join_locale (package_ids);
+ length = g_strv_length (package_ids);
+ message = g_strdup_printf (ngettext ("To remove %s other packages that depend on it must also be removed.",
+ "To remove %s other packages that depend on them must also be removed.",
+ length), name);
+ g_free (name);
+
+ /* show UI */
+ gpk_client_dialog_set_package_list (gclient->priv->dialog, list);
+ gpk_client_dialog_set_title (gclient->priv->dialog, title);
+ gpk_client_dialog_set_message (gclient->priv->dialog, message);
+ gpk_client_dialog_set_action (gclient->priv->dialog, _("Remove"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, GPK_CLIENT_DIALOG_PACKAGE_LIST, gclient->priv->timestamp);
+ button = gpk_client_dialog_run (gclient->priv->dialog);
+ g_free (title);
+ g_free (message);
+
+ /* did we click no or exit the window? */
+ if (button != GTK_RESPONSE_OK) {
+ gpk_client_dialog_close (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to additional requires");
ret = FALSE;
goto out;
}
@@ -1221,35 +1280,24 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset resolve"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
ret = FALSE;
goto out;
}
/* try to remove the package_ids */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
ret = pk_client_remove_packages (gclient->priv->client_action, package_ids, TRUE, FALSE, &error_local);
if (!ret) {
- /* check if we got a permission denied */
- if (g_str_has_prefix (error_local->message, "org.freedesktop.packagekit.")) {
- gpk_client_error_msg (gclient, _("Failed to remove package"),
- _("You don't have the necessary privileges to remove packages"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- } else {
- text = g_markup_escape_text (error_local->message, -1);
- gpk_client_error_msg (gclient, _("Failed to remove package"), text, error_local->message);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- g_free (text);
- }
+ gpk_client_error_msg (gclient, _("Failed to remove package"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
@@ -1262,17 +1310,6 @@
}
/**
- * gpk_client_get_window:
- **/
-GtkWindow *
-gpk_client_get_window (GpkClient *gclient)
-{
- GtkWidget *widget;
- widget = GTK_WIDGET (gpk_client_dialog_get_window (gclient->priv->dialog));
- return GTK_WINDOW (widget);
-}
-
-/**
* gpk_client_install_package_ids:
* @gclient: a valid #GpkClient instance
* @package_id: a package_id such as <literal>hal-info;0.20;i386;fedora</literal>
@@ -1285,18 +1322,23 @@
{
gboolean ret;
GError *error_local = NULL;
- gchar *text;
+ GtkResponseType button;
+ PkPackageList *list;
+ guint length;
+ gchar *name;
+ gchar *title;
+ gchar *message;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (package_ids != NULL, FALSE);
/* set title */
+ gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Installing packages"));
gpk_client_dialog_set_title (gclient->priv->dialog, _("Installing packages"));
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
/* are we dumb and can't check for depends? */
if (!pk_bitfield_contain (gclient->priv->roles, PK_ROLE_ENUM_GET_DEPENDS)) {
@@ -1304,10 +1346,63 @@
goto skip_checks;
}
- ret = gpk_client_depends_show (gclient, package_ids);
- /* did we click no or exit the window? */
+ /* have we previously said we don't want to be shown the confirmation */
+ ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_SHOW_DEPENDS, NULL);
+ if (!ret) {
+ egg_debug ("we've said we don't want the dep dialog");
+ goto skip_checks;
+ }
+
+ /* get the packages we depend on */
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Finding packages we depend on"));
+
+ /* reset */
+ ret = pk_client_reset (gclient->priv->client_resolve, &error_local);
if (!ret) {
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "user did not agree to additional deps");
+ gpk_client_error_msg (gclient, _("Failed to reset resolve client"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
+ /* find out if this would drag in other packages */
+ ret = pk_client_get_depends (gclient->priv->client_resolve, pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED), package_ids, TRUE, &error_local);
+ if (!ret) {
+ gpk_client_error_msg (gclient, _("Could not work out what packages would be also installed"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ g_error_free (error_local);
+ goto out;
+ }
+
+ /* these are the new packages */
+ list = pk_client_get_package_list (gclient->priv->client_resolve);
+ length = pk_package_list_get_size (list);
+ if (length == 0)
+ goto skip_checks;
+
+ /* title */
+ title = g_strdup_printf (ngettext ("%i additional package also has to be installed",
+ "%i additional packages also have to be installed",
+ length), length);
+
+ /* message */
+ name = gpk_dialog_package_id_name_join_locale (package_ids);
+ message = g_strdup_printf (ngettext ("To install %s, an additional package also has to be downloaded.",
+ "To install %s, additional packages also have to be downloaded.",
+ length), name);
+ g_free (name);
+
+ gpk_client_dialog_set_package_list (gclient->priv->dialog, list);
+ gpk_client_dialog_set_title (gclient->priv->dialog, title);
+ gpk_client_dialog_set_message (gclient->priv->dialog, message);
+ gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, GPK_CLIENT_DIALOG_PACKAGE_LIST, gclient->priv->timestamp);
+ button = gpk_client_dialog_run (gclient->priv->dialog);
+
+ /* did we click no or exit the window? */
+ if (button != GTK_RESPONSE_OK) {
+ gpk_client_dialog_close (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to additional deps");
ret = FALSE;
goto out;
}
@@ -1316,7 +1411,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset resolve"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
@@ -1324,20 +1419,13 @@
/* try to install the package_id */
gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Installing packages"));
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
+ if (gclient->priv->show_progress)
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
+
ret = pk_client_install_packages (gclient->priv->client_action, package_ids, &error_local);
if (!ret) {
- /* check if we got a permission denied */
- if (g_str_has_prefix (error_local->message, "org.freedesktop.packagekit.")) {
- gpk_client_error_msg (gclient, _("Failed to install package"),
- _("You don't have the necessary privileges to install packages"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- } else {
- text = g_markup_escape_text (error_local->message, -1);
- gpk_client_error_msg (gclient, _("Failed to install package"), text, error_local->message);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- g_free (text);
- }
+ gpk_client_error_msg (gclient, _("Failed to install package"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
goto out;
}
@@ -1368,31 +1456,120 @@
gboolean ret;
GError *error_local = NULL;
gchar **package_ids = NULL;
- GtkWidget *widget;
+ gchar *message;
+ const PkPackageObj *obj;
+ PkPackageList *list;
+ PkPackageId *id = NULL;
+ gchar *text;
+ gboolean already_installed = FALSE;
+ gchar *title;
+ guint len;
+ guint i;
+ GString *string;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (packages != NULL, FALSE);
+ string = g_string_new ("");
+ len = g_strv_length (packages);
+ for (i=0; i<len; i++)
+ g_string_append_printf (string, "â <i>%s</i>\n", packages[i]);
+
+ /* display messagebox */
+ text = g_string_free (string, FALSE);
+
/* check user wanted operation */
+ message = g_strdup_printf ("%s\n\n%s\n%s", _("An additional file is required"),
+ text, _("Do you want to search for this file now?"));
gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Package installer"));
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- ret = gpk_client_confirm_action (gclient, _("wants to install packages"), package_ids[0]);
+ ret = gpk_client_confirm_action (gclient, _("wants to install packages"), message);
+ g_free (text);
+ g_free (message);
if (!ret) {
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to search");
ret = FALSE;
goto out;
}
- /* resolve a 2D array to package_id's */
- widget = GTK_WIDGET (gpk_client_dialog_get_window (gclient->priv->dialog));
- package_ids = gpk_client_resolve_show (GTK_WINDOW (widget), packages);
- if (package_ids == NULL) {
- /* generic error message */
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "failed to resolve packages");
- ret = FALSE;
+ /* set title */
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Searching for packages"));
+ gpk_client_dialog_set_image_status (gclient->priv->dialog, PK_STATUS_ENUM_WAIT);
+ if (gclient->priv->show_progress)
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
+
+ /* reset */
+ ret = pk_client_reset (gclient->priv->client_resolve, &error_local);
+ if (!ret) {
+ gpk_client_error_msg (gclient, _("Failed to reset resolve client"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
+ /* find out if we can find a package */
+ ret = pk_client_resolve (gclient->priv->client_resolve, PK_FILTER_ENUM_NONE, packages, &error_local);
+ if (!ret) {
+ gpk_client_error_msg (gclient, _("Incorrect response from search"), error_local);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ goto out;
+ }
+
+ /* found nothing? */
+ list = pk_client_get_package_list (gclient->priv->client_resolve);
+ len = pk_package_list_get_size (list);
+ if (len == 0) {
+ text = pk_package_ids_to_text (packages, ",");
+ title = g_strdup_printf (_("Could not find %s"), text);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to find package"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("The packages could not be found in any software source"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "no package found");
+ g_free (text);
+ g_free (title);
+ goto out;
+ }
+
+ /* see what we've got already */
+ for (i=0; i<len; i++) {
+ obj = pk_package_list_get_obj (list, i);
+ if (obj->info == PK_INFO_ENUM_INSTALLED) {
+ already_installed = TRUE;
+ } else if (obj->info == PK_INFO_ENUM_AVAILABLE) {
+ egg_debug ("package '%s' resolved", obj->id->name);
+ id = obj->id;
+ //TODO: we need to list these in a gpk-client-chooser
+ }
+ }
+
+ /* already installed? */
+ if (already_installed) {
+ text = pk_package_ids_to_text (packages, ",");
+ title = g_strdup_printf (_("Failed to install %s"), text);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to install package"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("The package is already installed"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "package already found");
+ g_free (text);
+ g_free (title);
+ goto out;
+ }
+
+ /* got junk? */
+ if (id == NULL) {
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to install package"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("Incorrect response from search"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "package already found");
+ goto out;
+ }
+
+ /* convert to data */
+ package_ids = pk_package_list_to_strv (list);
+ g_object_unref (list);
+
/* install these packages */
ret = gpk_client_install_package_ids (gclient, package_ids, &error_local);
if (!ret) {
@@ -1432,14 +1609,18 @@
PkPackageId *id = NULL;
gchar **package_ids = NULL;
gchar *text;
+ gchar *message;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (full_path != NULL, FALSE);
/* check user wanted operation */
+ message = g_strdup_printf ("%s\n\nâ %s\n\n%s", _("The following file is required:"),
+ full_path, _("Do you want to search for this now?"));
gpk_client_dialog_set_window_title (gclient->priv->dialog, _("File installer"));
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- ret = gpk_client_confirm_action (gclient, _("wants to install a file"), full_path);
+ ret = gpk_client_confirm_action (gclient, _("wants to install a file"), message);
+ g_free (message);
if (!ret) {
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to search");
ret = FALSE;
@@ -1448,10 +1629,8 @@
ret = pk_client_search_file (gclient->priv->client_resolve, PK_FILTER_ENUM_NONE, full_path, &error_local);
if (!ret) {
- text = g_strdup_printf ("%s: %s", _("Incorrect response from search"), error_local->message);
- gpk_client_error_msg (gclient, _("Failed to search for file"), text, NULL);
+ gpk_client_error_msg (gclient, _("Failed to search for file"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- g_free (text);
ret = FALSE;
goto out;
}
@@ -1460,8 +1639,11 @@
list = pk_client_get_package_list (gclient->priv->client_resolve);
len = pk_package_list_get_size (list);
if (len == 0) {
- gpk_client_error_msg (gclient, _("Failed to find package"), _("The file could not be found in any packages"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, NULL);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to find package"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("The file could not be found in any packages"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "no files found");
ret = FALSE;
goto out;
}
@@ -1481,21 +1663,16 @@
/* already installed? */
if (already_installed) {
text = g_strdup_printf (_("The %s package already provides the file %s"), id->name, full_path);
- gpk_client_error_msg (gclient, _("Failed to install file"), text, NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to install file"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, text);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "already provided");
g_free (text);
ret = FALSE;
goto out;
}
- /* got junk? */
- if (id == NULL) {
- gpk_client_error_msg (gclient, _("Failed to install file"), _("Incorrect response from file search"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
- ret = FALSE;
- goto out;
- }
-
/* install this specific package */
package_id = pk_package_id_to_string (id);
package_ids = pk_package_ids_from_id (package_id);
@@ -1618,17 +1795,22 @@
{
guint i;
guint len;
- const PkPackageObj *obj;
PkPackageObj *obj_new;
gboolean ret = TRUE;
gchar **parts;
GError *error_local = NULL;
GtkResponseType button;
PkPackageList *list = NULL;
- GString *string;
- gchar *text;
gchar **package_ids = NULL;
+ /* check it's not session wide banned in gconf */
+ ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_ENABLE_CODEC_HELPER, NULL);
+ if (!ret) {
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "not enabled in GConf : %s", GPK_CONF_ENABLE_CODEC_HELPER);
+ ret = FALSE;
+ goto out;
+ }
+
/* confirm */
ret = gpk_client_install_gstreamer_codecs_confirm (gclient, codec_name_strings);
if (!ret) {
@@ -1642,9 +1824,8 @@
gpk_client_dialog_set_image_status (gclient->priv->dialog, PK_STATUS_ENUM_WAIT);
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
/* save the objects to download in a list */
list = pk_package_list_new ();
@@ -1660,12 +1841,16 @@
egg_debug ("codec description=%s", parts[1]);
obj_new = gpk_client_install_gstreamer_codec_part (gclient, parts[0], parts[1], &error_local);
if (obj_new == NULL) {
- gpk_client_error_msg (gclient, _("Failed to search for codec"), _("Could not find codec in any configured software source"), error_local->message);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to search for codec"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("Could not find codec in any configured software source"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
ret = FALSE;
}
if (obj_new != NULL)
pk_package_list_add_obj (list, obj_new);
+
pk_package_obj_free (obj_new);
g_strfreev (parts);
if (!ret)
@@ -1677,32 +1862,12 @@
if (!ret)
goto out;
- /* process package list */
- string = g_string_new (_("The following packages can be installed:"));
- g_string_append (string, "\n\n");
- len = pk_package_list_get_size (list);
- for (i=0; i<len; i++) {
- obj = pk_package_list_get_obj (list, i);
- text = gpk_package_id_format_oneline (obj->id, obj->summary);
- g_string_append_printf (string, "%s\n", text);
- g_free (text);
- }
-
- g_string_append_printf (string, "\n%s\n", _("Do you want to install these now?"));
-
- /* remove last \n */
- g_string_set_size (string, string->len - 1);
-
- /* display messagebox */
- text = g_string_free (string, FALSE);
-
+ gpk_client_dialog_set_package_list (gclient->priv->dialog, list);
gpk_client_dialog_set_title (gclient->priv->dialog, _("Install the following codecs"));
- gpk_client_dialog_set_message (gclient->priv->dialog, text);
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("Do you want to install these packages now?"));
gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-information");
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, gclient->priv->timestamp);
- g_free (text);
-
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, GPK_CLIENT_DIALOG_PACKAGE_LIST, gclient->priv->timestamp);
button = gpk_client_dialog_run (gclient->priv->dialog);
/* close, we're going to fail the method */
@@ -1745,25 +1910,46 @@
gchar *package_id = NULL;
gchar **package_ids = NULL;
guint len;
- GtkWidget *widget;
+ GtkWindow *window;
+ gchar *message;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (mime_type != NULL, FALSE);
+ /* check it's not session wide banned in gconf */
+ ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_ENABLE_MIME_TYPE_HELPER, NULL);
+ if (!ret) {
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "not enabled in GConf : %s", GPK_CONF_ENABLE_MIME_TYPE_HELPER);
+ ret = FALSE;
+ goto out;
+ }
+
/* make sure the user wants to do action */
- gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Mime type installer"));
+ message = g_strdup_printf ("%s\n\nâ %s\n\n%s",
+ _("An additional program is required to open this type of file:"),
+ mime_type, _("Do you want to search for a program to open this file type now?"));
+ gpk_client_dialog_set_window_title (gclient->priv->dialog, _("File type installer"));
gpk_client_dialog_set_action (gclient->priv->dialog, _("Search"));
- ret = gpk_client_confirm_action (gclient, _("requires a new mime type"), mime_type);
+ ret = gpk_client_confirm_action (gclient, _("requires a new mime type"), message);
+ g_free (message);
if (!ret) {
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to search");
ret = FALSE;
goto out;
}
+ /* set title */
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Searching for file handlers"));
+ gpk_client_dialog_set_image_status (gclient->priv->dialog, PK_STATUS_ENUM_WAIT);
+
+ /* setup the UI */
+ if (gclient->priv->show_progress)
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
+
/* reset */
ret = pk_client_reset (gclient->priv->client_resolve, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset client"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset resolve client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
@@ -1772,7 +1958,7 @@
ret = pk_client_what_provides (gclient->priv->client_resolve, pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED),
PK_PROVIDES_ENUM_MIMETYPE, mime_type, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to search for provides"), _("Incorrect response from search"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to search for provides"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
ret = FALSE;
goto out;
@@ -1782,20 +1968,25 @@
list = pk_client_get_package_list (gclient->priv->client_resolve);
len = pk_package_list_get_size (list);
if (len == 0) {
- gpk_client_error_msg (gclient, _("Failed to find software"),
- _("No new applications can be found to handle this type of file"), NULL);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to find software"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("No new applications can be found to handle this type of file"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "nothing was found to handle mime type");
ret = FALSE;
goto out;
}
/* populate a chooser */
- widget = GTK_WIDGET (gpk_client_dialog_get_window (gclient->priv->dialog));
- package_id = gpk_client_chooser_show (GTK_WINDOW (widget), list, _("Applications that can open this type of file"));
+ window = gpk_client_dialog_get_window (gclient->priv->dialog);
+ package_id = gpk_client_chooser_show (window, list, _("Applications that can open this type of file"));
/* selected nothing */
if (package_id == NULL) {
- gpk_client_error_msg (gclient, _("Failed to install software"), _("No applications were chosen to be installed"), NULL);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to install software"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("No applications were chosen to be installed"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "user chose nothing");
ret = FALSE;
goto out;
@@ -1827,29 +2018,48 @@
{
gboolean ret;
PkPackageList *list = NULL;
+ GtkResponseType button;
GError *error_local = NULL;
- gchar *package_id = NULL;
gchar **package_ids = NULL;
guint len;
- GtkWidget *widget;
+ gchar *message;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
g_return_val_if_fail (font_desc != NULL, FALSE);
+ /* check it's not session wide banned in gconf */
+ ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_ENABLE_FONT_HELPER, NULL);
+ if (!ret) {
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "not enabled in GConf : %s", GPK_CONF_ENABLE_FONT_HELPER);
+ ret = FALSE;
+ goto out;
+ }
+
/* check user wanted operation */
+ message = g_strdup_printf ("%s\n\n%s", _("An additional font is required to view this file correctly"),
+ _("Do you want to search for a suitable font now?"));
gpk_client_dialog_set_window_title (gclient->priv->dialog, _("Font installer"));
gpk_client_dialog_set_action (gclient->priv->dialog, _("Search"));
- ret = gpk_client_confirm_action (gclient, _("wants to install a font"), font_desc);
+ ret = gpk_client_confirm_action (gclient, _("wants to install a font"), message);
+ g_free (message);
if (!ret) {
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to search");
ret = FALSE;
goto out;
}
+ /* set title */
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Searching for fonts"));
+ gpk_client_dialog_set_image_status (gclient->priv->dialog, PK_STATUS_ENUM_WAIT);
+
+ /* setup the UI */
+ if (gclient->priv->show_progress)
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
+
/* reset */
ret = pk_client_reset (gclient->priv->client_resolve, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset client"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset resolve client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
@@ -1858,7 +2068,7 @@
ret = pk_client_what_provides (gclient->priv->client_resolve, pk_bitfield_value (PK_FILTER_ENUM_NOT_INSTALLED),
PK_PROVIDES_ENUM_FONT, font_desc, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to search for provides"), _("Incorrect response from search"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to search for provides"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
ret = FALSE;
goto out;
@@ -1868,33 +2078,41 @@
list = pk_client_get_package_list (gclient->priv->client_resolve);
len = pk_package_list_get_size (list);
if (len == 0) {
- gpk_client_error_msg (gclient, _("Failed to find font"),
- _("No new fonts can be found for this document"), NULL);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to find font"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("No new fonts can be found for this document"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+ gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, NULL);
ret = FALSE;
goto out;
}
- /* populate a chooser */
- widget = GTK_WIDGET (gpk_client_dialog_get_window (gclient->priv->dialog));
- package_id = gpk_client_chooser_show (GTK_WINDOW (widget), list, _("Available fonts for this document"));
+ gpk_client_dialog_set_package_list (gclient->priv->dialog, list);
+ gpk_client_dialog_set_title (gclient->priv->dialog, _("Install the following fonts"));
+ gpk_client_dialog_set_message (gclient->priv->dialog, _("Do you want to install these packages now?"));
+ gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-information");
+ gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, GPK_CLIENT_DIALOG_PACKAGE_LIST, gclient->priv->timestamp);
+ button = gpk_client_dialog_run (gclient->priv->dialog);
- /* selected nothing */
- if (package_id == NULL) {
- gpk_client_error_msg (gclient, _("Failed to install fonts"), _("No fonts were chosen to be installed"), NULL);
- gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "user chose nothing");
+ /* close, we're going to fail the method */
+ if (button != GTK_RESPONSE_OK) {
+ gpk_client_dialog_close (gclient->priv->dialog);
+ gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "did not agree to download");
ret = FALSE;
goto out;
}
- /* install this specific package */
- package_ids = g_strsplit (package_id, "|", 1);
+ /* convert to list of package id's */
+ package_ids = pk_package_list_to_strv (list);
ret = gpk_client_install_package_ids (gclient, package_ids, error);
+
out:
+ if (!ret)
+ gpk_client_dialog_close (gclient->priv->dialog);
+ g_strfreev (package_ids);
if (list != NULL)
g_object_unref (list);
- g_strfreev (package_ids);
- g_free (package_id);
return ret;
}
@@ -1948,9 +2166,8 @@
/* show UI */
gpk_client_dialog_set_title (gclient->priv->dialog, title);
gpk_client_dialog_set_message (gclient->priv->dialog, message);
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-question");
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_CONFIRM, 0, gclient->priv->timestamp);
button = gpk_client_dialog_run (gclient->priv->dialog);
g_free (message);
@@ -1963,9 +2180,8 @@
gpk_client_set_status (gclient, PK_STATUS_ENUM_WAIT);
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* get files to be installed */
catalog = pk_catalog_new ();
@@ -1979,8 +2195,7 @@
/* show UI */
gpk_client_dialog_set_title (gclient->priv->dialog, _("No packages need to be installed"));
gpk_client_dialog_set_message (gclient->priv->dialog, "");
- gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-warning");
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
gpk_client_dialog_run (gclient->priv->dialog);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "No packages need to be installed");
ret = FALSE;
@@ -2007,7 +2222,7 @@
gpk_client_dialog_set_message (gclient->priv->dialog, text);
gpk_client_dialog_set_image (gclient->priv->dialog, "dialog-question");
gpk_client_dialog_set_action (gclient->priv->dialog, _("Install"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, gclient->priv->timestamp);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, gclient->priv->timestamp);
button = gpk_client_dialog_run (gclient->priv->dialog);
g_free (text);
@@ -2047,7 +2262,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset client"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
@@ -2058,24 +2273,16 @@
/* wrap update, but handle all the GPG and EULA stuff */
ret = pk_client_update_system (gclient->priv->client_action, &error_local);
if (!ret) {
- /* print a proper error if we have it */
- if (error_local->code == PK_CLIENT_ERROR_FAILED_AUTH) {
- message = g_strdup (_("Authorization could not be obtained"));
- } else {
- message = g_strdup_printf (_("The error was: %s"), error_local->message);
- }
-
/* display and set */
text = g_strdup_printf ("%s: %s", _("Failed to update system"), message);
- gpk_client_error_msg (gclient, _("Failed to update system"), text, error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to update system"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
/* if we are not showing UI, then notify the user what we are doing (just on the active terminal) */
ret = gconf_client_get_bool (gclient->priv->gconf_client, GPK_CONF_NOTIFY_CRITICAL, NULL);
@@ -2127,7 +2334,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset resolve"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
@@ -2138,24 +2345,15 @@
/* wrap update, but handle all the GPG and EULA stuff */
ret = pk_client_refresh_cache (gclient->priv->client_action, TRUE, &error_local);
if (!ret) {
- /* print a proper error if we have it */
- if (error_local->code == PK_CLIENT_ERROR_FAILED_AUTH) {
- message = g_strdup (_("Authorisation could not be obtained"));
- } else {
- message = g_strdup_printf (_("The error was: %s"), error_local->message);
- }
-
/* display and set */
- text = g_strdup_printf ("%s: %s", _("Failed to update package lists"), message);
- gpk_client_error_msg (gclient, _("Failed to update package lists"), text, NULL);
+ gpk_client_error_msg (gclient, _("Failed to update package lists"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
@@ -2186,7 +2384,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset get-updates"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
@@ -2195,18 +2393,17 @@
/* wrap update, but handle all the GPG and EULA stuff */
ret = pk_client_get_updates (gclient->priv->client_action, PK_FILTER_ENUM_NONE, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Getting update lists failed"), _("Failed to get updates"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to get updates"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
/* ignore this if it's uninteresting */
if (gclient->priv->show_progress) {
gpk_client_dialog_set_title (gclient->priv->dialog, _("Getting update lists"));
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
}
/* wait for an answer */
@@ -2238,7 +2435,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset get-distro-upgrades"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
@@ -2253,17 +2450,15 @@
/* wrap update, but handle all the GPG and EULA stuff */
ret = pk_client_get_distro_upgrades (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Getting update lists failed"),
- _("Getting the list of distribution upgrades failed"), error_local->message);
+ gpk_client_error_msg (gclient, _("Getting update lists failed"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
gpk_client_dialog_set_title (gclient->priv->dialog, _("Getting distribution upgrade information"));
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
@@ -2286,7 +2481,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset get-file-list"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
g_error_free (error_local);
return FALSE;
@@ -2297,16 +2492,15 @@
ret = pk_client_get_files (gclient->priv->client_action, package_ids, &error_local);
g_strfreev (package_ids);
if (!ret) {
- gpk_client_error_msg (gclient, _("Getting file list failed"), _("Failed to get file list"), error_local->message);
+ gpk_client_error_msg (gclient, _("Getting file list failed"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
gpk_client_dialog_set_title (gclient->priv->dialog, _("Getting file lists"));
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
@@ -2330,7 +2524,6 @@
{
gboolean ret = TRUE;
GError *error_local = NULL;
- gchar *text = NULL;
gchar *message = NULL;
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
@@ -2338,7 +2531,7 @@
/* reset */
ret = pk_client_reset (gclient->priv->client_action, &error_local);
if (!ret) {
- gpk_client_error_msg (gclient, _("Failed to reset client"), _("Failed to reset resolve"), error_local->message);
+ gpk_client_error_msg (gclient, _("Failed to reset action client"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
goto out;
}
@@ -2346,25 +2539,16 @@
/* wrap update, but handle all the GPG and EULA stuff */
ret = pk_client_update_packages (gclient->priv->client_action, package_ids, &error_local);
if (!ret) {
- /* print a proper error if we have it */
- if (error_local->code == PK_CLIENT_ERROR_FAILED_AUTH) {
- message = g_strdup (_("Authorisation could not be obtained"));
- } else {
- message = g_strdup_printf (_("The error was: %s"), error_local->message);
- }
-
/* display and set */
- text = g_strdup_printf ("%s: %s", _("Failed to update packages"), message);
- gpk_client_error_msg (gclient, _("Failed to update packages"), text, NULL);
+ gpk_client_error_msg (gclient, _("Failed to update packages"), error_local);
gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, message);
goto out;
}
/* setup the UI */
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
gpk_client_dialog_set_title (gclient->priv->dialog, _("Update packages"));
if (gclient->priv->show_progress)
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
@@ -2376,7 +2560,6 @@
if (error_local != NULL)
g_error_free (error_local);
g_free (message);
- g_free (text);
return ret;
}
@@ -2475,7 +2658,7 @@
g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
/* go back to the UI */
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
gclient->priv->using_secondary_client = FALSE;
egg_debug ("trying to requeue install");
@@ -2621,11 +2804,10 @@
role == PK_ROLE_ENUM_SEARCH_FILE ||
role == PK_ROLE_ENUM_SEARCH_NAME ||
role == PK_ROLE_ENUM_GET_UPDATES) {
- gpk_client_dialog_set_show_message (gclient->priv->dialog, FALSE);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0, 0);
} else {
- gpk_client_dialog_set_show_message (gclient->priv->dialog, TRUE);
+ gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, GPK_CLIENT_DIALOG_PACKAGE_PADDING, 0);
}
- gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_PROGRESS, 0);
/* wait for an answer */
g_main_loop_run (gclient->priv->loop);
Modified: trunk/src/gpk-common.h
==============================================================================
--- trunk/src/gpk-common.h (original)
+++ trunk/src/gpk-common.h Thu Sep 18 10:55:08 2008
@@ -55,6 +55,10 @@
#define GPK_CONF_APPLICATION_FILTER_NEWEST "/apps/gnome-packagekit/application/filter_newest"
#define GPK_CONF_UPDATE_VIEWER_PRECACHE_DETAILS "/apps/gnome-packagekit/update_viewer/precache_details"
+#define GPK_CONF_ENABLE_FONT_HELPER "/apps/gnome-packagekit/interface/enable_font_helper"
+#define GPK_CONF_ENABLE_CODEC_HELPER "/apps/gnome-packagekit/interface/enable_codec_helper"
+#define GPK_CONF_ENABLE_MIME_TYPE_HELPER "/apps/gnome-packagekit/interface/enable_mime_type_helper"
+
#define GPK_BUGZILLA_URL "https://bugs.freedesktop.org/"
#define GPK_ICON_SOFTWARE_UPDATE "system-software-update"
Modified: trunk/src/gpk-dbus.c
==============================================================================
--- trunk/src/gpk-dbus.c (original)
+++ trunk/src/gpk-dbus.c Thu Sep 18 10:55:08 2008
@@ -432,7 +432,7 @@
/* unwrap and turn into a GPtrArray */
array = g_ptr_array_new ();
for (i=0; i<codecs->len; i++) {
- varray = (GValueArray *) g_ptr_array_index (codecs, 0);
+ varray = (GValueArray *) g_ptr_array_index (codecs, i);
value = g_value_array_get_nth (varray, 0);
description = g_value_dup_string (value);
value = g_value_array_get_nth (varray, 1);
Modified: trunk/src/gpk-interface.h
==============================================================================
--- trunk/src/gpk-interface.h (original)
+++ trunk/src/gpk-interface.h Thu Sep 18 10:55:08 2008
@@ -53,7 +53,7 @@
#endif /* !G_ENABLE_DEBUG */
-/* NONE:UINT,UINT,STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.CPEMHU:1) */
+/* NONE:UINT,UINT,STRING,POINTER (/tmp/dbus-binding-tool-c-marshallers.3LDXHU:1) */
extern void dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_STRING_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
@@ -101,7 +101,7 @@
}
#define dbus_glib_marshal_gpk_dbus_NONE__UINT_UINT_STRING_POINTER dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_STRING_POINTER
-/* NONE:UINT,UINT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.CPEMHU:2) */
+/* NONE:UINT,UINT,BOXED,POINTER (/tmp/dbus-binding-tool-c-marshallers.3LDXHU:2) */
extern void dbus_glib_marshal_gpk_dbus_VOID__UINT_UINT_BOXED_POINTER (GClosure *closure,
GValue *return_value,
guint n_param_values,
Modified: trunk/src/gpk-self-test.c
==============================================================================
--- trunk/src/gpk-self-test.c (original)
+++ trunk/src/gpk-self-test.c Thu Sep 18 10:55:08 2008
@@ -42,9 +42,9 @@
egg_debug_init (TRUE);
/* tests go here */
- egg_string_test (test);
- gpk_common_test (test);
- gpk_dbus_test (test);
+// egg_string_test (test);
+// gpk_common_test (test);
+// gpk_dbus_test (test);
gpk_client_dialog_test (test);
return egg_test_finish (test);
Modified: trunk/src/gpk-update-viewer.c
==============================================================================
--- trunk/src/gpk-update-viewer.c (original)
+++ trunk/src/gpk-update-viewer.c Thu Sep 18 10:55:08 2008
@@ -642,6 +642,7 @@
gpk_client_set_interaction (gclient, GPK_CLIENT_INTERACT_NEVER);
list = gpk_client_get_updates (gclient, &error);
if (list == NULL) {
+ gpk_update_viewer_description_animation_stop ();
egg_warning ("failed: %s", error->message);
g_error_free (error);
goto out;
@@ -692,7 +693,8 @@
gpk_update_viewer_description_animation_stop ();
out:
- g_object_unref (list);
+ if (list != NULL)
+ g_object_unref (list);
}
/**
Modified: trunk/src/gpk-watch.c
==============================================================================
--- trunk/src/gpk-watch.c (original)
+++ trunk/src/gpk-watch.c Thu Sep 18 10:55:08 2008
@@ -266,7 +266,7 @@
GpkWatch *watch = GPK_WATCH (data);
if (egg_strequal (action, "do-not-show-notify-complete")) {
- egg_debug ("set %s to FALSE", GPK_CONF_PROMPT_FIRMWARE);
+ egg_debug ("set %s to FALSE", GPK_CONF_NOTIFY_COMPLETED);
gconf_client_set_bool (watch->priv->gconf_client, GPK_CONF_NOTIFY_COMPLETED, FALSE, NULL);
} else if (egg_strequal (action, "show-error-details")) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]