def keyPressEvent(self, event): key = event.key() modifier = event.modifiers() DELETE_BUDDY = (modifier == QtCore.Qt.ControlModifier) and ( key == QtCore.Qt.Key_Backspace) OPEN_CHAT_WIN = key == QtCore.Qt.Key_Return VIEW_PROFILE = (modifier == QtCore.Qt.ControlModifier) and (key == QtCore.Qt.Key_I) if OPEN_CHAT_WIN: contact = self.get_current_selected_contact() PRESS_ENTER_ON_CONTACT_ITEM = contact is not None if PRESS_ENTER_ON_CONTACT_ITEM: self.goto_or_create_tab_before_send_msg(contact) elif DELETE_BUDDY: # item = self.selection_model.selectedItems()[0] # uri = str(item.data(self.FIRST_COLUMN, QtCore.Qt.UserRole).toString()) # IS_BUDDY_ITEM = uri.find('sip:') != STR_NOT_FOUND # if IS_BUDDY_ITEM: uri = self._get_current_selected_uri() if uri: self.delete_buddy(uri) elif VIEW_PROFILE: uri = self._get_current_selected_uri() if uri: user = self.user.group_agent.get_contact_by_uri(uri) read_only = True ProfileDialog.get_data(self, user, read_only)
def keyPressEvent(self, event): key = event.key() modifier = event.modifiers() DELETE_BUDDY = (modifier == QtCore.Qt.ControlModifier) and (key == QtCore.Qt.Key_Backspace) OPEN_CHAT_WIN = key == QtCore.Qt.Key_Return VIEW_PROFILE = (modifier == QtCore.Qt.ControlModifier) and (key == QtCore.Qt.Key_I) if OPEN_CHAT_WIN: contact = self.get_current_selected_contact() PRESS_ENTER_ON_CONTACT_ITEM = contact is not None if PRESS_ENTER_ON_CONTACT_ITEM: self.goto_or_create_tab_before_send_msg(contact) elif DELETE_BUDDY: # item = self.selection_model.selectedItems()[0] # uri = str(item.data(self.FIRST_COLUMN, QtCore.Qt.UserRole).toString()) # IS_BUDDY_ITEM = uri.find('sip:') != STR_NOT_FOUND # if IS_BUDDY_ITEM: uri = self._get_current_selected_uri() if uri: self.delete_buddy(uri) elif VIEW_PROFILE: uri = self._get_current_selected_uri() if uri: user = self.user.group_agent.get_contact_by_uri(uri) read_only = True ProfileDialog.get_data(self, user, read_only)
def on_avatar_left_clicked(self): read_only = True user = self.blah.user is_save_btn_clicked, new_user = ProfileDialog.get_data( self, user, read_only) assert new_user != None
def on_avatar_left_clicked(self): read_only = True user = self.blah.user is_save_btn_clicked, new_user = ProfileDialog.get_data(self, user, read_only) assert new_user != None