Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #427: sugar-427.patch

File sugar-427.patch, 1.4 KB (added by alsroot, 4 years ago)
  • src/sugar/activity/activity.py

    From 61b27c8c3dcb8c858519548f31bf24886cd7882f Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Wed, 23 Sep 2009 15:38:31 +0000
    Subject: Doesnt shutdown or restart, when an activity shows 'all changes will be lost' error message #427
    
    ---
     src/sugar/activity/activity.py |    8 +++++---
     1 files changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
    index 9c9fde8..f483774 100644
    a b  
    420420    def __session_quit_requested_cb(self, session): 
    421421        self._quit_requested = True 
    422422 
    423         if not self._prepare_close(): 
    424             session.will_quit(self, False) 
    425         elif not self._updating_jobject: 
     423        if self._prepare_close() and not self._updating_jobject: 
    426424            session.will_quit(self, True) 
    427425 
    428426    def __session_quit_cb(self, client): 
     
    755753        self.remove_alert(alert) 
    756754        if response_id == gtk.RESPONSE_OK: 
    757755            self.close(skip_save=True) 
     756            if self._quit_requested: 
     757                self._session.will_quit(self, True) 
     758        elif self._quit_requested: 
     759            self._session.will_quit(self, False) 
    758760 
    759761    def can_close(self): 
    760762        """Activities should override this function if they want to perform