Skip to content

Commit

Permalink
fix importing and double items in list
Browse files Browse the repository at this point in the history
  • Loading branch information
soaresden committed Apr 5, 2021
1 parent dabd7f6 commit 4d9c0ee
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 39 deletions.
42 changes: 21 additions & 21 deletions RecalCopier/00-Menu.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion RecalCopier/00-Menu.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2320,7 +2320,7 @@ Infos/Images/Videos/Manuels/Maps/Overlays ...</value>
8OqtgVd5WDEVN3EDsEI/sW1hxSjwanos+n8Hcfj+X8uSBfl/rVjsP9vrhIxN3bzwAAAAAElFTkSuQmCC
</value>
</data>
<data name="ButtonCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="ButtonCopyMenu.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADIAAAAzCAYAAADVY1sUAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wwAADsMBx2+oZAAADPpJREFUaEPdWXdcleUeZx6mbNmyRQlRFGSjsocDNcIBoqCXIVNBxBGZpWallnm1
Expand Down
4 changes: 2 additions & 2 deletions RecalCopier/00-Menu.vb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Public Class Form1
End If

'On met les tooltip
ToolTipCopy.SetToolTip(ButtonCopy, "Générez votre dossier Custom !")
ToolTipCopy.SetToolTip(ButtonCopyMenu, "Générez votre dossier Custom !")
ToolTipOverlays.SetToolTip(ButtonOverlay, "Gérez votre collection d'overlays")
ToolTipSaves.SetToolTip(ButtonSave, "Maitrisez/renommer vos sauvegardes orphelines")
ToolTipBlindTest.SetToolTip(ButtonQuizz, "Essayez de reconnaitre par video/son vos jeux favoris !")
Expand Down Expand Up @@ -144,7 +144,7 @@ Public Class Form1
Private Sub RichTextBox2_Click(sender As Object, e As EventArgs) Handles RichTextBox2.Click
System.Diagnostics.Process.Start(String.Format("http://jujuvincebros.fr/telechargements2/file/10-arrm-another-recalbox-roms-manager"))
End Sub
Private Sub ButtonCopy_Click_1(sender As Object, e As EventArgs) Handles ButtonCopy.Click
Private Sub ButtonCopy_Click_1(sender As Object, e As EventArgs) Handles ButtonCopyMenu.Click
If My.Settings.RecalboxFolder = "" Then
MsgBox("Pas de Chemin !")
ButtonSetDossier.PerformClick()
Expand Down
29 changes: 14 additions & 15 deletions RecalCopier/CopyRoms.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3313,7 +3313,6 @@ lignesuivante:

For i = 0 To FinalGrid.RowCount - 1
For j = 0 To FinalGrid.ColumnCount - 1

Dim verifheader As String = xlWorkSheet.Cells(1, j + 1).value.ToString

'On ecrit les cellules
Expand All @@ -3322,6 +3321,7 @@ lignesuivante:
If Not FinalGrid(j, i).Value.ToString = "" Then
Select Case j
Case 12 'format player en chiffre entier
xlWorkSheet.Cells(i + 2, j + 1).NumberFormat = "@"
xlWorkSheet.Cells(i + 2, j + 1) = CStr((FinalGrid(j, i).Value.ToString()))
Case 21 'format Taille Mo en virgule
xlWorkSheet.Cells(i + 2, j + 1) = CDbl(FinalGrid(j, i).Value.ToString())
Expand Down Expand Up @@ -3353,12 +3353,12 @@ colonneselection:
xlWorkSheet.Columns(20 + 1).EntireColumn.Hidden = True 'coches...

'On tente la Mise en forme Tableau
Dim rg As Excel.Range = xlWorkSheet.Range("A1:W" & FinalGrid.RowCount - 1)
Dim rg As Excel.Range = xlWorkSheet.Range("A1:W" & FinalGrid.RowCount + 1)
Dim objTable As Excel.ListObject
objTable = xlWorkSheet.ListObjects.AddEx(Excel.XlListObjectSourceType.xlSrcRange, rg, , Excel.XlYesNoGuess.xlYes)

'On met en forme la colonne Selection, Inserez un 1, et icone
Dim rgselection As Excel.Range = xlWorkSheet.Range("W2:W" & FinalGrid.RowCount - 1)
Dim rgselection As Excel.Range = xlWorkSheet.Range("W2:W" & FinalGrid.RowCount + 1)

'Gris
rgselection.Interior.Color = Color.DarkGray
Expand All @@ -3380,23 +3380,20 @@ colonneselection:
.IconSet = Excel.XlIconSet.xl3Symbols
End With
With rgselection.FormatConditions(1).IconCriteria(2)
.Type = Excel.XlConditionValueTypes.xlConditionValuePercent
.Type = Excel.XlConditionValueTypes.xlConditionValueNumber
.Value = 0
.Operator = 5
End With
With rgselection.FormatConditions(1).IconCriteria(3)
.Type = Excel.XlConditionValueTypes.xlConditionValuePercent
.Type = Excel.XlConditionValueTypes.xlConditionValueNumber
.Value = 1
.Operator = 7
End With

'Validation en 1
With rgselection.Validation
.Delete()
.Add(Type:=Excel.XlDVType.xlValidateList,
AlertStyle:=Excel.XlDVAlertStyle.xlValidAlertStop,
Operator:=Excel.XlFormatConditionOperator.xlBetween,
Formula1:="1")
.Add(Type:=Excel.XlDVType.xlValidateList, AlertStyle:=Excel.XlDVAlertStyle.xlValidAlertStop, Operator:=Excel.XlFormatConditionOperator.xlBetween, Formula1:="1")
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = "Saisir 1 ou Blanc"
Expand Down Expand Up @@ -3457,7 +3454,6 @@ colonneselection:
End Sub

Private Sub ImportToRecopierBox_Click(sender As Object, e As EventArgs) Handles ImportToRecopierBox.Click

Using O As New OpenFileDialog With {.Filter = "Fichiers Excel|*.xlsx", .Multiselect = False, .Title = "Choisir votre Xlsx"}
If O.ShowDialog = 1 Then
Dim xlApp As Excel.Application
Expand All @@ -3469,26 +3465,29 @@ colonneselection:
xlWorkSheet = xlWorkBook.Worksheets(1)

listconsoleselected.Items.Clear()
'Dim get systems
'On recupere les systemes temporairement dans la liste des systemes selectionnés
For i = 2 To xlWorkSheet.Application.WorksheetFunction.CountA(xlWorkSheet.Range("A:A"))
Dim valeurcellule As String = xlWorkSheet.Range("A" & i).Value
If Not listconsoleselected.Items.Contains(valeurcellule) Then
listconsoleselected.Items.Add(valeurcellule)
End If
Next

'Clear par precaution
FinalGrid.Rows.Clear()
'On peuple par les consoles
'On selection par rapport a la liste temporaire
ListGameLists.ClearSelected()

For j = 0 To ListGameLists.Items.Count - 1
Dim valeurencours = ListGameLists.Items(j)
If listconsoleselected.Items.Contains(valeurencours) = True Then
ListGameLists.SetSelected(j, True)
End If
Next
'on efface pour eviter les doublons
listconsoleselected.Items.Clear()
'On réalise l'import
ButtonGenererList.PerformClick()

'Maintenant on va analyser les selection et cocher
'Maintenant on va analyser les selections et cocher
ButtonAfficherMaSelection.PerformClick()
listboxMaSelection.Items.Clear()

Expand Down

0 comments on commit 4d9c0ee

Please sign in to comment.