Chum notes
This commit is contained in:
parent
e0dafd76ab
commit
99b701061b
13 changed files with 49 additions and 10 deletions
|
@ -24,6 +24,7 @@ CHANGELOG
|
|||
* Auto-update from zip and tar - Kiooeht [evacipatedBox]
|
||||
* Minimizable memo userlist - Kiooeht [evacipatedBox] (Idea: [alGore], [lostGash])
|
||||
* Chumroll notifications on chum sign-in/out - Kiooeht [evacipatedBox]
|
||||
* Chum notes - Kiooeht [evacipatedBox]
|
||||
* Bug fixes
|
||||
* 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]
|
||||
|
|
|
@ -12,7 +12,6 @@ Features
|
|||
* "Someone has friended you" notifier
|
||||
* Show true bans?
|
||||
* Colour saving boxes things?
|
||||
* Chum notes?
|
||||
* Whowas for last seen online?
|
||||
* Tab completion of two letter names
|
||||
* Customizable name alerts
|
||||
|
|
|
@ -165,7 +165,7 @@ class pesterQuirks(object):
|
|||
yield q
|
||||
|
||||
class PesterProfile(object):
|
||||
def __init__(self, handle, color=None, mood=Mood("offline"), group=None, chumdb=None):
|
||||
def __init__(self, handle, color=None, mood=Mood("offline"), group=None, notes="", chumdb=None):
|
||||
self.handle = handle
|
||||
if color is None:
|
||||
if chumdb:
|
||||
|
@ -180,6 +180,7 @@ class PesterProfile(object):
|
|||
else:
|
||||
group = "Chums"
|
||||
self.group = group
|
||||
self.notes = notes
|
||||
def initials(self, time=None):
|
||||
handle = self.handle
|
||||
caps = [l for l in handle if l.isupper()]
|
||||
|
@ -210,7 +211,8 @@ class PesterProfile(object):
|
|||
return (self.handle, {"handle": self.handle,
|
||||
"mood": self.mood.name(),
|
||||
"color": unicode(self.color.name()),
|
||||
"group": unicode(self.group)})
|
||||
"group": unicode(self.group),
|
||||
"notes": unicode(self.notes)})
|
||||
def blocked(self, config):
|
||||
return self.handle in config.getBlocklist()
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ def themeChecker(theme):
|
|||
"main/menus/rclickchumlist/invitechum", "main/menus/client/randen", \
|
||||
"main/menus/rclickchumlist/memosetting", "main/menus/rclickchumlist/memonoquirk", \
|
||||
"main/menus/rclickchumlist/memohidden", "main/menus/rclickchumlist/memoinvite", \
|
||||
"main/menus/rclickchumlist/memomute"]
|
||||
"main/menus/rclickchumlist/memomute", "main/menus/rclickchumlist/notes"]
|
||||
|
||||
for n in needs:
|
||||
try:
|
||||
|
|
|
@ -196,11 +196,12 @@ class PesterProfileDB(dict):
|
|||
|
||||
u = []
|
||||
for (handle, c) in chumdict.iteritems():
|
||||
try:
|
||||
g = c['group']
|
||||
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']), group=g)))
|
||||
except KeyError:
|
||||
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']))))
|
||||
options = dict()
|
||||
if 'group' in c:
|
||||
options['group'] = c['group']
|
||||
if 'notes' in c:
|
||||
options['notes'] = c['notes']
|
||||
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']), **options)))
|
||||
converted = dict(u)
|
||||
self.update(converted)
|
||||
|
||||
|
@ -233,6 +234,17 @@ class PesterProfileDB(dict):
|
|||
else:
|
||||
self[handle] = PesterProfile(handle, group=theGroup)
|
||||
self.save()
|
||||
def getNotes(self, handle, default=""):
|
||||
if not self.has_key(handle):
|
||||
return default
|
||||
else:
|
||||
return self[handle].notes
|
||||
def setNotes(self, handle, notes):
|
||||
if self.has_key(handle):
|
||||
self[handle].notes = notes
|
||||
else:
|
||||
self[handle] = PesterProfile(handle, notes=notes)
|
||||
self.save()
|
||||
def __setitem__(self, key, val):
|
||||
dict.__setitem__(self, key, val)
|
||||
self.save()
|
||||
|
@ -642,6 +654,7 @@ class chumListing(QtGui.QTreeWidgetItem):
|
|||
self.handle = chum.handle
|
||||
self.setMood(Mood("offline"))
|
||||
self.status = None
|
||||
self.setToolTip(0, "%s: %s" % (chum.handle, window.chumdb.getNotes(chum.handle)))
|
||||
def setMood(self, mood):
|
||||
if self.mainwindow.chumList.notify:
|
||||
#print "%s -> %s" % (self.chum.mood.name(), mood.name())
|
||||
|
@ -753,9 +766,13 @@ class chumArea(RightClickTree):
|
|||
self.renamegroup = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/renamegroup"], self)
|
||||
self.connect(self.renamegroup, QtCore.SIGNAL('triggered()'),
|
||||
self, QtCore.SLOT('renameGroup()'))
|
||||
self.notes = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/notes"], self)
|
||||
self.connect(self.notes, QtCore.SIGNAL('triggered()'),
|
||||
self, QtCore.SLOT('editNotes()'))
|
||||
|
||||
self.optionsMenu.addAction(self.pester)
|
||||
self.optionsMenu.addAction(self.logchum)
|
||||
self.optionsMenu.addAction(self.notes)
|
||||
self.optionsMenu.addAction(self.blockchum)
|
||||
self.optionsMenu.addAction(self.removechum)
|
||||
self.moveMenu = QtGui.QMenu(self.mainwindow.theme["main/menus/rclickchumlist/movechum"], self)
|
||||
|
@ -1116,6 +1133,7 @@ class chumArea(RightClickTree):
|
|||
self.blockchum.setText(theme["main/menus/rclickchumlist/blockchum"])
|
||||
self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"])
|
||||
self.reportchum.setText(theme["main/menus/rclickchumlist/report"])
|
||||
self.notes.setText(theme["main/menus/rclickchumlist/notes"])
|
||||
self.removegroup.setText(theme["main/menus/rclickchumlist/removegroup"])
|
||||
self.renamegroup.setText(theme["main/menus/rclickchumlist/renamegroup"])
|
||||
self.moveMenu.setTitle(theme["main/menus/rclickchumlist/movechum"])
|
||||
|
@ -1191,9 +1209,10 @@ class chumArea(RightClickTree):
|
|||
self.mainwindow.sendMessage.emit("ALT %s" % (currentChum.chum.handle) , "calSprite")
|
||||
@QtCore.pyqtSlot()
|
||||
def openChumLogs(self):
|
||||
currentChum = self.currentItem().text(0)
|
||||
currentChum = self.currentItem()
|
||||
if not currentChum:
|
||||
return
|
||||
currentChum = currentChum.text(0)
|
||||
self.pesterlogviewer = PesterLogViewer(currentChum, self.mainwindow.config, self.mainwindow.theme, self.mainwindow)
|
||||
self.connect(self.pesterlogviewer, QtCore.SIGNAL('rejected()'),
|
||||
self, QtCore.SLOT('closeActiveLog()'))
|
||||
|
@ -1205,6 +1224,16 @@ class chumArea(RightClickTree):
|
|||
self.pesterlogviewer.close()
|
||||
self.pesterlogviewer = None
|
||||
@QtCore.pyqtSlot()
|
||||
def editNotes(self):
|
||||
currentChum = self.currentItem()
|
||||
if not currentChum:
|
||||
return
|
||||
(notes, ok) = QtGui.QInputDialog.getText(self, "Notes", "Enter your notes...")
|
||||
if ok:
|
||||
notes = unicode(notes)
|
||||
self.mainwindow.chumdb.setNotes(currentChum.handle, notes)
|
||||
currentChum.setToolTip(0, "%s: %s" % (currentChum.handle, notes))
|
||||
@QtCore.pyqtSlot()
|
||||
def renameGroup(self):
|
||||
if not hasattr(self, 'renamegroupdialog'):
|
||||
self.renamegroupdialog = None
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
"blockchum": "Block",
|
||||
"addchum": "Add Chum",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Unblock",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
"blockchum": "Slam",
|
||||
"addchum": "Add to Crew",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Rhymes...",
|
||||
"unblockchum": "Rectify",
|
||||
"removegroup": "Forget Crew",
|
||||
"renamegroup": "Rename Crew",
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
"blockchum": "Block",
|
||||
"addchum": "Add Chum",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Unblock",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
"report": "Report",
|
||||
"addchum": "Add Chum",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Unblock",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"blockchum": "Block",
|
||||
"addchum": "Add Chum",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Unblock",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"blockchum": "BLOCK",
|
||||
"addchum": "ADD CHUM",
|
||||
"viewlog": "VIEW PESTERLOG",
|
||||
"notes": "EDIT NOTES...",
|
||||
"unblockchum": "UNBLOCK",
|
||||
"removegroup": "REMOVE GROUP",
|
||||
"renamegroup": "RENAME GROUP",
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
"blockchum": "Block",
|
||||
"addchum": "Add Chump",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Mercy",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
"blockchum": "Condemn",
|
||||
"addchum": "Add User",
|
||||
"viewlog": "View Pesterlog",
|
||||
"notes": "Edit Notes...",
|
||||
"unblockchum": "Forgive",
|
||||
"removegroup": "Remove Group",
|
||||
"renamegroup": "Rename Group",
|
||||
|
|
Loading…
Reference in a new issue