gnome-packagekit r320 - in trunk: data src



Author: rhughes
Date: Fri Oct  3 13:44:40 2008
New Revision: 320
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=320&view=rev

Log:
from git

Modified:
   trunk/data/gnome-packagekit.schemas.in
   trunk/data/gpk-client.glade
   trunk/src/Makefile.am
   trunk/src/gpk-client-dialog.c
   trunk/src/gpk-client-dialog.h
   trunk/src/gpk-client.c
   trunk/src/gpk-enum.c

Modified: trunk/data/gnome-packagekit.schemas.in
==============================================================================
--- trunk/data/gnome-packagekit.schemas.in	(original)
+++ trunk/data/gnome-packagekit.schemas.in	Fri Oct  3 13:44:40 2008
@@ -30,7 +30,7 @@
       <applyto>/apps/gnome-packagekit/enable_check_hardware</applyto>
       <owner>gnome-packagekit</owner>
       <type>bool</type>
-      <default>true</default>
+      <default>false</default>
       <locale name="C">
         <short>Ask the user if additional hardware drivers should be installed</short>
         <long>Ask the user if additional hardware drivers should be installed</long>

Modified: trunk/data/gpk-client.glade
==============================================================================
--- trunk/data/gpk-client.glade	(original)
+++ trunk/data/gpk-client.glade	Fri Oct  3 13:44:40 2008
@@ -127,14 +127,13 @@
                   <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="hscrollbar_policy">GTK_POLICY_AUTOMATIC</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>
@@ -173,7 +172,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="label" translatable="no">gtk-cancel</property>
+                <property name="label">gtk-cancel</property>
                 <property name="use_stock">True</property>
                 <property name="response_id">0</property>
               </widget>
@@ -186,7 +185,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="label" translatable="no">gtk-close</property>
+                <property name="label">gtk-close</property>
                 <property name="use_stock">True</property>
                 <property name="response_id">0</property>
               </widget>

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Fri Oct  3 13:44:40 2008
@@ -63,6 +63,8 @@
 	gpk-consolekit.h				\
 	gpk-dialog.c					\
 	gpk-dialog.h					\
+	gpk-vendor.c					\
+	gpk-vendor.h					\
 	gpk-client.c					\
 	gpk-client.h					\
 	gpk-client-dialog.c				\

Modified: trunk/src/gpk-client-dialog.c
==============================================================================
--- trunk/src/gpk-client-dialog.c	(original)
+++ trunk/src/gpk-client-dialog.c	Fri Oct  3 13:44:40 2008
@@ -163,9 +163,11 @@
 	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));
 
+	/* always force width */
+	gpk_client_dialog_show_widget (dialog, "label_force_width", TRUE);
+
 	/* show */
 	widget = glade_xml_get_widget (dialog->priv->glade_xml, "window_client");
 	gtk_widget_realize (widget);
@@ -767,6 +769,12 @@
 	widget = glade_xml_get_widget (dialog->priv->glade_xml, "button_cancel");
 	g_signal_connect (widget, "clicked", G_CALLBACK (gpk_client_dialog_button_cancel_cb), dialog);
 
+	/* set the message text an absolute width so it's forced to wrap */
+	widget = glade_xml_get_widget (dialog->priv->glade_xml, "hbox_message");
+	gtk_widget_set_size_request (widget, 400, -1);
+	widget = glade_xml_get_widget (dialog->priv->glade_xml, "label_message");
+	gtk_widget_set_size_request (widget, 400, -1);
+
 	/* clear status and progress text */
 	gpk_client_dialog_set_window_title (dialog, "");
 	gpk_client_dialog_set_title (dialog, "");

Modified: trunk/src/gpk-client-dialog.h
==============================================================================
--- trunk/src/gpk-client-dialog.h	(original)
+++ trunk/src/gpk-client-dialog.h	Fri Oct  3 13:44:40 2008
@@ -71,6 +71,7 @@
 /* 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)
+#define GPK_CLIENT_DIALOG_BUTTON_ACTION		pk_bitfield_value (GPK_CLIENT_DIALOG_WIDGET_BUTTON_ACTION)
 
 typedef struct _GpkClientDialogPrivate	 GpkClientDialogPrivate;
 typedef struct _GpkClientDialog		 GpkClientDialog;

Modified: trunk/src/gpk-client.c
==============================================================================
--- trunk/src/gpk-client.c	(original)
+++ trunk/src/gpk-client.c	Fri Oct  3 13:44:40 2008
@@ -63,6 +63,7 @@
 #include "gpk-animated-icon.h"
 #include "gpk-client-dialog.h"
 #include "gpk-dialog.h"
+#include "gpk-vendor.h"
 #include "gpk-enum.h"
 #include "gpk-x11.h"
 
@@ -84,6 +85,7 @@
 	PkClient		*client_secondary;
 	GConfClient		*gconf_client;
 	GpkClientDialog		*dialog;
+	GpkVendor		*vendor;
 	guint			 finished_timer_id;
 	PkExtra			*extra;
 	PkControl		*control;
@@ -607,10 +609,10 @@
 	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");
+			message = _("You don't have the necessary privileges to perform this action.");
 			gpk_client_dialog_set_help_id (gclient->priv->dialog, "dialog-permissions");
 		} else if (error->code == PK_CLIENT_ERROR_CANNOT_START_DAEMON) {
-			message = _("The packagekitd service could not be started");
+			message = _("The packagekitd service could not be started.");
 			gpk_client_dialog_set_help_id (gclient->priv->dialog, "dialog-no-service");
 		} else {
 			details = error->message;
@@ -1467,6 +1469,8 @@
 {
 	gboolean ret;
 	GError *error_local = NULL;
+	GtkResponseType button;
+	gchar *info_url;
 	gchar **package_ids = NULL;
 	gchar *message;
 	const PkPackageObj *obj;
@@ -1544,11 +1548,21 @@
 			//FIXME: shows package_id in UI
 			text = pk_package_ids_to_text (packages);
 			title = g_strdup_printf (_("Could not find %s"), text);
+			info_url = gpk_vendor_get_not_found_url (gclient->priv->vendor, GPK_VENDOR_URL_TYPE_DEFAULT);
 			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_set_help_id (gclient->priv->dialog, "dialog-package-not-found");
-			gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
-			gpk_client_dialog_run (gclient->priv->dialog);
+			gpk_client_dialog_set_action (gclient->priv->dialog, _("More information"));
+
+			/* only show the "more info" button if there is a valid link */
+			if (info_url != NULL)
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, GPK_CLIENT_DIALOG_BUTTON_ACTION, 0);
+			else
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+			button = gpk_client_dialog_run (gclient->priv->dialog);
+			if (button == GTK_RESPONSE_OK)
+				gpk_gnome_open (info_url);
+			g_free (info_url);
 			g_free (text);
 			g_free (title);
 		}
@@ -1641,6 +1655,8 @@
 	gchar *package_id = NULL;
 	PkPackageList *list = NULL;
 	const PkPackageObj *obj;
+	GtkResponseType button;
+	gchar *info_url;
 	PkPackageId *id = NULL;
 	gchar **package_ids = NULL;
 	gchar *text;
@@ -1696,11 +1712,19 @@
 	len = pk_package_list_get_size (list);
 	if (len == 0) {
 		if (gclient->priv->show_warning) {
+			info_url = gpk_vendor_get_not_found_url (gclient->priv->vendor, GPK_VENDOR_URL_TYPE_DEFAULT);
 			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_set_help_id (gclient->priv->dialog, "dialog-package-not-found");
-			gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
-			gpk_client_dialog_run (gclient->priv->dialog);
+			/* only show the "more info" button if there is a valid link */
+			if (info_url != NULL)
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, GPK_CLIENT_DIALOG_BUTTON_ACTION, 0);
+			else
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+			button = gpk_client_dialog_run (gclient->priv->dialog);
+			if (button == GTK_RESPONSE_OK)
+				gpk_gnome_open (info_url);
+			g_free (info_url);
 		}
 		gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "no files found");
 		ret = FALSE;
@@ -1868,6 +1892,7 @@
 	gchar **parts;
 	GError *error_local = NULL;
 	GtkResponseType button;
+	gchar *info_url;
 	PkPackageList *list = NULL;
 	gchar **package_ids = NULL;
 	const gchar *title;
@@ -1919,11 +1944,19 @@
 		obj_new = gpk_client_install_gstreamer_codec_part (gclient, parts[0], parts[1], &error_local);
 		if (obj_new == NULL) {
 			if (gclient->priv->show_warning) {
+				info_url = gpk_vendor_get_not_found_url (gclient->priv->vendor, GPK_VENDOR_URL_TYPE_CODEC);
 				gpk_client_dialog_set_title (gclient->priv->dialog, _("Failed to search for plugin"));
 				gpk_client_dialog_set_message (gclient->priv->dialog, _("Could not find plugin in any configured software source"));
 				gpk_client_dialog_set_help_id (gclient->priv->dialog, "dialog-package-not-found");
-				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
-				gpk_client_dialog_run (gclient->priv->dialog);
+				/* only show the "more info" button if there is a valid link */
+				if (info_url != NULL)
+					gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, GPK_CLIENT_DIALOG_BUTTON_ACTION, 0);
+				else
+					gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+				button = gpk_client_dialog_run (gclient->priv->dialog);
+				if (button == GTK_RESPONSE_OK)
+					gpk_gnome_open (info_url);
+				g_free (info_url);
 			}
 			gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, error_local->message);
 			g_error_free (error_local);
@@ -2003,6 +2036,8 @@
 	gchar **package_ids = NULL;
 	guint len;
 	GtkWindow *window;
+	GtkResponseType button;
+	gchar *info_url;
 	gchar *message;
 
 	g_return_val_if_fail (GPK_IS_CLIENT (gclient), FALSE);
@@ -2070,11 +2105,19 @@
 	len = pk_package_list_get_size (list);
 	if (len == 0) {
 		if (gclient->priv->show_warning) {
+			info_url = gpk_vendor_get_not_found_url (gclient->priv->vendor, GPK_VENDOR_URL_TYPE_MIME);
 			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_set_help_id (gclient->priv->dialog, "dialog-package-not-found");
-			gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
-			gpk_client_dialog_run (gclient->priv->dialog);
+			/* only show the "more info" button if there is a valid link */
+			if (info_url != NULL)
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, GPK_CLIENT_DIALOG_BUTTON_ACTION, 0);
+			else
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+			button = gpk_client_dialog_run (gclient->priv->dialog);
+			if (button == GTK_RESPONSE_OK)
+				gpk_gnome_open (info_url);
+			g_free (info_url);
 		}
 		gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "nothing was found to handle mime type");
 		ret = FALSE;
@@ -2126,6 +2169,7 @@
 	gboolean ret;
 	PkPackageList *list = NULL;
 	GtkResponseType button;
+	gchar *info_url;
 	GError *error_local = NULL;
 	gchar **package_ids = NULL;
 	guint len;
@@ -2195,11 +2239,19 @@
 	len = pk_package_list_get_size (list);
 	if (len == 0) {
 		if (gclient->priv->show_warning) {
+			info_url = gpk_vendor_get_not_found_url (gclient->priv->vendor, GPK_VENDOR_URL_TYPE_FONT);
 			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_set_help_id (gclient->priv->dialog, "dialog-package-not-found");
-			gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
-			gpk_client_dialog_run (gclient->priv->dialog);
+			/* only show the "more info" button if there is a valid link */
+			if (info_url != NULL)
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, GPK_CLIENT_DIALOG_BUTTON_ACTION, 0);
+			else
+				gpk_client_dialog_show_page (gclient->priv->dialog, GPK_CLIENT_DIALOG_PAGE_WARNING, 0, 0);
+			button = gpk_client_dialog_run (gclient->priv->dialog);
+			if (button == GTK_RESPONSE_OK)
+				gpk_gnome_open (info_url);
+			g_free (info_url);
 		}
 		gpk_client_error_set (error, GPK_CLIENT_ERROR_FAILED, "failed to find font");
 		ret = FALSE;
@@ -3184,6 +3236,7 @@
 	gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
 					   PK_DATA G_DIR_SEPARATOR_S "icons");
 
+	gclient->priv->vendor = gpk_vendor_new ();
 	gclient->priv->dialog = gpk_client_dialog_new ();
 	gpk_client_dialog_set_window_icon (gclient->priv->dialog, "pk-package-installed");
 	g_signal_connect (gclient->priv->dialog, "cancel",
@@ -3273,6 +3326,7 @@
 	g_object_unref (gclient->priv->extra);
 	g_object_unref (gclient->priv->gconf_client);
 	g_object_unref (gclient->priv->dialog);
+	g_object_unref (gclient->priv->vendor);
 	g_main_loop_unref (gclient->priv->loop);
 
 	G_OBJECT_CLASS (gpk_client_parent_class)->finalize (object);

Modified: trunk/src/gpk-enum.c
==============================================================================
--- trunk/src/gpk-enum.c	(original)
+++ trunk/src/gpk-enum.c	Fri Oct  3 13:44:40 2008
@@ -192,6 +192,7 @@
 	{PK_GROUP_ENUM_SERVERS,			"network-server"},
 	{PK_GROUP_ENUM_SYSTEM,			"applications-system"},
 	{PK_GROUP_ENUM_VIRTUALIZATION,		"computer"},
+	{PK_GROUP_ENUM_VENDOR,			"application-certificate"},
 	{0, NULL}
 };
 
@@ -1299,6 +1300,9 @@
 	case PK_GROUP_ENUM_COLLECTIONS:
 		text = _("Package collections");
 		break;
+	case PK_GROUP_ENUM_VENDOR:
+		text = _("Vendor");
+		break;
 	case PK_GROUP_ENUM_UNKNOWN:
 		text = _("Unknown group");
 		break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]