diff --git a/app/DD_Clipboard_Searcher/ClassInit.vb b/app/DD_Clipboard_Searcher/ClassInit.vb index 4305797..10eb59a 100644 --- a/app/DD_Clipboard_Searcher/ClassInit.vb +++ b/app/DD_Clipboard_Searcher/ClassInit.vb @@ -234,7 +234,7 @@ Public Class ClassInit End Try End Sub - Public Shared Sub Refresh_Profile_Links() + Public Shared Function Refresh_Profile_Links() As String Dim oWhereClause = $"T1.USER_ID = {USER_ID} OR GROUP_ID IN (SELECT DISTINCT GUID FROM TBDD_GROUPS WHERE GUID IN (SELECT GROUP_ID FROM TBDD_GROUPS_USER WHERE USER_ID = {USER_ID}))" Dim ProfileSQL As String = $"SELECT DISTINCT GUID, NAME,REGEX_EXPRESSION,COMMENT,PROC_NAME,PROFILE_TYPE FROM VWCW_USER_PROFILE T1 WHERE {oWhereClause}" @@ -246,8 +246,7 @@ Public Class ClassInit DT_USER_PROFILES = Database.GetDatatable(ProfileSQL) If DT_USER_PROFILES Is Nothing OrElse DT_USER_PROFILES.Rows.Count = 0 Then - MsgBox("No profiles configured for this user so far!", MsgBoxStyle.Exclamation) - Exit Sub + Return "Es wurden noch keine Profile für den aktuellen Benutzer konfiguriert." End If DTPROFILE_REL_PROCESS = Database.GetDatatable(oProcessSQL) @@ -256,6 +255,9 @@ Public Class ClassInit Catch ex As Exception Logger.Error(ex) MsgBox("Unexpected Error in Refresh_Profile_Links: " & ex.Message, MsgBoxStyle.Critical) + Return "Fehler bei Aktualisierung!" End Try - End Sub + + Return "Aktualisierung erfolgreich." + End Function End Class diff --git a/app/DD_Clipboard_Searcher/frmAdministration.vb b/app/DD_Clipboard_Searcher/frmAdministration.vb index a6c57b2..acff277 100644 --- a/app/DD_Clipboard_Searcher/frmAdministration.vb +++ b/app/DD_Clipboard_Searcher/frmAdministration.vb @@ -627,7 +627,8 @@ Public Class frmAdministration Status_Changed("Daten-Suche gespeichert") End If Catch ex As Exception - MsgBox("Unexpected Error while saving Data Search: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) + ShowErrorMessage(ex) + 'MsgBox("Unexpected Error while saving Data Search: " & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub diff --git a/app/DD_Clipboard_Searcher/frmStart.Designer.vb b/app/DD_Clipboard_Searcher/frmStart.Designer.vb index 392f43b..80ff5a5 100644 --- a/app/DD_Clipboard_Searcher/frmStart.Designer.vb +++ b/app/DD_Clipboard_Searcher/frmStart.Designer.vb @@ -34,6 +34,7 @@ Partial Class frmStart Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.labelUser = New System.Windows.Forms.ToolStripStatusLabel() Me.lblrefresh = New System.Windows.Forms.ToolStripStatusLabel() + Me.labelVersion = New System.Windows.Forms.ToolStripStatusLabel() Me.TimerClose = New System.Windows.Forms.Timer(Me.components) Me.ContextMenuStripForm = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.MinimierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() @@ -45,11 +46,14 @@ Partial Class frmStart Me.btnAdminConfig = New System.Windows.Forms.Button() Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components) Me.TimerRefresh = New System.Windows.Forms.Timer(Me.components) - Me.labelVersion = New System.Windows.Forms.ToolStripStatusLabel() + Me.GroupBox2 = New System.Windows.Forms.GroupBox() + Me.labelRefresh = New System.Windows.Forms.Label() + Me.labelStatus = New System.Windows.Forms.Label() Me.cmstrpNotifyIcon.SuspendLayout() Me.StatusStrip1.SuspendLayout() Me.ContextMenuStripForm.SuspendLayout() Me.GroupBox1.SuspendLayout() + Me.GroupBox2.SuspendLayout() Me.SuspendLayout() ' 'NotifyIconMain @@ -105,8 +109,8 @@ Partial Class frmStart ' 'StatusStrip1 ' - Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.labelUser, Me.lblrefresh, Me.labelVersion}) - Me.StatusStrip1.Location = New System.Drawing.Point(0, 154) + Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.labelUser, Me.labelVersion, Me.lblrefresh}) + Me.StatusStrip1.Location = New System.Drawing.Point(0, 232) Me.StatusStrip1.Name = "StatusStrip1" Me.StatusStrip1.Size = New System.Drawing.Size(345, 22) Me.StatusStrip1.SizingGrip = False @@ -123,7 +127,14 @@ Partial Class frmStart 'lblrefresh ' Me.lblrefresh.Name = "lblrefresh" - Me.lblrefresh.Size = New System.Drawing.Size(0, 17) + Me.lblrefresh.Size = New System.Drawing.Size(59, 17) + Me.lblrefresh.Text = "lblRefresh" + ' + 'labelVersion + ' + Me.labelVersion.Name = "labelVersion" + Me.labelVersion.Size = New System.Drawing.Size(62, 17) + Me.labelVersion.Text = "Version {0}" ' 'TimerClose ' @@ -227,19 +238,43 @@ Partial Class frmStart ' Me.TimerRefresh.Interval = 120000 ' - 'labelVersion + 'GroupBox2 ' - Me.labelVersion.Name = "labelVersion" - Me.labelVersion.Size = New System.Drawing.Size(62, 17) - Me.labelVersion.Text = "Version {0}" + Me.GroupBox2.Controls.Add(Me.labelStatus) + Me.GroupBox2.Controls.Add(Me.labelRefresh) + Me.GroupBox2.Location = New System.Drawing.Point(15, 157) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(318, 64) + Me.GroupBox2.TabIndex = 14 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "Informationen" + ' + 'labelRefresh + ' + Me.labelRefresh.AutoSize = True + Me.labelRefresh.Location = New System.Drawing.Point(8, 21) + Me.labelRefresh.Name = "labelRefresh" + Me.labelRefresh.Size = New System.Drawing.Size(132, 13) + Me.labelRefresh.TabIndex = 0 + Me.labelRefresh.Text = "Aktualisierung erfolgreich." + ' + 'labelStatus + ' + Me.labelStatus.AutoSize = True + Me.labelStatus.Location = New System.Drawing.Point(8, 34) + Me.labelStatus.Name = "labelStatus" + Me.labelStatus.Size = New System.Drawing.Size(38, 13) + Me.labelStatus.TabIndex = 0 + Me.labelStatus.Text = "Label3" ' 'frmStart ' Me.Appearance.Options.UseFont = True Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(345, 176) + Me.ClientSize = New System.Drawing.Size(345, 254) Me.ContextMenuStrip = Me.ContextMenuStripForm + Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.btnAdminConfig) Me.Controls.Add(Me.btnUserConfig) Me.Controls.Add(Me.GroupBox1) @@ -249,8 +284,8 @@ Partial Class frmStart Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.KeyPreview = True Me.MaximizeBox = False - Me.MaximumSize = New System.Drawing.Size(361, 215) - Me.MinimumSize = New System.Drawing.Size(361, 215) + Me.MaximumSize = New System.Drawing.Size(361, 293) + Me.MinimumSize = New System.Drawing.Size(361, 293) Me.Name = "frmStart" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Clipboard Watcher" @@ -259,6 +294,8 @@ Partial Class frmStart Me.StatusStrip1.PerformLayout() Me.ContextMenuStripForm.ResumeLayout(False) Me.GroupBox1.ResumeLayout(False) + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() @@ -285,4 +322,7 @@ Partial Class frmStart Friend WithEvents AblaufAnzeigenToolStripMenuItem As ToolStripMenuItem Friend WithEvents BisherigenAblaufAnzeigenToolStripMenuItem As ToolStripMenuItem Friend WithEvents labelVersion As ToolStripStatusLabel + Friend WithEvents GroupBox2 As GroupBox + Friend WithEvents labelRefresh As Label + Friend WithEvents labelStatus As Label End Class diff --git a/app/DD_Clipboard_Searcher/frmStart.resx b/app/DD_Clipboard_Searcher/frmStart.resx index d0e6a07..1779a55 100644 --- a/app/DD_Clipboard_Searcher/frmStart.resx +++ b/app/DD_Clipboard_Searcher/frmStart.resx @@ -4663,7 +4663,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABU - CwAAAk1TRnQBSQFMAgEBBQEAASgBAAEoAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CwAAAk1TRnQBSQFMAgEBBQEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/app/DD_Clipboard_Searcher/frmStart.vb b/app/DD_Clipboard_Searcher/frmStart.vb index 26ba4f7..d495c23 100644 --- a/app/DD_Clipboard_Searcher/frmStart.vb +++ b/app/DD_Clipboard_Searcher/frmStart.vb @@ -60,9 +60,7 @@ Public Class frmStart End If - labelVersion.Text = String.Format(labelVersion.Text, My.Application.Info.Version.ToString) - labelUser.Text = String.Format(labelUser.Text, USER_USERNAME) - labelHotkey.Text = String.Format(labelHotkey.Text, $"{HotkeyFunctionKey.ToUpper}+{HotkeySearchKey.ToUpper}") + RefreshUI() End Sub Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing @@ -153,6 +151,7 @@ Public Class frmStart Try Dim oProfiles = oProfileFilter.Profiles.AsEnumerable() + Dim oEnvironment = GetEnvironment() oProfiles = oProfileFilter.FilterProfilesByClipboardRegex(oProfiles, ClipboardContents) oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "FilterProfilesByClipboardRegex") @@ -162,6 +161,8 @@ Public Class frmStart oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "FilterWindowsByWindowTitleRegex") oProfiles = oProfileFilter.FilterProfilesByFocusedControl(oProfiles, ClipboardContents, Handle) oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "FilterProfilesByFocusedControl") + oProfiles = oProfileFilter.FilterProfilesBySearchResults(oProfiles, oEnvironment.Database, oEnvironment.User, ClipboardContents) + oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "FilterProfilesBySearchResults") oProfiles = oProfileFilter.ClearNotMatchedProfiles(oProfiles) oProfiles = oProfileFilter.ClearDuplicateProfiles(oProfiles) oProfiles = oProfileFilter.LogRemainingProfiles(oProfiles, "CleanUp") @@ -386,10 +387,19 @@ Public Class frmStart End If End Sub Private Sub TimerRefresh_Tick(sender As Object, e As EventArgs) Handles TimerRefresh.Tick - ClassInit.Refresh_Profile_Links() - lblrefresh.Text = + RefreshUI() + End Sub + + Private Sub RefreshUI() + Dim oResultText = ClassInit.Refresh_Profile_Links() + lblrefresh.Text = "" ClassInit.CheckModuleData() - lblrefresh.Text = $"Refreshed: {Now.ToShortTimeString} - UserLoggedIn: {USERCOUNT_LOGGED_IN}" + labelStatus.Text = oResultText + labelRefresh.Text = $"Aktualisiert: {Now.ToShortTimeString}" + lblrefresh.Text = $"Eingeloggte Benutzer: {USERCOUNT_LOGGED_IN}" + labelVersion.Text = String.Format(labelVersion.Text, My.Application.Info.Version.ToString) + labelUser.Text = String.Format(labelUser.Text, USER_USERNAME) + labelHotkey.Text = String.Format(labelHotkey.Text, $"{HotkeyFunctionKey.ToUpper}+{HotkeySearchKey.ToUpper}") End Sub Private Sub BisherigenAblaufAnzeigenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BisherigenAblaufAnzeigenToolStripMenuItem.Click diff --git a/app/DD_Clipboard_Searcher/modCurrent.vb b/app/DD_Clipboard_Searcher/modCurrent.vb index 2b1dcd3..a052890 100644 --- a/app/DD_Clipboard_Searcher/modCurrent.vb +++ b/app/DD_Clipboard_Searcher/modCurrent.vb @@ -9,6 +9,7 @@ Module modCurrent Public Database As MSSQLServer Public Automation As ClassAutomation + Public ConfigManager As ConfigManager(Of ClassConfig) Public MyConnectionString As String = ""