Skip to content

Commit

Permalink
audio alert for patch completion
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.code.sf.net/p/oblivionworks/code/Programs/Wrye%20Bash@1361 c80116c5-1073-4541-b2a9-63b9fd661f84
  • Loading branch information
NickDickinsonWilde committed Jul 4, 2011
1 parent 7a23e03 commit a45f9b7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Mopy/bash/balt.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,15 @@ def showWryeLog(parent,logText,title='',style=0,asDialog=True,icons=None):
else:
window.Show()

def playSound(parent,sound):
if not sound: return
sound = wx.Sound(sound)
if sound.IsOk():
sound.Play(wx.SOUND_ASYNC)
print 'played sound'
else:
showError(parent,_("Invalid sound file %s.") % sound)

# Other Windows ---------------------------------------------------------------
#------------------------------------------------------------------------------
class ListEditorData:
Expand Down
12 changes: 11 additions & 1 deletion Mopy/bash/basher.py
Original file line number Diff line number Diff line change
Expand Up @@ -5858,6 +5858,7 @@ def Execute(self,event=None):
#--Convert log/readme to wtxt and show log
docsDir = bosh.modInfos.dir.join('Docs')
bolt.WryeText.genHtml(readme,None,docsDir)
balt.playSound(self.parent,bosh.inisettings['SoundSuccess'].s)
balt.showWryeLog(self.parent,readme.root+'.html',patchName.s,icons=bashBlue)
#--Select?
message = _("Activate %s?") % (patchName.s,)
Expand All @@ -5873,9 +5874,13 @@ def Execute(self,event=None):
% (fileName.s,))
modList.RefreshUI()
except bosh.FileEditError, error:
balt.playSound(self.parent,bosh.inisettings['SoundError'].s)
balt.showError(self,str(error),_("File Edit Error"))
except CancelError:
pass
except:
balt.playSound(self.parent,bosh.inisettings['SoundError'].s)
raise
finally:
progress.Destroy()
else:
Expand Down Expand Up @@ -5935,6 +5940,7 @@ def Execute(self,event=None):
#--Convert log/readme to wtxt and show log
docsDir = bosh.modInfos.dir.join('Docs')
bolt.WryeText.genHtml(readme,None,docsDir)
balt.playSound(self.parent,bosh.inisettings['SoundSuccess'].s)
balt.showWryeLog(self.parent,readme.root+'.html',patchName.s,icons=bashBlue)
#--Select?
message = _("Activate %s?") % (patchName.s,)
Expand All @@ -5951,9 +5957,13 @@ def Execute(self,event=None):
modList.RefreshUI()
del patchFile
except bosh.FileEditError, error:
balt.playSound(self.parent,bosh.inisettings['SoundError'].s)
balt.showError(self,str(error),_("File Edit Error"))
except CancelError:
del patchFile
except:
balt.playSound(self.parent,bosh.inisettings['SoundError'].s)
raise
finally:
progress.Destroy()

Expand Down Expand Up @@ -11447,7 +11457,7 @@ def Execute(self,event):
clip.write('[spoiler][xml]')
# CBash/Python patch?
log.setHeader('== '+_('Patch Mode'))
clip.write('== '+_('Patch Mode')+'\n')
clip.write('== '+_('Patch Mode')+'\n'),
if doCBash:
if settings['bash.CBashEnabled']:
msg = 'CBash v%u.%u.%u' % (CBash.GetVersionMajor(),CBash.GetVersionMinor(),CBash.GetVersionRevision())
Expand Down
4 changes: 3 additions & 1 deletion Mopy/bash/bosh.py
Original file line number Diff line number Diff line change
Expand Up @@ -33615,7 +33615,8 @@ def initDefaultSettings():
inisettings['SkipHideConfirmation'] = False
inisettings['SkipResetTimeNotifications'] = False
inisettings['AutoSizeListColumns'] = 0
#inisettings['show?toollaunchers'] = True
inisettings['SoundSuccess'] = GPath('')
inisettings['SoundError'] = GPath('')

def initOptions(bashIni):
initDefaultTools()
Expand All @@ -33642,6 +33643,7 @@ def initOptions(bashIni):
defaultValue = usedSettings.get(usedKey,'')
settingType = type(defaultValue)
if settingType in (bolt.Path,list):
if value == '.': continue
value = GPath(value)
if not value.isabs():
value = dirs['app'].join(value)
Expand Down
6 changes: 6 additions & 0 deletions Mopy/bash_default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ s7zExtraCompressionArguments=-ms=on -ms=1m
; If set to 0 feature is disabled (default).
iAutoSizeListColumns=0

;sSound*: if set plays that sound in the specified situation. Can be an absolute path or a relative path from the app dir.
;sSoundError: Bashed Patch build error
sSoundError=.
;sSoundSuccess: Bashed Patch build success
sSoundSuccess=.

; _______ _ ____ _ _
; |__ __| | | / __ \ | | (_)
; | | ___ ___ | | | | | | _ __ | |_ _ ___ _ __ ___
Expand Down

0 comments on commit a45f9b7

Please sign in to comment.