Version control: Add the 'Locate change' button to the global version control dialog.

[DEVELOPMENT ENVIRONMENT]
* NEW: Version control: Add the 'Locate change' button to the global version control dialog.
This commit is contained in:
Benoît Minisini 2023-09-19 19:18:52 +02:00
parent 5508e90eff
commit 580adc9ccf
2 changed files with 52 additions and 21 deletions

View File

@ -1,9 +1,17 @@
' Gambas class file
Static Private $sPath As String
Static Private $bLocateChange As Boolean
Static Private $iLine As Integer
Public Sub Run()
$bLocateChange = False
Me.ShowModal()
If $bLocateChange Then Project.OpenFile($sPath, $iLine)
End
Private Sub GetChanges() As String
@ -177,8 +185,8 @@ Public Sub tabVersionControl_Click()
End Select
chkHideTrans.Visible = tabVersionControl.Index = 1 And edtDiff.Visible
panChange.Visible = tabVersionControl.Index = 2
panChanges.Visible = tabVersionControl.Index = 1 And edtDiff.Visible
panHistory.Visible = tabVersionControl.Index = 2
End
@ -214,3 +222,12 @@ Public Sub chkShowHistoryChanges_Click()
End
Public Sub btnLocateChange_Click()
If edtDiff.LocateChange(ByRef $sPath, ByRef $iLine) Then Return
$bLocateChange = True
Me.Close
End

View File

@ -1,7 +1,7 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,122,66)
MoveScaled(0,0,162,66)
Icon = Picture["icon:/small/save"]
Arrangement = Arrange.Vertical
Spacing = True
@ -41,31 +41,43 @@
Index = 0
}
{ HBox1 HBox
MoveScaled(1,59,120,4)
MoveScaled(1,59,158,4)
Spacing = True
{ chkHideTrans CheckBox
MoveScaled(0,0,24,4)
Visible = False
AutoResize = True
Text = ("Hide translation changes")
}
{ panChange HBox
MoveScaled(0,0,36,4)
{ panChanges HBox
MoveScaled(0,0,42,4)
Visible = False
Expand = True
Spacing = True
{ btnLocateChange Button
MoveScaled(0,0,17,4)
AutoResize = True
Text = ("Locate change")
Picture = Picture["icon:/small/find"]
}
{ chkHideTrans CheckBox
MoveScaled(17,0,24,4)
AutoResize = True
Text = ("Hide translation changes")
}
}
{ panHistory HBox
MoveScaled(44,0,30,4)
Visible = False
Expand = True
Spacing = True
{ chkShowHistoryChanges CheckBox
MoveScaled(0,0,29,3)
MoveScaled(1,0,25,4)
AutoResize = True
Text = ("Display changes in history")
}
{ spnChange Spinner
MoveScaled(29,0,4,4)
MoveScaled(25,0,4,4)
Margin = True
Type = Spinner.Circle
}
}
{ panNothing Panel
MoveScaled(9,0,31,4)
MoveScaled(75,0,13,4)
Visible = False
Arrangement = Arrange.Horizontal
AutoResize = True
@ -76,34 +88,36 @@
Alignment = Align.Center
}
{ lblNothingToCommit Label
MoveScaled(4,0,25,4)
MoveScaled(4,0,7,4)
Font = Font["Italic"]
Text = ("There is nothing to commit.")
}
}
{ Panel1 Panel
MoveScaled(41,0,2,4)
MoveScaled(92,0,2,4)
Expand = True
}
{ btnCommit Button
MoveScaled(44,0,16,4)
MoveScaled(95,0,13,4)
AutoResize = True
Text = ("Commit") & "..."
Picture = Picture["icon:/small/apply"]
}
{ btnCommitPush Button
MoveScaled(61,0,24,4)
MoveScaled(109,0,19,4)
AutoResize = True
Text = ("Commit and push") & "..."
Picture = Picture["icon:/small/upload"]
Default = True
}
{ btnPush Button
MoveScaled(86,0,16,4)
MoveScaled(129,0,11,4)
AutoResize = True
Text = ("Push") & "..."
Picture = Picture["icon:/small/upload"]
}
{ btnCancel Button
MoveScaled(103,0,16,4)
MoveScaled(141,0,16,4)
Text = ("Cancel")
Cancel = True
}