Zooflow: Custom Searches

This commit is contained in:
Jonathan Jenne
2022-06-08 16:31:34 +02:00
parent bd136bf6be
commit d5b9cae282
22 changed files with 1024 additions and 283 deletions

View File

@@ -65,6 +65,12 @@ Public Class frmDocumentResultList
Private ReadOnly ColumnDocumentId As String = "DocID"
Private ReadOnly ColumnIcon As String = "ICON"
Private ReadOnly ColumnCheckedOut As String = "CHECKED_OUT"
Private ReadOnly FontSizeDeltaList As New List(Of FontSetting) From {
New FontSetting With {.Title = "Normal", .Value = 0},
New FontSetting With {.Title = "Groß", .Value = 1},
New FontSetting With {.Title = "Größer", .Value = 2},
New FontSetting With {.Title = "Noch Größer", .Value = 3}
}
Private Property _ActiveGrid As GridControl = Nothing
Private Property _ActiveGridBand As GridBand = Nothing
@@ -81,6 +87,9 @@ Public Class frmDocumentResultList
Public Event NeedsRefresh As EventHandler(Of Integer) Implements IResultForm.NeedsRefresh
Public Event ResultsRefreshed As EventHandler(Of List(Of DocumentResultList.DocumentResult))
Public Event NeedsNewSavedSearch As EventHandler
Public Event SearchSaved As EventHandler
Private Delegate Sub DatasourceDelegate(View As GridView, Datasource As Object)
Private Delegate Function RefreshResultsDelegate(Results As IEnumerable(Of BaseResult)) As Boolean
@@ -163,15 +172,9 @@ Public Class frmDocumentResultList
RibbonPageGroupFilesystem.Visible = False
End If
Dim oFontSizeDeltaList = New List(Of FontSetting) From {
New FontSetting With {.Title = "Normal", .Value = 0},
New FontSetting With {.Title = "Groß", .Value = 1},
New FontSetting With {.Title = "Größer", .Value = 2},
New FontSetting With {.Title = "Noch Größer", .Value = 3}
}
cmbGridFontSize.Items.Clear()
cmbGridFontSize.Items.AddRange(oFontSizeDeltaList)
BarEditItemGridFontSize.EditValue = oFontSizeDeltaList.
cmbGridFontSize.Items.AddRange(FontSizeDeltaList)
BarEditItemGridFontSize.EditValue = FontSizeDeltaList.
Where(Function(delta) delta.Value = Config.Config.GridFontSizeDelta).
FirstOrDefault()
@@ -185,6 +188,13 @@ Public Class frmDocumentResultList
RibbonPageGroupFilesystem.Visible = False
End If
chkGridShowQuickfilter.Checked = LayoutManager.GetFilterRowVisible()
chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible()
chkGridShowTitle.Checked = LayoutManager.GetBandTitleVisible()
' Hide the complete Navigation Ribbon Group if desired
RibbonPageGroup_Navigation.Visible = Params.ShowBackNavigation
If OperationMode = OperationMode.ZooFlow Or OperationMode = OperationMode.WithAppServer Then
CtrlObjectPropertyDialog.Initialize(LogConfig, Me, Client, Environment)
@@ -196,12 +206,10 @@ Public Class frmDocumentResultList
panelContainerStatus.Visibility = Docking.DockVisibility.Hidden
End If
' Hide the complete Navigation Ribbon Group if desired
RibbonPageGroup_Navigation.Visible = Params.ShowBackNavigation
UpdateTotalResults()
LoadGridDataAndLayout()
' Initialize Grid Settings
GridBuilder.WithReadOnlyOptions()
' Force initialize, this is needed so that grid settings are loaded correctly from the workspace
@@ -221,10 +229,6 @@ Public Class frmDocumentResultList
' This loads the default workspace, for now
Workspace.LoadWorkspace(Config.Config.SelectedWorkspace)
chkGridShowQuickfilter.Checked = LayoutManager.GetFilterRowVisible()
chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible()
chkGridShowTitle.Checked = LayoutManager.GetBandTitleVisible()
' This needs to done be after loading the grid
' so we can set the row handle and start loading the (only) file
If Params.ShowFileList = False Then
@@ -234,6 +238,22 @@ Public Class frmDocumentResultList
DockPanelFileList.Show()
End If
' Hide the refresh button when nobody handles the refresh event
If NeedsRefreshEvent IsNot Nothing Then
RibbonPageRefresh.Visible = True
Else
RibbonPageRefresh.Visible = False
End If
' Hide the saved search button when nobody handles the saved search event
If NeedsNewSavedSearchEvent IsNot Nothing Then
RibbonPageGroupSavedSearch.Visible = True
Else
RibbonPageGroupSavedSearch.Visible = False
End If
Catch ex As Exception
FormHelper.ShowErrorMessage(ex, "Error while loading results")
@@ -243,21 +263,8 @@ Public Class frmDocumentResultList
End Try
End Sub
Public Class FontSetting
Public Property Title As String
Public Property Value As Integer
Public Overrides Function ToString() As String
Return Title
End Function
End Class
Private Sub frmDocumentResultList_Closing(sender As Object, e As CancelEventArgs) Handles Me.FormClosing
Try
'LayoutManager.GridView_SaveLayout(_ActiveGrid.MainView)
'LayoutManager.Workspace_Save(WorkspaceManager1)
'LayoutManager.DockManager_SaveLayout(DockManager1)
LayoutManager.SaveWindowLocationAndSize(Me)
Workspace.SaveWorkspaces()
@@ -1086,4 +1093,19 @@ Public Class frmDocumentResultList
Workspace.LoadWorkspace(oWorkspaceName)
End If
End Sub
Private Sub btnSaveAsMySearch_ItemClick(sender As Object, e As ItemClickEventArgs) Handles btnSaveAsMySearch.ItemClick
RaiseEvent NeedsNewSavedSearch(Me, New EventArgs)
End Sub
Public Class FontSetting
Public Property Title As String
Public Property Value As Integer
Public Overrides Function ToString() As String
Return Title
End Function
End Class
End Class