Exemplo n.º 1
0
 def __init__(self, client, opts):
     ClientExtrasBase.__init__(self, client, opts)
     self.setup_menu()
     self.setup_tray(opts.tray_icon)
     self.setup_clipboard_helper(ClipboardProtocolHelper)
     self._last_key_events = maxdeque(maxlen=5)
     self._dropped_num_lock_press = False
Exemplo n.º 2
0
 def __init__(self, client, opts, conn):
     ClientExtrasBase.__init__(self, client, opts, conn)
     try:
         from xpra.platform.gdk_clipboard import TranslatedClipboardProtocolHelper
         self.setup_clipboard_helper(TranslatedClipboardProtocolHelper)
     except ImportError, e:
         log.error("GDK Translated Clipboard failed to load: %s - using default fallback", e)
         self.setup_clipboard_helper(DefaultClipboardProtocolHelper)
Exemplo n.º 3
0
 def cleanup(self):
     log("ClientExtras.cleanup() tray=%s", self.tray)
     ClientExtrasBase.cleanup(self)
     if self.tray:
         log("ClientExtras.cleanup() calling tray.close=%s", self.tray.close)
         self.tray.close()
         self.tray = None
     self.setup_console_event_listener(False)
     log("ClientExtras.cleanup() ended")
Exemplo n.º 4
0
 def cleanup(self):
     log("ClientExtras.cleanup() tray=%s", self.tray)
     ClientExtrasBase.cleanup(self)
     if self.tray:
         log("ClientExtras.cleanup() calling tray.close=%s",
             self.tray.close)
         self.tray.close()
         self.tray = None
     self.setup_console_event_listener(False)
     log("ClientExtras.cleanup() ended")
Exemplo n.º 5
0
 def __init__(self, client, opts):
     ClientExtrasBase.__init__(self, client, opts)
     try:
         from xpra.platform.gdk_clipboard import TranslatedClipboardProtocolHelper
         self.setup_clipboard_helper(TranslatedClipboardProtocolHelper)
     except ImportError, e:
         log.error(
             "GDK Translated Clipboard failed to load: %s - using default fallback",
             e)
         self.setup_clipboard_helper(DefaultClipboardProtocolHelper)
Exemplo n.º 6
0
 def __init__(self, client, opts, conn):
     self.menu_bar = None
     self.macapp = None
     self.last_attention_request_id = -1
     ClientExtrasBase.__init__(self, client, opts, conn)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_macdock()
     try:
         from xpra.darwin.osx_clipboard import OSXClipboardProtocolHelper
         self.setup_clipboard_helper(OSXClipboardProtocolHelper)
     except ImportError, e:
         log.error("OSX clipboard failed to load: %s - using default fallback", e)
         self.setup_clipboard_helper(DefaultClipboardProtocolHelper)
Exemplo n.º 7
0
 def __init__(self, client, opts, conn):
     self.menu_bar = None
     self.macapp = None
     self.last_attention_request_id = -1
     ClientExtrasBase.__init__(self, client, opts, conn)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_macdock()
     try:
         from xpra.darwin.osx_clipboard import OSXClipboardProtocolHelper
         self.setup_clipboard_helper(OSXClipboardProtocolHelper)
     except ImportError, e:
         log.error(
             "OSX clipboard failed to load: %s - using default fallback", e)
         self.setup_clipboard_helper(DefaultClipboardProtocolHelper)
Exemplo n.º 8
0
 def mask_to_names(self, mask):
     names = ClientExtrasBase.mask_to_names(self, mask)
     log("mask_to_names(%s)=%s, emulate_altgr=%s", mask, names,
         self.emulate_altgr)
     if self.emulate_altgr:
         self.AltGr_modifiers(names)
     return names
Exemplo n.º 9
0
 def mask_to_names(self, mask):
     names = ClientExtrasBase.mask_to_names(self, mask)
     if self.emulate_altgr:
         self.AltGr_modifiers(names)
     if self.num_lock_modifier:
         try:
             import win32api         #@UnresolvedImport
             import win32con         #@UnresolvedImport
             numlock = win32api.GetKeyState(win32con.VK_NUMLOCK)
             log("mask_to_names(%s) GetKeyState(VK_NUMLOCK)=%s", mask, numlock)
             if numlock and self.num_lock_modifier not in names:
                 names.append(self.num_lock_modifier)
             elif not numlock and self.num_lock_modifier in names:
                 names.remove(self.num_lock_modifier)
         except:
             pass
     log("mask_to_names(%s)=%s", mask, names)
     return names
Exemplo n.º 10
0
 def mask_to_names(self, mask):
     names = ClientExtrasBase.mask_to_names(self, mask)
     if self.emulate_altgr:
         self.AltGr_modifiers(names)
     if self.num_lock_modifier:
         try:
             import win32api  #@UnresolvedImport
             import win32con  #@UnresolvedImport
             numlock = win32api.GetKeyState(win32con.VK_NUMLOCK)
             log("mask_to_names(%s) GetKeyState(VK_NUMLOCK)=%s", mask,
                 numlock)
             if numlock and self.num_lock_modifier not in names:
                 names.append(self.num_lock_modifier)
             elif not numlock and self.num_lock_modifier in names:
                 names.remove(self.num_lock_modifier)
         except:
             pass
     log("mask_to_names(%s)=%s", mask, names)
     return names
Exemplo n.º 11
0
 def __init__(self, client, opts, conn):
     self.menu_bar = None
     self.macapp = None
     ClientExtrasBase.__init__(self, client, opts, conn)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_macdock()
Exemplo n.º 12
0
 def cleanup(self):
     log("cleanup() tray=%s", self.tray)
     ClientExtrasBase.cleanup(self)
     if self.tray:
         self.tray.close()
         self.tray = None
Exemplo n.º 13
0
 def cleanup(self):
     log("cleanup() tray=%s", self.tray)
     ClientExtrasBase.cleanup(self)
     if self.tray:
         self.tray.close()
         self.tray = None
Exemplo n.º 14
0
 def __init__(self, client, opts, conn):
     ClientExtrasBase.__init__(self, client, opts, conn)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_growl(opts.notifications)
     self.setup_macdock()
Exemplo n.º 15
0
 def grok_modifier_map(self, display_source, xkbmap_mod_meanings):
     modifiers = ClientExtrasBase.grok_modifier_map(self, display_source, xkbmap_mod_meanings)
     modifiers["meta"] = 1 << 3
     return  modifiers
Exemplo n.º 16
0
 def set_modifier_mappings(self, mappings):
     ClientExtrasBase.set_modifier_mappings(self, mappings)
     self.num_lock_modifier = self.modifier_keys.get("Num_Lock")
     log("set_modifier_mappings found 'Num_Lock' modifier value: %s", self.num_lock_modifier)
Exemplo n.º 17
0
 def cleanup(self):
     ClientExtrasBase.cleanup(self)
     self.remove_all_menus()
Exemplo n.º 18
0
 def __init__(self, client, opts):
     ClientExtrasBase.__init__(self, client, opts)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_growl(opts.notifications)
     self.setup_macdock()
Exemplo n.º 19
0
 def set_modifier_mappings(self, mappings):
     ClientExtrasBase.set_modifier_mappings(self, mappings)
     self.num_lock_modifier = self.modifier_keys.get("Num_Lock")
     log("set_modifier_mappings found 'Num_Lock' modifier value: %s",
         self.num_lock_modifier)
Exemplo n.º 20
0
 def exit(self):
     ClientExtrasBase.exit(self)
     if self.tray:
         self.tray.close()
Exemplo n.º 21
0
 def cleanup(self):
     ClientExtrasBase.cleanup(self)
     self.remove_all_menus()
Exemplo n.º 22
0
 def exit(self):
     ClientExtrasBase.exit(self)
     if self.tray:
         self.tray.close()
Exemplo n.º 23
0
 def cleanup(self):
     ClientExtrasBase.cleanup(self)
     if self.tray:
         self.tray.close()
Exemplo n.º 24
0
 def __init__(self, client, opts):
     ClientExtrasBase.__init__(self, client, opts)
     self.locate_icon_filename(opts.tray_icon)
     self.setup_growl()
     self.setup_macdock()
     self.clipboard_helper = None
Exemplo n.º 25
0
 def mask_to_names(self, mask):
     names = ClientExtrasBase.mask_to_names(self, mask)
     log("mask_to_names(%s)=%s, emulate_altgr=%s", mask, names, self.emulate_altgr)
     if self.emulate_altgr:
         self.AltGr_modifiers(names)
     return names
Exemplo n.º 26
0
 def grok_modifier_map(self, display_source, xkbmap_mod_meanings):
     modifiers = ClientExtrasBase.grok_modifier_map(self, display_source,
                                                    xkbmap_mod_meanings)
     modifiers["meta"] = 1 << 3
     return modifiers
Exemplo n.º 27
0
 def cleanup(self):
     ClientExtrasBase.cleanup(self)
     if self.tray:
         self.tray.close()