gnome-packagekit r87 - in trunk: data src



Author: rhughes
Date: Sat Jan 26 16:45:16 2008
New Revision: 87
URL: http://svn.gnome.org/viewvc/gnome-packagekit?rev=87&view=rev

Log:
from git

Modified:
   trunk/data/pk-update-viewer.glade
   trunk/src/pk-common-gui.c
   trunk/src/pk-common-gui.h
   trunk/src/pk-notify.c
   trunk/src/pk-progress.c
   trunk/src/pk-update-viewer.c
   trunk/src/pk-watch.c

Modified: trunk/data/pk-update-viewer.glade
==============================================================================
--- trunk/data/pk-update-viewer.glade	(original)
+++ trunk/data/pk-update-viewer.glade	Sat Jan 26 16:45:16 2008
@@ -5,6 +5,7 @@
   <widget class="GtkWindow" id="window_updates">
     <property name="visible">True</property>
     <property name="title" translatable="yes">Update System</property>
+    <property name="resizable">False</property>
     <property name="modal">True</property>
     <property name="window_position">GTK_WIN_POS_CENTER</property>
     <property name="icon_name">system-software-update</property>
@@ -861,6 +862,179 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkVBox" id="vbox_confirm2">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="border_width">10</property>
+                <property name="spacing">5</property>
+                <child>
+                  <widget class="GtkHBox" id="hbox20">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <child>
+                      <widget class="GtkImage" id="image17">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="stock">gtk-dialog-error</property>
+                        <property name="icon_size">6</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="padding">20</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkVBox" id="vbox5">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="spacing">10</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox21">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <child>
+                              <widget class="GtkLabel" id="label_error_title">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label">&lt;b&gt;Update was cancelled&lt;/b&gt;</property>
+                                <property name="use_markup">True</property>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                              </packing>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkHBox" id="hbox22">
+                            <property name="visible">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <child>
+                              <widget class="GtkLabel" id="label_error_message">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label">The transaction was cancelled before any actions were taken</property>
+                              </widget>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                              </packing>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <widget class="GtkExpander" id="expander1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <child>
+                              <widget class="GtkHBox" id="hbox24">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label_error_details">
+                                    <property name="visible">True</property>
+                                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                    <property name="label">Geeky information about the error...</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                            </child>
+                            <child>
+                              <widget class="GtkLabel" id="label27">
+                                <property name="visible">True</property>
+                                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                                <property name="label" translatable="yes">&lt;b&gt;More details:&lt;/b&gt;</property>
+                                <property name="use_markup">True</property>
+                              </widget>
+                              <packing>
+                                <property name="type">label_item</property>
+                              </packing>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="padding">5</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+                <child>
+                  <widget class="GtkHButtonBox" id="hbuttonbox6">
+                    <property name="visible">True</property>
+                    <property name="spacing">5</property>
+                    <property name="layout_style">GTK_BUTTONBOX_END</property>
+                    <child>
+                      <widget class="GtkButton" id="button_help5">
+                        <property name="can_focus">True</property>
+                        <property name="can_default">True</property>
+                        <property name="label">gtk-help</property>
+                        <property name="use_stock">True</property>
+                        <property name="response_id">0</property>
+                      </widget>
+                      <packing>
+                        <property name="secondary">True</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkButton" id="button_close5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="can_default">True</property>
+                        <property name="label">gtk-close</property>
+                        <property name="use_stock">True</property>
+                        <property name="response_id">0</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label23">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Error</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="position">4</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </widget>
         </child>
         <child>

Modified: trunk/src/pk-common-gui.c
==============================================================================
--- trunk/src/pk-common-gui.c	(original)
+++ trunk/src/pk-common-gui.c	Sat Jan 26 16:45:16 2008
@@ -444,7 +444,7 @@
 	case PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE:
 		text = _("Could not remove a protected system package");
 		break;
-	case PK_ERROR_ENUM_PROCESS_QUIT:
+	case PK_ERROR_ENUM_TRANSACTION_CANCELLED:
 		text = _("The transaction was canceled");
 		break;
 	case PK_ERROR_ENUM_PROCESS_KILL:
@@ -466,6 +466,102 @@
 }
 
 /**
+ * pk_error_enum_to_localised_message:
+ **/
+const gchar *
+pk_error_enum_to_localised_message (PkErrorCodeEnum code)
+{
+	const gchar *text = NULL;
+	switch (code) {
+	case PK_ERROR_ENUM_NO_NETWORK:
+		text = _("There is no network connection available.\n"
+			 "Please check your connection settings and try again");
+		break;
+	case PK_ERROR_ENUM_NO_CACHE:
+		text = _("The package list needs to be rebuilt\nTODO:how?.");
+		break;
+	case PK_ERROR_ENUM_OOM:
+		text = _("The service that is responsible for handling user requests is out of memory.\nPlease restart your computer.");
+		break;
+	case PK_ERROR_ENUM_CREATE_THREAD_FAILED:
+		text = _("A thread could not be created to service the user request.");
+		break;
+	case PK_ERROR_ENUM_NOT_SUPPORTED:
+		text = _("The action is not supported by this backend\n"
+			 "Please report a bug as this shouldn't have happened.");
+		break;
+	case PK_ERROR_ENUM_INTERNAL_ERROR:
+		text = _("A problem that we were not expecting has occurred.\n"
+			 "Please report this bug with the error description.");
+		break;
+	case PK_ERROR_ENUM_GPG_FAILURE:
+		text = _("A security trust relationship could not be made with the remote software source\n"
+			 "Please check your security settings.");
+		break;
+	case PK_ERROR_ENUM_PACKAGE_NOT_INSTALLED:
+		text = _("The package that is trying to be removed or updated is not already installed, and hence nothing can be done.");
+		break;
+	case PK_ERROR_ENUM_PACKAGE_NOT_FOUND:
+		text = _("The package that is being modified was not found on your system or in any remote software source.");
+		break;
+	case PK_ERROR_ENUM_PACKAGE_ALREADY_INSTALLED:
+		text = _("The package that is trying to be installed is already installed.");
+		break;
+	case PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED:
+		text = _("The package download failed\nPlease check your network connectivity.");
+		break;
+	case PK_ERROR_ENUM_GROUP_NOT_FOUND:
+		text = _("The group type was not found\nPlease check your group list and try again.");
+		break;
+	case PK_ERROR_ENUM_DEP_RESOLUTION_FAILED:
+		text = _("A package could not be found on your system or in a remote software source that allows the transaction to complete\n"
+			 "More information is available in the detailed report.");
+		break;
+	case PK_ERROR_ENUM_FILTER_INVALID:
+		text = _("The search filter was not correctly formed.");
+		break;
+	case PK_ERROR_ENUM_PACKAGE_ID_INVALID:
+		text = _("The package ID was not well formed when sent to the server.\n"
+			 "This normally indicates an internal error and should be reported.");
+		break;
+	case PK_ERROR_ENUM_TRANSACTION_ERROR:
+		text = _("An unspecified transaction error has occurred.\n"
+			 "More information is available in the detailed report.");
+		break;
+	case PK_ERROR_ENUM_REPO_NOT_FOUND:
+		text = _("The remote software source name was not found\n"
+			 "You may need to disable an item in Software Sources");
+		break;
+	case PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE:
+		text = _("Removing a protected system package was denied, and thus the whole transaction failed.");
+		break;
+	case PK_ERROR_ENUM_TRANSACTION_CANCELLED:
+		text = _("The transaction was canceled successfully and no packages were changed.");
+		break;
+	case PK_ERROR_ENUM_PROCESS_KILL:
+		text = _("The transaction was canceled successfully and no packages were changed.\n"
+			 "The backend did not exit cleanly.");
+		break;
+	case PK_ERROR_ENUM_FAILED_INITIALIZATION:
+		text = _("The native package backend could not be initialised.\n"
+			 "Please make sure no other tools are accessing package information.");
+		break;
+	case PK_ERROR_ENUM_FAILED_FINALISE:
+		text = _("The native package backend could not be closed.\n"
+			 "Please make sure no other tools are accessing package information.");
+		break;
+	case PK_ERROR_ENUM_FAILED_CONFIG_PARSING:
+		text = _("The native package configuration file could not be opened.\n"
+			 "Please make sure configuration is valid.");
+		break;
+	default:
+		text = _("Unknown error, please report a bug.\n"
+			 "More information is available in the detailed report.");
+	}
+	return text;
+}
+
+/**
  * pk_restart_enum_to_localised_text_future:
  **/
 const gchar *

Modified: trunk/src/pk-common-gui.h
==============================================================================
--- trunk/src/pk-common-gui.h	(original)
+++ trunk/src/pk-common-gui.h	Sat Jan 26 16:45:16 2008
@@ -73,6 +73,7 @@
 const gchar	*pk_status_enum_to_icon_name		(PkStatusEnum	 status);
 const gchar	*pk_restart_enum_to_icon_name		(PkRestartEnum	 restart);
 const gchar	*pk_error_enum_to_localised_text	(PkErrorCodeEnum code);
+const gchar	*pk_error_enum_to_localised_message	(PkErrorCodeEnum code);
 const gchar	*pk_restart_enum_to_localised_text	(PkRestartEnum	 restart);
 const gchar	*pk_message_enum_to_icon_name		(PkMessageEnum	 message);
 const gchar	*pk_message_enum_to_localised_text	(PkMessageEnum	 message);

Modified: trunk/src/pk-notify.c
==============================================================================
--- trunk/src/pk-notify.c	(original)
+++ trunk/src/pk-notify.c	Sat Jan 26 16:45:16 2008
@@ -443,7 +443,7 @@
 	message = g_strdup_printf (ngettext ("The following important update is available for your computer:\n\n%s",
 					     "The following important updates are available for your computer:\n\n%s", number), details);
 
-	pk_debug ("Doing requires-restart notification");
+	pk_debug ("Doing critical updates warning: %s", message);
 	pk_smart_icon_notify_new (notify->priv->sicon, title, message, "software-update-urgent",
 				  PK_NOTIFY_URGENCY_CRITICAL, PK_NOTIFY_TIMEOUT_NEVER);
 	pk_smart_icon_notify_button (notify->priv->sicon, PK_NOTIFY_BUTTON_UPDATE_COMPUTER, NULL);
@@ -665,7 +665,7 @@
 
 	/* ignore some errors */
 	if (error_code == PK_ERROR_ENUM_PROCESS_KILL ||
-	    error_code == PK_ERROR_ENUM_PROCESS_QUIT) {
+	    error_code == PK_ERROR_ENUM_TRANSACTION_CANCELLED) {
 		pk_debug ("error ignored %s\n%s", title, details);
 		return;
 	}

Modified: trunk/src/pk-progress.c
==============================================================================
--- trunk/src/pk-progress.c	(original)
+++ trunk/src/pk-progress.c	Sat Jan 26 16:45:16 2008
@@ -160,7 +160,7 @@
 pk_progress_error_code_cb (PkClient *client, PkErrorCodeEnum code, const gchar *details, PkProgress *progress)
 {
 	/* ignore some errors */
-	if (code == PK_ERROR_ENUM_PROCESS_QUIT ||
+	if (code == PK_ERROR_ENUM_TRANSACTION_CANCELLED ||
 	    code == PK_ERROR_ENUM_PROCESS_KILL) {
 		pk_debug ("ignoring cancel error");
 		return;
@@ -521,6 +521,7 @@
 {
 	GtkWidget *main_window;
 	GtkWidget *widget;
+	PkEnumList *role_list;
 
 	progress->priv = PK_PROGRESS_GET_PRIVATE (progress);
 	progress->priv->task_ended = FALSE;
@@ -570,6 +571,16 @@
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (pk_progress_cancel_cb), progress);
 
+	/* get actions */
+	role_list = pk_client_get_actions (progress->priv->client);
+
+	/* can we ever do the action? */
+	if (pk_enum_list_contains (role_list, PK_ROLE_ENUM_CANCEL) == FALSE) {
+		gtk_widget_hide (widget);
+	}
+
+	g_object_unref (role_list);
+
 	widget = glade_xml_get_widget (progress->priv->glade_xml, "button_hide");
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (pk_progress_hide_cb), progress);

Modified: trunk/src/pk-update-viewer.c
==============================================================================
--- trunk/src/pk-update-viewer.c	(original)
+++ trunk/src/pk-update-viewer.c	Sat Jan 26 16:45:16 2008
@@ -104,6 +104,7 @@
 	PAGE_DETAILS,
 	PAGE_PROGRESS,
 	PAGE_CONFIRM,
+	PAGE_ERROR,
 	PAGE_LAST
 } PkPageEnum;
 
@@ -113,9 +114,17 @@
 static void
 pk_updates_set_page (PkPageEnum page)
 {
-	GtkWidget *notebook;
-	notebook = glade_xml_get_widget (glade_xml, "notebook_hidden");
-	gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), page);
+	GtkWidget *widget;
+	widget = glade_xml_get_widget (glade_xml, "notebook_hidden");
+	gtk_notebook_set_current_page (GTK_NOTEBOOK (widget), page);
+
+	/* some pages are resizeable */
+	widget = glade_xml_get_widget (glade_xml, "window_updates");
+	if (page == PAGE_DETAILS) {
+		gtk_window_set_resizable (GTK_WINDOW (widget), TRUE);
+	} else {
+		gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
+	}
 }
 
 /**
@@ -942,36 +951,30 @@
 }
 
 /**
- * pk_updates_error_message:
+ * pk_updates_error_code_cb:
  **/
 static void
-pk_updates_error_message (const gchar *title, const gchar *details)
+pk_updates_error_code_cb (PkClient *client, PkErrorCodeEnum code, const gchar *details, gpointer data)
 {
-	GtkWidget *main_window;
-	GtkWidget *dialog;
-	gchar *escaped_details;
+	GtkWidget *widget;
+	const gchar *title;
+	gchar *title_bold;
 
-	pk_warning ("error %s:%s", title, details);
-	main_window = glade_xml_get_widget (glade_xml, "window_updates");
+	/* set correct view */
+	pk_updates_set_page (PAGE_ERROR);
 
-	/* we need to format this */
-	escaped_details = pk_error_format_details (details);
+	/* set bold title */
+	widget = glade_xml_get_widget (glade_xml, "label_error_title");
+	title = pk_error_enum_to_localised_text (code);
+	title_bold = g_strdup_printf ("<b>%s</b>", title);
+	gtk_label_set_label (GTK_LABEL (widget), title_bold);
+	g_free (title_bold);
 
-	dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), GTK_DIALOG_DESTROY_WITH_PARENT,
-					 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, title);
-	gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog), escaped_details);
-	gtk_dialog_run (GTK_DIALOG (dialog));
-	gtk_widget_destroy (GTK_WIDGET (dialog));
-	g_free (escaped_details);
-}
+	widget = glade_xml_get_widget (glade_xml, "label_error_message");
+	gtk_label_set_label (GTK_LABEL (widget), pk_error_enum_to_localised_message (code));
 
-/**
- * pk_updates_error_code_cb:
- **/
-static void
-pk_updates_error_code_cb (PkClient *client, PkErrorCodeEnum code, const gchar *details, gpointer data)
-{
-	pk_updates_error_message (pk_error_enum_to_localised_text (code), details);
+	widget = glade_xml_get_widget (glade_xml, "label_error_details");
+	gtk_label_set_label (GTK_LABEL (widget), details);
 }
 
 /**
@@ -1102,11 +1105,19 @@
 	widget = glade_xml_get_widget (glade_xml, "button_close4");
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (pk_button_close_cb), loop);
+	widget = glade_xml_get_widget (glade_xml, "button_close5");
+	g_signal_connect (widget, "clicked",
+			  G_CALLBACK (pk_button_close_cb), loop);
 	widget = glade_xml_get_widget (glade_xml, "button_cancel");
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (pk_button_cancel_cb), loop);
 	gtk_widget_set_sensitive (widget, FALSE);
 
+	/* can we ever do the action? */
+	if (pk_enum_list_contains (role_list, PK_ROLE_ENUM_CANCEL) == FALSE) {
+		gtk_widget_hide (widget);
+	}
+
 	widget = glade_xml_get_widget (glade_xml, "button_review");
 	g_signal_connect (widget, "clicked",
 			  G_CALLBACK (pk_button_review_cb), loop);

Modified: trunk/src/pk-watch.c
==============================================================================
--- trunk/src/pk-watch.c	(original)
+++ trunk/src/pk-watch.c	Sat Jan 26 16:45:16 2008
@@ -339,7 +339,7 @@
 	if (error_code == PK_ERROR_ENUM_NOT_SUPPORTED ||
 	    error_code == PK_ERROR_ENUM_NO_NETWORK ||
 	    error_code == PK_ERROR_ENUM_PROCESS_KILL ||
-	    error_code == PK_ERROR_ENUM_PROCESS_QUIT) {
+	    error_code == PK_ERROR_ENUM_TRANSACTION_CANCELLED) {
 		pk_debug ("error ignored %s\n%s", title, details);
 		return;
 	}



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