Beispiel #1
0
	def onMailboxSelectionChanged(self,selection):
		model, treeiter = selection.get_selected()
		mbSplit = re.split("-",model[treeiter][2])
		
		if len(mbSplit) >= 2:
			serverId = mbSplit[0]
			mbName = ""
			for idx in range(1,len(mbSplit)):
				mbName += mbSplit[idx]
			
			imapMgr = PyGMIMAPMgr("load-maillist",{"serverid": serverId, "mailbox": mbName})	
			imapMgr.setMainWindow(self)
			imapMgr.start()
Beispiel #2
0
	def onMaillistSelectionChanged(self,selection):
		model, treeiter = selection.get_selected()
		if model == None:
			return
			
		mailId = model[treeiter][5]
		mboxName = model[treeiter][6]
		serverId = model[treeiter][7]
		
		# we need an imapManager to get the mail
		imapMgr = PyGMIMAPMgr("load-mail",{"serverid": serverId, "mailbox": mboxName, "mailid": mailId})
		imapMgr.setMainWindow(self)
		imapMgr.start()
Beispiel #3
0
	def onSendReceiveButtonClicked(self,button):
		imapThread = PyGMIMAPMgr("load-mailboxes")
		imapThread.setMainWindow(self)
		imapThread.start()
Beispiel #4
0
		handler = logging.FileHandler("/var/log/pygmail.log")
		print "Logging to: /var/log/pygmail.log"
	except IOError:
		handler = logging.FileHandler("/tmp/pygmail.log")
		print "Logging to: /tmp/pygmail.log"
		
	formatter = logging.Formatter('%(asctime)s [%(levelname)s] - %(message)s')
	handler.setFormatter(formatter)
	logger.addHandler(handler) 
	logger.setLevel(logging.INFO)
	
	# Init SQLMgr
	sqlMgr = PyGMSQLiteMgr()
	sqlMgr.Connect()
	
	
	imapThread = PyGMIMAPMgr("load-mailboxes")
	
	builder = Gtk.Builder()
	builder.add_from_file("ui/MainWindow.ui")
	win = builder.get_object("MainWindow")
	winMgr = MainWindowMgr(builder,win,sqlMgr)
	
	imapThread.setMainWindow(winMgr)
	imapThread.start()
	
	win.show_all()
	winMgr.addThreadToKill(imapThread)
	Gtk.main()