contacts minor refactoring

This commit is contained in:
ingvar1995 2018-04-18 23:55:51 +03:00
parent 0ba1aadf70
commit dec4990d32
12 changed files with 204 additions and 188 deletions

View file

@ -1,5 +1,5 @@
from contacts import contact
import util
import util.util as util
from PyQt5 import QtGui, QtCore
from wrapper import toxcore_enums_and_consts as constants
@ -8,8 +8,8 @@ from wrapper import toxcore_enums_and_consts as constants
class GroupChat(contact.Contact):
def __init__(self, name, status_message, widget, tox, group_number):
super().__init__(None, group_number, name, status_message, widget, None)
def __init__(self, profile_manager, name, status_message, widget, tox, group_number):
super().__init__(None, group_number, profile_manager, name, status_message, widget, None)
self._tox = tox
self.set_status(constants.TOX_USER_STATUS['NONE'])
@ -23,13 +23,9 @@ class GroupChat(contact.Contact):
def new_title(self, title):
super().set_name(title)
def load_avatar(self):
path = util.curr_directory() + '/images/group.png'
width = self._widget.avatar_label.width()
pixmap = QtGui.QPixmap(path)
self._widget.avatar_label.setPixmap(pixmap.scaled(width, width, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation))
self._widget.avatar_label.repaint()
@staticmethod
def get_default_avatar_name():
return 'group.png'
def remove_invalid_unsent_files(self):
pass