diff plugins/xxchatnotify.py @ 73:7b752c9d0c28 ornery-dev

Alias Lib is now really stable. Awesome tool! Fix to Chat Notify, plugin now sets Plugin DB settings correctly.
author sirebral
date Thu, 20 Aug 2009 08:41:29 -0500
parents c54768cffbd4
children 6debef714365
line wrap: on
line diff
--- a/plugins/xxchatnotify.py	Thu Aug 20 03:45:45 2009 -0500
+++ b/plugins/xxchatnotify.py	Thu Aug 20 08:41:29 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,12 +49,14 @@
             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.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')