[gnome-shell] Revert "Revert "modalDialog: Destroy dialogs on close""



commit 7c21ab0985527066b4fccfd38526c896d5f58ee2
Author: Ray Strode <rstrode redhat com>
Date:   Sat Apr 6 10:53:11 2013 -0400

    Revert "Revert "modalDialog: Destroy dialogs on close""
    
    This reverts commit 007820b7c119d4cdb6d1a5bfb2d695ebc532bd5e.
    
    (I only meant to revert that in my local branch)

 js/ui/endSessionDialog.js |    3 ++-
 js/ui/modalDialog.js      |    7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index b7850a4..d322581 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -225,7 +225,8 @@ const EndSessionDialog = new Lang.Class({
     Extends: ModalDialog.ModalDialog,
 
     _init: function() {
-        this.parent({ styleClass: 'end-session-dialog' });
+        this.parent({ styleClass: 'end-session-dialog',
+                      destroyOnClose: false });
 
         this._user = AccountsService.UserManager.get_default().get_user(GLib.get_user_name());
 
diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js
index 304733e..beac7fe 100644
--- a/js/ui/modalDialog.js
+++ b/js/ui/modalDialog.js
@@ -38,13 +38,15 @@ const ModalDialog = new Lang.Class({
                                         styleClass: null,
                                         parentActor: Main.uiGroup,
                                         keybindingMode: Shell.KeyBindingMode.SYSTEM_MODAL,
-                                        shouldFadeIn: true });
+                                        shouldFadeIn: true,
+                                        destroyOnClose: true });
 
         this.state = State.CLOSED;
         this._hasModal = false;
         this._keybindingMode = params.keybindingMode;
         this._shellReactive = params.shellReactive;
         this._shouldFadeIn = params.shouldFadeIn;
+        this._destroyOnClose = params.destroyOnClose;
 
         this._group = new St.Widget({ visible: false,
                                       x: 0,
@@ -277,6 +279,9 @@ const ModalDialog = new Lang.Class({
                                    this.state = State.CLOSED;
                                    this._group.hide();
                                    this.emit('closed');
+
+                                   if (this._destroyOnClose)
+                                       this.destroy();
                                })
                          });
     },


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