Chum notes

This commit is contained in:
Kiooeht 2011-08-22 01:13:43 -07:00
parent e0dafd76ab
commit 99b701061b
13 changed files with 49 additions and 10 deletions

View file

@ -24,6 +24,7 @@ CHANGELOG
* Auto-update from zip and tar - Kiooeht [evacipatedBox] * Auto-update from zip and tar - Kiooeht [evacipatedBox]
* Minimizable memo userlist - Kiooeht [evacipatedBox] (Idea: [alGore], [lostGash]) * Minimizable memo userlist - Kiooeht [evacipatedBox] (Idea: [alGore], [lostGash])
* Chumroll notifications on chum sign-in/out - Kiooeht [evacipatedBox] * Chumroll notifications on chum sign-in/out - Kiooeht [evacipatedBox]
* Chum notes - Kiooeht [evacipatedBox]
* 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

@ -12,7 +12,6 @@ Features
* "Someone has friended you" notifier * "Someone has friended you" notifier
* Show true bans? * Show true bans?
* Colour saving boxes things? * Colour saving boxes things?
* Chum notes?
* Whowas for last seen online? * Whowas for last seen online?
* Tab completion of two letter names * Tab completion of two letter names
* Customizable name alerts * Customizable name alerts

View file

@ -165,7 +165,7 @@ class pesterQuirks(object):
yield q yield q
class PesterProfile(object): 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 self.handle = handle
if color is None: if color is None:
if chumdb: if chumdb:
@ -180,6 +180,7 @@ class PesterProfile(object):
else: else:
group = "Chums" group = "Chums"
self.group = group self.group = group
self.notes = notes
def initials(self, time=None): def initials(self, time=None):
handle = self.handle handle = self.handle
caps = [l for l in handle if l.isupper()] caps = [l for l in handle if l.isupper()]
@ -210,7 +211,8 @@ class PesterProfile(object):
return (self.handle, {"handle": self.handle, return (self.handle, {"handle": self.handle,
"mood": self.mood.name(), "mood": self.mood.name(),
"color": unicode(self.color.name()), "color": unicode(self.color.name()),
"group": unicode(self.group)}) "group": unicode(self.group),
"notes": unicode(self.notes)})
def blocked(self, config): def blocked(self, config):
return self.handle in config.getBlocklist() return self.handle in config.getBlocklist()

View file

@ -505,7 +505,7 @@ def themeChecker(theme):
"main/menus/rclickchumlist/invitechum", "main/menus/client/randen", \ "main/menus/rclickchumlist/invitechum", "main/menus/client/randen", \
"main/menus/rclickchumlist/memosetting", "main/menus/rclickchumlist/memonoquirk", \ "main/menus/rclickchumlist/memosetting", "main/menus/rclickchumlist/memonoquirk", \
"main/menus/rclickchumlist/memohidden", "main/menus/rclickchumlist/memoinvite", \ "main/menus/rclickchumlist/memohidden", "main/menus/rclickchumlist/memoinvite", \
"main/menus/rclickchumlist/memomute"] "main/menus/rclickchumlist/memomute", "main/menus/rclickchumlist/notes"]
for n in needs: for n in needs:
try: try:

View file

@ -196,11 +196,12 @@ class PesterProfileDB(dict):
u = [] u = []
for (handle, c) in chumdict.iteritems(): for (handle, c) in chumdict.iteritems():
try: options = dict()
g = c['group'] if 'group' in c:
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']), group=g))) options['group'] = c['group']
except KeyError: if 'notes' in c:
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood'])))) options['notes'] = c['notes']
u.append((handle, PesterProfile(handle, color=QtGui.QColor(c['color']), mood=Mood(c['mood']), **options)))
converted = dict(u) converted = dict(u)
self.update(converted) self.update(converted)
@ -233,6 +234,17 @@ class PesterProfileDB(dict):
else: else:
self[handle] = PesterProfile(handle, group=theGroup) self[handle] = PesterProfile(handle, group=theGroup)
self.save() 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): def __setitem__(self, key, val):
dict.__setitem__(self, key, val) dict.__setitem__(self, key, val)
self.save() self.save()
@ -642,6 +654,7 @@ class chumListing(QtGui.QTreeWidgetItem):
self.handle = chum.handle self.handle = chum.handle
self.setMood(Mood("offline")) self.setMood(Mood("offline"))
self.status = None self.status = None
self.setToolTip(0, "%s: %s" % (chum.handle, window.chumdb.getNotes(chum.handle)))
def setMood(self, mood): def setMood(self, mood):
if self.mainwindow.chumList.notify: if self.mainwindow.chumList.notify:
#print "%s -> %s" % (self.chum.mood.name(), mood.name()) #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.renamegroup = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/renamegroup"], self)
self.connect(self.renamegroup, QtCore.SIGNAL('triggered()'), self.connect(self.renamegroup, QtCore.SIGNAL('triggered()'),
self, QtCore.SLOT('renameGroup()')) 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.pester)
self.optionsMenu.addAction(self.logchum) self.optionsMenu.addAction(self.logchum)
self.optionsMenu.addAction(self.notes)
self.optionsMenu.addAction(self.blockchum) self.optionsMenu.addAction(self.blockchum)
self.optionsMenu.addAction(self.removechum) self.optionsMenu.addAction(self.removechum)
self.moveMenu = QtGui.QMenu(self.mainwindow.theme["main/menus/rclickchumlist/movechum"], self) 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.blockchum.setText(theme["main/menus/rclickchumlist/blockchum"])
self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"]) self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"])
self.reportchum.setText(theme["main/menus/rclickchumlist/report"]) 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.removegroup.setText(theme["main/menus/rclickchumlist/removegroup"])
self.renamegroup.setText(theme["main/menus/rclickchumlist/renamegroup"]) self.renamegroup.setText(theme["main/menus/rclickchumlist/renamegroup"])
self.moveMenu.setTitle(theme["main/menus/rclickchumlist/movechum"]) 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") self.mainwindow.sendMessage.emit("ALT %s" % (currentChum.chum.handle) , "calSprite")
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def openChumLogs(self): def openChumLogs(self):
currentChum = self.currentItem().text(0) currentChum = self.currentItem()
if not currentChum: if not currentChum:
return return
currentChum = currentChum.text(0)
self.pesterlogviewer = PesterLogViewer(currentChum, self.mainwindow.config, self.mainwindow.theme, self.mainwindow) self.pesterlogviewer = PesterLogViewer(currentChum, self.mainwindow.config, self.mainwindow.theme, self.mainwindow)
self.connect(self.pesterlogviewer, QtCore.SIGNAL('rejected()'), self.connect(self.pesterlogviewer, QtCore.SIGNAL('rejected()'),
self, QtCore.SLOT('closeActiveLog()')) self, QtCore.SLOT('closeActiveLog()'))
@ -1205,6 +1224,16 @@ class chumArea(RightClickTree):
self.pesterlogviewer.close() self.pesterlogviewer.close()
self.pesterlogviewer = None self.pesterlogviewer = None
@QtCore.pyqtSlot() @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): def renameGroup(self):
if not hasattr(self, 'renamegroupdialog'): if not hasattr(self, 'renamegroupdialog'):
self.renamegroupdialog = None self.renamegroupdialog = None

View file

@ -47,6 +47,7 @@
"blockchum": "Block", "blockchum": "Block",
"addchum": "Add Chum", "addchum": "Add Chum",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Unblock", "unblockchum": "Unblock",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",

View file

@ -45,6 +45,7 @@
"blockchum": "Slam", "blockchum": "Slam",
"addchum": "Add to Crew", "addchum": "Add to Crew",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Rhymes...",
"unblockchum": "Rectify", "unblockchum": "Rectify",
"removegroup": "Forget Crew", "removegroup": "Forget Crew",
"renamegroup": "Rename Crew", "renamegroup": "Rename Crew",

View file

@ -45,6 +45,7 @@
"blockchum": "Block", "blockchum": "Block",
"addchum": "Add Chum", "addchum": "Add Chum",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Unblock", "unblockchum": "Unblock",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",

View file

@ -43,6 +43,7 @@
"report": "Report", "report": "Report",
"addchum": "Add Chum", "addchum": "Add Chum",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Unblock", "unblockchum": "Unblock",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",

View file

@ -46,6 +46,7 @@
"blockchum": "Block", "blockchum": "Block",
"addchum": "Add Chum", "addchum": "Add Chum",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Unblock", "unblockchum": "Unblock",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",

View file

@ -46,6 +46,7 @@
"blockchum": "BLOCK", "blockchum": "BLOCK",
"addchum": "ADD CHUM", "addchum": "ADD CHUM",
"viewlog": "VIEW PESTERLOG", "viewlog": "VIEW PESTERLOG",
"notes": "EDIT NOTES...",
"unblockchum": "UNBLOCK", "unblockchum": "UNBLOCK",
"removegroup": "REMOVE GROUP", "removegroup": "REMOVE GROUP",
"renamegroup": "RENAME GROUP", "renamegroup": "RENAME GROUP",

View file

@ -45,6 +45,7 @@
"blockchum": "Block", "blockchum": "Block",
"addchum": "Add Chump", "addchum": "Add Chump",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Mercy", "unblockchum": "Mercy",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",

View file

@ -46,6 +46,7 @@
"blockchum": "Condemn", "blockchum": "Condemn",
"addchum": "Add User", "addchum": "Add User",
"viewlog": "View Pesterlog", "viewlog": "View Pesterlog",
"notes": "Edit Notes...",
"unblockchum": "Forgive", "unblockchum": "Forgive",
"removegroup": "Remove Group", "removegroup": "Remove Group",
"renamegroup": "Rename Group", "renamegroup": "Rename Group",