Opkman: Begin implementing support for private repositories.

git-svn-id: trunk@55794 -
This commit is contained in:
balazs 2017-09-07 12:34:56 +00:00
parent c1c81c4d63
commit 60ec73e66a
10 changed files with 334 additions and 69 deletions

2
.gitattributes vendored
View File

@ -3457,6 +3457,8 @@ components/onlinepackagemanager/opkman_const.pas svneol=native#text/pascal
components/onlinepackagemanager/opkman_contributors.txt svneol=native#text/plain
components/onlinepackagemanager/opkman_createjsonforupdatesfrm.lfm svneol=native#text/plain
components/onlinepackagemanager/opkman_createjsonforupdatesfrm.pas svneol=native#text/pascal
components/onlinepackagemanager/opkman_createrepositoryfrm.lfm -text svneol=native#plain/text
components/onlinepackagemanager/opkman_createrepositoryfrm.pas svneol=native#text/pascal
components/onlinepackagemanager/opkman_createrepositorypackagefrm.lfm svneol=native#text/plain
components/onlinepackagemanager/opkman_createrepositorypackagefrm.pas svneol=native#text/pascal
components/onlinepackagemanager/opkman_downloader.pas svneol=native#text/pascal

View File

@ -20,7 +20,7 @@
<Description Value="Online package manger"/>
<License Value="GPL"/>
<Version Major="1"/>
<Files Count="21">
<Files Count="22">
<Item1>
<Filename Value="onlinepackagemanagerintf.pas"/>
<HasRegisterProc Value="True"/>
@ -111,6 +111,10 @@
<Filename Value="opkman_repositories.pas"/>
<UnitName Value="opkman_repositories"/>
</Item21>
<Item22>
<Filename Value="opkman_createrepositoryfrm.pas"/>
<UnitName Value="opkman_createrepositoryfrm"/>
</Item22>
</Files>
<i18n>
<EnableI18N Value="True"/>

View File

@ -14,7 +14,8 @@ uses
opkman_installer, opkman_packagelistfrm, opkman_options,
opkman_createrepositorypackagefrm, opkman_categoriesfrm,
opkman_packagedetailsfrm, opkman_updates, opkman_createjsonforupdatesfrm,
opkman_uploader, opkman_repositories, LazarusPackageIntf;
opkman_uploader, opkman_repositories, opkman_createrepositoryfrm,
LazarusPackageIntf;
implementation

View File

@ -164,6 +164,7 @@ resourcestring
rsMainFrm_TBHelp_Hint = 'Help (' + cHelpPage + ')';
rsMainFrm_miCreateRepositoryPackage = 'Create repository package';
rsMainFrm_miCreateJSONForUpdates = 'Create JSON for updates';
rsMainFrm_miCreateRepository = 'Create private repository';
rsMainFrm_miJSONShow = 'Show JSON';
rsMainFrm_miJSONHide = 'Hide JSON';
rsMainFrm_miJSONSort = 'Sort';
@ -393,6 +394,20 @@ resourcestring
rsRepositories_InputBox_Caption1 = 'Edit repository';
rsRepositories_InputBox_Text = 'Type the repository address:';
//create private repository
rsCreateRepositoryFrm_Caption = 'Create private repository';
rsCreateRepositoryFrm_bOpen_Caption = 'Open';
rsCreateRepositoryFrm_bOpen_Hint = 'Open private respository';
rsCreateRepositoryFrm_bCreate_Caption = 'Create';
rsCreateRepositoryFrm_bCreate_Hint = 'Create private repository';
rsCreateRepositoryFrm_bAdd_Caption = 'Add';
rsCreateRepositoryFrm_bAdd_Hint = 'Add package to the current repository';
rsCreateRepositoryFrm_bDelete_Caption = 'Delete';
rsCreateRepositoryFrm_bDelete_Hint = 'Delete package from the current repository';
rsCreateRepositoryFrm_bCancel_Caption = 'Cancel';
rsCreateRepositoryFrm_bCancel_Hint = 'Close this dialog';
implementation
end.

View File

@ -0,0 +1,87 @@
object CreateRepositoryFrm: TCreateRepositoryFrm
Left = 350
Height = 600
Top = 250
Width = 800
BorderIcons = [biSystemMenu]
Caption = 'CreateRepositoryFrm'
ClientHeight = 600
ClientWidth = 800
Constraints.MinHeight = 450
Constraints.MinWidth = 650
OnCreate = FormCreate
OnDestroy = FormDestroy
PopupMode = pmExplicit
Position = poOwnerFormCenter
object pnButtons: TPanel
Left = 0
Height = 41
Top = 559
Width = 800
Align = alBottom
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 37
ClientWidth = 796
TabOrder = 0
OnResize = pnButtonsResize
object bOpen: TButton
Left = 6
Height = 27
Top = 4
Width = 80
Caption = 'Open'
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object bCreate: TButton
Left = 87
Height = 27
Top = 4
Width = 80
Caption = 'Create'
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object bAdd: TButton
Left = 368
Height = 27
Top = 4
Width = 80
BorderSpacing.Around = 1
Caption = 'Add'
Constraints.MinWidth = 80
ParentShowHint = False
ShowHint = True
TabOrder = 2
end
object bDelete: TButton
Left = 449
Height = 27
Top = 4
Width = 80
BorderSpacing.Around = 1
Caption = 'Delete'
Constraints.MinWidth = 80
ParentShowHint = False
ShowHint = True
TabOrder = 3
end
object bCancel: TButton
Left = 705
Height = 27
Top = 4
Width = 80
Anchors = [akTop, akRight]
BorderSpacing.Around = 1
Caption = 'Cancel'
Constraints.MinWidth = 80
ModalResult = 2
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
end
end

View File

@ -0,0 +1,108 @@
{
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. *
* *
***************************************************************************
Author: Balázs Székely
}
unit opkman_createrepositoryfrm;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil,
// LCL
Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls,
// OpkMan
opkman_VirtualTrees;
type
{ TCreateRepositoryFrm }
TCreateRepositoryFrm = class(TForm)
bAdd: TButton;
bCancel: TButton;
bDelete: TButton;
bOpen: TButton;
bCreate: TButton;
pnButtons: TPanel;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure pnButtonsResize(Sender: TObject);
private
FVST: TVirtualStringTree;
FRepository: String;
procedure EnableDisableButtons(const AEnable: Boolean);
public
end;
var
CreateRepositoryFrm: TCreateRepositoryFrm;
implementation
uses opkman_const;
{$R *.lfm}
{ TCreateRepositoryFrm }
procedure TCreateRepositoryFrm.FormCreate(Sender: TObject);
begin
Caption := rsCreateRepositoryFrm_Caption;
bCreate.Caption := rsCreateRepositoryFrm_bCreate_Caption;
bCreate.Hint := rsCreateRepositoryFrm_bCreate_Hint;
bOpen.Caption := rsCreateRepositoryFrm_bOpen_Caption;
bOpen.Hint := rsCreateRepositoryFrm_bOpen_Hint;
bAdd.Caption := rsCreateRepositoryFrm_bAdd_Caption;
bAdd.Hint := rsCreateRepositoryFrm_bAdd_Hint;
bDelete.Caption := rsCreateRepositoryFrm_bDelete_Caption;
bDelete.Hint := rsCreateRepositoryFrm_bDelete_Hint;
bCancel.Caption := rsCreateRepositoryFrm_bCancel_Caption;
bCancel.Hint := rsCreateRepositoryFrm_bCancel_Hint;
EnableDisableButtons(True);
FVST := TVirtualStringTree.Create(nil);
end;
procedure TCreateRepositoryFrm.FormDestroy(Sender: TObject);
begin
FVST.Free;
end;
procedure TCreateRepositoryFrm.pnButtonsResize(Sender: TObject);
begin
bAdd.Left := (pnButtons.Width - (bAdd.Width + bDelete.Width)) div 2;
bDelete.Left := bAdd.Left + bAdd.Width + 3;
end;
procedure TCreateRepositoryFrm.EnableDisableButtons(const AEnable: Boolean);
begin
bOpen.Enabled := AEnable;
bCreate.Enabled := AEnable;
bAdd.Enabled := AEnable and FileExists(Trim(FRepository));
bDelete.Enabled := AEnable and FileExists(Trim(FRepository)) and (FVST.RootNodeCount > 0);
bCancel.Enabled := AEnable;
end;
end.

View File

@ -1,23 +1,25 @@
object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 550
Height = 500
Height = 600
Top = 254
Width = 750
Width = 800
BorderIcons = [biSystemMenu]
Caption = 'CreateRepositoryPackagesFrm'
ClientHeight = 500
ClientWidth = 750
ClientHeight = 600
ClientWidth = 800
Constraints.MinHeight = 450
Constraints.MinWidth = 650
OnCreate = FormCreate
OnDestroy = FormDestroy
PopupMode = pmExplicit
PopupParent = MainFrm.Owner
Position = poOwnerFormCenter
LCLVersion = '1.9.0.0'
object pnMessage: TPanel
Left = 247
Height = 402
Height = 502
Top = 57
Width = 503
Width = 553
Align = alClient
BevelOuter = bvNone
Caption = 'No items to show'
@ -34,7 +36,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object pnPackages: TPanel
Left = 0
Height = 402
Height = 502
Top = 57
Width = 245
Align = alLeft
@ -45,11 +47,11 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 57
Top = 0
Width = 750
Width = 800
Align = alTop
BevelOuter = bvNone
ClientHeight = 57
ClientWidth = 750
ClientWidth = 800
TabOrder = 2
object lbPackagedir: TLabel
AnchorSideLeft.Control = pnBrowse
@ -68,7 +70,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 2
Top = 55
Width = 750
Width = 800
Align = alBottom
end
object edPackageDir: TDirectoryEdit
@ -81,7 +83,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 80
Height = 23
Top = 17
Width = 664
Width = 714
OnAcceptDirectory = edPackageDirAcceptDirectory
ShowHidden = False
ButtonWidth = 50
@ -95,31 +97,31 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object pnData: TPanel
Left = 247
Height = 402
Height = 502
Top = 57
Width = 503
Width = 553
Align = alClient
BevelOuter = bvNone
ClientHeight = 402
ClientWidth = 503
ClientHeight = 502
ClientWidth = 553
TabOrder = 3
object pnPackageData: TPanel
Left = 0
Height = 213
Height = 313
Top = 189
Width = 503
Width = 553
Align = alClient
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 209
ClientWidth = 499
ClientHeight = 309
ClientWidth = 549
TabOrder = 1
Visible = False
object edSupportedWidgetset: TEdit
Left = 170
Height = 23
Top = 80
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 2
end
@ -143,7 +145,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 8
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end
@ -151,7 +153,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 45
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 1
end
@ -164,7 +166,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentColor = False
end
object lbOF1: TLabel
Left = 474
Left = 524
Height = 15
Top = 14
Width = 5
@ -176,7 +178,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentFont = False
end
object lbOF3: TLabel
Left = 474
Left = 524
Height = 15
Top = 50
Width = 5
@ -188,7 +190,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentFont = False
end
object lbOF4: TLabel
Left = 474
Left = 524
Height = 15
Top = 85
Width = 5
@ -204,12 +206,12 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 189
Top = 0
Width = 503
Width = 553
Align = alTop
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 185
ClientWidth = 499
ClientWidth = 549
TabOrder = 0
Visible = False
object lbCategory: TLabel
@ -221,7 +223,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
ParentColor = False
end
object lbOF2: TLabel
Left = 474
Left = 524
Height = 15
Top = 14
Width = 5
@ -252,7 +254,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 83
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 2
end
@ -260,7 +262,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 118
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 3
end
@ -277,7 +279,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 152
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 4
Visible = False
@ -294,7 +296,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 48
Width = 300
Width = 350
Anchors = [akTop, akLeft, akRight]
TabOrder = 1
end
@ -302,16 +304,16 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 170
Height = 23
Top = 9
Width = 301
Width = 351
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 301
ClientWidth = 351
ParentColor = False
TabOrder = 0
object spCategories: TSpeedButton
Left = 251
Left = 301
Height = 23
Top = 0
Width = 50
@ -325,7 +327,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
Left = 0
Height = 23
Top = 0
Width = 251
Width = 301
Align = alClient
AutoSize = False
ParentShowHint = False
@ -338,7 +340,7 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
end
object spMain: TSplitter
Left = 245
Height = 402
Height = 502
Top = 57
Width = 2
AutoSnap = False
@ -349,13 +351,13 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
object pnButtons: TPanel
Left = 0
Height = 41
Top = 459
Width = 750
Top = 559
Width = 800
Align = alBottom
BevelOuter = bvNone
BorderStyle = bsSingle
ClientHeight = 37
ClientWidth = 746
ClientWidth = 796
TabOrder = 5
object cbJSONForUpdates: TCheckBox
AnchorSideLeft.Control = pnButtons
@ -374,16 +376,16 @@ object CreateRepositoryPackagesFrm: TCreateRepositoryPackagesFrm
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = pnButtons
AnchorSideRight.Side = asrBottom
Left = 312
Left = 375
Height = 29
Top = 4
Width = 428
Width = 415
Anchors = [akTop, akRight]
BorderSpacing.Around = 6
BorderSpacing.InnerBorder = 1
BevelOuter = bvNone
ClientHeight = 29
ClientWidth = 428
ClientWidth = 415
TabOrder = 1
object bCancel: TButton
Left = 325

View File

@ -1,3 +1,26 @@
{
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. *
* *
***************************************************************************
Author: Balázs Székely
}
unit opkman_createrepositorypackagefrm;
{$mode objfpc}{$H+}
@ -449,7 +472,7 @@ begin
Data^.FPackageRelativePath := TPackageData(PackageList.Objects[I]).FPackageRelativePath;
Data^.FFullPath := TPackageData(PackageList.Objects[I]).FFullPath;
if not LoadPackageData(Data^.FFullPath, Data) then
MessageDlgEx(rsCreateRepositoryPackageFrm_Error0, mtError, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_Error0, mtError, [mbOk], Self);
Data^.FLazCompatibility := '1.6, 1.8, Trunk';
Data^.FFPCCompatibility := '2.6.4, 3.0.0, 3.0.2, 3.0.4';
Data^.FSupportedWidgetSet := 'win32/64, gtk2, carbon';
@ -466,7 +489,7 @@ begin
FVSTPackages.SortTree(0, opkman_VirtualTrees.sdAscending);
end
else
MessageDlgEx(rsCreateRepositoryPackageFrm_NoPackage, mtInformation, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_NoPackage, mtInformation, [mbOk], Self);
finally
for I := PackageList.Count - 1 downto 0 do
PackageList.Objects[I].Free;
@ -488,7 +511,7 @@ end;
procedure TCreateRepositoryPackagesFrm.spCategoriesClick(Sender: TObject);
begin
CategoriesFrm := TCategoriesFrm.Create(Self.Parent);
CategoriesFrm := TCategoriesFrm.Create(Self);
try
CategoriesFrm.SetupControls;
CategoriesFrm.CategoriesCSV := edCategories.Text;
@ -525,7 +548,7 @@ begin
if Data^.FCategory = '' then
begin
SelectAndFocusNode(Node);
MessageDlgEx(rsCreateRepositoryPackageFrm_Message0 + ' "' + Data^.FName + '".', mtInformation, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_Message0 + ' "' + Data^.FName + '".', mtInformation, [mbOk], Self);
edCategories.SetFocus;
Exit;
end;
@ -536,21 +559,21 @@ begin
if Trim(Data^.FLazCompatibility) = '' then
begin
SelectAndFocusNode(Node);
MessageDlgEx(rsCreateRepositoryPackageFrm_Message1 + ' "' + Data^.FName + '".', mtInformation, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_Message1 + ' "' + Data^.FName + '".', mtInformation, [mbOk], Self);
edLazCompatibility.SetFocus;
Exit;
end;
if Trim(Data^.FFPCCompatibility) = '' then
begin
SelectAndFocusNode(Node);
MessageDlgEx(rsCreateRepositoryPackageFrm_Message2 + ' "' + Data^.FName + '".', mtInformation, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_Message2 + ' "' + Data^.FName + '".', mtInformation, [mbOk], Self);
edFPCCompatibility.SetFocus;
Exit;
end;
if Trim(Data^.FSupportedWidgetSet) = '' then
begin
SelectAndFocusNode(Node);
MessageDlgEx(rsCreateRepositoryPackageFrm_Message3 + ' "' + Data^.FName + '".', mtInformation, [mbOk], TForm(Self.Parent));
MessageDlgEx(rsCreateRepositoryPackageFrm_Message3 + ' "' + Data^.FName + '".', mtInformation, [mbOk], Self);
edSupportedWidgetset.SetFocus;
Exit;
end;
@ -635,8 +658,8 @@ procedure TCreateRepositoryPackagesFrm.bCancelClick(Sender: TObject);
begin
if Assigned(FPackageZipper) then
FPackageZipper.Terminate;
TForm(Self.Parent).ModalResult := mrCancel;
TForm(Self.Parent).Close;
ModalResult := mrCancel;
Close;
end;
procedure TCreateRepositoryPackagesFrm.VSTPackagesGetText(
@ -852,7 +875,7 @@ procedure TCreateRepositoryPackagesFrm.DoOnZippError(Sender: TObject;
begin
Screen.Cursor := crDefault;
MessageDlgEx(rsCreateRepositoryPackageFrm_Error1 + ' "' + AZipFile + '". ' + rsProgressFrm_Error1 + sLineBreak +
AErrMsg, mtError, [mbOk], TForm(Self.Parent));
AErrMsg, mtError, [mbOk], Self);
ShowHideControls(2);
EnableDisableControls(True);
end;
@ -1042,7 +1065,7 @@ begin
ErrMsg := '';
if not CreateJSON(ErrMsg) then
begin
MessageDlgEx(ErrMsg, mtError, [mbOk], TForm(Self.Parent));
MessageDlgEx(ErrMsg, mtError, [mbOk], Self);
Exit;
end;
@ -1051,7 +1074,7 @@ begin
ErrMsg := '';
if not CreateJSONForUpdates(ErrMsg) then
begin
MessageDlgEx(ErrMsg, mtError, [mbOk], TForm(Self.Parent));
MessageDlgEx(ErrMsg, mtError, [mbOk], Self);
Exit;
end;
end;
@ -1062,9 +1085,9 @@ begin
Screen.Cursor := crDefault;
ShowHideControls(2);
EnableDisableControls(True);
MessageDlgEx(rsCreateRepositoryPackageFrm_Message7, mtInformation, [mbOk], TForm(Self.Parent));
TForm(Self.Parent).ModalResult := mrOk;
TForm(Self.Parent).Close;
MessageDlgEx(rsCreateRepositoryPackageFrm_Message7, mtInformation, [mbOk], Self);
ModalResult := mrOk;
Close;
end;
poSubmit:
begin
@ -1096,7 +1119,7 @@ begin
Screen.Cursor := crDefault;
ShowHideControls(2);
EnableDisableControls(True);
MessageDlgEx(AErrMsg, mtError, [mbOk], TForm(Self.Parent));
MessageDlgEx(AErrMsg, mtError, [mbOk], Self);
end;
procedure TCreateRepositoryPackagesFrm.DoOnUploadCompleted(Sender: TObject);
@ -1111,9 +1134,9 @@ begin
DeleteFile(FDestDir + FPackageName + '.json');
if FileExists(FDestDir + 'update_' + FPackageName + '.json') then
DeleteFile(FDestDir + 'update_' + FPackageName + '.json');
MessageDlgEx(rsCreateRepositoryPackageFrm_Message9, mtInformation, [mbOk], TForm(Self.Parent));
TForm(Self.Parent).ModalResult := mrOk;
TForm(Self.Parent).Close;
MessageDlgEx(rsCreateRepositoryPackageFrm_Message9, mtInformation, [mbOk], Self);
Self.ModalResult := mrOk;
Self.Close;
end;
procedure TCreateRepositoryPackagesFrm.SetType(const ATyp: Integer);

View File

@ -562,8 +562,15 @@ object MainFrm: TMainFrm
Caption = 'Create repository package'
OnClick = miCreateRepositoryPackageClick
end
object miCreateRepository: TMenuItem
object miCreateJSONForUpdates: TMenuItem
Caption = 'Create JSON for updates'
OnClick = miCreateJSONForUpdatesClick
end
object MenuItem3: TMenuItem
Caption = '-'
end
object miCreateRepository: TMenuItem
Caption = 'Create personal repository'
OnClick = miCreateRepositoryClick
end
end

View File

@ -42,7 +42,7 @@ uses
opkman_serializablepackages, opkman_visualtree, opkman_const, opkman_common,
opkman_progressfrm, opkman_zipper, opkman_packagelistfrm, opkman_options,
opkman_optionsfrm, opkman_createrepositorypackagefrm, opkman_updates,
opkman_createjsonforupdatesfrm;
opkman_createjsonforupdatesfrm, opkman_createrepositoryfrm;
type
@ -56,6 +56,8 @@ type
imTBDis: TImageList;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
miCreateRepository: TMenuItem;
miLoadChecks: TMenuItem;
miSaveChecks: TMenuItem;
miDateDsc: TMenuItem;
@ -68,7 +70,7 @@ type
miJSONSort: TMenuItem;
miResetRating: TMenuItem;
miCopyToClpBrd: TMenuItem;
miCreateRepository: TMenuItem;
miCreateJSONForUpdates: TMenuItem;
miCreateRepositoryPackage: TMenuItem;
OD: TOpenDialog;
SD: TSaveDialog;
@ -105,6 +107,7 @@ type
tbCreate: TToolButton;
tbUpdate: TToolButton;
procedure miCopyToClpBrdClick(Sender: TObject);
procedure miCreateJSONForUpdatesClick(Sender: TObject);
procedure miCreateRepositoryClick(Sender: TObject);
procedure miCreateRepositoryPackageClick(Sender: TObject);
procedure miLoadChecksClick(Sender: TObject);
@ -990,7 +993,7 @@ begin
end;
end;
procedure TMainFrm.miCreateRepositoryClick(Sender: TObject);
procedure TMainFrm.miCreateJSONForUpdatesClick(Sender: TObject);
var
Msg: String;
begin
@ -1014,6 +1017,18 @@ begin
end;
end;
procedure TMainFrm.miCreateRepositoryClick(Sender: TObject);
var
CreateRepositoryFrm: TCreateRepositoryFrm;
begin
CreateRepositoryFrm := TCreateRepositoryFrm.Create(MainFrm);
try
CreateRepositoryFrm.ShowModal;
finally
CreateRepositoryFrm.Free;
end;
end;
procedure TMainFrm.miCopyToClpBrdClick(Sender: TObject);
var
Data: PData;
@ -1255,7 +1270,8 @@ begin
tbHelp.Hint := rsMainFrm_TBHelp_Hint;
miCreateRepositoryPackage.Caption := rsMainFrm_miCreateRepositoryPackage;
miCreateRepository.Caption := rsMainFrm_miCreateJSONForUpdates;
miCreateJSONForUpdates.Caption := rsMainFrm_miCreateJSONForUpdates;
miCreateRepository.Caption := rsMainFrm_miCreateRepository;
miJSONShow.Caption := rsMainFrm_miJSONShow;
miJSONHide.Caption := rsMainFrm_miJSONHide;
miJSONSort.Caption := rsMainFrm_miJSONSort;