[gnome-packagekit] Support the two new require-restart enumerated types



commit f1c73f610ef0b42d22f9b94ddab09b5d84dc0fea
Author: Richard Hughes <richard hughsie com>
Date:   Sat Jul 11 16:54:53 2009 +0100

    Support the two new require-restart enumerated types

 src/gpk-enum.c |   16 ++++++++++++++++
 src/gpk-enum.h |    6 ++++++
 2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/gpk-enum.c b/src/gpk-enum.c
index f5fd676..60dfa7f 100644
--- a/src/gpk-enum.c
+++ b/src/gpk-enum.c
@@ -209,6 +209,8 @@ static const PkEnumMatch enum_restart_icon_name[] = {
 	{PK_RESTART_ENUM_SYSTEM,		"system-shutdown"},
 	{PK_RESTART_ENUM_SESSION,		"system-log-out"},
 	{PK_RESTART_ENUM_APPLICATION,		"emblem-symbolic-link"},
+	{PK_RESTART_ENUM_SECURITY_SYSTEM,	"system-shutdown"},
+	{PK_RESTART_ENUM_SECURITY_SESSION,	"system-log-out"},
 	{0, NULL}
 };
 
@@ -218,6 +220,8 @@ static const PkEnumMatch enum_restart_dialog_icon_name[] = {
 	{PK_RESTART_ENUM_SYSTEM,		"dialog-error"},
 	{PK_RESTART_ENUM_SESSION,		"dialog-warning"},
 	{PK_RESTART_ENUM_APPLICATION,		"dialog-warning"},
+	{PK_RESTART_ENUM_SECURITY_SYSTEM,	"dialog-error"},
+	{PK_RESTART_ENUM_SECURITY_SESSION,	"dialog-error"},
 	{0, NULL}
 };
 
@@ -709,6 +713,12 @@ gpk_restart_enum_to_localised_text_future (PkRestartEnum restart)
 	case PK_RESTART_ENUM_SYSTEM:
 		text = _("A restart will be required");
 		break;
+	case PK_RESTART_ENUM_SECURITY_SESSION:
+		text = _("You will be required to log out and back in due to a security update");
+		break;
+	case PK_RESTART_ENUM_SECURITY_SYSTEM:
+		text = _("A restart will be required due to a security update");
+		break;
 	default:
 		egg_warning ("restart unrecognised: %i", restart);
 	}
@@ -735,6 +745,12 @@ gpk_restart_enum_to_localised_text (PkRestartEnum restart)
 	case PK_RESTART_ENUM_APPLICATION:
 		text = _("You need to restart the application");
 		break;
+	case PK_RESTART_ENUM_SECURITY_SESSION:
+		text = _("You need to log out and log back in to remain secure, as important security updates have recently been installed");
+		break;
+	case PK_RESTART_ENUM_SECURITY_SYSTEM:
+		text = _("A restart is required to remain secure, as important security updates have recently been installed");
+		break;
 	default:
 		egg_warning ("restart unrecognised: %i", restart);
 	}
diff --git a/src/gpk-enum.h b/src/gpk-enum.h
index 8a21365..4958019 100644
--- a/src/gpk-enum.h
+++ b/src/gpk-enum.h
@@ -105,6 +105,12 @@ typedef guint PkMediaTypeEnum;
 #define pk_client_set_only_trusted(c,t)
 #endif
 
+/* constants defined in 0.5.1 */
+#if (!PK_CHECK_VERSION(0,5,1))
+#define PK_RESTART_ENUM_SECURITY_SESSION		(PK_RESTART_ENUM_SYSTEM + 1)
+#define PK_RESTART_ENUM_SECURITY_SYSTEM			(PK_RESTART_ENUM_SECURITY_SESSION + 1)
+#endif
+
 void		 gpk_enum_test				(gpointer	 data);
 const gchar	*gpk_role_enum_to_localised_past	(PkRoleEnum	 role)
 							 G_GNUC_CONST;



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