From 0f874ae74a3ba929506ec99f856b7d597d935081 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Sat, 23 Sep 2017 15:20:53 -0600 Subject: [PATCH] Enhancement for issue #83 --- GBM/Forms/frmAdvancedImport.vb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/GBM/Forms/frmAdvancedImport.vb b/GBM/Forms/frmAdvancedImport.vb index ee374f9..d3e5997 100644 --- a/GBM/Forms/frmAdvancedImport.vb +++ b/GBM/Forms/frmAdvancedImport.vb @@ -1,10 +1,11 @@ Imports GBM.My.Resources +Imports System.IO Public Class frmAdvancedImport Private hshImportData As Hashtable Private hshFinalData As New Hashtable - Private bSelectAll As Boolean = False + Private bSelectAll As Boolean = True Private bIsLoading As Boolean = False Private iCurrentSort As Integer = 0 Private WithEvents tmFilterTimer As Timer @@ -44,7 +45,7 @@ Public Class frmAdvancedImport End If End Sub - Private Sub LoadData(Optional ByVal sFilter As String = "") + Private Sub LoadData(Optional ByVal sFilter As String = "", Optional ByVal bAutoDetect As Boolean = False) Dim oApp As clsGame Dim oListViewItem As ListViewItem Dim sTags As String @@ -79,6 +80,18 @@ Public Class frmAdvancedImport oListViewItem.Checked = False End If + If bAutoDetect Then + If oApp.AbsolutePath Then + If Directory.Exists(oApp.Path) Then + oListViewItem.Checked = True + Else + oListViewItem.Checked = False + End If + Else + oListViewItem.Checked = False + End If + End If + If sFilter = String.Empty Then bAddItem = True Else @@ -142,8 +155,7 @@ Public Class frmAdvancedImport Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load bIsLoading = True SetForm() - LoadData() - SelectToggle() + LoadData(String.Empty, True) bIsLoading = False End Sub @@ -184,6 +196,7 @@ Public Class frmAdvancedImport tmFilterTimer.Stop() tmFilterTimer.Enabled = False End Sub + End Class ' Column Sorter