def __toggle_callback(self, cell, path): """Callback function to toggle option""" options.toggle(path) if online_update_notification_enabled: self.cb_beta.set_sensitive(options.get('check_online_updates')) if 'nt' == os.name: self.cb_winapp2.set_sensitive( options.get('check_online_updates')) if 'auto_hide' == path: self.cb_refresh_operations() if 'auto_start' == path: if 'nt' == os.name: swc = Windows.start_with_computer if 'posix' == os.name: swc = Unix.start_with_computer try: swc(options.get(path)) except: traceback.print_exc() dlg = gtk.MessageDialog(self.parent, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format=str(sys.exc_info()[1])) dlg.run() dlg.destroy()
def __toggle_callback(self, cell, path): global win10_provider """Callback function to toggle option""" options.toggle(path) if online_update_notification_enabled: self.cb_beta.set_sensitive(options.get('check_online_updates')) if 'nt' == os.name: self.cb_winapp2.set_sensitive( options.get('check_online_updates')) if 'auto_hide' == path: self.refresh_operations = True if 'dark_mode' == path: if os.name != 'nt' or options.get("win10_mode") == False: Gtk.Settings.get_default().set_property( 'gtk-application-prefer-dark-theme', options.get('dark_mode')) if 'win10_mode' == path: if options.get("win10_mode"): screen = Gdk.Display.get_default_screen( Gdk.Display.get_default()) Gtk.StyleContext.add_provider_for_screen( screen, bleachbit.GUI.Bleachbit._style_provider, 600) else: screen = Gdk.Display.get_default_screen( Gdk.Display.get_default()) Gtk.StyleContext.remove_provider_for_screen( screen, bleachbit.GUI.Bleachbit._style_provider) if 'debug' == path: from bleachbit.Log import set_root_log_level set_root_log_level()
def __toggle_callback(self, cell, path): """Callback function to toggle option""" options.toggle(path) if online_update_notification_enabled: self.cb_beta.set_sensitive(options.get('check_online_updates')) if 'nt' == os.name: self.cb_winapp2.set_sensitive(options.get('check_online_updates')) if 'auto_hide' == path: self.refresh_operations = True
def __toggle_callback(self, cell, path): """Callback function to toggle option""" options.toggle(path) if online_update_notification_enabled: self.cb_beta.set_sensitive(options.get('check_online_updates')) if 'nt' == os.name: self.cb_winapp2.set_sensitive( options.get('check_online_updates')) if 'auto_hide' == path: self.refresh_operations = True if 'dark_mode' == path: Gtk.Settings.get_default().set_property( 'gtk-application-prefer-dark-theme', options.get('dark_mode'))
def __toggle_callback(self, cell, path): """Callback function to toggle option""" options.toggle(path) if online_update_notification_enabled: self.cb_beta.set_sensitive(options.get('check_online_updates')) if 'nt' == os.name: self.cb_winapp2.set_sensitive( options.get('check_online_updates')) if 'auto_hide' == path: self.refresh_operations = True if 'dark_mode' == path: if 'nt' == os.name and options.get('win10_theme'): self.cb_set_windows10_theme() Gtk.Settings.get_default().set_property( 'gtk-application-prefer-dark-theme', options.get('dark_mode')) if 'win10_theme' == path: self.cb_set_windows10_theme() if 'debug' == path: from bleachbit.Log import set_root_log_level set_root_log_level()