[gnome-shell] Add a variant of the Restart dialog for offline updates



commit a0fa9937ba0ae8ed961bab8e9471ad569c5ae652
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 26 00:52:41 2013 -0400

    Add a variant of the Restart dialog for offline updates
    
    Detect when an offline update is pending, and show a more
    suitable message in the Restart dialog.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706612

 js/ui/endSessionDialog.js |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index 61e4d6b..3e7f826 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -104,10 +104,25 @@ const restartDialogContent = {
     iconStyleClass: 'end-session-dialog-shutdown-icon'
 };
 
+const restartInstallDialogContent = {
+
+    subject: C_("title", "Restart & Install Updates"),
+    description: function(seconds) {
+        return ngettext("The system will automatically restart and install updates in %d second.",
+                        "The system will automatically restart and install updates in %d seconds.",
+                        seconds).format(seconds);
+    },
+    confirmButtons: [{ signal: 'ConfirmedReboot',
+                       label:  C_("button", "Restart & Install") }],
+    iconName: 'view-refresh-symbolic',
+    iconStyleClass: 'end-session-dialog-shutdown-icon'
+};
+
 const DialogContent = {
     0 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_LOGOUT */: logoutDialogContent,
     1 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_SHUTDOWN */: shutdownDialogContent,
-    2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */: restartDialogContent
+    2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */: restartDialogContent,
+    3: restartInstallDialogContent
 };
 
 const MAX_USERS_IN_SESSION_DIALOG = 5;
@@ -192,6 +207,7 @@ const EndSessionDialog = new Lang.Class({
         this._loginManager = LoginManager.getLoginManager();
         this._userManager = AccountsService.UserManager.get_default();
         this._user = this._userManager.get_user(GLib.get_user_name());
+        this._updatesFile = Gio.File.new_for_path('/system-update');
 
         this._secondsLeft = 0;
         this._totalSecondsToStayOpen = 0;
@@ -273,6 +289,9 @@ const EndSessionDialog = new Lang.Class({
         if (!open)
             return;
 
+        if (this._type == 2 && this._updatesFile.query_exists(null))
+            this._type = 3;
+
         let dialogContent = DialogContent[this._type];
 
         let subject = dialogContent.subject;


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