diff --git a/CHANGELOG.mkdn b/CHANGELOG.mkdn index 283e0e9..abba568 100644 --- a/CHANGELOG.mkdn +++ b/CHANGELOG.mkdn @@ -45,6 +45,7 @@ CHANGELOG * Show and support giving kick reasons - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) * Make adding quirks into multi-page wizard - Kiooeht [evacipatedBox] * Flash the taskbar on new messages - Kiooeht [evacipatedBox] +* Third beep sound for when your initials are mentioned in memos - Kiooeht [evacipatedBox] (Idea: Lexi [lexicalNuance]) * Bug fixes * Logviewer updates - Kiooeht [evacipatedBox] * Memo scrollbar thing - Kiooeht [evacipatedBox] diff --git a/TODO.mkdn b/TODO.mkdn index e5eef59..dda872e 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -13,6 +13,7 @@ Features * MSPA update notifier option * Don't animate emotes not in current tab * Show true bans? +* Colour saving boxes things? Bugs ---- diff --git a/memos.py b/memos.py index 1f97eac..46be764 100644 --- a/memos.py +++ b/memos.py @@ -315,13 +315,13 @@ class MemoText(PesterText): if msg.count(" msg.count(""): for i in range(msg.count("")): msg = msg + "" - return msg + return "" + msg + "" if type(lexmsg[0]) is mecmd: memsg = chum.memsg(systemColor, lexmsg, time=time.getGrammar()) window.chatlog.log(parent.channel, memsg) self.append(convertTags(memsg)) else: - self.append("" + makeSafe(convertTags(lexmsg)) + "") + self.append(makeSafe(convertTags(lexmsg))) window.chatlog.log(parent.channel, lexmsg) def changeTheme(self, theme): diff --git a/menus.py b/menus.py index 9331368..cf331f1 100644 --- a/menus.py +++ b/menus.py @@ -941,11 +941,14 @@ class PesterOptions(QtGui.QDialog): self.chatsoundcheck.setChecked(self.config.chatSound()) self.memosoundcheck = QtGui.QCheckBox("Memo Sounds", self) self.memosoundcheck.setChecked(self.config.memoSound()) + self.namesoundcheck = QtGui.QCheckBox("Memo Mention (initials)", self) + self.namesoundcheck.setChecked(self.config.nameSound()) if self.config.soundOn(): self.soundcheck.setChecked(True) else: self.chatsoundcheck.setEnabled(False) self.memosoundcheck.setEnabled(False) + self.namesoundcheck.setEnabled(False) self.timestampcheck = QtGui.QCheckBox("Time Stamps", self) @@ -1121,6 +1124,7 @@ class PesterOptions(QtGui.QDialog): layout_indent = QtGui.QVBoxLayout() layout_indent.addWidget(self.chatsoundcheck) layout_indent.addWidget(self.memosoundcheck) + layout_indent.addWidget(self.namesoundcheck) layout_indent.setContentsMargins(22,0,0,0) layout_sound.addLayout(layout_indent) self.pages.addWidget(widget) @@ -1182,9 +1186,11 @@ class PesterOptions(QtGui.QDialog): if state == 0: self.chatsoundcheck.setEnabled(False) self.memosoundcheck.setEnabled(False) + self.namesoundcheck.setEnabled(False) else: self.chatsoundcheck.setEnabled(True) self.memosoundcheck.setEnabled(True) + self.namesoundcheck.setEnabled(True) class PesterUserlist(QtGui.QDialog): def __init__(self, config, theme, parent): diff --git a/pesterchum.py b/pesterchum.py index 913bc5d..2658223 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -503,6 +503,8 @@ class userConfig(object): return self.config.get('chatSound', True) def memoSound(self): return self.config.get('memoSound', True) + def nameSound(self): + return self.config.get('nameSound', True) def set(self, item, setting): self.config[item] = setting try: @@ -1742,6 +1744,12 @@ class PesterWindow(MovingWindow): msg = "%s" % (systemColor.name(), msg) memo.addMessage(msg, handle) if self.config.soundOn(): + if self.config.nameSound(): + initials = self.userprofile.chat.initials() + search = r"\b[%s%s][%s%s]\b" % (initials[0].lower(), initials[0], initials[1].lower(), initials[1]) + if re.search(search, convertTags(msg, "text")): + self.namesound.play() + return if self.config.memoSound(): self.memosound.play() @@ -1981,10 +1989,12 @@ class PesterWindow(MovingWindow): try: self.alarm = pygame.mixer.Sound(theme["main/sounds/alertsound"]) self.memosound = pygame.mixer.Sound(theme["main/sounds/memosound"]) + self.namesound = pygame.mixer.Sound("themes/namealarm.wav") self.ceasesound = pygame.mixer.Sound(theme["main/sounds/ceasesound"]) except Exception, e: self.alarm = NoneSound() self.memosound = NoneSound() + self.namesound = NoneSound() self.ceasesound = NoneSound() def changeTheme(self, theme): @@ -2558,6 +2568,10 @@ class PesterWindow(MovingWindow): curmemosound = self.config.memoSound() if memosoundsetting != curmemosound: self.config.set('memoSound', memosoundsetting) + namesoundsetting = self.optionmenu.namesoundcheck.isChecked() + curnamesound = self.config.nameSound() + if namesoundsetting != curnamesound: + self.config.set('nameSound', namesoundsetting) # timestamps timestampsetting = self.optionmenu.timestampcheck.isChecked() self.config.set("showTimeStamps", timestampsetting) diff --git a/themes/namealarm.wav b/themes/namealarm.wav new file mode 100644 index 0000000..10e6ad0 Binary files /dev/null and b/themes/namealarm.wav differ