diff --git a/src/menu.py b/src/menu.py index 474a201..2363f6f 100644 --- a/src/menu.py +++ b/src/menu.py @@ -1,5 +1,6 @@ from PySide import QtCore, QtGui from settings import Settings +from util import bin_to_string class AddContact(QtGui.QWidget): @@ -102,8 +103,7 @@ class ProfileSettings(QtGui.QWidget): font.setBold(True) self.tox_id.setFont(font) self.tox_id.setObjectName("tox_id") - # TODO: copy TOX ID to self.tox_id - s = 'ID' + s = bin_to_string(self.tox.self_get_address().value) self.tox_id.setText(s) self.copyId = QtGui.QPushButton(self) self.copyId.setGeometry(QtCore.QRect(40, 250, 98, 31)) @@ -133,7 +133,7 @@ class ProfileSettings(QtGui.QWidget): def copy(self): clipboard = QtGui.QApplication.clipboard() - id = unicode(self.tox.self_get_public_key()) + id = bin_to_string(self.tox.self_get_address().value) clipboard.setText(id) diff --git a/tests/tests.py b/tests/tests.py index c488884..ea8ad30 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -66,3 +66,11 @@ class TestTox(): for data in node_generator(): tox.bootstrap(*data) del tox + + def test_friend_list(self): + data = Profile.open_profile(Settings.get_default_path(), 'tox_save') + settings = Settings.get_default_settings() + tox = tox_factory(data, settings) + s = tox.self_get_friend_list() + assert s + del tox