def __init__(self, parent): BaseDialog.__init__(self, 'preferences', parent, 'core.glade') ctx.logger.debug('initalizing preferences dialog') # init some data mapping = self.mail_cfg = { 'smtp_host': 'text', 'smtp_user': '******', 'smtp_password': '******', 'mail_encoding': 'text', 'mail_default_from': 'text', 'smtp_port': 'value', 'smtp_use_tls': 'active', 'smtp_raise_error': 'active', 'debug': 'active', 'log_timeformat': 'text', } cfg, w = ctx.settings, self.widgets # load values from the preferences module and visualize # them in the preferences dialog for widget, property in mapping.iteritems(): w[widget].set_property(property, cfg[widget]) ctx.logger.debug('loaded preferences from database') # the combo box to change the active project self._themes = ObjectList([ Column('display_name', str, 'Name'), Column('author', str, 'Autor') ]) self._themes.connect('item-activated', self.on_theme_choice_changed) self._themes.set_border_width(10) self.widgets.theme_vbox.pack_end(self._themes) # add all themes to the combo self._refresh_themes() # init the recipients ObjectList vbox = self.widgets.recipients_vbox self._recipients = ObjectList([ Column('name', str, 'Name', editable=True), Column('mail', str, 'E-Mail', editable=True), Column('active', str, 'Mail senden', editable=True), Column('comment', str, 'Bemerkung', editable=True) ], sortable=True) self._recipients.connect('item-changed', self._on_recipient_edited) vbox.pack_start(self._recipients) self._update_recipients() self._recipients.show() ctx.logger.debug('inialized recipients preferences dialog-page')
def create_ui(self): self._last_selected = None self.document = None self.tasks = {} self.restart = False self.errors_ol = ObjectList([Column('markup', use_markup=True)]) self.errors_ol.set_headers_visible(False) self.scrolled_window = gtk.ScrolledWindow() self.scrolled_window.show() self.scrolled_window.add(self.errors_ol) self.scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.add_main_widget(self.scrolled_window) self.errors_ol.show_all() self.sort_combo = AttrSortCombo( self.errors_ol, [ ('lineno', _('Line Number')), ('message', _('Message')), ('type_', _('Type')), ], 'lineno', ) self.sort_combo.show() self.add_main_widget(self.sort_combo, expand=False)
def create_list(self): self.notify_list = ObjectList([ Column('stock', use_stock=True), Column('time', sorted=True), Column('markup', use_markup=True, expand=True), ]) self.notify_list.set_headers_visible(False) self._hbox.pack_start(self.notify_list)
def create_ui(self): self.todo_list = ObjectList([ Column('line', sorted=True), Column('todo', resizable=True, width=200, tooltip_attr='todo'), Column('marker', width=50), ]) self.add_main_widget(self.todo_list) self.todo_list.show_all()
def create_list(self): self._list = ObjectList([ Column('symbol', title=_('Symbol'), use_markup=True), Column('filename', title=_('Location'), use_markup=True), Column('dataline', title=_('Data'), use_markup=True), ]) self._scroll = gtk.ScrolledWindow() self._scroll.add(self._list) self._list.connect('item-double-clicked', self._on_list_double_click) self._vbox.pack_start(self._scroll) self._scroll.show_all()
def create_list(self): self._list = ObjectList( [ Column('number', title=_('Number')), Column('description', title=_('Description')) ] ) self._scroll = gtk.ScrolledWindow() self._scroll.add(self._list) self._list.connect('item-activated', self._on_list_double_click) self._vbox.pack_start(self._scroll) self._list.show_all()
def create_ui(self): self.history_tree = ObjectList( [Column('markup', use_markup=True, expand=True)]) self.history_tree.set_headers_visible(False) self.add_main_widget(self.history_tree) self.x11_clipboard = gtk.Clipboard(selection="PRIMARY") self.gnome_clipboard = gtk.Clipboard(selection="CLIPBOARD") self.history_tree.connect('item-right-clicked', self.on_paste_rclick) self.__pulse_bar = gtk.ProgressBar() self.add_main_widget(self.__pulse_bar, expand=False) # only show pulse bar if working self.__pulse_bar.hide() self.__pulse_bar.set_size_request(-1, 12) self.__pulse_bar.set_pulse_step(0.01) self.history_tree.show_all()
def create_ui(self): self.vbox = gtk.VBox(spacing=3) self.vbox.set_border_width(6) self.hbox = gtk.HBox() self.entry = gtk.Entry() self.check = gtk.CheckButton(label='-k') self.list = ObjectList([ Column('markup', title=_('Man page'), sorted=True, use_markup=True), Column('description', title=_('Description'), use_markup=True), ]) self.scroll = gtk.ScrolledWindow() self.scroll.add(self.list) self.scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.hbox.pack_start(self.entry) self.hbox.pack_start(self.check, expand=False) self.vbox.pack_start(self.hbox, expand=False) self.vbox.pack_start(self.scroll) self.add_main_widget(self.vbox) self.vbox.show_all()
def create_file_list(self): self.file_list = ObjectList() self.file_list.set_headers_visible(False) def visible_func(item): return item is not None and item.visible self.file_list.set_visible_func(visible_func) self.file_list.set_columns(self._columns) self.file_list.connect('selection-changed', self.on_selection_changed) self.file_list.connect('item-activated', self.on_file_activated) self.file_list.connect('item-right-clicked', self.on_file_right_click) self.entries = {} self.update_to_path(self.svc.path) self.file_list.show() self._file_scroll = gtk.ScrolledWindow( hadjustment=self.file_list.props.hadjustment, vadjustment=self.file_list.props.vadjustment, ) self._file_scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self._file_scroll.add(self.file_list) self._file_scroll.show() self._vbox.pack_start(self._file_scroll) self._sort_combo = AttrSortCombo(self.file_list, [ ('is_dir_sort', _('Directories First')), ('path', _('File Path')), ('lower_name', _('File Name')), ('name', _('File Name (Case Sensitive)')), ('extension_sort', _('Extension')), ('state', _('Version Control Status')), ], 'is_dir_sort') self._sort_combo.show() self._vbox.pack_start(self._sort_combo, expand=False) self.on_selection_changed(self.file_list)