diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index 00bcb9b..a519d4c 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -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] diff --git a/TODO.mkdn b/TODO.mkdn index 6b4af30..f904509 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -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 diff --git a/dataobjs.py b/dataobjs.py index 71a0054..28260fd 100644 --- a/dataobjs.py +++ b/dataobjs.py @@ -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() diff --git a/parsetools.py b/parsetools.py index 19be1bf..6c3f52b 100644 --- a/parsetools.py +++ b/parsetools.py @@ -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: diff --git a/pesterchum.py b/pesterchum.py index 53b1d0a..87a8cf7 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -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 diff --git a/themes/FRESHjamz/style.js b/themes/FRESHjamz/style.js index 32448b6..1b23a63 100644 --- a/themes/FRESHjamz/style.js +++ b/themes/FRESHjamz/style.js @@ -47,6 +47,7 @@ "blockchum": "Block", "addchum": "Add Chum", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Unblock", "removegroup": "Remove Group", "renamegroup": "Rename Group", diff --git a/themes/Scratch/style.js b/themes/Scratch/style.js index 1bf32de..19eb7d2 100644 --- a/themes/Scratch/style.js +++ b/themes/Scratch/style.js @@ -45,6 +45,7 @@ "blockchum": "Slam", "addchum": "Add to Crew", "viewlog": "View Pesterlog", + "notes": "Edit Rhymes...", "unblockchum": "Rectify", "removegroup": "Forget Crew", "renamegroup": "Rename Crew", diff --git a/themes/Zodiac/style.js b/themes/Zodiac/style.js index 66c615b..35f2b59 100644 --- a/themes/Zodiac/style.js +++ b/themes/Zodiac/style.js @@ -45,6 +45,7 @@ "blockchum": "Block", "addchum": "Add Chum", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Unblock", "removegroup": "Remove Group", "renamegroup": "Rename Group", diff --git a/themes/enamel/style.js b/themes/enamel/style.js index 48dd823..d7c7076 100644 --- a/themes/enamel/style.js +++ b/themes/enamel/style.js @@ -43,6 +43,7 @@ "report": "Report", "addchum": "Add Chum", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Unblock", "removegroup": "Remove Group", "renamegroup": "Rename Group", diff --git a/themes/gold/style.js b/themes/gold/style.js index 265fe40..3691134 100644 --- a/themes/gold/style.js +++ b/themes/gold/style.js @@ -46,6 +46,7 @@ "blockchum": "Block", "addchum": "Add Chum", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Unblock", "removegroup": "Remove Group", "renamegroup": "Rename Group", diff --git a/themes/pesterchum/style.js b/themes/pesterchum/style.js index 61691bc..a38d1e6 100644 --- a/themes/pesterchum/style.js +++ b/themes/pesterchum/style.js @@ -46,6 +46,7 @@ "blockchum": "BLOCK", "addchum": "ADD CHUM", "viewlog": "VIEW PESTERLOG", + "notes": "EDIT NOTES...", "unblockchum": "UNBLOCK", "removegroup": "REMOVE GROUP", "renamegroup": "RENAME GROUP", diff --git a/themes/trollian/style.js b/themes/trollian/style.js index 5ed485c..f04c4b7 100644 --- a/themes/trollian/style.js +++ b/themes/trollian/style.js @@ -45,6 +45,7 @@ "blockchum": "Block", "addchum": "Add Chump", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Mercy", "removegroup": "Remove Group", "renamegroup": "Rename Group", diff --git a/themes/typewriter/style.js b/themes/typewriter/style.js index 8386ac4..81a0e69 100644 --- a/themes/typewriter/style.js +++ b/themes/typewriter/style.js @@ -46,6 +46,7 @@ "blockchum": "Condemn", "addchum": "Add User", "viewlog": "View Pesterlog", + "notes": "Edit Notes...", "unblockchum": "Forgive", "removegroup": "Remove Group", "renamegroup": "Rename Group",