Sort memo list

This commit is contained in:
Kiooeht 2011-09-05 15:17:07 -07:00
parent b0e9a1aaac
commit 6a05bab45b
3 changed files with 13 additions and 0 deletions

View file

@ -31,6 +31,7 @@ CHANGELOG
* Netsplit notification in memos - Kiooeht [evacipatedBox] * Netsplit notification in memos - Kiooeht [evacipatedBox]
* Toast Notifications - Kiooeht [evacipatedBox] * Toast Notifications - Kiooeht [evacipatedBox]
* Disable randomEncounter options when it's offline - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) * Disable randomEncounter options when it's offline - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance])
* Sort list of memos alphabetically or by number of users - Kiooeht [evacipatedBox] (Idea: [lostGash])
* Bug fixes * Bug fixes
* Don't delete random chum when blocking someone not on chumroll - Kiooeht [evacipatedBox] * Don't delete random chum when blocking someone not on chumroll - Kiooeht [evacipatedBox]
* Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox] * Openning global userlist doesn't reset OP status of memo users - Kiooeht [evacipatedBox]

View file

@ -17,6 +17,11 @@ Features
* When 'banned' make impossible to connect using timestamp banned under * When 'banned' make impossible to connect using timestamp banned under
* Auto download/install updates via Windows installer * Auto download/install updates via Windows installer
* Turn memo notifications on/off from right-click menu on memos (Idea: lostGash) * Turn memo notifications on/off from right-click menu on memos (Idea: lostGash)
* Use MemoServ to send offline messages in email-like fashion (Idea: ghostDunk)
* Use MemoServ to save profiles (Idea: ghostDunk)
* Better NickServ registering
* Unified data storage, OS-based user data location
* Spectation notices (Idea: lexicalNuance)
Bugs Bugs
---- ----

View file

@ -1530,6 +1530,11 @@ class MemoListItem(QtGui.QTreeWidgetItem):
def __init__(self, channel, usercount): def __init__(self, channel, usercount):
QtGui.QTreeWidgetItem.__init__(self, [channel, str(usercount)]) QtGui.QTreeWidgetItem.__init__(self, [channel, str(usercount)])
self.target = channel self.target = channel
def __lt__(self, other):
column = self.treeWidget().sortColumn()
if str(self.text(column)).isdigit() and str(other.text(column)).isdigit():
return int(self.text(column)) < int(other.text(column))
return self.text(column) < other.text(column)
class PesterMemoList(QtGui.QDialog): class PesterMemoList(QtGui.QDialog):
def __init__(self, parent, channel=""): def __init__(self, parent, channel=""):
@ -1549,6 +1554,8 @@ class PesterMemoList(QtGui.QDialog):
self.channelarea.setIndentation(0) self.channelarea.setIndentation(0)
self.channelarea.setColumnWidth(0,200) self.channelarea.setColumnWidth(0,200)
self.channelarea.setColumnWidth(1,10) self.channelarea.setColumnWidth(1,10)
self.channelarea.setSortingEnabled(True)
self.channelarea.sortByColumn(0, QtCore.Qt.AscendingOrder)
self.connect(self.channelarea, self.connect(self.channelarea,
QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem *, int)'), QtCore.SIGNAL('itemDoubleClicked(QTreeWidgetItem *, int)'),
self, QtCore.SLOT('joinActivatedMemo()')) self, QtCore.SLOT('joinActivatedMemo()'))