Usability updates for #22
This commit is contained in:
Generated
+5
-4
@@ -44,7 +44,7 @@ Partial Class frmAdvancedImport
|
|||||||
'chkSelectAll
|
'chkSelectAll
|
||||||
'
|
'
|
||||||
Me.chkSelectAll.AutoSize = True
|
Me.chkSelectAll.AutoSize = True
|
||||||
Me.chkSelectAll.Location = New System.Drawing.Point(15, 12)
|
Me.chkSelectAll.Location = New System.Drawing.Point(18, 12)
|
||||||
Me.chkSelectAll.Name = "chkSelectAll"
|
Me.chkSelectAll.Name = "chkSelectAll"
|
||||||
Me.chkSelectAll.Size = New System.Drawing.Size(15, 14)
|
Me.chkSelectAll.Size = New System.Drawing.Size(15, 14)
|
||||||
Me.chkSelectAll.TabIndex = 0
|
Me.chkSelectAll.TabIndex = 0
|
||||||
@@ -97,11 +97,12 @@ Partial Class frmAdvancedImport
|
|||||||
'
|
'
|
||||||
'lblFilter
|
'lblFilter
|
||||||
'
|
'
|
||||||
Me.lblFilter.Location = New System.Drawing.Point(363, 12)
|
Me.lblFilter.Location = New System.Drawing.Point(307, 12)
|
||||||
Me.lblFilter.Name = "lblFilter"
|
Me.lblFilter.Name = "lblFilter"
|
||||||
Me.lblFilter.Size = New System.Drawing.Size(47, 14)
|
Me.lblFilter.Size = New System.Drawing.Size(103, 14)
|
||||||
Me.lblFilter.TabIndex = 0
|
Me.lblFilter.TabIndex = 0
|
||||||
Me.lblFilter.Text = "Search:"
|
Me.lblFilter.Text = "Filter:"
|
||||||
|
Me.lblFilter.TextAlign = System.Drawing.ContentAlignment.TopRight
|
||||||
'
|
'
|
||||||
'frmAdvancedImport
|
'frmAdvancedImport
|
||||||
'
|
'
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ Public Class frmAdvancedImport
|
|||||||
Private hshFinalData As New Hashtable
|
Private hshFinalData As New Hashtable
|
||||||
Private bSelectAll As Boolean = False
|
Private bSelectAll As Boolean = False
|
||||||
Private bIsLoading As Boolean = False
|
Private bIsLoading As Boolean = False
|
||||||
|
Private iCurrentSort As Integer = 0
|
||||||
Private WithEvents tmFilterTimer As Timer
|
Private WithEvents tmFilterTimer As Timer
|
||||||
|
|
||||||
Public Property ImportData As Hashtable
|
Public Property ImportData As Hashtable
|
||||||
@@ -36,11 +37,20 @@ Public Class frmAdvancedImport
|
|||||||
UpdateSelected()
|
UpdateSelected()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SaveChecked(ByVal oItem As ListViewItem)
|
||||||
|
If oItem.Checked Then
|
||||||
|
FinalData.Add(oItem.Tag, ImportData(oItem.Tag))
|
||||||
|
Else
|
||||||
|
FinalData.Remove(oItem.Tag)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub LoadData(Optional ByVal sFilter As String = "")
|
Private Sub LoadData(Optional ByVal sFilter As String = "")
|
||||||
Dim oApp As clsGame
|
Dim oApp As clsGame
|
||||||
Dim oListViewItem As ListViewItem
|
Dim oListViewItem As ListViewItem
|
||||||
Dim sTags As String
|
Dim sTags As String
|
||||||
|
Dim bAddItem As Boolean
|
||||||
|
Dim bResetSelectAll As Boolean = False
|
||||||
|
|
||||||
Cursor.Current = Cursors.WaitCursor
|
Cursor.Current = Cursors.WaitCursor
|
||||||
lstGames.BeginUpdate()
|
lstGames.BeginUpdate()
|
||||||
@@ -52,6 +62,7 @@ Public Class frmAdvancedImport
|
|||||||
lstGames.Columns.Add(frmAdvancedImport_ColumnTags, 190)
|
lstGames.Columns.Add(frmAdvancedImport_ColumnTags, 190)
|
||||||
|
|
||||||
For Each de As DictionaryEntry In ImportData
|
For Each de As DictionaryEntry In ImportData
|
||||||
|
bAddItem = False
|
||||||
oApp = DirectCast(de.Value, clsGame)
|
oApp = DirectCast(de.Value, clsGame)
|
||||||
sTags = String.Empty
|
sTags = String.Empty
|
||||||
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
|
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
|
||||||
@@ -62,21 +73,48 @@ Public Class frmAdvancedImport
|
|||||||
|
|
||||||
oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.TrueProcess, sTags})
|
oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.TrueProcess, sTags})
|
||||||
oListViewItem.Tag = oApp.CompoundKey
|
oListViewItem.Tag = oApp.CompoundKey
|
||||||
oListViewItem.Checked = bSelectAll
|
|
||||||
|
If FinalData.ContainsKey(oApp.CompoundKey) Then
|
||||||
|
oListViewItem.Checked = True
|
||||||
|
Else
|
||||||
|
oListViewItem.Checked = False
|
||||||
|
End If
|
||||||
|
|
||||||
If sFilter = String.Empty Then
|
If sFilter = String.Empty Then
|
||||||
lstGames.Items.Add(oListViewItem)
|
bAddItem = True
|
||||||
Else
|
Else
|
||||||
If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.TrueProcess.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then
|
If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.TrueProcess.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then
|
||||||
lstGames.Items.Add(oListViewItem)
|
bAddItem = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If bAddItem Then
|
||||||
|
If oListViewItem.Checked Then bResetSelectAll = True
|
||||||
|
lstGames.Items.Add(oListViewItem)
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
lstGames.ListViewItemSorter = New ListViewItemComparer(0)
|
'Change the status of the "Select All" checkbox depending on the status of the items filter results. Set loading flag so we don't trigger any events
|
||||||
|
bIsLoading = True
|
||||||
|
If Not bResetSelectAll And bSelectAll Then
|
||||||
|
bSelectAll = False
|
||||||
|
chkSelectAll.Checked = False
|
||||||
|
ElseIf bResetSelectAll And Not bSelectAll Then
|
||||||
|
bSelectAll = True
|
||||||
|
chkSelectAll.Checked = True
|
||||||
|
End If
|
||||||
|
bIsLoading = False
|
||||||
|
|
||||||
|
lstGames.ListViewItemSorter = New ListViewItemComparer(iCurrentSort)
|
||||||
lstGames.EndUpdate()
|
lstGames.EndUpdate()
|
||||||
UpdateSelected()
|
UpdateSelected()
|
||||||
lblGames.Text = mgrCommon.FormatString(frmAdvancedImport_NewConfigs, lstGames.Items.Count)
|
|
||||||
|
If txtFilter.Text = String.Empty Then
|
||||||
|
lblGames.Text = mgrCommon.FormatString(frmAdvancedImport_Configs, lstGames.Items.Count)
|
||||||
|
Else
|
||||||
|
lblGames.Text = mgrCommon.FormatString(frmAdvancedImport_Configs, lstGames.Items.Count) & " " & frmAdvancedImport_Filtered
|
||||||
|
End If
|
||||||
|
|
||||||
Cursor.Current = Cursors.Default
|
Cursor.Current = Cursors.Default
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -97,17 +135,8 @@ Public Class frmAdvancedImport
|
|||||||
tmFilterTimer.Enabled = False
|
tmFilterTimer.Enabled = False
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BuildList()
|
|
||||||
Dim oData As ListViewItem
|
|
||||||
|
|
||||||
For i As Integer = 0 To lstGames.CheckedItems.Count - 1
|
|
||||||
oData = lstGames.Items(i)
|
|
||||||
FinalData.Add(oData.Tag, ImportData(oData.Tag))
|
|
||||||
Next
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub UpdateSelected()
|
Private Sub UpdateSelected()
|
||||||
lblSelected.Text = mgrCommon.FormatString(frmAdvancedImport_Selected, lstGames.CheckedItems.Count)
|
lblSelected.Text = mgrCommon.FormatString(frmAdvancedImport_Selected, FinalData.Count)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
@@ -123,7 +152,10 @@ Public Class frmAdvancedImport
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub lstGames_ItemChecked(sender As Object, e As ItemCheckedEventArgs) Handles lstGames.ItemChecked
|
Private Sub lstGames_ItemChecked(sender As Object, e As ItemCheckedEventArgs) Handles lstGames.ItemChecked
|
||||||
If Not bIsLoading Then UpdateSelected()
|
SaveChecked(e.Item)
|
||||||
|
If Not bIsLoading Then
|
||||||
|
UpdateSelected()
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
|
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
|
||||||
@@ -131,12 +163,12 @@ Public Class frmAdvancedImport
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
|
Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
|
||||||
BuildList()
|
If FinalData.Count > 0 Then Me.DialogResult = Windows.Forms.DialogResult.OK
|
||||||
If ImportData.Count > 0 Then Me.DialogResult = Windows.Forms.DialogResult.OK
|
|
||||||
Me.Close()
|
Me.Close()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub lstGames_ColumnClick(sender As Object, e As ColumnClickEventArgs) Handles lstGames.ColumnClick
|
Private Sub lstGames_ColumnClick(sender As Object, e As ColumnClickEventArgs) Handles lstGames.ColumnClick
|
||||||
|
iCurrentSort = e.Column
|
||||||
lstGames.ListViewItemSorter = New ListViewItemComparer(e.Column)
|
lstGames.ListViewItemSorter = New ListViewItemComparer(e.Column)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|||||||
Generated
+21
-12
@@ -736,7 +736,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Process.
|
''' Looks up a localized string similar to Monitored Process.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property frmAdvancedImport_ColumnProcess() As String
|
Friend ReadOnly Property frmAdvancedImport_ColumnProcess() As String
|
||||||
Get
|
Get
|
||||||
@@ -753,6 +753,24 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Configurations ([PARAM]).
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmAdvancedImport_Configs() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmAdvancedImport_Configs", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to [Filtered].
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmAdvancedImport_Filtered() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmAdvancedImport_Filtered", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Import Game Configurations.
|
''' Looks up a localized string similar to Import Game Configurations.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -763,7 +781,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Search:.
|
''' Looks up a localized string similar to Filter:.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property frmAdvancedImport_lblFilter() As String
|
Friend ReadOnly Property frmAdvancedImport_lblFilter() As String
|
||||||
Get
|
Get
|
||||||
@@ -772,16 +790,7 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to [PARAM] configurations available.
|
''' Looks up a localized string similar to Selected ([PARAM]).
|
||||||
'''</summary>
|
|
||||||
Friend ReadOnly Property frmAdvancedImport_NewConfigs() As String
|
|
||||||
Get
|
|
||||||
Return ResourceManager.GetString("frmAdvancedImport_NewConfigs", resourceCulture)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
'''<summary>
|
|
||||||
''' Looks up a localized string similar to [PARAM] Selected.
|
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property frmAdvancedImport_Selected() As String
|
Friend ReadOnly Property frmAdvancedImport_Selected() As String
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -871,11 +871,11 @@
|
|||||||
<data name="frmAdvancedImport_FormName" xml:space="preserve">
|
<data name="frmAdvancedImport_FormName" xml:space="preserve">
|
||||||
<value>Import Game Configurations</value>
|
<value>Import Game Configurations</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_NewConfigs" xml:space="preserve">
|
<data name="frmAdvancedImport_Configs" xml:space="preserve">
|
||||||
<value>[PARAM] configurations available</value>
|
<value>Configurations ([PARAM])</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_Selected" xml:space="preserve">
|
<data name="frmAdvancedImport_Selected" xml:space="preserve">
|
||||||
<value>[PARAM] Selected</value>
|
<value>Selected ([PARAM])</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmChooseGame_btnCancel" xml:space="preserve">
|
<data name="frmChooseGame_btnCancel" xml:space="preserve">
|
||||||
<value>&Cancel</value>
|
<value>&Cancel</value>
|
||||||
@@ -1571,15 +1571,18 @@
|
|||||||
<value>PNG files (*.png)|*.png</value>
|
<value>PNG files (*.png)|*.png</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_lblFilter" xml:space="preserve">
|
<data name="frmAdvancedImport_lblFilter" xml:space="preserve">
|
||||||
<value>Search:</value>
|
<value>Filter:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_ColumnName" xml:space="preserve">
|
<data name="frmAdvancedImport_ColumnName" xml:space="preserve">
|
||||||
<value>Name</value>
|
<value>Name</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_ColumnProcess" xml:space="preserve">
|
<data name="frmAdvancedImport_ColumnProcess" xml:space="preserve">
|
||||||
<value>Process</value>
|
<value>Monitored Process</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmAdvancedImport_ColumnTags" xml:space="preserve">
|
<data name="frmAdvancedImport_ColumnTags" xml:space="preserve">
|
||||||
<value>Tags</value>
|
<value>Tags</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="frmAdvancedImport_Filtered" xml:space="preserve">
|
||||||
|
<value>[Filtered]</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user