comparison frontends/primitivus/primitivus @ 116:7c482ecac0ff

primitivus: basic contact list, connexion now work \o/
author Goffi <goffi@goffi.org>
date Thu, 01 Jul 2010 18:52:51 +0800
parents e5ca22113280
children 1f0fd6f03e2b
comparison
equal deleted inserted replaced
115:eed4f77c942e 116:7c482ecac0ff
24 from quick_frontend.quick_chat_list import QuickChatList 24 from quick_frontend.quick_chat_list import QuickChatList
25 from quick_frontend.quick_contact_list import QuickContactList 25 from quick_frontend.quick_contact_list import QuickContactList
26 from quick_frontend.quick_contact_management import QuickContactManagement 26 from quick_frontend.quick_contact_management import QuickContactManagement
27 import urwid 27 import urwid
28 from profile_manager import ProfileManager 28 from profile_manager import ProfileManager
29 from contact_list import ContactList
29 import pdb 30 import pdb
30 """from window import Window 31 """from window import Window
31 from editbox import EditBox 32 from editbox import EditBox
32 from statusbar import StatusBar 33 from statusbar import StatusBar
33 from chat import Chat 34 from chat import Chat
59 ] 60 ]
60 61
61 class PrimitivusApp(QuickApp): 62 class PrimitivusApp(QuickApp):
62 63
63 def __init__(self): 64 def __init__(self):
65 self.CM = QuickContactManagement() #FIXME: not the best place
64 QuickApp.__init__(self) #XXX: yes it's an unusual place for the constructor of a parent class, but the init order is important 66 QuickApp.__init__(self) #XXX: yes it's an unusual place for the constructor of a parent class, but the init order is important
65 67
66 ## main loop setup ## 68 ## main loop setup ##
67 self.main_widget = self.__buildMainWidget() 69 self.main_widget = self.__buildMainWidget()
68 self.loop = urwid.MainLoop(self.main_widget, const_PALETTE, event_loop=urwid.GLibEventLoop(), unhandled_input=self.key_handler) 70 self.loop = urwid.MainLoop(self.main_widget, const_PALETTE, event_loop=urwid.GLibEventLoop(), unhandled_input=self.key_handler)
77 def __buildMainWidget(self): 79 def __buildMainWidget(self):
78 #main_widget = urwid.Filler(ProfileManager(self)) 80 #main_widget = urwid.Filler(ProfileManager(self))
79 main_widget = ProfileManager(self) 81 main_widget = ProfileManager(self)
80 return main_widget 82 return main_widget
81 83
84 def plug_profile(self, profile_key='@DEFAULT@'):
85 self.loop.widget = self.contactList = ContactList(self, self.CM)
86 QuickApp.plug_profile(self, profile_key)
87
82 88
83 sat = PrimitivusApp() 89 sat = PrimitivusApp()
84 sat.start() 90 sat.start()