Version control: Add a rotating spinner while the git log history is loading.

[DEVELOPMENT ENVIRONMENT]
* NEW: Version control: Add a rotating spinner while the git log history is loading.
This commit is contained in:
gambas 2022-04-04 18:31:54 +02:00
parent 203a1789c7
commit d69837264b
5 changed files with 49 additions and 21 deletions

View file

@ -21,7 +21,9 @@ Private $aFind As Integer[]
Private $iLastLine As Integer
Private $iLastLineOffset As Integer
Private $hTask As CVersionControlHistoryTask
Private $hSpinner As Spinner
Public Sub _new()
@ -497,12 +499,15 @@ Public Sub StopFillWithHistory()
End
Public Sub FillWithHistory(sPath As String, Optional sPath2 As String, Optional bFull As Boolean)
Public Sub FillWithHistory(sPath As String, hSpinner As Spinner, Optional sPath2 As String, Optional bFull As Boolean)
StopFillWithHistory
Me.Clear
$hSpinner = hSpinner
hSpinner.Show
hSpinner.Start
$hTask = New CVersionControlHistoryTask(sPath, sPath2, bFull) As "TaskVCHistory"
'Me.Text = VersionControl.History(sPath, sPath2, bFull)
@ -528,6 +533,12 @@ End
Public Sub TaskVCHistory_Kill()
If $hSpinner Then
$hSpinner.Stop
$hSpinner.Hide
$hSpinner = Null
Endif
If $hTask Then
Me.SetFocus
Me.Reset

View file

@ -139,16 +139,16 @@ Public Sub tabInfo_Click()
Case 0
btnRevert.Show
chkShowHistoryChanges.Hide
panChange.Hide
btnLocateChange.Show
LoadVersionControlInfo
Case 1
btnRevert.Hide
chkShowHistoryChanges.Show
panChange.Show
btnLocateChange.Hide
If edtHistory.IsVoid() Then edtHistory.FillWithHistory($sPath, $sPath2)
If edtHistory.IsVoid() Then edtHistory.FillWithHistory($sPath, spnChange, $sPath2)
End Select
@ -174,7 +174,7 @@ End
Public Sub chkShowHistoryChanges_Click()
edtHistory.FillWithHistory($sPath, $sPath2, chkShowHistoryChanges.Value)
edtHistory.FillWithHistory($sPath, spnChange, $sPath2, chkShowHistoryChanges.Value)
End

View file

@ -39,7 +39,7 @@
Index = 0
}
{ HBox1 HBox
MoveScaled(4,54,96,4)
MoveScaled(4,54,108,4)
Spacing = True
{ btnRevert Button
MoveScaled(0,0,18,4)
@ -54,17 +54,26 @@
Text = ("Locate change")
Picture = Picture["icon:/small/find"]
}
{ chkShowHistoryChanges CheckBox
MoveScaled(46,1,29,3)
AutoResize = True
Text = ("Display changes in history")
{ panChange HBox
MoveScaled(44,0,37,4)
Expand = True
Spacing = True
{ chkShowHistoryChanges CheckBox
MoveScaled(0,0,29,3)
AutoResize = True
Text = ("Display changes in history")
}
{ spnChange Spinner
MoveScaled(32,0,4,4)
Type = Spinner.Circle
}
}
{ Panel3 Panel
MoveScaled(76,0,1,4)
MoveScaled(86,0,1,4)
Expand = True
}
{ btnClose Button
MoveScaled(79,0,16,4)
MoveScaled(89,0,16,4)
Text = ("Close")
Picture = Picture["icon:/small/close"]
Default = True

View file

@ -174,7 +174,7 @@ Public Sub tabVersionControl_Click()
Try edtDiff.SetFocus
Case 2
If edtHistory.IsVoid() Then edtHistory.FillWithHistory(Project.Dir)
If edtHistory.IsVoid() Then edtHistory.FillWithHistory(Project.Dir, spnChange)
Case 3
Try trmShell.Exec(["bash"], ["PWD=" & Project.Dir])
@ -183,7 +183,7 @@ Public Sub tabVersionControl_Click()
End Select
chkHideTrans.Visible = tabVersionControl.Index = 1 And edtDiff.Visible
chkShowHistoryChanges.Visible = tabVersionControl.Index = 2
panChange.Visible = tabVersionControl.Index = 2
End
@ -215,6 +215,6 @@ End
Public Sub chkShowHistoryChanges_Click()
edtHistory.FillWithHistory(Project.Dir,, chkShowHistoryChanges.Value)
edtHistory.FillWithHistory(Project.Dir, spnChange,, chkShowHistoryChanges.Value)
End

View file

@ -57,11 +57,19 @@
AutoResize = True
Text = ("Hide translation changes")
}
{ chkShowHistoryChanges CheckBox
MoveScaled(0,0,29,3)
Visible = False
AutoResize = True
Text = ("Display changes in history")
{ panChange HBox
MoveScaled(0,0,36,4)
Expand = True
{ chkShowHistoryChanges CheckBox
MoveScaled(0,0,29,3)
Visible = False
AutoResize = True
Text = ("Display changes in history")
}
{ spnChange Spinner
MoveScaled(29,0,4,4)
Type = Spinner.Circle
}
}
{ panNothing Panel
MoveScaled(9,0,31,4)