From a7f6ee4b3865a969f8591dd87c261cf4cbfca848 Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Mon, 9 May 2011 18:59:36 -0700 Subject: [PATCH] Give voice in memos --- CHANGELOG.mkdn | 1 + memos.py | 52 +++++++++++++++++++++++++++++++-- themes/enamel/style.js | 4 ++- themes/enamel/voice.png | Bin 0 -> 598 bytes themes/gold/style.js | 4 ++- themes/gold/voice.png | Bin 0 -> 598 bytes themes/pesterchum/style.js | 4 ++- themes/pesterchum/voice.png | Bin 0 -> 598 bytes themes/pesterchum2.5/voice.png | Bin 0 -> 598 bytes themes/trollian/style.js | 4 ++- themes/trollian/voice.png | Bin 0 -> 598 bytes themes/trollian2.5/voice.png | Bin 0 -> 598 bytes themes/typewriter/style.js | 4 ++- themes/typewriter/voice.png | Bin 0 -> 324 bytes 14 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 themes/enamel/voice.png create mode 100644 themes/gold/voice.png create mode 100644 themes/pesterchum/voice.png create mode 100644 themes/pesterchum2.5/voice.png create mode 100644 themes/trollian/voice.png create mode 100644 themes/trollian2.5/voice.png create mode 100644 themes/typewriter/voice.png diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index 148c231..95ed34a 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -22,6 +22,7 @@ CHANGELOG * Automatically turn off quirks when talking to bots - Kiooeht [evacipatedBox] * Rearrange options menu, make tabbed - Kiooeht [evacipatedBox] * Rearrange memos window for readability - Kiooeht [evacipatedBox] +* Give voice to memo users - Kiooeht [evacipatedBox] * Bug fixes * Logviewer updates - Kiooeht [evacipatedBox] * Memo scrollbar thing - Kiooeht [evacipatedBox] diff --git a/memos.py b/memos.py index 2fff37e..fafd13f 100644 --- a/memos.py +++ b/memos.py @@ -346,6 +346,9 @@ class PesterMemo(PesterConvo): self.opAction = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/opuser"], self) self.connect(self.opAction, QtCore.SIGNAL('triggered()'), self, QtCore.SLOT('opSelectedUser()')) + self.voiceAction = QtGui.QAction(self.mainwindow.theme["main/menus/rclickchumlist/voiceuser"], self) + self.connect(self.voiceAction, QtCore.SIGNAL('triggered()'), + self, QtCore.SLOT('voiceSelectedUser()')) self.userlist.optionsMenu.addAction(self.addchumAction) # ban & op list added if we are op @@ -482,6 +485,7 @@ class PesterMemo(PesterConvo): self.addchumAction.setText(theme["main/menus/rclickchumlist/addchum"]) self.banuserAction.setText(theme["main/menus/rclickchumlist/banuser"]) self.opAction.setText(theme["main/menus/rclickchumlist/opuser"]) + self.voiceAction.setText(theme["main/menus/rclickchumlist/voiceuser"]) self.quirksOff.setText(theme["main/menus/rclickchumlist/quirksoff"]) self.logchum.setText(theme["main/menus/rclickchumlist/viewlog"]) @@ -514,11 +518,15 @@ class PesterMemo(PesterConvo): if item.op: icon = PesterIcon(self.mainwindow.theme["memos/op/icon"]) item.setIcon(icon) + elif item.voice: + icon = PesterIcon(self.mainwindow.theme["memos/voice/icon"]) + item.setIcon(icon) def addUser(self, handle): chumdb = self.mainwindow.chumdb defaultcolor = QtGui.QColor("black") op = False + voice = False if handle[0] == '@': op = True handle = handle[1:] @@ -526,6 +534,9 @@ class PesterMemo(PesterConvo): self.userlist.optionsMenu.addAction(self.opAction) self.userlist.optionsMenu.addAction(self.banuserAction) self.op = True + elif handle[0] == '+': + voice = True + handle = handle[1:] item = QtGui.QListWidgetItem(handle) if handle == self.mainwindow.profile().handle: color = self.mainwindow.profile().color @@ -533,9 +544,13 @@ class PesterMemo(PesterConvo): color = chumdb.getColor(handle, defaultcolor) item.setTextColor(color) item.op = op + item.voice = voice if op: icon = PesterIcon(self.mainwindow.theme["memos/op/icon"]) item.setIcon(icon) + elif voice: + icon = PesterIcon(self.mainwindow.theme["memos/voice/icon"]) + item.setIcon(icon) self.userlist.addItem(item) def timeUpdate(self, handle, cmd): @@ -631,7 +646,7 @@ class PesterMemo(PesterConvo): oldnick = l[0] newnick = l[1] h = oldnick - if (update in ["join","left", "kick", "+o", "-o"]) \ + if (update in ["join","left", "kick", "+o", "-o", "+v", "-v"]) \ and channel != self.channel: return chums = self.userlist.findItems(h, QtCore.Qt.MatchFlags(0)) @@ -713,19 +728,44 @@ class PesterMemo(PesterConvo): elif update == "+o": chums = self.userlist.findItems(h, QtCore.Qt.MatchFlags(0)) for c in chums: + c.op = True icon = PesterIcon(self.mainwindow.theme["memos/op/icon"]) c.setIcon(icon) if unicode(c.text()) == self.mainwindow.profile().handle: self.userlist.optionsMenu.addAction(self.opAction) + self.userlist.optionsMenu.addAction(self.voiceAction) self.userlist.optionsMenu.addAction(self.banuserAction) elif update == "-o": chums = self.userlist.findItems(h, QtCore.Qt.MatchFlags(0)) for c in chums: - icon = QtGui.QIcon() - c.setIcon(icon) + c.op = False + if c.voice: + icon = PesterIcon(self.mainwindow.theme["memos/voice/icon"]) + c.setIcon(icon) + else: + icon = QtGui.QIcon() + c.setIcon(icon) if unicode(c.text()) == self.mainwindow.profile().handle: self.userlist.optionsMenu.removeAction(self.opAction) + self.userlist.optionsMenu.removeAction(self.voiceAction) self.userlist.optionsMenu.removeAction(self.banuserAction) + elif update == "+v": + chums = self.userlist.findItems(h, QtCore.Qt.MatchFlags(0)) + for c in chums: + c.voice = True + if not c.op: + icon = PesterIcon(self.mainwindow.theme["memos/voice/icon"]) + c.setIcon(icon) + elif update == "-v": + chums = self.userlist.findItems(h, QtCore.Qt.MatchFlags(0)) + for c in chums: + c.voice = False + if c.op: + icon = PesterIcon(self.mainwindow.theme["memos/op/icon"]) + c.setIcon(icon) + else: + icon = QtGui.QIcon() + c.setIcon(icon) @QtCore.pyqtSlot() def addChumSlot(self): @@ -745,6 +785,12 @@ class PesterMemo(PesterConvo): return currentHandle = unicode(self.userlist.currentItem().text()) self.mainwindow.setChannelMode.emit(self.channel, "+o", currentHandle) + @QtCore.pyqtSlot() + def voiceSelectedUser(self): + if not self.userlist.currentItem(): + return + currentHandle = unicode(self.userlist.currentItem().text()) + self.mainwindow.setChannelMode.emit(self.channel, "+v", currentHandle) def resetSlider(self, time, send=True): self.timeinput.setText(delta2txt(time)) self.timeinput.setSlider() diff --git a/themes/enamel/style.js b/themes/enamel/style.js index ccbd88d..fba646b 100644 --- a/themes/enamel/style.js +++ b/themes/enamel/style.js @@ -45,6 +45,7 @@ "movechum": "Move To", "banuser": "Ban User", "opuser": "Make OP", + "voiceuser": "Give Voice", "quirksoff": "Quirks Off" } }, @@ -314,6 +315,7 @@ } }, "systemMsgColor": "#646464", - "op": { "icon": "$path/smooth.png" } + "op": { "icon": "$path/smooth.png" }, + "voice": { "icon": "$path/voice.png" } } } diff --git a/themes/enamel/voice.png b/themes/enamel/voice.png new file mode 100644 index 0000000000000000000000000000000000000000..c400a6c86248a3a1b92ebf3e411a048b32764aa1 GIT binary patch literal 598 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMffdHQnS0MfW|9`*#egXdj0{;hw z{0|BJ9~$;QEaHDeAC}=Ks$x_+L=?zp&_kQOp09w*PH&{?D2Ff9|~h z^OpQyvf}@WRsUD*`oC-U|J{54@7?!*-`)Rr@BP2`;s1w^|37~E|LM>FKY#!K1zH5O zj=JFLwGGZd6IDxs{DOhz69f$Q=bik48W@wj-CYQ&rUPkkxG}^WTYDJDY4>z-43W5;+W%I_*+9T`vS`Zmx&;~9UN3*!FFqT@_S{|V zyN^+I_+J~96QMtq9hnmhB3S}wg!u+9U0A=w;`W-WKC>gubRH#LI27QbbK>6qs)f51 zG>x{#RkGAC}=Ks$x_+L=?zp&_kQOp09w*PH&{?D2Ff9|~h z^OpQyvf}@WRsUD*`oC-U|J{54@7?!*-`)Rr@BP2`;s1w^|37~E|LM>FKY#!K1zH5O zj=JFLwGGZd6IDxs{DOhz69f$Q=bik48W@wj-CYQ&rUPkkxG}^WTYDJDY4>z-43W5;+W%I_*+9T`vS`Zmx&;~9UN3*!FFqT@_S{|V zyN^+I_+J~96QMtq9hnmhB3S}wg!u+9U0A=w;`W-WKC>gubRH#LI27QbbK>6qs)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