Ignore:
Timestamp:
Jun 5, 2017, 1:17:02 PM (3 years ago)
Author:
hectorgh
Message:

fixed button click call when coming back from a different option

Location:
lliurex-session-manager/trunk/fuentes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lliurex-session-manager/trunk/fuentes/debian/changelog

    r2870 r5074  
     1lliurex-session-manager (0.5) xenial; urgency=high
     2
     3  * Fixed connect function when choosing a different option
     4
     5 -- Hector Garcia Huerta <hectorgh@gmail.com>  Mon, 05 Jun 2017 13:14:44 +0200
     6
    17lliurex-session-manager (0.4-1) xenial; urgency=medium
    28
  • lliurex-session-manager/trunk/fuentes/install-files/usr/bin/lliurex-session-manager

    r2869 r5074  
    3939                self.can_hibernate=True
    4040                self.can_switch=True
     41                self.handler_id=None
    4142               
    4243                #DBUS INIT
     
    247248                self.current_action_image.set_from_file(LOGOUT_RSRC)
    248249                self.current_action_label.set_text(_("Log out now"))
    249                 self.execute_now_button.connect("clicked",self.execute_now,self.logout)
     250                if self.handler_id!=None:
     251                        self.execute_now_button.disconnect(self.handler_id)
     252                self.handler_id=self.execute_now_button.connect("clicked",self.execute_now,self.logout)
    250253                GLib.timeout_add(10,self.wait_to_execute,_("Session will close in %s seconds..."),self.logout)
    251254                self.cancel_button.set_visible(False)
     
    268271                self.current_action_image.set_from_file(SUSPEND_RSRC)
    269272                self.current_action_label.set_text(_("Suspend now"))
    270                 self.execute_now_button.connect("clicked",self.execute_now,self.suspend)
     273                if self.handler_id!=None:
     274                        self.execute_now_button.disconnect(self.handler_id)
     275                self.handler_id=self.execute_now_button.connect("clicked",self.execute_now,self.suspend)
    271276                GLib.timeout_add(10,self.wait_to_execute,_("System will suspend in %s seconds..."),self.suspend)
    272277                self.cancel_button.set_visible(False)
     
    280285                self.current_action_image.set_from_file(HIBERNATE_RSRC)
    281286                self.current_action_label.set_text(_("Hibernate now"))
    282                 self.execute_now_button.connect("clicked",self.execute_now,self.hibernate)
     287                if self.handler_id!=None:
     288                        self.execute_now_button.disconnect(self.handler_id)
     289                self.handler_id=self.execute_now_button.connect("clicked",self.execute_now,self.hibernate)
    283290                GLib.timeout_add(10,self.wait_to_execute,_("System will hibernate in %s seconds..."),self.hibernate)
    284291                self.cancel_button.set_visible(False)
     
    293300                self.current_action_image.set_from_file(REBOOT_RSRC)
    294301                self.current_action_label.set_text(_("Reboot now"))
    295                 self.execute_now_button.connect("clicked",self.execute_now,self.reboot)
     302                if self.handler_id!=None:
     303                        self.execute_now_button.disconnect(self.handler_id)
     304                self.handler_id=self.execute_now_button.connect("clicked",self.execute_now,self.reboot)
    296305                GLib.timeout_add(10,self.wait_to_execute,_("System will reboot in %s seconds..."),self.reboot)
    297306                self.cancel_button.set_visible(False)
     
    305314                self.current_action_image.set_from_file(SHUTDOWN_RSRC)
    306315                self.current_action_label.set_text(_("Shutdown now"))
    307                 self.execute_now_button.connect("clicked",self.execute_now,self.shutdown)
     316                if self.handler_id!=None:
     317                        self.execute_now_button.disconnect(self.handler_id)
     318                self.handler_id=self.execute_now_button.connect("clicked",self.execute_now,self.shutdown)
    308319                GLib.timeout_add(10,self.wait_to_execute,_("System will shutdown in %s seconds..."),self.shutdown)
    309320                self.cancel_button.set_visible(False)
Note: See TracChangeset for help on using the changeset viewer.