当前位置: 首页>>代码示例>>Python>>正文


Python GObjectWrapper.__init__方法代码示例

本文整理汇总了Python中virtaal.common.GObjectWrapper.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python GObjectWrapper.__init__方法的具体用法?Python GObjectWrapper.__init__怎么用?Python GObjectWrapper.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在virtaal.common.GObjectWrapper的用法示例。


在下文中一共展示了GObjectWrapper.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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()
开发者ID:AndreasEisele,项目名称:wikitrans-pootle,代码行数:35,代码来源:checkscontroller.py

示例2: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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
开发者ID:Ailick,项目名称:virtaal,代码行数:27,代码来源:unitcontroller.py

示例3: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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
开发者ID:Ailick,项目名称:virtaal,代码行数:33,代码来源:unitview.py

示例4: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
 def __init__(self, controller):
     GObjectWrapper.__init__(self)
     self.controller = controller
     self._widgets = {}
     self.data = {}
     self._setup_key_bindings()
     self._setup_menu_item()
开发者ID:adamchainz,项目名称:virtaal,代码行数:9,代码来源:propertiesview.py

示例5: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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)
开发者ID:elric,项目名称:virtaal-debian,代码行数:10,代码来源:prefscontroller.py

示例6: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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)
开发者ID:elric,项目名称:virtaal-debian-snapshots,代码行数:13,代码来源:placeablescontroller.py

示例7: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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"))
开发者ID:nrtest,项目名称:wikitrans-pootle,代码行数:13,代码来源:plugincontroller.py

示例8: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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()
开发者ID:Ailick,项目名称:virtaal,代码行数:13,代码来源:lookupcontroller.py

示例9: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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
开发者ID:Ailick,项目名称:virtaal,代码行数:15,代码来源:cursor.py

示例10: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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()
开发者ID:adamchainz,项目名称:virtaal,代码行数:15,代码来源:selectview.py

示例11: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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()
开发者ID:AndreasEisele,项目名称:wikitrans-pootle,代码行数:16,代码来源:undocontroller.py

示例12: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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)
开发者ID:AndreasEisele,项目名称:wikitrans-pootle,代码行数:16,代码来源:modecontroller.py

示例13: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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()
开发者ID:AndreasEisele,项目名称:wikitrans-pootle,代码行数:16,代码来源:tmcontroller.py

示例14: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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)
开发者ID:denji,项目名称:virtaal,代码行数:16,代码来源:maincontroller.py

示例15: __init__

# 需要导入模块: from virtaal.common import GObjectWrapper [as 别名]
# 或者: from virtaal.common.GObjectWrapper import __init__ [as 别名]
    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
开发者ID:Ailick,项目名称:virtaal,代码行数:18,代码来源:langcontroller.py


注:本文中的virtaal.common.GObjectWrapper.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。