Added "change room" on list double click
This commit is contained in:
parent
7cc1b29615
commit
d64c16e4e4
@ -72,6 +72,10 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
self.listTreeView.expandAll()
|
self.listTreeView.expandAll()
|
||||||
self.listTreeView.resizeColumnToContents(1)
|
self.listTreeView.resizeColumnToContents(1)
|
||||||
|
|
||||||
|
def roomClicked(self, item):
|
||||||
|
while(item.parent().row() != -1):
|
||||||
|
item = item.parent()
|
||||||
|
self.joinRoom(item.sibling(item.row(), 0).data())
|
||||||
|
|
||||||
def userListChange(self):
|
def userListChange(self):
|
||||||
self._syncplayClient.showUserList()
|
self._syncplayClient.showUserList()
|
||||||
@ -82,13 +86,15 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
def showErrorMessage(self, message):
|
def showErrorMessage(self, message):
|
||||||
print("ERROR:\t" + message)
|
print("ERROR:\t" + message)
|
||||||
|
|
||||||
def joinRoom(self):
|
def joinRoom(self, room = None):
|
||||||
room = self.roomInput.text()
|
if room == None:
|
||||||
|
room = self.roomInput.text()
|
||||||
if room == "":
|
if room == "":
|
||||||
if self._syncplayClient.userlist.currentUser.file:
|
if self._syncplayClient.userlist.currentUser.file:
|
||||||
room = self._syncplayClient.userlist.currentUser.file["name"]
|
room = self._syncplayClient.userlist.currentUser.file["name"]
|
||||||
else:
|
else:
|
||||||
room = self._syncplayClient.defaultRoom
|
room = self._syncplayClient.defaultRoom
|
||||||
|
self.roomInput.setText(room)
|
||||||
self._syncplayClient.setRoom(room)
|
self._syncplayClient.setRoom(room)
|
||||||
self._syncplayClient.sendRoom()
|
self._syncplayClient.sendRoom()
|
||||||
|
|
||||||
@ -179,6 +185,7 @@ class MainWindow(QtGui.QMainWindow):
|
|||||||
window.listTreeModel = QtGui.QStandardItemModel()
|
window.listTreeModel = QtGui.QStandardItemModel()
|
||||||
window.listTreeView = QtGui.QTreeView()
|
window.listTreeView = QtGui.QTreeView()
|
||||||
window.listTreeView.setModel(window.listTreeModel)
|
window.listTreeView.setModel(window.listTreeModel)
|
||||||
|
window.listTreeView.doubleClicked.connect(self.roomClicked)
|
||||||
window.listlabel = QtGui.QLabel("List of who is playing what")
|
window.listlabel = QtGui.QLabel("List of who is playing what")
|
||||||
window.listFrame = QtGui.QFrame()
|
window.listFrame = QtGui.QFrame()
|
||||||
window.listFrame.setLineWidth(0)
|
window.listFrame.setLineWidth(0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user