diff plugins/xxchatnotify.py @ 18:97265586402b ornery-orc

Traipse 'OpenRPG' {090827-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc''s main goal is to offer more advanced features and enhance the productivity of the user. Update Summary: Update Manager is now in version 0.8. While not every button works, users can now browse the different revisions and their different changesets. The code has been refined some with feature from Core added to it. A Crash report is now created if the users software crashes. Update Manager has been moved to the Traipse Suite menu item, and a Debug Console as been added as well.
author sirebral
date Thu, 27 Aug 2009 01:04:43 -0500
parents 4385a7d0efd1
children ff154cf3350c
line wrap: on
line diff
--- a/plugins/xxchatnotify.py	Thu Aug 13 13:14:10 2009 -0500
+++ b/plugins/xxchatnotify.py	Thu Aug 27 01:04:43 2009 -0500
@@ -34,10 +34,10 @@
         self.topframe.Bind(wx.EVT_MENU, self.on_settings, self.notifyAll)
         self.topframe.Bind(wx.EVT_MENU, self.on_settings, self.notifyWhisper)
 
-
     def on_settings(self, evt):
         if self.notifyToggle.IsChecked() == False:
             self.notify = 'Off'
+            self.plugindb.SetString('xxchatnotify', 'notify', self.notify)
             return
         if self.notifyBeep.IsChecked() == True:
             self.notify ='beep'
@@ -49,14 +49,16 @@
             self.type = 'all'
         elif self.notifyWhisper.IsChecked() == True:
             self.type = 'whisper'
+        self.plugindb.SetString('xxchatnotify', 'notify', self.notify)
+        self.plugindb.SetString('xxchatnotify', 'type', self.type)
 
 
     def plugin_enabled(self):
         self.plugin_addcommand('/notify', self.on_notify, 'beep | flash | both | off | type all|whisper | clearsound | lsound soundfile [Local Sound Files only] | rsound http://to.sound.file [Remote Sound Files only] - This command turns on the chat notification. You can use sound files and flash by issuing /notify both')
-        self.notify = self.plugindb.GetString('xxchatnotify', 'notify', 'off')
-        self.type = self.plugindb.GetString('xxchatnotify', 'type', 'all')
-        self.mainframe = open_rpg.get_component('frame')
-        self.sound_player = open_rpg.get_component('sound')
+        self.notify = self.plugindb.GetString('xxchatnotify', 'notify', string) or 'off'
+        self.type = self.plugindb.GetString('xxchatnotify', 'type', string) or 'beep'
+        self.mainframe = component.get('frame')
+        self.sound_player = component.get('sound')
         self.soundloc = self.plugindb.GetString('xxchatnotify', 'soundloc', 'local')
         self.soundfile = self.plugindb.GetString('xxchatnotify', 'soundfile', 'None')
         self.chat_settings()