Manually rearrange chumroll
This commit is contained in:
parent
d1ecdb2a38
commit
e9e97ab49c
5 changed files with 71 additions and 5 deletions
|
@ -39,6 +39,7 @@ CHANGELOG
|
||||||
* New smilies - Kiooeht [evacipatedBox]
|
* New smilies - Kiooeht [evacipatedBox]
|
||||||
* Refresh theme in options - Kiooeht [evacipatedBox]
|
* Refresh theme in options - Kiooeht [evacipatedBox]
|
||||||
* Separate tabbed/untabbed windows for conversaions and memos - Kiooeht [evacipatedBox]
|
* Separate tabbed/untabbed windows for conversaions and memos - Kiooeht [evacipatedBox]
|
||||||
|
* Manually rearrange chumroll - Kiooeht [evacipatedBox] (Idea: [turntableAbbess (aka. TA or SGRILL)])
|
||||||
* 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]
|
||||||
|
@ -46,6 +47,7 @@ CHANGELOG
|
||||||
* Trollian 2.5 tray icon is now Trollian icon - Kiooeht [evacipatedBox]
|
* Trollian 2.5 tray icon is now Trollian icon - Kiooeht [evacipatedBox]
|
||||||
* Don't screw up <c> tags with the mispeller - Kiooeht [evacipatedBox]
|
* Don't screw up <c> tags with the mispeller - Kiooeht [evacipatedBox]
|
||||||
* Don't break if profile uses non-existant theme - Kiooeht [evacipatedBox]
|
* Don't break if profile uses non-existant theme - Kiooeht [evacipatedBox]
|
||||||
|
* Properly rearrange groups when not displaying number of online chums - Kiooeht [evacipatedBox]
|
||||||
* Mac Bug fixes
|
* Mac Bug fixes
|
||||||
* Create all datadir stuff - Lexi [lexicalNuance]
|
* Create all datadir stuff - Lexi [lexicalNuance]
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ Features
|
||||||
* "Pester" menu option to just pester a handle
|
* "Pester" menu option to just pester a handle
|
||||||
* Auto-login Nickserv
|
* Auto-login Nickserv
|
||||||
* Make toast notifications only on certain chums
|
* Make toast notifications only on certain chums
|
||||||
|
* Local alisas for chums
|
||||||
|
* Italics/uderline - needed for canon
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
----
|
----
|
||||||
|
|
1
menus.py
1
menus.py
|
@ -1112,6 +1112,7 @@ class PesterOptions(QtGui.QDialog):
|
||||||
self.sortBox = QtGui.QComboBox(self)
|
self.sortBox = QtGui.QComboBox(self)
|
||||||
self.sortBox.addItem("Alphabetically")
|
self.sortBox.addItem("Alphabetically")
|
||||||
self.sortBox.addItem("By Mood")
|
self.sortBox.addItem("By Mood")
|
||||||
|
self.sortBox.addItem("Manually")
|
||||||
method = self.config.sortMethod()
|
method = self.config.sortMethod()
|
||||||
if method >= 0 and method < self.sortBox.count():
|
if method >= 0 and method < self.sortBox.count():
|
||||||
self.sortBox.setCurrentIndex(method)
|
self.sortBox.setCurrentIndex(method)
|
||||||
|
|
|
@ -329,8 +329,9 @@ class chumArea(RightClickTree):
|
||||||
event.ignore()
|
event.ignore()
|
||||||
return
|
return
|
||||||
thisitem = str(event.source().currentItem().text(0))
|
thisitem = str(event.source().currentItem().text(0))
|
||||||
if thisitem.rfind(" ") != -1:
|
if thisitem.rfind(" (") != -1:
|
||||||
thisitem = thisitem[0:thisitem.rfind(" ")]
|
thisitem = thisitem[0:thisitem.rfind(" (")]
|
||||||
|
# Drop item is a group
|
||||||
if thisitem == "Chums" or thisitem in self.groups:
|
if thisitem == "Chums" or thisitem in self.groups:
|
||||||
droppos = self.itemAt(event.pos())
|
droppos = self.itemAt(event.pos())
|
||||||
if not droppos: return
|
if not droppos: return
|
||||||
|
@ -352,24 +353,46 @@ class chumArea(RightClickTree):
|
||||||
text = text[0:text.rfind(" (")]
|
text = text[0:text.rfind(" (")]
|
||||||
gTemp.append([unicode(text), self.topLevelItem(i).isExpanded()])
|
gTemp.append([unicode(text), self.topLevelItem(i).isExpanded()])
|
||||||
self.mainwindow.config.saveGroups(gTemp)
|
self.mainwindow.config.saveGroups(gTemp)
|
||||||
|
# Drop item is a chum
|
||||||
else:
|
else:
|
||||||
item = self.itemAt(event.pos())
|
item = self.itemAt(event.pos())
|
||||||
if item:
|
if item:
|
||||||
text = str(item.text(0))
|
text = str(item.text(0))
|
||||||
|
# Figure out which group to drop into
|
||||||
if text.rfind(" (") != -1:
|
if text.rfind(" (") != -1:
|
||||||
text = text[0:text.rfind(" (")]
|
text = text[0:text.rfind(" (")]
|
||||||
if text == "Chums" or text in self.groups:
|
if text == "Chums" or text in self.groups:
|
||||||
group = text
|
group = text
|
||||||
|
gitem = item
|
||||||
else:
|
else:
|
||||||
ptext = str(item.parent().text(0))
|
ptext = str(item.parent().text(0))
|
||||||
if ptext.rfind(" ") != -1:
|
if ptext.rfind(" ") != -1:
|
||||||
ptext = ptext[0:ptext.rfind(" ")]
|
ptext = ptext[0:ptext.rfind(" ")]
|
||||||
group = ptext
|
group = ptext
|
||||||
|
gitem = item.parent()
|
||||||
|
|
||||||
chumLabel = event.source().currentItem()
|
chumLabel = event.source().currentItem()
|
||||||
chumLabel.chum.group = group
|
chumLabel.chum.group = group
|
||||||
self.mainwindow.chumdb.setGroup(chumLabel.chum.handle, group)
|
self.mainwindow.chumdb.setGroup(chumLabel.chum.handle, group)
|
||||||
self.takeItem(chumLabel)
|
self.takeItem(chumLabel)
|
||||||
self.addItem(chumLabel)
|
# Using manual chum reordering
|
||||||
|
if self.mainwindow.config.sortMethod() == 2:
|
||||||
|
insertIndex = gitem.indexOfChild(item)
|
||||||
|
if insertIndex == -1:
|
||||||
|
insertIndex = 0
|
||||||
|
gitem.insertChild(insertIndex, chumLabel)
|
||||||
|
chums = self.mainwindow.config.chums()
|
||||||
|
if item == gitem:
|
||||||
|
item = gitem.child(0)
|
||||||
|
inPos = chums.index(str(item.text(0)))
|
||||||
|
if chums.index(thisitem) < inPos:
|
||||||
|
inPos -= 1
|
||||||
|
chums.remove(thisitem)
|
||||||
|
chums.insert(inPos, unicode(thisitem))
|
||||||
|
|
||||||
|
self.mainwindow.config.setChums(chums)
|
||||||
|
else:
|
||||||
|
self.addItem(chumLabel)
|
||||||
if self.mainwindow.config.showOnlineNumbers():
|
if self.mainwindow.config.showOnlineNumbers():
|
||||||
self.showOnlineNumbers()
|
self.showOnlineNumbers()
|
||||||
|
|
||||||
|
@ -538,7 +561,33 @@ class chumArea(RightClickTree):
|
||||||
text = text[0:text.rfind(" (")]
|
text = text[0:text.rfind(" (")]
|
||||||
if text == chumLabel.chum.group:
|
if text == chumLabel.chum.group:
|
||||||
break
|
break
|
||||||
self.topLevelItem(i).addChild(chumLabel)
|
# Manual sorting
|
||||||
|
if self.mainwindow.config.sortMethod() == 2:
|
||||||
|
chums = self.mainwindow.config.chums()
|
||||||
|
fi = chums.index(chumLabel.chum.handle)
|
||||||
|
c = 1
|
||||||
|
|
||||||
|
# TODO: Rearrange chums list on drag-n-drop
|
||||||
|
bestj = 0
|
||||||
|
bestname = ""
|
||||||
|
if fi > 0:
|
||||||
|
while not bestj:
|
||||||
|
for j in xrange(self.topLevelItem(i).childCount()):
|
||||||
|
if chums[fi-c] == str(self.topLevelItem(i).child(j).text(0)):
|
||||||
|
bestj = j
|
||||||
|
bestname = chums[fi-c]
|
||||||
|
break
|
||||||
|
c += 1
|
||||||
|
if fi-c < 0:
|
||||||
|
break
|
||||||
|
if bestname:
|
||||||
|
self.topLevelItem(i).insertChild(bestj+1, chumLabel)
|
||||||
|
else:
|
||||||
|
self.topLevelItem(i).insertChild(bestj, chumLabel)
|
||||||
|
#sys.exit(0)
|
||||||
|
self.topLevelItem(i).addChild(chumLabel)
|
||||||
|
else: # All other sorting
|
||||||
|
self.topLevelItem(i).addChild(chumLabel)
|
||||||
self.sort()
|
self.sort()
|
||||||
if self.mainwindow.config.showOnlineNumbers():
|
if self.mainwindow.config.showOnlineNumbers():
|
||||||
self.showOnlineNumbers()
|
self.showOnlineNumbers()
|
||||||
|
@ -628,7 +677,9 @@ class chumArea(RightClickTree):
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def sort(self):
|
def sort(self):
|
||||||
if self.mainwindow.config.sortMethod() == 1:
|
if self.mainwindow.config.sortMethod() == 2:
|
||||||
|
pass # Do nothing!!!!! :OOOOOOO It's manual, bitches
|
||||||
|
elif self.mainwindow.config.sortMethod() == 1:
|
||||||
for i in range(self.topLevelItemCount()):
|
for i in range(self.topLevelItemCount()):
|
||||||
self.moodSort(i)
|
self.moodSort(i)
|
||||||
else:
|
else:
|
||||||
|
|
10
profile.py
10
profile.py
|
@ -121,6 +121,16 @@ class userConfig(object):
|
||||||
if not self.config.has_key('chums'):
|
if not self.config.has_key('chums'):
|
||||||
self.set("chums", [])
|
self.set("chums", [])
|
||||||
return self.config.get('chums', [])
|
return self.config.get('chums', [])
|
||||||
|
def setChums(self, newchums):
|
||||||
|
fp = open(self.filename) # what if we have two clients open??
|
||||||
|
newconfig = json.load(fp)
|
||||||
|
fp.close()
|
||||||
|
oldchums = newconfig['chums']
|
||||||
|
# Time to merge these two! :OOO
|
||||||
|
for c in list(set(oldchums) - set(newchums)):
|
||||||
|
newchums.append(c)
|
||||||
|
|
||||||
|
self.set("chums", newchums)
|
||||||
def hideOfflineChums(self):
|
def hideOfflineChums(self):
|
||||||
return self.config.get('hideOfflineChums', False)
|
return self.config.get('hideOfflineChums', False)
|
||||||
def defaultprofile(self):
|
def defaultprofile(self):
|
||||||
|
|
Loading…
Reference in a new issue