Beispiel #1
0
 def __init__(self, gconf_client, driver, editing_macro, parent = None):
     
     self.__gconf_client = gconf_client
     self.__driver = driver
     self.__clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)
     
     self.__recorder = g15keyio.G15KeyRecorder(self.__driver)
     self.__recorder.on_stop = self._on_stop_record
     self.__recorder.on_add = self._on_record_add
     
     self.__widget_tree = gtk.Builder()
     self.__widget_tree.set_translation_domain("g15-macroeditor")
     self.__widget_tree.add_from_file(os.path.join(g15globals.ui_dir, "script-editor.ui"))
     self._load_objects()
     if parent is not None:
         self.__window.set_transient_for(parent)
     self._load_key_presses()
     self._configure_widgets()
     self._add_info_box()
     self.set_macro(editing_macro)
     self._set_available()
     
     # Connect signal handlers
     self.__widget_tree.connect_signals(self)
     
     # Configure defaults
     self.__output_delays.set_active(g15gconf.get_bool_or_default(self.__gconf_client, "/apps/gnome15/script_editor/record_delays", True))
     self.__emit_uinput.set_active(g15gconf.get_bool_or_default(self.__gconf_client, "/apps/gnome15/script_editor/emit_uinput", False))
     self.__recorder.output_delays = self.__output_delays.get_active()
     self.__recorder.emit_uinput = self.__emit_uinput.get_active()
Beispiel #2
0
def is_locked(device):
    """
    Get if the active profile is "locked" or if it may be changed for the specified device. 
    
    Keyword arguments:
    device        -- device associated with profile
    """
    return g15gconf.get_bool_or_default(conf_client, "/apps/gnome15/%s/locked" % device.uid, False)
Beispiel #3
0
 def _load_hidden_configuration(self):
     self.scroll_delay = float(
         g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/scroll_delay', 500)) / 1000.0
     self.scroll_amount = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/scroll_amount', 5)
     self.animated_menus = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/animated_menus', True)
     self.animation_delay = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/animation_delay',
                                                        100) / 1000.0
     self.key_hold_duration = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/key_hold_duration',
                                                          2000) / 1000.0
     self.macro_handler.use_x_test = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/use_x_test', True)
     self.disable_svg_glow = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/disable_svg_glow', False)
     self.fade_screen_on_close = g15gconf.get_bool_or_default(
         self.conf_client,
         '/apps/gnome15/fade_screen_on_close',
         True)
     self.all_off_on_disconnect = g15gconf.get_bool_or_default(
         self.conf_client,
         '/apps/gnome15/all_off_on_disconnect',
         True)
     self.fade_keyboard_backlight_on_close = g15gconf.get_bool_or_default(
         self.conf_client,
         '/apps/gnome15/fade_keyboard_backlight_on_close',
         True)
     self.start_in_threads = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/start_in_threads', False)
     self._mark_all_pages_dirty()
Beispiel #4
0
def is_locked(device):
    """
    Get if the active profile is "locked" or if it may be changed for the specified device. 
    
    Keyword arguments:
    device        -- device associated with profile
    """
    return g15gconf.get_bool_or_default(conf_client,
                                        "/apps/gnome15/%s/locked" % device.uid,
                                        False)
Beispiel #5
0
    def __init__(self, gconf_client, driver, editing_macro, parent=None):

        self.__gconf_client = gconf_client
        self.__driver = driver
        self.__clipboard = gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD)

        self.__recorder = g15keyio.G15KeyRecorder(self.__driver)
        self.__recorder.on_stop = self._on_stop_record
        self.__recorder.on_add = self._on_record_add

        self.__widget_tree = gtk.Builder()
        self.__widget_tree.set_translation_domain("g15-macroeditor")
        self.__widget_tree.add_from_file(
            os.path.join(g15globals.ui_dir, "script-editor.ui"))
        self._load_objects()
        if parent is not None:
            self.__window.set_transient_for(parent)
        self._load_key_presses()
        self._configure_widgets()
        self._add_info_box()
        self.set_macro(editing_macro)
        self._set_available()

        # Connect signal handlers
        self.__widget_tree.connect_signals(self)

        # Configure defaults
        self.__output_delays.set_active(
            g15gconf.get_bool_or_default(
                self.__gconf_client,
                "/apps/gnome15/script_editor/record_delays", True))
        self.__emit_uinput.set_active(
            g15gconf.get_bool_or_default(
                self.__gconf_client, "/apps/gnome15/script_editor/emit_uinput",
                False))
        self.__recorder.output_delays = self.__output_delays.get_active()
        self.__recorder.emit_uinput = self.__emit_uinput.get_active()
Beispiel #6
0
 def _load_hidden_configuration(self):
     self.scroll_delay = float(g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/scroll_delay', 500)) / 1000.0
     self.scroll_amount = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/scroll_amount', 5)
     self.animated_menus = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/animated_menus', True)
     self.animation_delay = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/animation_delay', 100) / 1000.0
     self.key_hold_duration = g15gconf.get_int_or_default(self.conf_client, '/apps/gnome15/key_hold_duration', 2000) / 1000.0
     self.macro_handler.use_x_test = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/use_x_test', True)
     self.disable_svg_glow = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/disable_svg_glow', False)
     self.fade_screen_on_close = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/fade_screen_on_close', True)
     self.all_off_on_disconnect = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/all_off_on_disconnect', True)
     self.fade_keyboard_backlight_on_close = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/fade_keyboard_backlight_on_close', True)
     self.start_in_threads = g15gconf.get_bool_or_default(self.conf_client, '/apps/gnome15/start_in_threads', False)
     self._mark_all_pages_dirty()
Beispiel #7
0
 def IsCyclingEnabled(self):
     return g15gconf.get_bool_or_default(self._service.conf_client, "/apps/gnome15/%s/cycle_screens" % self._screen.device.uid, True);
Beispiel #8
0
 def _is_monitor_session(self):
     return g15gconf.get_bool_or_default(self.conf_client, "/apps/gnome15/monitor_desktop_session", True)
Beispiel #9
0
 def _is_monitor_session(self):
     return g15gconf.get_bool_or_default(self.conf_client, "/apps/gnome15/monitor_desktop_session", True)
Beispiel #10
0
 def IsCyclingEnabled(self):
     return g15gconf.get_bool_or_default(self._service.conf_client,
                                         "/apps/gnome15/%s/cycle_screens" % self._screen.device.uid, True);
Beispiel #11
0
def get_bool_or_default(gconf_client, key, default=None):
    return g15gconf.get_bool_or_default(gconf_client, key, default)