Changes for issue #125

This commit is contained in:
MikeMaximus
2018-02-24 09:28:06 -06:00
parent bb6e292c6f
commit dca86beebe
3 changed files with 47 additions and 6 deletions
+44 -3
View File
@@ -1225,6 +1225,11 @@ Public Class frmMain
End Sub
Public Sub UpdateLog(sLogUpdate As String, Optional bTrayUpdate As Boolean = True, Optional objIcon As System.Windows.Forms.ToolTipIcon = ToolTipIcon.Info, Optional bTimeStamp As Boolean = True) Handles oBackup.UpdateLog, oRestore.UpdateLog
Dim prsNotify As Process
Dim sUrgency As String
Dim sIconLocation As String
Dim sNotifyArgs As String
'Thread Safe (If one control requires an invoke assume they all do)
If txtLog.InvokeRequired = True Then
Dim d As New UpdateLogCallBack(AddressOf UpdateLog)
@@ -1260,9 +1265,45 @@ Public Class frmMain
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon
If bTrayUpdate Then gMonTray.ShowBalloonTip(10000)
If bTrayUpdate Then
If mgrCommon.IsUnix Then
'Build args for notify-send
Select Case objIcon
Case ToolTipIcon.Error
sUrgency = "critical"
Case ToolTipIcon.Warning
sUrgency = "normal"
Case ToolTipIcon.Info
sUrgency = "low"
Case Else
sUrgency = "low"
End Select
sIconLocation = "/usr/share/icons/hicolor/256x256/apps/gbm.png"
sNotifyArgs = "-i " & sIconLocation & " -u " & sUrgency & " -t 10000 """ & App_NameLong & """ """ & sLogUpdate.Replace("""", "\""") & """"
Try
'Execute notify-send
prsNotify = New Process
prsNotify.StartInfo.FileName = "/usr/bin/notify-send"
prsNotify.StartInfo.Arguments = sNotifyArgs
prsNotify.StartInfo.UseShellExecute = False
prsNotify.StartInfo.RedirectStandardOutput = True
prsNotify.StartInfo.CreateNoWindow = True
prsNotify.Start()
Catch ex As Exception
'Show default notification style
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon
gMonTray.ShowBalloonTip(10000)
End Try
Else
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon
gMonTray.ShowBalloonTip(10000)
End If
End If
End If
Application.DoEvents()
End Sub
+2 -2
View File
@@ -2,8 +2,8 @@ Package: gbm
Architecture: all
Maintainer: Sebastian Riedel <git@basxto.de>
Priority: optional
Version: 1.0.5
Version: 1.0.8
Homepage: https://mikemaximus.github.io/gbm-web/
Bugs: https://github.com/MikeMaximus/gbm/issues
Depends: mono-vbnc, libsqlite3-0, p7zip-full
Depends: mono-vbnc, libsqlite3-0, p7zip-full, libnotify-bin
Description: Automatically backup your saved games!
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh -e
#check for all dependencies
for prog in mono readlink df 7za;do
for prog in mono readlink df 7za notify-send;do
[ -n "`whereis -b ${prog} | cut -sd' ' -f2`" ] || (echo "Please install ${prog}" && exit 1);
done
for lib in libsqlite3;do