當前位置: 首頁>>代碼示例>>Python>>正文


Python delegates.GladeSlaveDelegate類代碼示例

本文整理匯總了Python中kiwi.ui.delegates.GladeSlaveDelegate的典型用法代碼示例。如果您正苦於以下問題:Python GladeSlaveDelegate類的具體用法?Python GladeSlaveDelegate怎麽用?Python GladeSlaveDelegate使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GladeSlaveDelegate類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, model=None, statusbar=None):
        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)

        self.model = model

        filecolumns = [Column('path', data_type=str, title="Arquivo", expand=True, searchable=True)]
        self.filelist.set_columns(filecolumns)
開發者ID:dsaran,項目名稱:packagehelper,代碼行數:7,代碼來源:listslave.py

示例2: __init__

 def __init__(self, parent, reptype = None):
 
         GladeSlaveDelegate.__init__(self, "ui", toplevel_name = 'ReportWindow')
         dic_reps = {'inventory' : self._inventory_report }
         
         print 'AAAAAAA', dic_reps
         self.show_report(report = dic_reps[reptype]())
開發者ID:camontalvanx,項目名稱:crisk,代碼行數:7,代碼來源:reportview.py

示例3: __init__

	def __init__(self, parent, mo):
		self.log = logging.getLogger('MINICAL')
		self.parent = parent
		self.mo = mo
		self.factory = Factory()

		self.__stop_auto_highlight = False # Disable automatic highlighting of events.
		self.__stop_auto_dayjump = False   # Disable automatically jumping to the start of the event on selection.
		self.__stop_auto_treeview_update = False   # FIXME

		GladeSlaveDelegate.__init__(self, gladefile='mo_tab_events', toplevel_name='window_main')

		# Set up the user interface
		eventColumns = [
			Column('start', title='Start', data_type=datetime.datetime, sorted=True),
			Column('end', title='End', data_type=datetime.datetime),
			Column('summaryformat', title='Summary', use_markup=True),
			Column('duration', title='Duration', justify=gtk.JUSTIFY_RIGHT)
		]
		self.treeview_event = ObjectTree(eventColumns)
		self.vbox_eventslist.add(self.treeview_event)
		self.combobox_display_range.set_active(self.show_ranges.index(self.mo.config['events.default_show'].lower()))
		cal_options = gtk.CALENDAR_WEEK_START_MONDAY
		if self.mo.config['events.cal_show_weeknr']:
			cal_options |= gtk.CALENDAR_SHOW_WEEK_NUMBERS
		self.calendar.set_display_options((self.calendar.get_display_options() | cal_options))

		# Connect signals
		self.treeview_event.connect('selection-changed', self.treeview_event__selection_changed)
		self.treeview_event.connect('row-activated', self.treeview_event__row_activated)
		self.treeview_event.connect('key-press-event', self.treeview_event__key_press_event)

		self.on_toolbutton_today__clicked()
開發者ID:fboender,項目名稱:miniorganizer,代碼行數:33,代碼來源:event.py

示例4: __init__

 def __init__(self, parent):
     
     self.__parent = parent
     
     GladeSlaveDelegate.__init__(self,  
                                 gladefile = 'controls',
                                 toplevel_name = 'ControlsWindow')
     
     
開發者ID:camontalvanx,項目名稱:crisk,代碼行數:7,代碼來源:controlsview.py

示例5: __init__

    def __init__(self, store, model=None, visual_mode=False, edit_mode=None):
        """ A base class for editor slaves inheritance

        :param store: a store
        :param model: the object model tied with the proxy widgets
        :param visual_mode: does this slave must be opened in visual mode?
                            if so, all the proxy widgets will be disable
        :param edit_mode: indicate if the slave are being edited or its a new one
                          The editor that creates the slave should pass his
                          property edit_mode to the slaves.
                          If None self.edit_mode will be defined accordingly to
                          the model
        """
        self.store = store
        # FIXME: Need to check if we need to add edit_mode parameter for all classes
        # that inherit from BaseEditor
        if edit_mode is not None:
            self.edit_mode = edit_mode
        else:
            self.edit_mode = model is not None
        self.visual_mode = visual_mode

        if model:
            created = ""
        else:
            created = "created "
            model = self.create_model(self.store)

            if model is None:
                fmt = "%s.create_model() must return a valid model, not %r"
                raise ValueError(fmt % (self.__class__.__name__, model))

        log.info("%s editor using a %smodel %s" % (
            self.__class__.__name__, created, type(model).__name__))

        if self.model_type:
            if not isinstance(model, self.model_type):
                fmt = '%s editor requires a model of type %s, got a %r'
                raise TypeError(
                    fmt % (self.__class__.__name__,
                           self.model_type.__name__,
                           model))
        else:
            fmt = "Editor %s must define a model_type attribute"
            raise ValueError(fmt % (self.__class__.__name__, ))
        self.model = model

        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)
        if self.visual_mode:
            self._setup_visual_mode()
        self.setup_proxies()
        self.setup_slaves()

        EditorSlaveCreateEvent.emit(self, model, store, visual_mode)
開發者ID:Guillon88,項目名稱:stoq,代碼行數:54,代碼來源:baseeditor.py

示例6: __init__

    def __init__(self, parent):
        self.parent = parent
        # Be carefull that, when passing the widget list, the sizegroups
        # that you want to be merged are in the list, otherwise, they wont
        # be.
        GladeSlaveDelegate.__init__(self, gladefile="slave_view.ui", toplevel_name="window_container")

        self.slave = NestedSlave(self)
        self.attach_slave("eventbox", self.slave)
        self.slave.show()
        self.slave.focus_toplevel()  # Must be done after attach
開發者ID:gitter-badger,項目名稱:kiwi,代碼行數:11,代碼來源:slaves.py

示例7: __init__

    def __init__(self, payment_type, group, branch, method, total_value,
                 editor_class, parent):
        self.parent = parent
        self.branch = branch
        self.payment_type = payment_type
        self.group = group
        self.total_value = total_value
        self.editor_class = editor_class
        self.method = method

        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)
        self._setup_widgets()
開發者ID:romaia,項目名稱:stoq,代碼行數:12,代碼來源:paymentslave.py

示例8: __init__

    def __init__(self, store=None, payment_type=None, default_method=None):
        self._default_method = default_method
        self._widgets = {}
        self._methods = {}
        self._selected_method = None

        if payment_type is None:
            raise ValueError("payment_type must be set")
        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)

        self.store = store
        self._setup_payment_methods(payment_type)
開發者ID:pkaislan,項目名稱:stoq,代碼行數:12,代碼來源:paymentmethodslave.py

示例9: __init__

 def __init__(self, parent):
     
     self.__parent = parent
     
     GladeSlaveDelegate.__init__(self,  
                                 gladefile = 'ui',
                                 toplevel_name = 'InventoryWindow')
     self.list = self.get_widget('invent_list')
     cols = [ Column('name', title = _('Name'), data_type = unicode, 
                     searchable = True, sorted = True),
              Column('description', title = _('Description'), data_type = unicode, 
                     expand = True),
              Column('owner', title = _('Owner'), data_type = unicode),
              Column('value', title = _('Value'), data_type = currency)]
     self.list.set_columns(cols)
     self.populate_list()
開發者ID:camontalvanx,項目名稱:crisk,代碼行數:16,代碼來源:inventoryview.py

示例10: __init__

    def __init__(self, store, model=None, visual_mode=False):
        """ A base class for editor slaves inheritance

        :param store: a store
        :param model: the object model tied with the proxy widgets
        :param visual_mode: does this slave must be opened in visual mode?
                            if so, all the proxy widgets will be disable
        """
        self.store = store
        self.edit_mode = model is not None
        self.visual_mode = visual_mode

        if model:
            created = ""
        else:
            created = "created "
            model = self.create_model(self.store)

            if model is None:
                raise ValueError(
                    "%s.create_model() must return a valid model, not %r" % (
                    self.__class__.__name__, model))

        log.info("%s editor using a %smodel %s" % (
            self.__class__.__name__, created, type(model).__name__))

        if self.model_type:
            if not isinstance(model, self.model_type):
                raise TypeError(
                    '%s editor requires a model of type %s, got a %r' % (
                    self.__class__.__name__, self.model_type.__name__,
                    model))
        else:
            raise ValueError("Editor %s must define a model_type "
                             "attribute" % (
                self.__class__.__name__, ))
        self.model = model

        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)
        if self.visual_mode:
            self._setup_visual_mode()
        self.setup_proxies()
        self.setup_slaves()

        EditorSlaveCreateEvent.emit(self, model, store, visual_mode)
開發者ID:romaia,項目名稱:stoq,代碼行數:45,代碼來源:baseeditor.py

示例11: __init__

	def __init__(self, dt = None):
		if not dt:
			self.dt = datetime.datetime.now()
		else:
			self.dt = dt
			
		# Set up the user interface
		GladeSlaveDelegate.__init__(self, gladefile="mo_datetime_edit", toplevel_name="window_main")

		self.entry_date = DateEntry()
		self.entry_time = ProxyEntry(data_type=datetime.time)
		self.set_datetime(self.dt)
		self.entry_date.connect('changed', self.entry_date__changed)
		self.entry_time.connect('changed', self.entry_time__changed)
		self.hbox.pack_start(self.entry_date, expand=False, fill=False)
		self.hbox.pack_start(self.entry_time, expand=False, fill=False)

		self.show()
開發者ID:fboender,項目名稱:miniorganizer,代碼行數:18,代碼來源:datetimeedit.py

示例12: __init__

    def __init__(self, model=None, scripts=None, statusbar=None):
        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)

        assert model, "Model should not be None"
        self.model = model

        self.statusbar = statusbar

        self.fileTree.set_columns([Column('name', data_type=str, searchable=True, 
                                   expand=True)])

        #XXX: This argument is not necessary anymore since we should use model data to fill list
        if scripts:
            self._set_message("")
            self._fill(scripts)

        self._enable_drag_and_drop()
        self._setup_context_menu()
開發者ID:dsaran,項目名稱:packagehelper,代碼行數:18,代碼來源:filetree.py

示例13: __init__

    def __init__(self, store=None, payment_type=None, default_method=None,
                 no_payments=False):
        """
        :param no_payments: if ``True``, add the option "No payments" that
        doesn't create any payments.
        """
        self._default_method = default_method
        self._no_payments = no_payments
        self._widgets = {}
        self._methods = {}
        self._selected_method = None

        if payment_type is None:
            raise ValueError("payment_type must be set")
        GladeSlaveDelegate.__init__(self, gladefile=self.gladefile)

        self.store = store
        self._setup_payment_methods(payment_type)
開發者ID:hackedbellini,項目名稱:stoq,代碼行數:18,代碼來源:paymentmethodslave.py

示例14: __init__

	def __init__(self, parent, mo):
		self.parent = parent
		self.mo = mo
		self.factory = Factory()

		# Set up the user interface
		GladeSlaveDelegate.__init__(self, gladefile="mo_tab_notes", toplevel_name="window_main")
	
		noteColumns = [
			Column("summary", title='Title', data_type=str),
		]
		#self.treeview_note = ObjectList(noteColumns)
		self.treeview_note = ObjectTree(noteColumns)
		self.vbox_notelist.add(self.treeview_note)

		# Connect signals
		self.treeview_note.connect('row-activated', self.treeview_note__row_activated)
		self.treeview_note.connect('selection-changed', self.treeview_note__selection_changed)
		self.treeview_note.connect('key-press-event', self.treeview_note__key_press_event)

		self.refresh()
開發者ID:fboender,項目名稱:miniorganizer,代碼行數:21,代碼來源:note.py

示例15: __init__

	def __init__(self, parent, mo):
		self.parent = parent
		self.mo = mo
		self.factory = Factory()

		GladeSlaveDelegate.__init__(self, gladefile="mo_tab_todo", toplevel_name="window_main")

		# Set up the user interface
		todoColumns = [
			Column("done", title='Done', data_type=bool, editable=True),
			Column("summaryformat", title='Summary', use_markup=True),
			Column('priority', title='Priority', sorted=True, order=gtk.SORT_DESCENDING),
			ColoredColumn('due', title='Due', data_type=datetime.datetime, color='red', data_func=self.color_due),
			Column('created', title='Created', data_type=datetime.datetime)
		]
		self.treeview_todo = ObjectTree(todoColumns)
		self.vbox_todolist.add(self.treeview_todo)

		# Connect signals
		self.treeview_todo.connect('row-activated', self.treeview_todo__row_activated)
		self.treeview_todo.connect('selection-changed', self.treeview_todo__selection_changed)
		self.treeview_todo.connect('key-press-event', self.treeview_todo__key_press_event)

		self.refresh()
開發者ID:fboender,項目名稱:miniorganizer,代碼行數:24,代碼來源:todo.py


注:本文中的kiwi.ui.delegates.GladeSlaveDelegate類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。