List current rooms in join list

This commit is contained in:
et0h 2021-11-07 16:21:41 +00:00
parent 3b2bb2726a
commit 4383ca5d7b

View File

@ -468,6 +468,9 @@ class MainWindow(QtWidgets.QMainWindow):
self.roomsCombobox.clear() self.roomsCombobox.clear()
for roomListValue in self.config['roomList']: for roomListValue in self.config['roomList']:
self.roomsCombobox.addItem(roomListValue) self.roomsCombobox.addItem(roomListValue)
for room in self.currentRooms:
if room not in self.config['roomList']:
self.roomsCombobox.addItem(room)
self.roomsCombobox.setEditText(previousRoomSelection) self.roomsCombobox.setEditText(previousRoomSelection)
def addRoomToList(self, newRoom=None): def addRoomToList(self, newRoom=None):
@ -603,7 +606,9 @@ class MainWindow(QtWidgets.QMainWindow):
): ):
self._syncplayClient.fileSwitch.setCurrentDirectory(os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"])) self._syncplayClient.fileSwitch.setCurrentDirectory(os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]))
self.currentRooms = []
for room in rooms: for room in rooms:
self.currentRooms.append(room)
if self.hideEmptyRooms: if self.hideEmptyRooms:
foundEmptyRooms = False foundEmptyRooms = False
for user in rooms[room]: for user in rooms[room]:
@ -704,6 +709,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.listTreeView.expandAll() self.listTreeView.expandAll()
self.updateListGeometry() self.updateListGeometry()
self._syncplayClient.fileSwitch.setFilenameWatchlist(self.newWatchlist) self._syncplayClient.fileSwitch.setFilenameWatchlist(self.newWatchlist)
self.fillRoomsCombobox()
@needsClient @needsClient
def undoPlaylistChange(self): def undoPlaylistChange(self):
@ -2085,6 +2091,7 @@ class MainWindow(QtWidgets.QMainWindow):
self._syncplayClient = None self._syncplayClient = None
self.folderSearchEnabled = True self.folderSearchEnabled = True
self.hideEmptyRooms = False self.hideEmptyRooms = False
self.currentRooms = []
self.QtGui = QtGui self.QtGui = QtGui
if isMacOS(): if isMacOS():
self.setWindowFlags(self.windowFlags()) self.setWindowFlags(self.windowFlags())