Skip to content

Commit

Permalink
Git integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tvannini committed Sep 19, 2023
1 parent 5df2e90 commit ee3cea4
Show file tree
Hide file tree
Showing 7 changed files with 237 additions and 74 deletions.
64 changes: 44 additions & 20 deletions cvsinfo.pas
Expand Up @@ -44,39 +44,63 @@ procedure Tf_CVSInfo.BtnOKClick(Sender: TObject);
i, words: integer;
s: string;
begin
// ________________________________________________ Count words in message ___
s := Trim(cvs_comment.Text);
words := 0;
for i := 1 to Length(s) do
// _______________________________________________________ Git integration ___
if f_work.gitIntegrated then
begin
if s[i] = ' ' then
if Trim(cvs_comment.Text) = '' then
begin
Inc(words);
ShowMessage('Please provide a commit message!');
Exit;
end
else
begin
// _____________________________________________________ Compose result ___
f_work.CVSCheckInData := Trim(cvs_comment.Text);
end;
end;
Inc(words);
// ______________________________________________ Check minimal conditions ___
if (words < 3) and (Length(s) < 20) then
begin
ShowMessage('Comment is too short.' + #13 + #10 +
'Please write something more..!');
Exit;
end
else if Trim(cvs_worksheet.Text) = '' then
else
// _______________________________________________ Generic CVS integration ___
begin
ShowMessage('Please provide a worksheet code!');
Exit;
// ______________________________________________ Count words in message ___
s := Trim(cvs_comment.Text);
words := 0;
for i := 1 to Length(s) do
begin
if s[i] = ' ' then
begin
Inc(words);
end;
end;
Inc(words);
// ____________________________________________ Check minimal conditions ___
if (words < 3) and (Length(s) < 20) then
begin
ShowMessage('Comment is too short.' + #13 + #10 +
'Please write something more..!');
Exit;
end
else if Trim(cvs_worksheet.Text) = '' then
begin
ShowMessage('Please provide a worksheet code!');
Exit;
end;
// ______________________________________________________ Compose result ___
f_work.CVSCheckInData := Trim(cvs_worksheet.Text) + ' - ' +
Trim(cvs_comment.Text);
end;
// ________________________________________________________ Compose result ___
f_work.CVSCheckInData := Trim(cvs_worksheet.Text) + ' - ' +
Trim(cvs_comment.Text);
ModalResult := mrOk;
end;

procedure Tf_CVSInfo.FormShow(Sender: TObject);
begin
cvs_comment.Text := '';
cvs_worksheet.Text := '';
if f_work.gitIntegrated then
begin
Label2.Visible := False;
cvs_worksheet.Visible := False;
cvs_comment.Height := 180;
end;
cvs_comment.SetFocus;
end;

Expand Down
5 changes: 3 additions & 2 deletions jxob.ini
Expand Up @@ -25,10 +25,11 @@ temp_dir=
design_report=
cvs_versioning=0
layer=0
git=1
[Recent]
app1=C:\Devel\projects\dev\htdocs\dev.php
app3=C:\Devel\projects\evision_saas\htdocs\evision_saas.php
app4=C:\Devel\projects\ekovision\htdocs\ekovision.php
app3=C:\Devel\projects\ekovision\htdocs\ekovision.php
app4=C:\Devel\projects\evision_saas\htdocs\evision_saas.php
; --- Recently opened projects
; This is a list of proposed projects, in the form
; app<x>=<app_main_file>, where <x> is a progressive number and
Expand Down
3 changes: 2 additions & 1 deletion login.pas
Expand Up @@ -96,7 +96,8 @@ procedure Tf_login.FormShow(Sender: TObject);
f_work.e_res_y.Text := f_work.settings.ReadString('Forms',
'Resolution_y',
'768');
loginOK := False;
loginOK := False;

end;


Expand Down
76 changes: 61 additions & 15 deletions preferences.dfm
@@ -1,7 +1,7 @@
object f_config: Tf_config
Left = 432
Top = 176
Width = 405
Width = 440
Height = 620
Caption = 'Settings'
Color = clBtnFace
Expand All @@ -23,12 +23,12 @@ object f_config: Tf_config
Caption = 'Call Program'
end
object PageControl1: TPageControl
Left = 0
Left = 20
Top = 73
Width = 397
Width = 400
Height = 469
ActivePage = ts_generale
Align = alClient
Align = alCustom
TabOrder = 0
object ts_generale: TTabSheet
Caption = 'General'
Expand Down Expand Up @@ -68,6 +68,42 @@ object f_config: Tf_config
Caption = 'Development layer:'
Visible = False
end
object Label23: TLabel
Left = 24
Top = 280
Width = 156
Height = 13
Caption = 'Integrate local versioning system:'
end
object Label24: TLabel
Left = 55
Top = 324
Width = 314
Height = 29
AutoSize = False
Caption =
'If ".git" folder is found in application root, then Git will be ' +
'used to COMMIT each CHECK-IN.'
WordWrap = True
end
object Label25: TLabel
Left = 55
Top = 400
Width = 314
Height = 30
AutoSize = False
Caption =
'"check-in.bat" and "check-out.bat" scripts must be provided in B' +
'uilder folder.'
WordWrap = True
end
object Label26: TLabel
Left = 55
Top = 355
Width = 232
Height = 13
Caption = 'NOTE: "git" command must be provided to CMD.'
end
object e_def_user: TEdit
Left = 170
Top = 20
Expand Down Expand Up @@ -135,14 +171,14 @@ object f_config: Tf_config
OnClick = PathButton3Click
end
object e_cvs: TCheckBox
Left = 20
Top = 280
Width = 337
Left = 36
Top = 380
Width = 245
Height = 21
Caption = 'Integrate external CVS'
Caption = 'Other CVS'
Ctl3D = False
ParentCtl3D = False
TabOrder = 8
TabOrder = 9
end
object e_layer: TComboBox
Left = 170
Expand All @@ -157,6 +193,16 @@ object f_config: Tf_config
'Application core'
'Overriding layer')
end
object e_git: TCheckBox
Left = 36
Top = 304
Width = 245
Height = 21
Caption = 'Git'
Ctl3D = False
ParentCtl3D = False
TabOrder = 8
end
end
object ts_actions: TTabSheet
Caption = 'Actions'
Expand Down Expand Up @@ -1232,13 +1278,13 @@ object f_config: Tf_config
object Panel1: TPanel
Left = 0
Top = 542
Width = 397
Width = 432
Height = 51
Align = alBottom
BevelOuter = bvNone
TabOrder = 1
object Button1: TButton
Left = 166
Left = 182
Top = 16
Width = 75
Height = 25
Expand All @@ -1250,7 +1296,7 @@ object f_config: Tf_config
object Panel2: TPanel
Left = 0
Top = 0
Width = 397
Width = 432
Height = 73
Align = alTop
BevelOuter = bvNone
Expand All @@ -1267,7 +1313,7 @@ object f_config: Tf_config
object e_iniFile: TEdit
Left = 20
Top = 38
Width = 355
Width = 400
Height = 19
Ctl3D = False
ParentCtl3D = False
Expand All @@ -1276,8 +1322,8 @@ object f_config: Tf_config
end
end
object ActionList1: TActionList
Left = 460
Top = 192
Left = 348
Top = 144
object carica_ini: TAction
Caption = 'carica_ini'
OnExecute = carica_iniExecute
Expand Down
16 changes: 16 additions & 0 deletions preferences.pas
Expand Up @@ -70,6 +70,11 @@ Tf_config = class(TForm)
e_brackets: TComboBox;
e_layer: TComboBox;
Label22: TLabel;
Label23: TLabel;
e_git: TCheckBox;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
Expand Down Expand Up @@ -112,6 +117,16 @@ procedure Tf_config.Button1Click(Sender: TObject);
f_work.settings.WriteInteger('O2_ENV', 'layer', e_layer.ItemIndex);
f_work.settings.WriteString('O2_ENV', 'design_report', e_reppath.Text);
f_work.settings.WriteBool('O2_ENV', 'cvs_versioning', e_cvs.Checked);
// ________________________________________________ Manage Git integration ___
f_work.settings.WriteBool('O2_ENV', 'git', e_git.Checked);
if (e_cvs.Checked and DirectoryExists(f_work.workdir + 'git')) then
begin
f_work.gitIntegrated := true;
end
else
begin
f_work.gitIntegrated := false;
end;
// __________________________________________ Save brackets mode in editor ___
if e_brackets.ItemIndex = 1 then
begin
Expand Down Expand Up @@ -191,6 +206,7 @@ procedure Tf_config.carica_iniExecute(Sender: TObject);
e_cvs.Checked := f_work.settings.ReadBool('O2_ENV',
'cvs_versioning',
false);
e_git.Checked := f_work.settings.ReadBool('O2_ENV', 'git', false);
brackets := f_work.settings.ReadString('Editor', 'brackets', 'N');
// _____________________________________________________ Only open bracket ___
if brackets = 'O' then
Expand Down
6 changes: 3 additions & 3 deletions work.dfm
Expand Up @@ -84,7 +84,7 @@ object f_work: Tf_work
Top = 32
Width = 870
Height = 602
ActivePage = ts_programmi
ActivePage = ts_openapp
Align = alClient
MultiLine = True
PopupMenu = pop_pagecontrol1
Expand Down Expand Up @@ -837,7 +837,7 @@ object f_work: Tf_work
Top = 0
Width = 862
Height = 547
ActivePage = ts_form
ActivePage = ts_prg_prop
Align = alClient
Style = tsButtons
TabOrder = 1
Expand Down Expand Up @@ -2568,7 +2568,7 @@ object f_work: Tf_work
OnDblClick = Zoom11Click
end
object BitBtn5: TBitBtn
Left = 748
Left = 668
Top = 40
Width = 90
Height = 25
Expand Down

0 comments on commit ee3cea4

Please sign in to comment.