示例#1
0
    def register_callbacks(self):
        """Connect the GTK+ signals we care about"""
        self.connect('key-press-event', self.on_key_press)
        self.connect('button-press-event', self.on_button_press)
        self.connect('delete_event', self.on_delete_event)
        self.connect('destroy', self.on_destroy_event)
        self.connect('window-state-event', self.on_window_state_changed)
        self.connect('focus-out-event', self.on_focus_out)
        self.connect('focus-in-event', self.on_focus_in)

        # Attempt to grab a global hotkey for hiding the window.
        # If we fail, we'll never hide the window, iconifying instead.
        if self.config['keybindings']['hide_window'] != None:
            if display_manager() == 'X11':
                try:
                    self.hidebound = Keybinder.bind(
                        self.config['keybindings']['hide_window'].replace(
                            '<Shift>', ''), self.on_hide_window)
                except (KeyError, NameError):
                    pass

                if not self.hidebound:
                    err('Unable to bind hide_window key, another instance/window has it.'
                        )
                    self.hidefunc = self.iconify
                else:
                    self.hidefunc = self.hide
示例#2
0
    def register_callbacks(self):
        """Connect the GTK+ signals we care about"""
        self.connect('key-press-event', self.on_key_press)
        self.connect('button-press-event', self.on_button_press)
        self.connect('delete_event', self.on_delete_event)
        self.connect('destroy', self.on_destroy_event)
        self.connect('window-state-event', self.on_window_state_changed)
        self.connect('focus-out-event', self.on_focus_out)
        self.connect('focus-in-event', self.on_focus_in)

        # Attempt to grab a global hotkey for hiding the window.
        # If we fail, we'll never hide the window, iconifying instead.
        if self.config['keybindings']['hide_window'] != None:
            if display_manager() == 'X11':
                try:
                    self.hidebound = Keybinder.bind(
                        self.config['keybindings']['hide_window'].replace('<Shift>',''),
                        self.on_hide_window)
                except (KeyError, NameError):
                    pass

                if not self.hidebound:
                    err('Unable to bind hide_window key, another instance/window has it.')
                    self.hidefunc = self.iconify
                else:
                    self.hidefunc = self.hide
示例#3
0
import copy
import time
import uuid
import gi
from gi.repository import GObject
from gi.repository import Gtk, Gdk, GdkX11

from util import dbg, err, make_uuid, display_manager
import util
from translation import _
from version import APP_NAME
from container import Container
from factory import Factory
from terminator import Terminator

if display_manager() == 'X11':
    try:
        gi.require_version('Keybinder', '3.0')
        from gi.repository import Keybinder
        Keybinder.init()
    except (ImportError, ValueError):
        err('Unable to load Keybinder module. This means the \
hide_window shortcut will be unavailable')


# pylint: disable-msg=R0904
class Window(Container, Gtk.Window):
    """Class implementing a top-level Terminator window"""

    terminator = None
    title = None
示例#4
0
import copy
import time
import uuid
import gi
from gi.repository import GObject
from gi.repository import Gtk, Gdk, GdkX11

from util import dbg, err, make_uuid, display_manager
import util
from translation import _
from version import APP_NAME
from container import Container
from factory import Factory
from terminator import Terminator

if display_manager() == 'X11':
    try:
        gi.require_version('Keybinder', '3.0')
        from gi.repository import Keybinder
        Keybinder.init()
    except (ImportError, ValueError):
        err('Unable to load Keybinder module. This means the \
hide_window shortcut will be unavailable')

# pylint: disable-msg=R0904
class Window(Container, Gtk.Window):
    """Class implementing a top-level Terminator window"""

    terminator = None
    title = None
    isfullscreen = None