def _new_sms(self): model = SMSModel(self.model.device) view = SMSView() ctrl = SMSController(model, view, self) view.set_parent_view(self.view) view.show()
def _send_sms_to_contact(self, menuitem, treeview): selected = self._get_selected_objects(treeview) model = SMSModel(self.model.device) view = SMSView() ctrl = SMSController(model, view, self) view.set_parent_view(self.view) map(view.add_contact, selected["objs"]) view.show()
def _send_sms_from_storage(self, menuitem, treeview): model = SMSModel(self.model.device) view = SMSView() ctrl = SMSController(model, view, self, mode=STORAGE) view.set_parent_view(self.view) selected = self._get_selected_objects(treeview) ctrl.set_message_to_send(selected) view.show()
def on_treeview2_row_activated(self, treeview, path, col): model = treeview.get_model() if isinstance(model, ContactsModel): # we'll ignore activated events in the contact model # as the way to edit contacts is straight from treeview return if isinstance(model, gtk.TreeModelFilter): model = model.get_model() row = self.get_selected_row(treeview) obj = row[model.COL_OBJECT] m = SMSModel(self.model.device) ctrl = SMSController(m, self) view = SMSView(ctrl) view.set_parent_view(self.view) view.show() view.set_text(obj.text)