From 580adc9ccff564ae3c03907c31996b485057a630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 19 Sep 2023 19:18:52 +0200 Subject: [PATCH] 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. --- .../.src/VersionControl/FVersionControl.class | 21 +++++++- .../.src/VersionControl/FVersionControl.form | 52 ++++++++++++------- 2 files changed, 52 insertions(+), 21 deletions(-) diff --git a/app/src/gambas3/.src/VersionControl/FVersionControl.class b/app/src/gambas3/.src/VersionControl/FVersionControl.class index 98e13ee4e..cd5fd22a2 100644 --- a/app/src/gambas3/.src/VersionControl/FVersionControl.class +++ b/app/src/gambas3/.src/VersionControl/FVersionControl.class @@ -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 + diff --git a/app/src/gambas3/.src/VersionControl/FVersionControl.form b/app/src/gambas3/.src/VersionControl/FVersionControl.form index 648af357a..73ef042d7 100644 --- a/app/src/gambas3/.src/VersionControl/FVersionControl.form +++ b/app/src/gambas3/.src/VersionControl/FVersionControl.form @@ -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 }