Esempio n. 1
0
	def msg(self, vars, mc, data, caller):
		if mc == '_message_public':
			self.append_text('%s: %s'%(vars['_nick'], data))
			return
		if mc == '_message_public_question':
			self.append_text('%s %s: %s'%(vars['_nick'],
						      'fragt', 
						      data))
			return
		if mc == '_message_public_text_action':
			self.append_text('%s %s: %s'%(vars['_nick'], 
						      vars['_action'], 
						      data))
			return
		if mc == '_status_place_members':
  			# _list_members, _list_members_nicks
			for i in range(0, len(vars['_list_members'])):
				self.nicklist.append((vars['_list_members'][i], 
						      vars['_list_members_nicks'][i]))
			return
		if mc.startswith('_notice_place_leave'):
  			return
		if mc.startswith('_notice_place_enter'):
  			self.nicklist.append((vars['_source'], vars['_nick']))
			return
		PSYCObject.msg(self, vars, mc, data, caller)
Esempio n. 2
0
	def __init__(self, netname, center):
  		gtk.Frame.__init__(self, label = netname)
		PSYCObject.__init__(self, netname, center)

                vbox = gtk.VBox()
                self.add(vbox)

                self.textview = gtk.TextView()
                self.textview.set_cursor_visible(gtk.FALSE)
                self.textview.set_wrap_mode(gtk.WRAP_WORD)
                self.textview.set_editable(gtk.FALSE)
                self.textbuf = self.textview.get_buffer()

		hbox = gtk.HPaned()
  		hbox.pack1(self.textview)
                vbox.pack_start(hbox)
	
  		# uni, nick
		self.nicklist = gtk.ListStore(str, str)
  		self.nicklist.set_sort_column_id(1, gtk.SORT_ASCENDING)
  		nickview = gtk.TreeView()
  		nickview.set_model(self.nicklist)
		nickview.set_headers_visible(gtk.FALSE)
		
  		col = gtk.TreeViewColumn('Nick', gtk.CellRendererText(), text = 1)
		col.set_resizable(gtk.FALSE)
  		nickview.append_column(col)

		hbox.pack2(nickview, shrink=gtk.FALSE, resize=gtk.FALSE)

		self.entry = gtk.Entry()
                self.entry.set_text('')
                self.entry.connect('activate', self.onEntry)
                vbox.pack_end(self.entry, gtk.FALSE)
                self.show_all()
Esempio n. 3
0
File: rss.py Progetto: elmom/pypsyc
  	def msg(self, vars, mc, data, caller):
		if mc == '_status_place_description_news_rss':
			self.label.set_label(data)
  			self.show_all()
			return
		if mc == '_notice_news_headline_rss':
			renderer = gtk.CellRendererText()
  			text = vars.get('_news_headline').encode('utf-8')
  			column = gtk.TreeViewColumn(vars.get('_news_headline'), renderer, text=1)
			self.tree.append_column(column)
			self.show_all()
			return
		PSYCObject.msg(self, vars, mc, data, caller)
Esempio n. 4
0
File: rss.py Progetto: elmom/pypsyc
  	def __init__(self, netname, center):
		import gobject 
		gtk.Frame.__init__(self, label = netname)
  		PSYCObject.__init__(self, netname, center)
  		
  		vbox = gtk.VPaned()
  		self.add(vbox)
		
		self.label = gtk.Label()
		self.model = gtk.ListStore(str, str, str)
 		self.tree = gtk.TreeView(self.model)
		
		# demos
  		self.model.append(['Handy-Flatrate von DoCoMo in Japan'.encode('utf-8'),
				   'http://heise.de/newsticker/meldung/44883',
				   'Ab Sommer 2004 will auch DoCoMo den Japanern für umgerechnet 31 Euro im Monat eine mobile Flatrate anbieten. mehr...' ])


		renderer = gtk.CellRendererText()
  		column = gtk.TreeViewColumn("Headline", renderer, text=0)
  		self.tree.append_column(column)
  	
		self.tree.connect('row-activated', self.preview)
  
		s1 = gtk.ScrolledWindow()
  		s1.add(self.tree)
  		s1.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
		vbox.pack1(s1, gtk.TRUE)
               
		self.textview = gtk.TextView()
                self.textview.set_cursor_visible(gtk.FALSE)
                self.textview.set_wrap_mode(gtk.WRAP_WORD)
                self.textview.set_editable(gtk.FALSE)
		self.textbuf = self.textview.get_buffer()

		s2 = gtk.ScrolledWindow()
  		s2.add(self.textview)
  		s2.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
  		vbox.pack2(s2) 
  
		#vbox.pack_end(self.textview, gtk.FALSE)
		self.show_all()
Esempio n. 5
0
 def __init__(self, netname, center):
     PSYCObject.__init__(self, netname, center)
     self.members = {}
     self.flat = {}