Skip to content

Commit

Permalink
Fix wrong channel order caused by 5a8ac3c
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Kotrasinski <[email protected]>
  • Loading branch information
Wesmania committed Jun 15, 2017
1 parent d9f6fe5 commit 18fd1bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/chat/_chatwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,12 @@ def finishDownloadAvatar(self, reply):
self.channels[channel].chatters[player].avatarItem.setIcon(QtGui.QIcon(util.respix(reply.url().toString())))
self.channels[channel].chatters[player].avatarItem.setToolTip(self.channels[channel].chatters[player].avatarTip)

def addChannel(self, name, channel):
def addChannel(self, name, channel, index = None):
self.channels[name] = channel
self.addTab(self.channels[name], name)
channel.setTextWidth()
if index is None:
self.addTab(self.channels[name], name)
else:
self.insertTab(index, self.channels[name], name)

def closeChannel(self, index):
"""
Expand Down Expand Up @@ -277,14 +279,14 @@ def on_join(self, c, e):
if channel not in self.channels:
newch = Channel(self, channel)
if channel.lower() in self.crucialChannels:
self.insertTab(1, newch, channel) # CAVEAT: This is assumes a server tab exists.
self.addChannel(channel, newch, 1) # CAVEAT: This is assumes a server tab exists.
self.client.localBroadcast.connect(newch.printRaw)
newch.printAnnouncement("Welcome to Forged Alliance Forever!", "red", "+3")
newch.printAnnouncement("Check out the wiki: http://wiki.faforever.com for help with common issues.", "white", "+1")
newch.printAnnouncement("", "black", "+1")
newch.printAnnouncement("", "black", "+1")

self.addChannel(channel, newch)
else:
self.addChannel(channel, newch)

if channel.lower() in self.crucialChannels: # Make the crucial channels not closeable, and make the last one the active one
self.setCurrentWidget(self.channels[channel])
Expand Down
1 change: 1 addition & 0 deletions src/chat/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def setTextWidth(self):

def showEvent(self, event):
self.stopBlink()
self.setTextWidth()
return BaseClass.showEvent(self, event)

@QtCore.pyqtSlot()
Expand Down

0 comments on commit 18fd1bc

Please sign in to comment.