Unix fixes and feature lock outs
This commit is contained in:
@@ -178,11 +178,11 @@ Public Class frmAddWizard
|
||||
Return False
|
||||
End If
|
||||
|
||||
If Path.GetExtension(strPath.ToLower) <> ".exe" Then
|
||||
sErrorMessage = frmAddWizard_ErrorNotAProcess
|
||||
txtProcessPath.Focus()
|
||||
Return False
|
||||
End If
|
||||
'If Path.GetExtension(strPath.ToLower) <> ".exe" Then
|
||||
' sErrorMessage = frmAddWizard_ErrorNotAProcess
|
||||
' txtProcessPath.Focus()
|
||||
' Return False
|
||||
'End If
|
||||
|
||||
If Not Path.IsPathRooted(strPath) Then
|
||||
sErrorMessage = frmAddWizard_ErrorBadProcessPath
|
||||
|
||||
@@ -395,6 +395,8 @@ Public Class frmGameManager
|
||||
End Sub
|
||||
|
||||
Private Sub OpenBackupFile()
|
||||
'Unix Hanlder
|
||||
If Not mgrCommon.IsUnix Then
|
||||
Dim sFileName As String
|
||||
sFileName = BackupFolder & CurrentBackupItem.FileName
|
||||
|
||||
@@ -403,6 +405,9 @@ Public Class frmGameManager
|
||||
Else
|
||||
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
Else
|
||||
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -477,6 +482,7 @@ Public Class frmGameManager
|
||||
End Function
|
||||
|
||||
Private Sub OpenRestorePath()
|
||||
If Not mgrCommon.IsUnix Then
|
||||
Dim sPath As String = String.Empty
|
||||
|
||||
If CurrentBackupItem.AbsolutePath Then
|
||||
@@ -492,7 +498,9 @@ Public Class frmGameManager
|
||||
Else
|
||||
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
|
||||
Else
|
||||
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OpenTags()
|
||||
|
||||
@@ -30,7 +30,7 @@ Public Class frmIncludeExclude
|
||||
Return sRootFolder
|
||||
End Get
|
||||
Set(value As String)
|
||||
sRootFolder = value.TrimEnd("\")
|
||||
sRootFolder = value.TrimEnd(Path.DirectorySeparatorChar)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -52,7 +52,7 @@ Public Class frmIncludeExclude
|
||||
|
||||
If sFolders.Length <> 0 Then
|
||||
For Each sFolder As String In sFolders
|
||||
oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart("\"), 0, 0)
|
||||
oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart(Path.DirectorySeparatorChar), 0, 0)
|
||||
oChild.Name = sFolder
|
||||
oChild.Tag = 0
|
||||
oNode.Nodes.Add(oChild)
|
||||
@@ -64,7 +64,7 @@ Public Class frmIncludeExclude
|
||||
|
||||
If sFiles.Length <> 0 Then
|
||||
For Each sFile As String In sFiles
|
||||
oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart("\"), 1, 1)
|
||||
oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart(Path.DirectorySeparatorChar), 1, 1)
|
||||
oChild.Tag = 1
|
||||
oNode.Nodes.Add(oChild)
|
||||
Next
|
||||
@@ -195,7 +195,7 @@ Public Class frmIncludeExclude
|
||||
If Path.GetFileName(txtRootFolder.Text) = sNewLabel Then
|
||||
sFolderCheck = txtRootFolder.Text
|
||||
Else
|
||||
sFolderCheck = txtRootFolder.Text & "\" & sNewLabel
|
||||
sFolderCheck = txtRootFolder.Text & Path.DirectorySeparatorChar & sNewLabel
|
||||
End If
|
||||
If Directory.Exists(sFolderCheck) Then
|
||||
iType = 0
|
||||
|
||||
Generated
+2
-1
@@ -255,8 +255,9 @@ Partial Class frmMain
|
||||
'
|
||||
'gMonStripTxtStatus
|
||||
'
|
||||
Me.gMonStripTxtStatus.Margin = New System.Windows.Forms.Padding(5, 0, 0, 0)
|
||||
Me.gMonStripTxtStatus.Name = "gMonStripTxtStatus"
|
||||
Me.gMonStripTxtStatus.Size = New System.Drawing.Size(405, 17)
|
||||
Me.gMonStripTxtStatus.Size = New System.Drawing.Size(369, 22)
|
||||
Me.gMonStripTxtStatus.Spring = True
|
||||
Me.gMonStripTxtStatus.Text = "Monitor Status"
|
||||
Me.gMonStripTxtStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
|
||||
+2891
-30
File diff suppressed because it is too large
Load Diff
+20
-4
@@ -1245,6 +1245,8 @@ Public Class frmMain
|
||||
|
||||
'Functions to handle other features
|
||||
Private Sub RestartAsAdmin()
|
||||
'Unix Hanlder
|
||||
If Not mgrCommon.IsUnix Then
|
||||
If mgrCommon.IsElevated Then
|
||||
mgrCommon.ShowMessage(frmMain_ErrorAlreadyAdmin, MsgBoxStyle.Information)
|
||||
Else
|
||||
@@ -1254,6 +1256,9 @@ Public Class frmMain
|
||||
ShutdownApp(False)
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CleanLocalManifest()
|
||||
@@ -1416,12 +1421,19 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub Main_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
|
||||
'Intercept Exit & Minimize
|
||||
'Unix Handler
|
||||
If mgrCommon.IsUnix And Not bShutdown Then
|
||||
ShutdownApp()
|
||||
End If
|
||||
|
||||
'Intercept Exit
|
||||
If bShutdown = False Then
|
||||
e.Cancel = True
|
||||
If Not mgrCommon.IsUnix Then
|
||||
Me.Visible = False
|
||||
Me.ShowInTaskbar = False
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick
|
||||
@@ -1541,7 +1553,7 @@ Public Class frmMain
|
||||
LoadAndVerify()
|
||||
VerifyCustomPathVariables()
|
||||
|
||||
If oSettings.StartToTray Then
|
||||
If oSettings.StartToTray And Not mgrCommon.IsUnix Then
|
||||
Me.Visible = False
|
||||
Me.ShowInTaskbar = False
|
||||
End If
|
||||
@@ -1554,13 +1566,17 @@ Public Class frmMain
|
||||
|
||||
HandleScan()
|
||||
CheckForNewBackups()
|
||||
Catch niex As NotImplementedException
|
||||
'Ignore for Mono runtime tests
|
||||
Catch ex As Exception
|
||||
mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.Critical)
|
||||
bInitFail = True
|
||||
End Try
|
||||
|
||||
'Unix Handler
|
||||
If mgrCommon.IsUnix Then
|
||||
gMonTray.Visible = False
|
||||
Me.MinimizeBox = True
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
|
||||
|
||||
@@ -113,6 +113,12 @@ Public Class frmSettings
|
||||
nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold
|
||||
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked
|
||||
cboCompression.SelectedValue = oSettings.CompressionLevel
|
||||
|
||||
'Unix Handler
|
||||
If mgrCommon.IsUnix Then
|
||||
chkStartToTray.Checked = False
|
||||
chkStartWindows.Checked = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LoadCombos()
|
||||
@@ -159,6 +165,12 @@ Public Class frmSettings
|
||||
chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup
|
||||
grp7z.Text = frmSettings_grp7z
|
||||
lblCompression.Text = frmSettings_lblCompression
|
||||
|
||||
'Unix Handler
|
||||
If mgrCommon.IsUnix Then
|
||||
chkStartToTray.Enabled = False
|
||||
chkStartWindows.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Imports GBM.My.Resources
|
||||
Imports System.Net
|
||||
Imports System.IO
|
||||
Imports System.Security.Principal
|
||||
|
||||
Public Class mgrCommon
|
||||
|
||||
@@ -117,14 +118,9 @@ Public Class mgrCommon
|
||||
End Function
|
||||
|
||||
Public Shared Function IsElevated() As Boolean
|
||||
If IsUnix() Then
|
||||
Return True
|
||||
End If
|
||||
If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Dim oID As WindowsIdentity = WindowsIdentity.GetCurrent
|
||||
Dim oPrincipal As New WindowsPrincipal(oID)
|
||||
Return oPrincipal.IsInRole(WindowsBuiltInRole.Administrator)
|
||||
End Function
|
||||
|
||||
Public Shared Sub RestartAsAdmin()
|
||||
|
||||
Generated
+23
-14
@@ -78,6 +78,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property App_ErrorUnixNotAvailable() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("App_ErrorUnixNotAvailable", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] KB.
|
||||
'''</summary>
|
||||
@@ -3729,7 +3738,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property GBM_Tray_Detected() As System.Drawing.Icon
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Detected", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Icon)
|
||||
Return CType(obj, System.Drawing.Icon)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3739,7 +3748,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property GBM_Tray_Ready() As System.Drawing.Icon
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Ready", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Icon)
|
||||
Return CType(obj, System.Drawing.Icon)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3749,7 +3758,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property GBM_Tray_Stopped() As System.Drawing.Icon
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Stopped", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Icon)
|
||||
Return CType(obj, System.Drawing.Icon)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3759,7 +3768,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Admin() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Admin", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3769,7 +3778,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Clock() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Clock", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3779,7 +3788,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Detected() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Detected", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3789,7 +3798,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Inbox() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Inbox", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3799,7 +3808,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Ready() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Ready", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3809,7 +3818,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Searching() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Searching", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3819,7 +3828,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Stopped() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Stopped", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3829,7 +3838,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Unknown() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Unknown", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3839,7 +3848,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_User() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_User", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -3849,7 +3858,7 @@ Namespace My.Resources
|
||||
Friend ReadOnly Property Icon_Working() As System.Drawing.Bitmap
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("Icon_Working", resourceCulture)
|
||||
Return CType(obj,System.Drawing.Bitmap)
|
||||
Return CType(obj, System.Drawing.Bitmap)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -4016,7 +4025,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM].
|
||||
''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.*.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrCommon_FilesFilter() As String
|
||||
Get
|
||||
|
||||
@@ -1355,7 +1355,7 @@
|
||||
<value>Generating SHA-256 hash for [PARAM] backup file.</value>
|
||||
</data>
|
||||
<data name="mgrCommon_FilesFilter" xml:space="preserve">
|
||||
<value>[PARAM] files (*.[PARAM])|*.[PARAM]</value>
|
||||
<value>[PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.*</value>
|
||||
</data>
|
||||
<data name="mgrCommon_No" xml:space="preserve">
|
||||
<value>No</value>
|
||||
@@ -1561,4 +1561,7 @@
|
||||
<data name="frmMain_ErrorInitFailure" xml:space="preserve">
|
||||
<value>An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]The application will now exit.</value>
|
||||
</data>
|
||||
<data name="App_ErrorUnixNotAvailable" xml:space="preserve">
|
||||
<value>This function is currently not available on a Unix based operating system.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user