file transfers and login screen fix
This commit is contained in:
parent
0cf459e3a9
commit
f5d129578e
2 changed files with 22 additions and 6 deletions
|
@ -194,6 +194,9 @@ def file_chunk_request(tox, friend_number, file_number, position, size, user_dat
|
|||
"""
|
||||
Outgoing chunk
|
||||
"""
|
||||
if size:
|
||||
Profile.get_instance().outgoing_chunk(friend_number, file_number, position, size)
|
||||
else:
|
||||
invoke_in_main_thread(Profile.get_instance().outgoing_chunk,
|
||||
friend_number,
|
||||
file_number,
|
||||
|
|
|
@ -4,6 +4,19 @@ from PySide import QtCore, QtGui
|
|||
from widgets import *
|
||||
|
||||
|
||||
class NickEdit(QtGui.QPlainTextEdit):
|
||||
|
||||
def __init__(self, parent):
|
||||
super(NickEdit, self).__init__(parent)
|
||||
self.parent = parent
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if event.key() == QtCore.Qt.Key_Return:
|
||||
self.parent.create_profile()
|
||||
else:
|
||||
super(NickEdit, self).keyPressEvent(event)
|
||||
|
||||
|
||||
class LoginScreen(CenteredWidget):
|
||||
|
||||
def __init__(self):
|
||||
|
@ -19,7 +32,7 @@ class LoginScreen(CenteredWidget):
|
|||
self.new_profile.clicked.connect(self.create_profile)
|
||||
self.label = QtGui.QLabel(self)
|
||||
self.label.setGeometry(QtCore.QRect(20, 70, 101, 17))
|
||||
self.new_name = QtGui.QPlainTextEdit(self)
|
||||
self.new_name = NickEdit(self)
|
||||
self.new_name.setGeometry(QtCore.QRect(20, 100, 171, 31))
|
||||
self.load_profile = QtGui.QPushButton(self)
|
||||
self.load_profile.setGeometry(QtCore.QRect(220, 150, 161, 27))
|
||||
|
|
Loading…
Reference in a new issue