本文整理汇总了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)
示例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]())
示例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()
示例4: __init__
def __init__(self, parent):
self.__parent = parent
GladeSlaveDelegate.__init__(self,
gladefile = 'controls',
toplevel_name = 'ControlsWindow')
示例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)
示例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
示例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()
示例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)
示例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()
示例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)
示例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()
示例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()
示例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)
示例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()
示例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()