diff --git a/main.pb b/main.pb
index 977f651..ca37055 100644
--- a/main.pb
+++ b/main.pb
@@ -12,190 +12,190 @@
#EnableDebug=#True
Global GitIgnoreHelpHTML.s = ~"" + #LF$ +
-~"" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~" " + #LF$ +
-~" Aide .gitignore" + #LF$ +
-~" " + #LF$ +
-~"" + #LF$ +
-~"" + #LF$ +
-~" " + #LF$ +
-~"
📁 Guide .gitignore
" + #LF$ +
-~" " + #LF$ +
-~"
Le fichier .gitignore
permet de spécifier quels fichiers et dossiers Git doit ignorer lors du versioning.
" + #LF$ +
-~" " + #LF$ +
-~"
🎯 Syntaxe de base
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"
Ignorer des fichiers spécifiques :" + #LF$ +
-~"
" + #LF$ +
-~"config.txt # Ignore le fichier config.txt
" + #LF$ +
-~"*.log # Ignore tous les fichiers .log
" + #LF$ +
-~"temp/ # Ignore le dossier temp et tout son contenu" + #LF$ +
-~"
" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
🔧 Patterns et wildcards
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~" - * : correspond à n'importe quelle chaîne (sauf
/
) " + #LF$ +
-~" - ** : correspond à n'importe quel nombre de répertoires
" + #LF$ +
-~" - ? : correspond à un seul caractère
" + #LF$ +
-~" - [abc] : correspond à a, b ou c
" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
🚫 Négation avec !
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"*.log
" + #LF$ +
-~"!important.log # Inclut ce fichier malgré la règle précédente" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
📍 Chemins
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"
" + #LF$ +
-~"/build # Ignore build à la racine uniquement
" + #LF$ +
-~"build/ # Ignore tous les dossiers build
" + #LF$ +
-~"docs/**/*.pdf # Ignore tous les PDF dans docs et ses sous-dossiers" + #LF$ +
-~"
" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
💡 Exemples courants
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"# Fichiers de build
" + #LF$ +
-~"dist/
" + #LF$ +
-~"build/
" + #LF$ +
-~"
" + #LF$ +
-~"# Dépendances
" + #LF$ +
-~"node_modules/
" + #LF$ +
-~"vendor/
" + #LF$ +
-~"
" + #LF$ +
-~"# Configuration locale
" + #LF$ +
-~".env
" + #LF$ +
-~"config.local.json
" + #LF$ +
-~"
" + #LF$ +
-~"# Logs et caches
" + #LF$ +
-~"*.log
" + #LF$ +
-~".cache/
" + #LF$ +
-~"
" + #LF$ +
-~"# Fichiers d'IDE
" + #LF$ +
-~".vscode/
" + #LF$ +
-~".idea/
" + #LF$ +
-~"
" + #LF$ +
-~"# Fichiers système
" + #LF$ +
-~".DS_Store
" + #LF$ +
-~"Thumbs.db" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~" 💡 Conseil : Utilisez des commentaires avec #
pour documenter vos règles." + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~" ⚠️ Important : Le .gitignore ne s'applique qu'aux fichiers non-trackés. Pour ignorer des fichiers déjà versionnés, utilisez git rm --cached <fichier>
." + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
🔍 Tester vos règles
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"git check-ignore -v <fichier> # Vérifie si un fichier est ignoré
" + #LF$ +
-~"git status --ignored # Affiche les fichiers ignorés" + #LF$ +
-~"
" + #LF$ +
-~" " + #LF$ +
-~"
" + #LF$ +
-~"" + #LF$ +
-~""
+ ~"" + #LF$ +
+ ~"" + #LF$ +
+ ~" " + #LF$ +
+ ~" " + #LF$ +
+ ~" Aide .gitignore" + #LF$ +
+ ~" " + #LF$ +
+ ~"" + #LF$ +
+ ~"" + #LF$ +
+ ~" " + #LF$ +
+ ~"
📁 Guide .gitignore
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
Le fichier .gitignore
permet de spécifier quels fichiers et dossiers Git doit ignorer lors du versioning.
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
🎯 Syntaxe de base
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"
Ignorer des fichiers spécifiques :" + #LF$ +
+ ~"
" + #LF$ +
+ ~"config.txt # Ignore le fichier config.txt
" + #LF$ +
+ ~"*.log # Ignore tous les fichiers .log
" + #LF$ +
+ ~"temp/ # Ignore le dossier temp et tout son contenu" + #LF$ +
+ ~"
" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
🔧 Patterns et wildcards
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~" - * : correspond à n'importe quelle chaîne (sauf
/
) " + #LF$ +
+ ~" - ** : correspond à n'importe quel nombre de répertoires
" + #LF$ +
+ ~" - ? : correspond à un seul caractère
" + #LF$ +
+ ~" - [abc] : correspond à a, b ou c
" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
🚫 Négation avec !
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"*.log
" + #LF$ +
+ ~"!important.log # Inclut ce fichier malgré la règle précédente" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
📍 Chemins
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"/build # Ignore build à la racine uniquement
" + #LF$ +
+ ~"build/ # Ignore tous les dossiers build
" + #LF$ +
+ ~"docs/**/*.pdf # Ignore tous les PDF dans docs et ses sous-dossiers" + #LF$ +
+ ~"
" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
💡 Exemples courants
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Fichiers de build
" + #LF$ +
+ ~"dist/
" + #LF$ +
+ ~"build/
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Dépendances
" + #LF$ +
+ ~"node_modules/
" + #LF$ +
+ ~"vendor/
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Configuration locale
" + #LF$ +
+ ~".env
" + #LF$ +
+ ~"config.local.json
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Logs et caches
" + #LF$ +
+ ~"*.log
" + #LF$ +
+ ~".cache/
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Fichiers d'IDE
" + #LF$ +
+ ~".vscode/
" + #LF$ +
+ ~".idea/
" + #LF$ +
+ ~"
" + #LF$ +
+ ~"# Fichiers système
" + #LF$ +
+ ~".DS_Store
" + #LF$ +
+ ~"Thumbs.db" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~" 💡 Conseil : Utilisez des commentaires avec #
pour documenter vos règles." + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~" ⚠️ Important : Le .gitignore ne s'applique qu'aux fichiers non-trackés. Pour ignorer des fichiers déjà versionnés, utilisez git rm --cached <fichier>
." + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
🔍 Tester vos règles
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"git check-ignore -v <fichier> # Vérifie si un fichier est ignoré
" + #LF$ +
+ ~"git status --ignored # Affiche les fichiers ignorés" + #LF$ +
+ ~"
" + #LF$ +
+ ~" " + #LF$ +
+ ~"
" + #LF$ +
+ ~"" + #LF$ +
+ ~""
; =============================================================================
@@ -509,11 +509,11 @@ EndProcedure
Procedure.s _SupTrim(text.s)
If text = "" : ProcedureReturn "" : EndIf
-
+
Protected i.i = 1
Protected j.i = Len(text)
Protected c.l
-
+
; Trim gauche : avancer tant que <= 32
While i <= j
c = Asc(Mid(text, i, 1))
@@ -523,7 +523,7 @@ Procedure.s _SupTrim(text.s)
Break
EndIf
Wend
-
+
; Trim droite : reculer tant que <= 32
While j >= i
c = Asc(Mid(text, j, 1))
@@ -533,7 +533,7 @@ Procedure.s _SupTrim(text.s)
Break
EndIf
Wend
-
+
If j < i
ProcedureReturn ""
Else
@@ -595,11 +595,11 @@ EndProcedure
Procedure _ScanAndFillAllFiles(dir$, root$)
Protected did.i = ExamineDirectory(#PB_Any, dir$, "*")
If did = 0 : ProcedureReturn : EndIf
-
+
While NextDirectoryEntry(did)
Protected name$ = DirectoryEntryName(did)
If name$ = "." Or name$ = ".." : Continue : EndIf
-
+
Protected full$ = dir$ + name$
Debug full$
If DirectoryEntryType(did) = #PB_DirectoryEntry_Directory
@@ -612,7 +612,7 @@ Procedure _ScanAndFillAllFiles(dir$, root$)
; Fichier : on ajoute une ligne dans main\listFilesGit()
Protected rel$ = Mid(full$, Len(root$) + 1)
rel$ = ReplaceString(rel$, "\", "/") ; chemins normalisés
-
+
AddElement(main\listFilesGit())
main\listFilesGit()\name = rel$
main\listFilesGit()\status = " " ; 2 espaces = clean
@@ -621,22 +621,22 @@ Procedure _ScanAndFillAllFiles(dir$, root$)
main\listFilesGit()\statusDescription = "Unmodified"
EndIf
Wend
-
+
FinishDirectory(did)
EndProcedure
; --- API publique : appelle ceci pour remplir la liste
Procedure.i FillAllFilesRecursively()
-
- root$ = GetCurrentDirectory()
-
-
+
+ root$ = GetCurrentDirectory()
+
+
; Normalise avec un séparateur de fin
If Right(root$, 1) <> "\" And Right(root$, 1) <> "/" : root$ + "/" : EndIf
-
+
; On n'efface pas ici pour laisser le choix à l'appelant
_ScanAndFillAllFiles(root$, root$)
-
+
ProcedureReturn ListSize(main\listFilesGit())
EndProcedure
@@ -842,35 +842,35 @@ EndProcedure
Procedure GetGitStatus()
; Ne PAS vider la liste ici : on veut pouvoir mettre à jour des entrées existantes
; ClearList(main\listFilesGit()) ; <-- laissé intentionnellement commenté
-
+
; Configuration pour git status --porcelain --ignored
main\Gitcall\args = "status --porcelain --ignored"
code = RunExe(@main\Gitcall)
-
+
If code = 0
; Parser la sortie ligne par ligne
output$ = main\Gitcall\output
-
+
; Diviser en lignes
Dim lines.s(0)
lineCount = 0
currentPos = 1
-
+
; Compter les lignes
For i = 1 To Len(output$)
If Mid(output$, i, 1) = #LF$ Or Mid(output$, i, 1) = #CR$
lineCount + 1
EndIf
Next
-
+
; Redimensionner le tableau
If lineCount > 0
ReDim lines.s(lineCount)
-
+
; Remplir le tableau avec les lignes
lineIndex = 0
startPos = 1
-
+
For i = 1 To Len(output$)
If Mid(output$, i, 1) = #LF$ Or Mid(output$, i, 1) = #CR$
If i > startPos
@@ -885,13 +885,13 @@ Procedure GetGitStatus()
EndIf
EndIf
Next
-
+
; Traiter la dernière ligne si elle n'a pas de retour à la ligne
If startPos <= Len(output$)
lines(lineIndex) = Mid(output$, startPos)
EndIf
EndIf
-
+
; Parser chaque ligne
For i = 0 To ArraySize(lines())
line$ = lines(i)
@@ -904,7 +904,7 @@ Procedure GetGitStatus()
worktree$ = Mid(line$, 2, 1)
name$ = Mid(line$, 4) ; chemin tel que renvoyé par Git
name$ = ReplaceString(name$, "\", "/") ; normalisation (par sécurité)
-
+
; ----- MODIF: chercher si l'entrée existe déjà -----
found.b = #False
ForEach main\listFilesGit()
@@ -918,7 +918,7 @@ Procedure GetGitStatus()
Break
EndIf
Next
-
+
; Si non trouvée, on l'ajoute
If Not found
AddElement(main\listFilesGit())
@@ -932,10 +932,10 @@ Procedure GetGitStatus()
EndIf
EndIf
Next
-
+
Debug "Récupération des status Git réussie. " + Str(ListSize(main\listFilesGit())) + " fichiers (maj/ajout)."
ProcedureReturn #True
-
+
Else
Debug "Erreur Git ("+Str(code)+") "+main\GitCall\errors
ProcedureReturn #False
@@ -1261,23 +1261,30 @@ EndProcedure
Procedure AddRemoteRepo(Url.s,name.s="origin")
Url=_SupTrim(Url)
name=_SupTrim(name)
- Debug "Url="+Url
- Debug "name="+name
+ Protected add.b=#False
;Check if this remote already exists
main\Gitcall\args = "remote get-url "+name
If RunExe(@main\Gitcall) = 0
;if yes we remove it
- main\Gitcall\args = "remote remove "+name
- RunExe(@main\Gitcall)
+ If Url<>_SupTrim(main\Gitcall\output)
+ main\Gitcall\args = "remote remove "+name
+ RunExe(@main\Gitcall)
+ add=#True
+ EndIf
+ Else
+ add=#True
EndIf
; We add a new remote
- main\Gitcall\args = "remote add "+name+" "+Url
- If RunExe(@main\Gitcall) = 0
- MessageRequester("Git Remote", "OK:" + #LF$ + main\Gitcall\output, #PB_MessageRequester_Info)
+ If add=#True
+ main\Gitcall\args = "remote add "+name+" "+Url
+ If RunExe(@main\Gitcall) = 0
+ ;MessageRequester("Git Remote", "OK:" + #LF$ + main\Gitcall\output, #PB_MessageRequester_Info)
+ ProcedureReturn #True
+ Else
+ MessageRequester("Git config", "Échec: " + #LF$ + main\Gitcall\errors, #PB_MessageRequester_Error)
+ ProcedureReturn #False
+ EndIf
ProcedureReturn #True
- Else
- MessageRequester("Git config", "Échec: " + #LF$ + main\Gitcall\errors, #PB_MessageRequester_Error)
- ProcedureReturn #False
EndIf
EndProcedure
@@ -1351,7 +1358,7 @@ Procedure.s GetParentPath(path.s)
; Supprimer le séparateur final si présent
If Right(Path, 1) = "\" Or Right(Path, 1) = "/"
- Path = Left(Path, Len(Path) - 1)
+ Path = Left(Path, Len(Path) - 1)
EndIf
; Utiliser GetPathPart() qui retourne le chemin sans le fichier/dossier final
@@ -1378,13 +1385,13 @@ Procedure DoClone()
; Demander à l'utilisateur où cloner
choice = MessageRequester("Git Clone - Destination",
- "Où voulez-vous cloner le dépôt ?" + #LF$ + #LF$ +
- "OUI: Créer un répertoire '" + repoName + "' dans le répertoire courant" + #LF$ +
- " → " + currentDir + repoName + "/" + #LF$ + #LF$ +
- "NON: Cloner directement dans le répertoire courant" + #LF$ +
- " → " + currentDir + #LF$ + #LF$ +
- "ANNULER: Annuler l'opération",
- #PB_MessageRequester_YesNoCancel)
+ "Où voulez-vous cloner le dépôt ?" + #LF$ + #LF$ +
+ "OUI: Créer un répertoire '" + repoName + "' dans le répertoire courant" + #LF$ +
+ " → " + currentDir + repoName + "/" + #LF$ + #LF$ +
+ "NON: Cloner directement dans le répertoire courant" + #LF$ +
+ " → " + currentDir + #LF$ + #LF$ +
+ "ANNULER: Annuler l'opération",
+ #PB_MessageRequester_YesNoCancel)
Select choice
Case #PB_MessageRequester_Yes
@@ -1408,12 +1415,12 @@ Procedure DoClone()
If RunExe(@main\Gitcall) = 0
If targetFolder = "."
MessageRequester("Git Clone", "Succès:" + #LF$ +
- "Dépôt cloné dans le répertoire courant" + #LF$ + #LF$ +
- main\Gitcall\output, #PB_MessageRequester_Info)
+ "Dépôt cloné dans le répertoire courant" + #LF$ + #LF$ +
+ main\Gitcall\output, #PB_MessageRequester_Info)
Else
MessageRequester("Git Clone", "Succès:" + #LF$ +
- "Dépôt cloné dans le répertoire: " + targetFolder + "/" + #LF$ + #LF$ +
- main\Gitcall\output, #PB_MessageRequester_Info)
+ "Dépôt cloné dans le répertoire: " + targetFolder + "/" + #LF$ + #LF$ +
+ main\Gitcall\output, #PB_MessageRequester_Info)
EndIf
AddRemoteRepo(remoteUrl)
SetCurrentDirectory(GetGadgetText(#GgtFieldRepo))
@@ -1823,6 +1830,7 @@ Procedure RefreshFileList(null.i)
DisableGadget(#GdtBtnRefresh,#False)
GetBranchesList()
GetRemoteUrl()
+ GetCommitHistory()
EndProcedure
Procedure UpdateHelp(txt.s)
@@ -1834,7 +1842,7 @@ Procedure _SetTooltips()
GadgetToolTip(#GdtBtnInit, T("tip.init", "Initialiser un dépôt Git ici"))
GadgetToolTip(#GdtBtnRefresh, T("tip.refresh", "Rafraîchir la liste des fichiers et l’état Git"))
GadgetToolTip(#GgtFieldRepo, T("tip.repo.path", "Chemin du dossier projet (workdir)"))
-
+
; Remote / Branch
GadgetToolTip(#GdtFieldRemote, T("tip.remote", "URL du remote (ex.: https://... ou git@host:org/repo.git)"))
GadgetToolTip(#GdtSlctBranch, T("tip.branch.select","Choisir la branche active"))
@@ -1842,26 +1850,26 @@ Procedure _SetTooltips()
GadgetToolTip(#GdtBtnClone, T("tip.clone", "Cloner depuis l’URL remote"))
GadgetToolTip(#GdtBtnPull, T("tip.pull", "Récupérer et fusionner depuis le remote"))
GadgetToolTip(#GdtBtnPush, T("tip.push", "Envoyer vos commits sur le remote"))
-
+
; Fichiers & actions locales
GadgetToolTip(#GdtListStatus, T("tip.files.list", "Fichiers du dépôt : cochez pour préparer un commit, sélectionnez pour agir"))
GadgetToolTip(#GdtBtnRestore, T("tip.restore", "Restaurer les fichiers sélectionnés"))
GadgetToolTip(#GdtBtnRename, T("tip.rename", "Renommer les fichiers sélectionnés"))
GadgetToolTip(#GdtBtnDelete, T("tip.delete", "Supprimer les fichiers sélectionnés"))
GadgetToolTip(#GdtBtnIgnore, T("tip.ignore", "Ajouter/retirer les fichiers sélectionnés dans .gitignore"))
-
+
; Commit
GadgetToolTip(#GdtFieldMessage,T("tip.message", "Message du commit"))
GadgetToolTip(#GdtBtnCommit, T("tip.commit", "Committer tous les fichiers cochés avec le message"))
-
+
; History
GadgetToolTip(#GdtListHistory, T("tip.history", "Historique des commits"))
GadgetToolTip(#GdtBtnRestoreCommit,T("tip.history.restore","Restaurer/checkout le commit sélectionné"))
-
+
; .gitignore
GadgetToolTip(#GdtTxtGitIgnore, T("tip.gitignore.edit","Éditeur du .gitignore"))
GadgetToolTip(#GdtBtnSaveGitIgnore,T("tip.gitignore.save","Sauvegarder le .gitignore"))
-
+
; Config
GadgetToolTip(#GdtFieldUserName, T("tip.cfg.username","Nom d’utilisateur Git (user.name)"))
GadgetToolTip(#GdtFieldUserEmail,T("tip.cfg.useremail","Email Git (user.email)"))
@@ -1882,47 +1890,47 @@ Procedure InitGadget()
Protected haveHistorySel.b = Bool(GetGadgetState(#GdtListHistory) >= 0)
Protected userName$ = Trim(GetGadgetText(#GdtFieldUserName))
Protected userEmail$ = Trim(GetGadgetText(#GdtFieldUserEmail))
-
+
; Mémoriser l’état init global
main\info\isInit = isInit
-
+
; ---- Zone Dépôt ----------------------------------------------------------
DisableGadget(#GdtBtnInit, Bool(Not (hasGit And repoDirOK And Not isInit)))
DisableGadget(#GdtBtnRefresh, Bool(Not (hasGit And repoDirOK)))
DisableGadget(#GgtFieldRepo, Bool(Not hasGit))
-
+
; ---- Remote / Branch -----------------------------------------------------
DisableGadget(#GdtFieldRemote, Bool(Not (hasGit And repoDirOK)))
DisableGadget(#GdtSlctBranch, Bool(Not (hasGit And isInit)))
DisableGadget(#GdtBtnNewBranch,Bool(Not (hasGit And isInit)))
-
+
; Règle demandée : Clone/Pull/Push uniquement si une remote est définie
DisableGadget(#GdtBtnClone, Bool(Not (hasGit And repoDirOK And hasRemote)))
DisableGadget(#GdtBtnPull, Bool(Not (hasGit And isInit And hasRemote)))
DisableGadget(#GdtBtnPush, Bool(Not (hasGit And isInit And hasRemote)))
-
+
; ---- Fichiers & actions locales -----------------------------------------
; Restaurer / Renommer / Supprimer / Ignorer : uniquement si des fichiers sont sélectionnés
DisableGadget(#GdtBtnRestore, Bool(selCount = 0))
DisableGadget(#GdtBtnRename, Bool(selCount = 0))
DisableGadget(#GdtBtnDelete, Bool(selCount = 0))
DisableGadget(#GdtBtnIgnore, Bool(selCount = 0))
-
+
; Commit : uniquement si des fichiers sont cochés
DisableGadget(#GdtBtnCommit, Bool(Not (hasGit And isInit And checkedCount > 0)))
-
+
; ---- Onglet History ------------------------------------------------------
DisableGadget(#GdtBtnRestoreCommit, Bool(Not (hasGit And isInit And haveHistorySel)))
-
+
; ---- .gitignore ----------------------------------------------------------
; On autorise la sauvegarde si le repo est initialisé (fichier créé si besoin)
DisableGadget(#GdtBtnSaveGitIgnore, Bool(Not (hasGit And isInit)))
-
+
; ---- Config --------------------------------------------------------------
; Le bouton "Enregistrer" actif si au moins un champ non vide
DisableGadget(#GdtBtnSaveCfg, Bool(userName$ = "" And userEmail$ = ""))
-
-
+
+
EndProcedure
Macro RightGadget(GDT)
@@ -2081,26 +2089,26 @@ Procedure OpenGUI()
; --- Fin des onglets ---
CloseGadgetList()
- ; ============================================================
-; Aide à droite du Panel (sans splitter)
-; ============================================================
-; On garde #PanelW / #PanelH tels quels
-
-Define helpGap = 10 ; espace entre panel et aide
-Define helpX = #InPad + #PanelW + helpGap ; à droite du panel
-Define helpY = #InPad
-Define helpW = WindowWidth(#WinMain)-GadgetWidth(#gdtPnl)- #InPad*4 ; reste de largeur jusqu'à la marge droite
-Define helpH = #PanelH ; même hauteur que le panel
-
-; (Optionnel) borne minimale si besoin
-If helpW < 100 : helpW = 100 : EndIf
-
-; Soit en direct :
-WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
-
-; — ou, si tu veux un cadre :
-; FrameGadget(#GdtFrmHelp, helpX, helpY, helpW, helpH, T("GdtFrmHelp","Aide"))
-; WebViewGadget(#GdtHelp, helpX + 10, helpY + 25, helpW - 20, helpH - 35)
+ ; ============================================================
+ ; Aide à droite du Panel (sans splitter)
+ ; ============================================================
+ ; On garde #PanelW / #PanelH tels quels
+
+ Define helpGap = 10 ; espace entre panel et aide
+ Define helpX = #InPad + #PanelW + helpGap ; à droite du panel
+ Define helpY = #InPad
+ Define helpW = WindowWidth(#WinMain)-GadgetWidth(#gdtPnl)- #InPad*4 ; reste de largeur jusqu'à la marge droite
+ Define helpH = #PanelH ; même hauteur que le panel
+
+ ; (Optionnel) borne minimale si besoin
+ If helpW < 100 : helpW = 100 : EndIf
+
+ ; Soit en direct :
+ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
+
+ ; — ou, si tu veux un cadre :
+ ; FrameGadget(#GdtFrmHelp, helpX, helpY, helpW, helpH, T("GdtFrmHelp","Aide"))
+ ; WebViewGadget(#GdtHelp, helpX + 10, helpY + 25, helpW - 20, helpH - 35)
SetGadgetText(#GgtFieldRepo,main\GitCall\workdir)
@@ -2108,13 +2116,13 @@ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
InitGadget()
_SetTooltips()
If FileSize(".git")=-2:main\info\isInit=#True:EndIf
- If main\info\isInit=#True
- GetRemoteUrl("origin")
- GetCommitHistory()
- EndIf
-
+ ;If main\info\isInit=#True
+ ; GetRemoteUrl("origin")
+ ; GetCommitHistory()
+ ;;EndIf
+
GetBranchesList()
-
+
; =================== EVENT LOOP / BOUCLE ÉVÉNEMENTS ===================
Quit=#False
Repeat
@@ -2124,7 +2132,8 @@ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
Quit=#True
Case #PB_Event_Gadget
Select EventGadget()
- Case #gdtPnl
+ Case #GdtPnl
+ Debug "Click>#gdtPnl"
If EventType()=#PB_EventType_Change
ReadGitIgnorefile()
Select GetGadgetState(#GdtPnl)
@@ -2134,17 +2143,22 @@ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
EndIf
Case #GdtBtnInit
+ Debug "Click>#GdtBtnInit"
DoInit()
CreateThread(@RefreshFileList(),0)
Case #GdtBtnRefresh
+ Debug "Click>#GdtBtnRefresh"
CreateThread(@RefreshFileList(),0)
Case #GgtFieldRepo
+
If EventType()=#PB_EventType_LostFocus
+ Debug "Click>#GgtFieldRepo"
main\GitCall\workdir=GetGadgetText(#GgtFieldRepo)
CreateThread(@RefreshFileList(),0)
EndIf
Case #GdtBtnBrowseRepo
+ Debug "Click>#GdtBtnBrowseRepo"
Protected path.s=PathRequester("Select Folder",main\GitCall\workdir,WindowID(#WinMain))
If path<>"" And FileSize(path)=-2
main\GitCall\workdir=path
@@ -2158,15 +2172,21 @@ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
; EndIf
Case #GdtBtnClone
- DoClone()
+ Debug "Click>#GdtBtnClone"
+ DoClone()
Case #GdtBtnPush
+ Debug "Click>#GdtBtnPush"
DoPush()
Case #GdtBtnPull
+ Debug "Click>#GdtBtnPull"
DoPull()
Case #GdtListStatus
+ Debug "Click>#GdtListStatus"
Case #GdtBtnIgnore
+ Debug "Click>#GdtBtnIgnore"
ToggleGitIgnoreForSelection()
Case #GdtBtnSaveGitIgnore
+ Debug "Click>#GdtBtnSaveGitIgnore"
Protected hf.i=CreateFile(#PB_Any,".gitignore")
If hf
WriteString(hf,GetGadgetText(#GdtTxtGitIgnore))
@@ -2174,18 +2194,24 @@ WebViewGadget(#GdtHelp, helpX, helpY, helpW, helpH)
EndIf
Case #GdtBtnCommit
+ Debug "Click>#GdtBtnCommit"
DoCommit()
Case #GdtFieldRemote
+ Debug "Click>#GdtFieldRemote"
Case #GdtListHistory
+ Debug "Click>#GdtListHistory"
If EventType() = #PB_EventType_Change
ShowSelectedCommitInfo()
EndIf
Case #GdtSlctBranch
+ Debug "Click>#GdtSlctBranch"
Case #GdtSlctScope
+ Debug "Click>#GdtSlctScope"
GetGitIdentity()
Case #GdtBtnSaveCfg
+ Debug "Click>#GdtBtnSaveCfg"
SetGitIdentity()
@@ -2202,8 +2228,8 @@ OpenGUI()
; IDE Options = PureBasic 6.21 (Windows - x64)
-; CursorPosition = 541
-; FirstLine = 509
+; CursorPosition = 2191
+; FirstLine = 2180
; Folding = ----------
; Optimizer
; EnableThread