Ticket #37: guake.py.patch
| File guake.py.patch, 3.8 KB (added by pingou, 4 years ago) |
|---|
-
.py
old new 221 221 ac = self.client.get_bool(GCONF_PATH + 'general/use_scrollbar') 222 222 self.get_widget('show-scrollbar-checkbutton').set_active(ac) 223 223 224 # tray 225 ac = self.client.get_bool(GCONF_PATH + 'general/use_tray') 226 self.get_widget('show-tray-checkbutton').set_active(ac) 227 228 224 229 # hide on lost focus 225 230 ac = self.client.get_bool(GCONF_PATH + 'general/hide_on_lost_focus') 226 231 self.get_widget('hide-onlostfocus-checkbutton').set_active(ac) … … 343 348 fbool = chk.get_active() 344 349 self.client.set_bool(GCONF_PATH + 'general/use_scrollbar', fbool) 345 350 self.guake.toggle_scrollbars() 346 351 352 def on_show_tray_checkbutton_toggled(self, chk): 353 fbool = chk.get_active() 354 self.client.set_bool(GCONF_PATH + 'general/use_tray', fbool) 355 self.guake.toggle_tray() 356 347 357 def on_chk_lostfocus_toggled(self, chk): 348 358 fbool = chk.get_active() 349 359 self.client.set_bool(GCONF_PATH + 'general/hide_on_lost_focus', fbool) … … 574 584 # setting global hotkey and showing a pretty notification =) 575 585 globalhotkeys.init() 576 586 key = self.client.get_string(GHOTKEYS[0][0]) 577 filename = common.pixmapfile('guake-notification.png')578 if not globalhotkeys.bind(key, self.show_hide):579 n = pynotify.Notification(_('Guake!'),580 _('A problem happened when binding <b>%s</b> key.\n'581 'Please use guake properties form to choose another '582 'key') % key, filename)583 else:584 n = pynotify.Notification(_('Guake!'),585 _('Guake is already running,\n'586 'press <b>%s</b> to use it.') % key, filename)587 n.show()588 587 589 588 # trayicon! 590 tray_icon = GuakeStatusIcon() 591 tray_icon.connect('popup-menu', self.show_menu) 592 tray_icon.connect('activate', self.show_hide) 593 tray_icon.show_all() 589 ac = self.client.get_bool(GCONF_PATH + 'general/use_tray') 590 if ac==True: 591 tray_icon = GuakeStatusIcon() 592 tray_icon = tray_icon.set_tray() 593 tray_icon.connect('popup-menu', self.show_menu) 594 tray_icon.connect('activate', self.show_hide) 595 tray_icon.show_all() 594 596 595 597 # adding images from a different path. 596 598 ipath = common.pixmapfile('guake.png') … … 641 643 self.add_tab() 642 644 self.toggle_ontop() 643 645 646 # pop up that guake is working (or not) 647 filename = common.pixmapfile('guake-notification.png') 648 if not globalhotkeys.bind(key, self.show_hide): 649 n = pynotify.Notification(_('Guake!'), 650 _('A problem happened when binding <b>%s</b> key.\n' 651 'Please use guake properties form to choose another ' 652 'key') % key, filename) 653 else: 654 n = pynotify.Notification(_('Guake!'), 655 _('Guake is already running,\n' 656 'press <b>%s</b> to use it.') % key, filename) 657 658 n.show() 659 644 660 def on_window_lostfocus(self,window, event): 645 661 getb = lambda x:self.client.get_bool(x) 646 662 value = getb(GCONF_PATH+'general/hide_on_lost_focus') … … 849 865 b = self.client.get_bool(GCONF_PATH+'general/window_ontop') 850 866 self.window.set_keep_above(b) 851 867 868 def toggle_tray(self): 869 b = self.client.get_bool(GCONF_PATH+'general/use_tray') 870 if b==False: 871 try: 872 tray_icon = GuakeStatusIcon() 873 # To be fixed does not work yet, should remove all the tray 874 tray_icon.hide_all() 875 except: 876 pass 877 852 878 # -- format functions -- 853 879 854 880 def set_bgcolor(self):