Beispiel #1
0
	def __init__ (self, gui, cb = True):
		self.gui = gui
		self.data = gui.data
		gtk.VBox.__init__ (self)
		self.alt = gtk.Label ()
		self.scrolledwindow = gtk.ScrolledWindow ()
		self.image = gtk.Image ()
		self.text = gtk.TextView ()
		self.text.set_wrap_mode (gtk.WRAP_WORD_CHAR)
		self.text.set_editable (False)
		self.buttons = gtk.VBox ()
		self.color = gui.gui.messagecolor
		self.tabname = 'Message'
		self.no_size = True
		if cb:
			gui.register_attribute ('set', None, self.set)
		else:
			self.cb = None
		self.scrolledwindow.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
		self.scrolledwindow.add_with_viewport (self.image)
		self.pack_start (self.alt, False, True)
		self.pack_start (self.scrolledwindow, True, True)
		self.pack_start (self.text, True, True)
		self.pack_start (self.buttons, False, True)
		self.show_all ()
		self.alt.hide ()
Beispiel #2
0
	def __init__ (self, gui):
		gtk.Notebook.__init__ (self)
		self.connect ('page-added', self.no_new)	# Initialize tab labels.
		self.connect ('switch-page', self.no_new)
		self.set_show_tabs (True)
		self.set_tab_pos (gtk.POS_RIGHT)
		self.set_can_focus (False)
		self.button = gui.register_event ('button')
		def save_page ():
			p = self.get_current_page ()
			return lambda: self.set_current_page (p)
		gui.register_attribute ('save_page', save_page, self.set_current_page)
		gui.notebook_add ()
Beispiel #3
0
	def __init__ (self, gui):
		self.data = gui.data
		self.colors = gui.get_attribute ('colors', default = '#f00,#0f0').split (',', 1)
		signature = (str, str, bool, str, str, str, object)
		self.store = gtk.ListStore (*signature)
		gtk.TreeView.__init__ (self, self.store)
		self.set_can_focus (False)
		self.columns = [gtk.TreeViewColumn (x) for x in ('Name', 'Type', 'Running', 'Remaining', 'Duration')]
		self.renderer = [gtk.CellRendererToggle () if signature[c] == bool else gtk.CellRendererText () for c in range (len (self.columns))]
		for c, col in enumerate (self.columns):
			self.append_column (col)
			col.pack_start (self.renderer[c], True)
			col.add_attribute (self.renderer[c], 'active' if signature[c] is bool else 'text', c)
			if signature[c] is not bool:
				col.add_attribute (self.renderer[c], 'foreground', 5)
		self.set_reorderable (True)
		gui.register_attribute ('skip', self.skip, None)
		gui.register_attribute ('update', None, lambda x: self.update ())
Beispiel #4
0
	def __init__ (self, gui):
		self.color = gui.gui.historycolor
		self.tabname = 'History'
		self.size = 0
		gtk.VBox.__init__ (self)
		self.store = gtk.ListStore (str, str, object)
		self.selector = gtk.ComboBox (self.store)
		cell = gtk.CellRendererText ()
		self.selector.pack_start (cell)
		self.selector.show ()
		self.selector.add_attribute (cell, 'text', 0)
		self.pack_start (self.selector, False)
		self.timelabel = gtk.Label ()
		self.timelabel.show ()
		self.pack_start (self.timelabel, False)
		self.detail = Details (gui, False)
		self.pack_start (self.detail, True)
		self.detail.show ()
		self.selector.connect ('changed', self.update)
		self.size = 0
		gui.register_attribute ('add', None, self.add_item)
Beispiel #5
0
	def __init__ (self, gui, title):# {{{
		self.data = gui.data
		gtk.VBox.__init__ (self)
		self.store = gtk.ListStore (str, str, object, bool, bool, gtk.gdk.Pixbuf)
		self.treeview = gtk.TreeView (self.store)
		self.active_column = self.bool_column ('active', 3)
		self.visible_column = self.bool_column ('visible', 4)
		self.icon_column ('', 5)
		self.str_column (title, 0, 1)
		self.treeview.get_selection ().connect ('changed', self.selection_changed)
		self.details = Details (gui, False)
		win = gtk.ScrolledWindow ()
		self.pack_start (win)
		win.add (self.treeview)
		self.pack_start (self.details)
		self.changed = gui.register_event ('changed')
		gui.register_attribute ('select', None, self.select)
		gui.register_attribute ('update', None, lambda x: self.update ())
		self.data = gui.data
		self.show_all ()
		if not self.data.debug:
			self.active_column.set_visible (False)
			self.visible_column.set_visible (False)