def run(self, parent=None, text=""): if isinstance(text, str): text = tichy.Text(text) ##create main edje object, the evas object used to generate edje objects #self.main = gui.main_edje() self.main = parent ##set the title of the window self.main.etk_obj.title_set('Paroli Contacts') ##connect to tichy contacts service self.contact_service = Service('Contacts') self.phone_book = self.contact_service.contacts ##create empty contacts objects list self.contact_objects_list = None ##set edje file to be used ##TODO: make one edje file per plugin self.edje_file = os.path.join(os.path.dirname(__file__), 'paroli-contacts.edj') ##create application main window self.edje_obj = gui.edje_gui(self.main, 'people', self.edje_file) ##create scrollable box for contacts list contacts_box = gui.edje_box(self, 'V', 1) ##create list and populate box #print dir(self.phone_book) self.contact_objects_list = gui.contact_list(self.phone_book, contacts_box, self.main.etk_obj.evas, self.edje_file, 'contacts_item', self) ##add populated box to main window self.edje_obj.add(contacts_box.scrolled_view, contacts_box, "contacts-items") #self.edje_obj.edj.signal_callback_add("add_contact", "*", self.add_number_new_contact) self.edje_obj.edj.signal_callback_add("add_contact", "*", self.add_number_new_contact) self.edje_obj.edj.signal_callback_add("top_bar", "*", self.top_bar) #self.edje_obj.edj.signal_callback_add("mouse,move", "*", self.listen) self.edje_obj.edj.layer_set(2) self.edje_obj.edj.show() self.main.etk_obj.x_window_virtual_keyboard_state_set( ecore.x.ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) try: contacts_box.box.show() except Exception, e: print e
new_edje.edj.name_set('contacts_list') except Exception, e: print e self.extra_child = new_edje new_edje.edj.layer_set(3) new_edje.edj.show() print "done" try: contacts_box = gui.edje_box(self, 'V', 1) except Exception, e: print e try: print "self.lists.generate_contacts_list(self,orig_parent,self.phone_book,contacts_edje,self.edje_obj)" self.contact_objects_list = gui.contact_list( self.phone_book, contacts_box, self.main.etk_obj.evas, self.edje_file, 'tele-contacts_item', self) except Exception, e: print e try: to_2_swallowed = contacts_box.scrolled_view except Exception, e: print e try: print "new_edje.add(to_2_swallowed,contacts_edje)" new_edje.add(to_2_swallowed, contacts_box, "contacts-items") except Exception, e: print e
def run(self, parent, text = ""): if isinstance(text, str): text = tichy.Text(text) ##create main edje object, the evas object used to generate edje objects self.main = parent ##set the title of the window self.main.etk_obj.title_set('Paroli Msgs') ##direct connection to framework -- ONLY for TESTING #bus = dbus.SystemBus(mainloop=tichy.mainloop.dbus_loop) #self.gsm = bus.get_object('org.freesmartphone.ogsmd','/org/freesmartphone/GSM/Device') #self.gsm_service = tichy.Service('GSM') self.msgs_service = tichy.Service('Messages') inbox = self.msgs_service.inbox outbox = self.msgs_service.outbox all_list = inbox + outbox def comp(m1, m2): return cmp(m2.timestamp, m1.timestamp) all_list.sort(comp) #for e in all_list: #print e messages = all_list ##connect to tichy's contacts service self.contact_service = Service('Contacts') ##get contacts list self.phone_book = self.contact_service.contacts ## list used for messages TODO : Rename self.contact_objects_list = None ##set edje file to be used ##TODO: make one edje file per plugin self.edje_file = os.path.join(os.path.dirname(__file__),'paroli-msgs.edj') ##create application main window self.edje_obj = gui.edje_gui(self.main,'messages',self.edje_file) ##create scrollable box for contacts list contacts_box = gui.edje_box(self,'V',1) ##create list and populate box #print dir(self.phone_book) self.contact_objects_list = gui.contact_list(messages,contacts_box,self.main.etk_obj.evas,self.edje_file,'message_item',self,'msgs') ##add populated box to main window self.edje_obj.add(contacts_box.scrolled_view,contacts_box,"message-items") self.edje_obj.edj.signal_callback_add("create_message", "*", self.create_message) #self.edje_obj.edj.signal_callback_add("add_contact", "*", self.add_number_new_contact) self.edje_obj.edj.signal_callback_add("top_bar", "*", self.top_bar) self.edje_obj.edj.layer_set(2) self.edje_obj.edj.show() try: contacts_box.box.show() except Exception,e: print e
print e try: self.extra_child = new_edje new_edje.edj.layer_set(3) new_edje.edj.show() except Exception,e: print e print "done" try: contacts_box = gui.edje_box(self,'V',1) except Exception,e: print e print "done2" try: self.contact_objects_list = gui.contact_list(self.phone_book,contacts_box,self.main.etk_obj.evas,self.edje_file,'message-contacts_item',self, 'contacts' , emission) except Exception,e: print e print "done3" try: to_2_swallowed = contacts_box.scrolled_view except Exception,e: print e print "done4" try: #print "new_edje.add(to_2_swallowed,contacts_edje)" new_edje.add(to_2_swallowed,contacts_box,"items") except Exception,e: print e
def run(self, parent=None, text=""): if isinstance(text, str): text = tichy.Text(text) #print dir(parent.etk_obj) #parent.etk_obj.title_set('parent') #parent.etk_obj.hide_all() self.main = parent self.main.etk_obj.title_set('Paroli I/O') self.history_items = [] self.edje_file = os.path.join(os.path.dirname(__file__), 'paroli-i-o.edj') #dir(main.etk_obj) #print dir(main) #self.window = gui.Window(parent, modal=True) #self.window.etk_obj.theme_file_set('../tichy/gui_p/edje/paroli-in-tichy.edj') #print self.window.etk_obj.theme_file_get() #self.window.etk_obj.theme_group_set('tele') #print self.window.etk_obj.theme_group_get() #self.window.etk_obj.title_set('paroli dialer') #self.window.etk_obj.show_all() #print dir(self.window.etk_obj) #self.window.show() #self.window.etk_obj.propagate_color_set(0) #print self.window.etk_obj.children_get() self.gsm_service = tichy.Service('GSM') #print dir(gsm_service.logs) #print "printing of dir done" #print str(gsm_service.logs) #for i in gsm_service.logs: #print dir(i) print "logs done" #self.history = [('Ali', '099872394'),('bachus', '098953214'),('julius', '059321894'),('zacharias', '04326953214'),('zuberio', '09922153214'),('oliver', '03322153214'),('Paula', '0225623614')] self.history = self.gsm_service.logs self.history_scroller = [ 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'i' ] #,'i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i','i' self.edje_obj = gui.edje_gui(self.main, 'i-o', self.edje_file) self.edje_obj.edj.layer_set(2) self.edje_obj.edj.show() self.edje_obj.edj.signal_callback_add("edit_btn_clicked", "*", self.edit_mode) self.edje_obj.edj.signal_callback_add("top-bar", "*", self.top_bar) history_box = gui.edje_box(self, 'V', 1) self.lists = gui.lists() try: #self.lists.generate_list(self,self.main.etk_obj.evas,self.history_scroller,history_edje,self.edje_obj,'history_item') self.history_objects_list = gui.contact_list( self.history, history_box, self.main.etk_obj.evas, self.edje_file, 'history_item', self, kind='history') except Exception, e: print e