Exemple #1
0
    def __init__(self, store_controller):
        GObjectWrapper.__init__(self)

        self.current_unit = None
        self.main_controller = store_controller.main_controller
        self.main_controller.unit_controller = self
        self.store_controller = store_controller
        self.store_controller.unit_controller = self
        self.checks_controller = None

        from virtaal.views.unitview import UnitView
        self.view = UnitView(self)
        self.view.connect('delete-text', self._unit_delete_text)
        self.view.connect('insert-text', self._unit_insert_text)
        self.view.connect('paste-start', self._unit_paste_start)
        self.view.connect('modified', self._unit_modified)
        self.view.connect('unit-done', self._unit_done)
        self.view.enable_signals()

        self.store_controller.connect('store-loaded', self._on_store_loaded)
        self.main_controller.connect('controller-registered',
                                     self._on_controller_registered)

        self._recreate_workflow = False
        self._unit_state_names = {}
        self._state_timer_active = False
Exemple #2
0
    def __init__(self, controller):
        gtk.EventBox.__init__(self)
        GObjectWrapper.__init__(self)

        self.controller = controller
        self._focused_target_n = None
        self.gui = self.load_builder_file(["virtaal", "virtaal.ui"],
                                          root='UnitEditor',
                                          domain="virtaal")

        self.must_advance = False
        self._modified = False

        self.connect('key-press-event', self._on_key_press_event)
        # We automatically inherrit the tooltip from the Treeview, so we have
        # to show our own custom one to not have a tooltip obscuring things
        invisible_tooltip = gtk.Window(gtk.WINDOW_POPUP)
        invisible_tooltip.resize(1, 1)
        invisible_tooltip.set_opacity(0)
        self.set_tooltip_window(invisible_tooltip)
        self.connect('query-tooltip', self._on_query_tooltip)

        self._widgets = {
            'context_info': None,
            'state': None,
            'notes': {},
            'sources': [],
            'targets': []
        }
        self._get_widgets()
        self._widgets['vbox_editor'].reparent(self)
        self._setup_menus()
        self.unit = None
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.checks_controller = self
        self.store_controller = main_controller.store_controller

        main_controller.store_controller.connect('store-loaded', self._on_store_loaded)
        main_controller.unit_controller.connect('unit-modified', self._on_unit_modified)
        if main_controller.lang_controller:
            main_controller.lang_controller.connect('target-lang-changed', self._on_target_lang_changed)
        else:
            main_controller.connect('controller-registered', self._on_controller_registered)

        self._check_timer_active = False
        self.checker_info = {
            # XXX: Add other checkers below with a localisable string as key
            #      (used on the GUI) and a checker class as the value.
            _('Default'):    checks.StandardChecker,
            _('OpenOffice'): checks.OpenOfficeChecker,
            _('Mozilla'):    checks.MozillaChecker,
            _('Drupal'):     checks.DrupalChecker,
            _('GNOME'):      checks.GnomeChecker,
            _('KDE'):        checks.KdeChecker,
        }
        self._checker_menu_items = {}
        self._cursor_connection = ()
        self.last_unit = None

        self.projview = ChecksProjectView(self)
        self.unitview = ChecksUnitView(self)
        self.projview.show()
        self.unitview.show()
Exemple #4
0
 def __init__(self, controller):
     GObjectWrapper.__init__(self)
     self.controller = controller
     self._widgets = {}
     self.data = {}
     self._setup_key_bindings()
     self._setup_menu_item()
Exemple #5
0
    def __init__(self, store_controller):
        GObjectWrapper.__init__(self)

        self.current_unit = None
        self.main_controller = store_controller.main_controller
        self.main_controller.unit_controller = self
        self.store_controller = store_controller
        self.store_controller.unit_controller = self
        self.checks_controller = None

        from virtaal.views.unitview import UnitView
        self.view = UnitView(self)
        self.view.connect('delete-text', self._unit_delete_text)
        self.view.connect('insert-text', self._unit_insert_text)
        self.view.connect('paste-start', self._unit_paste_start)
        self.view.connect('modified', self._unit_modified)
        self.view.connect('unit-done', self._unit_done)
        self.view.enable_signals()

        self.store_controller.connect('store-loaded', self._on_store_loaded)
        self.main_controller.connect('controller-registered', self._on_controller_registered)

        self._recreate_workflow = False
        self._unit_state_names = {}
        self._state_timer_active = False
Exemple #6
0
    def __init__(self, controller):
        gtk.EventBox.__init__(self)
        GObjectWrapper.__init__(self)

        self.controller = controller
        self._focused_target_n = None
        self.gui = self.load_builder_file(["virtaal", "virtaal.ui"], root='UnitEditor', domain="virtaal")

        self.must_advance = False
        self._modified = False

        self.connect('key-press-event', self._on_key_press_event)
        # We automatically inherrit the tooltip from the Treeview, so we have
        # to show our own custom one to not have a tooltip obscuring things
        invisible_tooltip = gtk.Window(gtk.WINDOW_POPUP)
        invisible_tooltip.resize(1,1)
        invisible_tooltip.set_opacity(0)
        self.set_tooltip_window(invisible_tooltip)
        self.connect('query-tooltip', self._on_query_tooltip)

        self._widgets = {
            'context_info': None,
            'state': None,
            'notes': {},
            'sources': [],
            'targets': []
        }
        self._get_widgets()
        self._widgets['vbox_editor'].reparent(self)
        self._setup_menus()
        self.unit = None
Exemple #7
0
    def __init__(self, main_controller, config={}):
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.placeables_controller = main_controller.placeables_controller

        self.disabled_model_names = ['basetermmodel'] + self.config.get(
            'disabled_models', [])
        self.placeables_controller.add_parsers(*terminology.parsers)
        self.placeables_controller.non_target_placeables.append(
            terminology.TerminologyPlaceable)
        self.placeables_controller.connect('parsers-changed',
                                           self._on_placeables_changed)
        main_controller.view.main_window.connect('style-set',
                                                 self._on_style_set)
        self._on_style_set(main_controller.view.main_window, None)

        if not (terminology.TerminologyPlaceable,
                TerminologyGUIInfo) in placeablesguiinfo.element_gui_map:
            placeablesguiinfo.element_gui_map.insert(
                0, (terminology.TerminologyPlaceable, TerminologyGUIInfo))

        self.view = TerminologyView(self)
        self._connect_signals()
        self._load_models()
Exemple #8
0
 def __init__(self, controller):
     GObjectWrapper.__init__(self)
     self.controller = controller
     self._widgets = {}
     self.data = {}
     self._setup_key_bindings()
     self._setup_menu_item()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.placeables_controller = main_controller.placeables_controller
        self.plugin_controller = main_controller.plugin_controller
        self.view = PreferencesView(self)
        self.view.connect('prefs-done', self._on_prefs_done)
Exemple #10
0
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.placeables_controller = main_controller.placeables_controller
        self.plugin_controller = main_controller.plugin_controller
        from virtaal.views.prefsview import PreferencesView
        self.view = PreferencesView(self)
        self.view.connect('prefs-done', self._on_prefs_done)
Exemple #11
0
    def __init__(self, plugin, config):
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = plugin.main_controller
        self.plugin = plugin

        self.disabled_model_names = ['baselookupmodel'] + self.config.get('disabled_models', [])
        self._signal_ids = {}
        self.view = LookupView(self)
        self._load_models()
    def __init__(self, controller):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self.plugins = {}
        self.pluginmodules = {}

        if os.name == "nt":
            self.PLUGIN_DIRS.insert(0, os.path.join(pan_app.main_dir, "virtaal_plugins"))
        if "RESOURCEPATH" in os.environ:
            self.PLUGIN_DIRS.insert(0, os.path.join(os.environ["RESOURCEPATH"], "virtaal_plugins"))
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.placeables_controller = self
        self._init_parsers()
        self._init_parser_descriptions()
        self._init_notarget_list()

        self.main_controller.view.main_window.connect('style-set', self._on_style_set)
        self.main_controller.connect('quit', self._on_quit)
Exemple #14
0
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.placeables_controller = self
        self._init_parsers()
        self._init_parser_descriptions()
        self._init_notarget_list()

        self.main_controller.view.main_window.connect('style-set',
                                                      self._on_style_set)
        self.main_controller.connect('quit', self._on_quit)
    def __init__(self, items=None, bold_name=True):
        gtk.TreeView.__init__(self)
        GObjectWrapper.__init__(self)

        self.bold_name = bold_name
        self.selected_item = None
        if not items:
            items = gtk.ListStore(bool, str, str, TYPE_PYOBJECT, TYPE_PYOBJECT)
        self.set_model(items)

        self._add_columns()
        self._set_defaults()
        self._connect_events()
Exemple #16
0
    def __init__(self, model, indices, circular=True):
        """Constructor.
            @type  model: anything
            @param model: The model (usually a collection) to which the cursor is applicable.
            @type  indices: ordered collection
            @param indices: The valid values for C{self.index}."""
        GObjectWrapper.__init__(self)

        self.model = model
        self._indices = indices
        self.circular = circular

        self._pos = 0
    def __init__(self, model, indices, circular=True):
        """Constructor.
            @type  model: anything
            @param model: The model (usually a collection) to which the cursor is applicable.
            @type  indices: ordered collection
            @param indices: The valid values for C{self.index}."""
        GObjectWrapper.__init__(self)

        self.model = model
        self._indices = indices
        self.circular = circular

        self._pos = 0
Exemple #18
0
    def __init__(self, items=None, bold_name=True):
        gtk.TreeView.__init__(self)
        GObjectWrapper.__init__(self)

        self.bold_name = bold_name
        self.selected_item = None
        if not items:
            items = gtk.ListStore(bool, str, str, TYPE_PYOBJECT, TYPE_PYOBJECT)
        self.set_model(items)

        self._add_columns()
        self._set_defaults()
        self._connect_events()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.mode_controller = self

        self._init_modes()
        self.view = ModeView(self)
        self.view.connect('mode-selected', self._on_mode_selected)

        self.current_mode = None
        self.view.select_mode(self.modenames[self.default_mode_name])

        self.main_controller.store_controller.connect('store-closed', self._on_store_closed)
    def __init__(self, main_controller):
        """Constructor.
            @type main_controller: virtaal.controllers.MainController"""
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.undo_controller = self
        self.unit_controller = self.main_controller.store_controller.unit_controller

        self.enabled = True
        self.model = UndoModel(self)

        self._setup_key_bindings()
        self._connect_undo_signals()
Exemple #21
0
    def __init__(self):
        GObjectWrapper.__init__(self)
        self._force_saveas = False

        self._checks_controller = None
        self._lang_controller = None
        self._mode_controller = None
        self._placeables_controller = None
        self._plugin_controller = None
        self._store_controller = None
        self._undo_controller = None
        self._unit_controller = None
        self._welcomescreen_controller = None
        self.view = MainView(self)
    def __init__(self, main_controller, config={}):
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.disabled_model_names = ['basetmmodel'] + self.config.get('disabled_models', [])
        self.max_matches = self.config.get('max_matches', 5)
        self.min_quality = self.config.get('min_quality', 75)

        self._signal_ids = {}
        self.view = TMView(self, self.max_matches)
        self._load_models()

        self._connect_plugin()
Exemple #23
0
    def __init__(self):
        GObjectWrapper.__init__(self)
        self._force_saveas = False

        self._checks_controller = None
        self._lang_controller = None
        self._mode_controller = None
        self._placeables_controller = None
        self._plugin_controller = None
        self._store_controller = None
        self._undo_controller = None
        self._unit_controller = None
        self._welcomescreen_controller = None
        self.view = MainView(self)
    def __init__(self, main_controller, config={}):
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.disabled_model_names = ['basetmmodel'] + self.config.get(
            'disabled_models', [])
        self.max_matches = self.config.get('max_matches', 5)
        self.min_quality = self.config.get('min_quality', 75)

        self._signal_ids = {}
        self.view = TMView(self, self.max_matches)
        self._load_models()

        self._connect_plugin()
    def __init__(self, main_controller):
        """Constructor.
            @type main_controller: virtaal.controllers.MainController"""
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.undo_controller = self
        self.unit_controller = self.main_controller.store_controller.unit_controller

        self.enabled = True
        from virtaal.models.undomodel import UndoModel
        self.model = UndoModel(self)

        self._setup_key_bindings()
        self._connect_undo_signals()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.mode_controller = self

        self._init_modes()
        from virtaal.views.modeview  import ModeView
        self.view = ModeView(self)
        self.view.connect('mode-selected', self._on_mode_selected)

        self.current_mode = None
        self.view.select_mode(self.modenames[self.default_mode_name])

        self.main_controller.store_controller.connect('store-closed', self._on_store_closed)
Exemple #27
0
    def __init__(self, controller, classname=None):
        GObjectWrapper.__init__(self)

        self.controller = controller
        if classname:
            self.PLUGIN_CLASSNAME = classname
        else:
            # controller is maincontroller
            controller.plugin_controller = self
        self.plugins       = {}
        self.pluginmodules = {}

        if os.name == 'nt':
            self.PLUGIN_DIRS.insert(0, os.path.join(pan_app.main_dir, u'virtaal_plugins'))
        if 'RESOURCEPATH' in os.environ:
            self.PLUGIN_DIRS.insert(0, os.path.join(os.environ['RESOURCEPATH'].decode(sys.getfilesystemencoding()), u'virtaal_plugins'))
Exemple #28
0
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.lang_controller = self
        self.lang_identifier = None
        self.new_langs = []
        self._init_langs()
        self.recent_pairs = self._load_recent()

        self.main_controller.store_controller.connect('store-loaded', self._on_store_loaded)
        self.main_controller.connect('quit', self._on_quit)
        self.connect('source-lang-changed', self._on_lang_changed)
        self.connect('target-lang-changed', self._on_lang_changed)

        self.view = None
Exemple #29
0
    def __init__(self, main_controller, config={}):
        from virtaal.common import GObjectWrapper
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.disabled_model_names = ['basetmmodel'] + self.config.get('disabled_models', [])
        self.max_matches = self.config.get('max_matches', 5)
        self.min_quality = self.config.get('min_quality', 75)

        self._signal_ids = {}
        from tmview import TMView
        self.storecursor = None
        self.view = TMView(self, self.max_matches)
        self._load_models()

        self._connect_plugin()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.lang_controller = self
        self.lang_identifier = LanguageIdentifier(self.MODEL_DIR, self.CONF_FILE)
        self.new_langs = []
        self._init_langs()
        self.recent_pairs = self._load_recent()

        self.main_controller.store_controller.connect('store-loaded', self._on_store_loaded)
        self.main_controller.connect('quit', self._on_quit)
        self.connect('source-lang-changed', self._on_lang_changed)
        self.connect('target-lang-changed', self._on_lang_changed)

        self.view = LanguageView(self)
        self.view.show()
Exemple #31
0
    def __init__(self, controller, max_matches):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self.isvisible = False
        self.max_matches = max_matches
        self._may_show_tmwindow = True  # is it allowed to display now (application is in focus)
        self._should_show_tmwindow = False  # should it be displayed now (even if it doesn't, due to application focus?
        self._signal_ids = []

        self.tmwindow = TMWindow(self)
        main_window = self.controller.main_controller.view.main_window

        self._signal_ids.append(
            (self.tmwindow.treeview,
             self.tmwindow.treeview.connect('row-activated',
                                            self._on_row_activated)))
        self._signal_ids.append(
            (controller.main_controller.store_controller.view.parent_widget.
             get_vscrollbar(),
             controller.main_controller.store_controller.view.parent_widget.
             get_vscrollbar().connect('value-changed',
                                      self._on_store_view_scroll)))
        self._signal_ids.append(
            (main_window,
             main_window.connect('focus-in-event',
                                 self._on_focus_in_mainwindow)))
        self._signal_ids.append(
            (main_window,
             main_window.connect('focus-out-event',
                                 self._on_focus_out_mainwindow)))
        self._signal_ids.append(
            (main_window,
             main_window.connect('configure_event',
                                 self._on_configure_mainwindow)))
        self._signal_ids.append(
            (controller.main_controller.store_controller,
             controller.main_controller.store_controller.connect(
                 'store-closed', self._on_store_closed)))
        self._signal_ids.append(
            (controller.main_controller.store_controller,
             controller.main_controller.store_controller.connect(
                 'store-loaded', self._on_store_loaded)))

        self._setup_key_bindings()
        self._setup_menu_items()
Exemple #32
0
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.checks_controller = self
        self.store_controller = main_controller.store_controller

        main_controller.store_controller.connect('store-loaded',
                                                 self._on_store_loaded)
        main_controller.unit_controller.connect('unit-modified',
                                                self._on_unit_modified)
        if main_controller.lang_controller:
            main_controller.lang_controller.connect(
                'target-lang-changed', self._on_target_lang_changed)
        else:
            main_controller.connect('controller-registered',
                                    self._on_controller_registered)

        self.code = None
        self._checker = None
        self._check_timer_active = False
        self._checker_code_to_name = {
            None: _('Default'),
            # we keep the "openoffice" key for compatibility with the toolkit
            # and existing file headers
            "openoffice": _('LibreOffice'),
            "mozilla": _('Mozilla'),
            "kde": _('KDE'),
            "gnome": _('GNOME'),
            "drupal": _('Drupal'),
        }
        self._checker_name_to_code = dict([
            (value, key)
            for (key, value) in self._checker_code_to_name.items()
        ])
        self._checker_info = None
        self._checker_menu_items = {}
        self._cursor_connection = ()
        self.last_unit = None

        self._projview = None
        self._unitview = None

        if self.store_controller.get_store():
            # We are too late for the initial 'store-loaded'
            self._on_store_loaded(self.store_controller)
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.lang_controller = self
        self.lang_identifier = None
        self.new_langs = []
        self._init_langs()
        self.recent_pairs = self._load_recent()

        self.main_controller.store_controller.connect('store-loaded',
                                                      self._on_store_loaded)
        self.main_controller.connect('quit', self._on_quit)
        self.connect('source-lang-changed', self._on_lang_changed)
        self.connect('target-lang-changed', self._on_lang_changed)

        self.view = None
Exemple #34
0
    def __init__(self, main_controller, config={}):
        from virtaal.common import GObjectWrapper
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.disabled_model_names = ['basetmmodel'] + self.config.get(
            'disabled_models', [])
        self.max_matches = self.config.get('max_matches', 5)
        self.min_quality = self.config.get('min_quality', 75)

        self._signal_ids = {}
        from tmview import TMView
        self.storecursor = None
        self.view = TMView(self, self.max_matches)
        self._load_models()

        self._connect_plugin()
Exemple #35
0
    def __init__(self, controller, classname=None):
        GObjectWrapper.__init__(self)

        self.controller = controller
        if classname:
            self.PLUGIN_CLASSNAME = classname
        else:
            # controller is maincontroller
            controller.plugin_controller = self
        self.plugins = {}
        self.pluginmodules = {}

        if os.name == 'nt':
            self.PLUGIN_DIRS.insert(
                0, os.path.join(pan_app.main_dir, 'virtaal_plugins'))
        if 'RESOURCEPATH' in os.environ:
            self.PLUGIN_DIRS.insert(
                0, os.path.join(os.environ['RESOURCEPATH'], 'virtaal_plugins'))
Exemple #36
0
    def __init__(self, controller, max_matches):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self.isvisible = False
        self.max_matches = max_matches
        self._may_show_tmwindow = True # is it allowed to display now (application is in focus)
        self._should_show_tmwindow = False # should it be displayed now (even if it doesn't, due to application focus?
        self._signal_ids = []

        self.tmwindow = TMWindow(self)
        main_window = self.controller.main_controller.view.main_window

        self._signal_ids.append((
            self.tmwindow.treeview,
            self.tmwindow.treeview.connect('row-activated', self._on_row_activated)
        ))
        self._signal_ids.append((
            controller.main_controller.store_controller.view.parent_widget.get_vscrollbar(),
            controller.main_controller.store_controller.view.parent_widget.get_vscrollbar().connect('value-changed', self._on_store_view_scroll)
        ))
        self._signal_ids.append((
            main_window,
            main_window.connect('focus-in-event', self._on_focus_in_mainwindow)
        ))
        self._signal_ids.append((
            main_window,
            main_window.connect('focus-out-event', self._on_focus_out_mainwindow)
        ))
        self._signal_ids.append((
            main_window,
            main_window.connect('configure_event', self._on_configure_mainwindow)
        ))
        self._signal_ids.append((
            controller.main_controller.store_controller,
            controller.main_controller.store_controller.connect('store-closed', self._on_store_closed)
        ))
        self._signal_ids.append((
            controller.main_controller.store_controller,
            controller.main_controller.store_controller.connect('store-loaded', self._on_store_loaded)
        ))

        self._setup_key_bindings()
        self._setup_menu_items()
    def __init__(self, main_controller, config={}):
        GObjectWrapper.__init__(self)

        self.config = config
        self.main_controller = main_controller
        self.placeables_controller = main_controller.placeables_controller

        self.disabled_model_names = ['basetermmodel'] + self.config.get('disabled_models', [])
        self.placeables_controller.add_parsers(*terminology.parsers)
        self.placeables_controller.non_target_placeables.append(terminology.TerminologyPlaceable)
        self.placeables_controller.connect('parsers-changed', self._on_placeables_changed)
        main_controller.view.main_window.connect('style-set', self._on_style_set)

        if not (terminology.TerminologyPlaceable, TerminologyGUIInfo) in placeablesguiinfo.element_gui_map:
            placeablesguiinfo.element_gui_map.insert(0, (terminology.TerminologyPlaceable, TerminologyGUIInfo))

        self.view = TerminologyView(self)
        self._connect_signals()
        self._load_models()
Exemple #38
0
    def __init__(self, controller, max_matches):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self.isvisible = False
        self.max_matches = max_matches
        self._may_show_tmwindow = False
        self._should_show_tmwindow = False
        self._signal_ids = []

        self.tmwindow = TMWindow(self)
        main_window = self.controller.main_controller.view.main_window

        self._signal_ids.append(
            (self.tmwindow.treeview, self.tmwindow.treeview.connect("row-activated", self._on_row_activated))
        )
        self._signal_ids.append(
            (
                controller.main_controller.store_controller.view.parent_widget.get_vscrollbar(),
                controller.main_controller.store_controller.view.parent_widget.get_vscrollbar().connect(
                    "value-changed", self._on_store_view_scroll
                ),
            )
        )
        self._signal_ids.append((main_window, main_window.connect("focus-in-event", self._on_focus_in_mainwindow)))
        self._signal_ids.append((main_window, main_window.connect("focus-out-event", self._on_focus_out_mainwindow)))
        self._signal_ids.append(
            (
                controller.main_controller.store_controller,
                controller.main_controller.store_controller.connect("store-closed", self._on_store_closed),
            )
        )
        self._signal_ids.append(
            (
                controller.main_controller.store_controller,
                controller.main_controller.store_controller.connect("store-loaded", self._on_store_loaded),
            )
        )

        self._setup_key_bindings()
        self._setup_menu_items()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        self.main_controller.checks_controller = self
        self.store_controller = main_controller.store_controller

        main_controller.store_controller.connect('store-loaded', self._on_store_loaded)
        main_controller.unit_controller.connect('unit-modified', self._on_unit_modified)
        if main_controller.lang_controller:
            main_controller.lang_controller.connect('target-lang-changed', self._on_target_lang_changed)
        else:
            main_controller.connect('controller-registered', self._on_controller_registered)

        self.code = None
        self._checker = None
        self._check_timer_active = False
        self._checker_code_to_name = {
              None: _('Default'),
              # we keep the "openoffice" key for compatibility with the toolkit
              # and existing file headers
              "openoffice":  _('LibreOffice'),
              "mozilla": _('Mozilla'),
              "kde": _('KDE'),
              "gnome": _('GNOME'),
              "drupal": _('Drupal'),
        }
        self._checker_name_to_code = dict([(value, key) for (key, value) in self._checker_code_to_name.items()])
        self._checker_info = None
        self._checker_menu_items = {}
        self._cursor_connection = ()
        self.last_unit = None

        self._projview = None
        self._unitview = None

        if self.store_controller.get_store():
            # We are too late for the initial 'store-loaded'
            self._on_store_loaded(self.store_controller)
Exemple #40
0
    def __init__(self, controller):
        gtk.EventBox.__init__(self)
        GObjectWrapper.__init__(self)

        self.controller = controller
        self._focused_target_n = None
        self.gladefilename, self.gui = self.load_glade_file(["virtaal", "virtaal.glade"], root='UnitEditor', domain="virtaal")

        self.must_advance = False
        self._modified = False

        self.connect('key-press-event', self._on_key_press_event)

        self._widgets = {
            'context_info': None,
            'state': None,
            'notes': {},
            'sources': [],
            'targets': []
        }
        self._get_widgets()
        self._widgets['vbox_editor'].reparent(self)
        self._setup_menus()
        self.unit = None
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        from virtaal.views.propertiesview import PropertiesView
        self.view = PropertiesView(self)
 def __init__(self, controller):
     GObjectWrapper.__init__(self)
     self.controller = controller
     self._init_gui()
    def __init__(self, controller):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self._build_gui()
        self._load_modes()
    def __init__(self, controller):
        GObjectWrapper.__init__(self)

        self.controller = controller
        self._build_gui()
        self._load_modes()
    def __init__(self, main_controller):
        GObjectWrapper.__init__(self)

        self.main_controller = main_controller
        from virtaal.views.propertiesview import PropertiesView
        self.view = PropertiesView(self)