MS 24.07
This commit is contained in:
@@ -120,11 +120,18 @@ Public Class frmConfig_Basic
|
||||
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
|
||||
Select Case TabControl1.SelectedIndex
|
||||
Case 2
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
If Not folderwatch Is Nothing Then
|
||||
CURRENT_FOLDERWATCH = folderwatch
|
||||
End If
|
||||
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
||||
Dim SCAN_folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
If Not SCAN_folderwatch Is Nothing Then
|
||||
CURRENT_SCAN_FOLDERWATCH = SCAN_folderwatch
|
||||
End If
|
||||
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
||||
Me.txtScanFolderWatch.Text = CURRENT_SCAN_FOLDERWATCH
|
||||
|
||||
If Not ClassFolderWatcher.FolderWatcher Is Nothing Then
|
||||
If ClassFolderWatcher.FolderWatcher.EnableRaisingEvents = True Then
|
||||
btnstartstop1.Text = "Überwachung stoppen"
|
||||
@@ -137,43 +144,64 @@ Public Class frmConfig_Basic
|
||||
btnstartstop1.Text = "Überwachung starten"
|
||||
btnstartstop1.Image = My.Resources.bell_go
|
||||
End If
|
||||
|
||||
If Not ClassFolderWatcher.FolderWatcher_SCAN Is Nothing Then
|
||||
If ClassFolderWatcher.FolderWatcher_SCAN.EnableRaisingEvents = True Then
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
btnstartstop2.Image = My.Resources.bell_delete
|
||||
Else
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End If
|
||||
Else
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End If
|
||||
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub btnFW_Desktop_Click(sender As Object, e As EventArgs) Handles btnFW_Desktop.Click
|
||||
CURRENT_FOLDERWATCH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "SimpleIndexer")
|
||||
CheckFolder(CURRENT_FOLDERWATCH)
|
||||
CheckFolder(CURRENT_FOLDERWATCH, "DEFAULT")
|
||||
End Sub
|
||||
Sub CheckFolder(mypath As String)
|
||||
Sub CheckFolder(mypath As String, FOLDER_TYPE As String)
|
||||
Try
|
||||
If (Not System.IO.Directory.Exists(mypath)) Then
|
||||
System.IO.Directory.CreateDirectory(mypath)
|
||||
End If
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
Dim folderwatch = ClassDatabase.Execute_Scalar("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", MyConnectionString)
|
||||
Dim sql As String
|
||||
If folderwatch Is Nothing Then
|
||||
sql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, ADDED_WHO) VALUES (" & CURRENT_USERID & ",'" & mypath & "','" & Environment.UserName & "')"
|
||||
sql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, FOLDER_TYPE, ADDED_WHO) VALUES (" & CURRENT_USERID & ",'" & mypath & "','" & FOLDER_TYPE & "','" & Environment.UserName & "')"
|
||||
Else
|
||||
sql = "UPDATE TBGI_FOLDERWATCH_USER SET FOLDER_PATH = '" & mypath & "', CHANGED_WHO = '" & Environment.UserName & "' where GUID = " & folderwatch
|
||||
End If
|
||||
If ClassDatabase.Execute_non_Query(sql) Then
|
||||
folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID, MyConnectionString)
|
||||
CURRENT_FOLDERWATCH = folderwatch
|
||||
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
||||
folderwatch = ClassDatabase.Execute_Scalar("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & CURRENT_USERID & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'", MyConnectionString)
|
||||
|
||||
If FOLDER_TYPE = "SCAN" Then
|
||||
CURRENT_SCAN_FOLDERWATCH = folderwatch
|
||||
Me.txtScanFolderWatch.Text = CURRENT_SCAN_FOLDERWATCH
|
||||
|
||||
Else
|
||||
CURRENT_FOLDERWATCH = folderwatch
|
||||
Me.txtFolderWatch.Text = CURRENT_FOLDERWATCH
|
||||
End If
|
||||
|
||||
End If
|
||||
If FW_started = True Then
|
||||
If FW_started = True And FOLDER_TYPE = "DEFAULT" Then
|
||||
ClassFolderWatcher.Restart_FolderWatch()
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in CheckFolder:")
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnFW_OwnFiles_Click(sender As Object, e As EventArgs) Handles btnFW_OwnFiles.Click
|
||||
CURRENT_FOLDERWATCH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "SimpleIndexer")
|
||||
CheckFolder(CURRENT_FOLDERWATCH)
|
||||
CheckFolder(CURRENT_FOLDERWATCH, "DEFAULT")
|
||||
End Sub
|
||||
|
||||
<STAThread()> _
|
||||
@@ -193,11 +221,21 @@ Public Class frmConfig_Basic
|
||||
btnstartstop1.Image = My.Resources.bell_go
|
||||
End Select
|
||||
End Sub
|
||||
Sub CheckFWSCAN_State()
|
||||
Select Case ClassFolderWatcher.StartStop_FolderWatchSCAN()
|
||||
Case 1
|
||||
btnstartstop2.Text = "Überwachung stoppen"
|
||||
btnstartstop2.Image = My.Resources.bell_delete
|
||||
Case 0
|
||||
btnstartstop2.Text = "Überwachung starten"
|
||||
btnstartstop2.Image = My.Resources.bell_go
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub btnsetFW_Folder_Click(sender As Object, e As EventArgs) Handles btnsetFW_Folder.Click
|
||||
Dim fbdialog As New FolderBrowserDialog
|
||||
If fbdialog.ShowDialog() = DialogResult.OK Then
|
||||
CheckFolder(fbdialog.SelectedPath)
|
||||
CheckFolder(fbdialog.SelectedPath, "DEFAULT")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -218,4 +256,25 @@ Public Class frmConfig_Basic
|
||||
Private Sub btnApplicationFolder_Click(sender As Object, e As EventArgs) Handles btnApplicationFolder.Click
|
||||
Process.Start(Application.UserAppDataPath())
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
|
||||
My.Settings.Save()
|
||||
End Sub
|
||||
|
||||
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||
Dim fbdialog As New FolderBrowserDialog
|
||||
If fbdialog.ShowDialog() = DialogResult.OK Then
|
||||
CheckFolder(fbdialog.SelectedPath, "SCAN")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles btnstartstop2.Click
|
||||
If CURRENT_FOLDERWATCH <> "" Then
|
||||
CheckFWSCAN_State()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
|
||||
My.Settings.Save()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user