mirror of
https://github.com/stascorp/rdpwrap.git
synced 2025-08-09 20:14:05 +00:00
Added license info
Now license can be viewed in applications
This commit is contained in:
BIN
src-rdpconfig/LicenseUnit.dcu
Normal file
BIN
src-rdpconfig/LicenseUnit.dcu
Normal file
Binary file not shown.
47
src-rdpconfig/LicenseUnit.dfm
Normal file
47
src-rdpconfig/LicenseUnit.dfm
Normal file
@@ -0,0 +1,47 @@
|
||||
object LicenseForm: TLicenseForm
|
||||
Left = 0
|
||||
Top = 0
|
||||
BorderIcons = []
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'License Agreement'
|
||||
ClientHeight = 344
|
||||
ClientWidth = 386
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
Position = poOwnerFormCenter
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object mText: TMemo
|
||||
Left = 8
|
||||
Top = 8
|
||||
Width = 370
|
||||
Height = 297
|
||||
ReadOnly = True
|
||||
ScrollBars = ssBoth
|
||||
TabOrder = 0
|
||||
WordWrap = False
|
||||
end
|
||||
object bAccept: TButton
|
||||
Left = 115
|
||||
Top = 311
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = '&Accept'
|
||||
ModalResult = 1
|
||||
TabOrder = 1
|
||||
end
|
||||
object bDecline: TButton
|
||||
Left = 196
|
||||
Top = 311
|
||||
Width = 75
|
||||
Height = 25
|
||||
Caption = '&Decline'
|
||||
ModalResult = 2
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
43
src-rdpconfig/LicenseUnit.pas
Normal file
43
src-rdpconfig/LicenseUnit.pas
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
Copyright 2014 Stas'M Corp.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
}
|
||||
|
||||
unit LicenseUnit;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls;
|
||||
|
||||
type
|
||||
TLicenseForm = class(TForm)
|
||||
mText: TMemo;
|
||||
bAccept: TButton;
|
||||
bDecline: TButton;
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
LicenseForm: TLicenseForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
end.
|
Binary file not shown.
@@ -2,7 +2,7 @@ object MainForm: TMainForm
|
||||
Left = 0
|
||||
Top = 0
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'Remote Desktop Protocol Configuration'
|
||||
Caption = 'RDP Wrapper Configuration'
|
||||
ClientHeight = 245
|
||||
ClientWidth = 326
|
||||
Color = clBtnFace
|
||||
@@ -19,7 +19,7 @@ object MainForm: TMainForm
|
||||
TextHeight = 13
|
||||
object lRDPPort: TLabel
|
||||
Left = 203
|
||||
Top = 22
|
||||
Top = 33
|
||||
Width = 47
|
||||
Height = 13
|
||||
Caption = 'RDP Port:'
|
||||
@@ -100,7 +100,7 @@ object MainForm: TMainForm
|
||||
end
|
||||
object seRDPPort: TSpinEdit
|
||||
Left = 256
|
||||
Top = 19
|
||||
Top = 30
|
||||
Width = 62
|
||||
Height = 22
|
||||
MaxValue = 65535
|
||||
@@ -109,4 +109,13 @@ object MainForm: TMainForm
|
||||
Value = 0
|
||||
OnChange = seRDPPortChange
|
||||
end
|
||||
object bLicense: TButton
|
||||
Left = 224
|
||||
Top = 6
|
||||
Width = 94
|
||||
Height = 21
|
||||
Caption = 'View license...'
|
||||
TabOrder = 8
|
||||
OnClick = bLicenseClick
|
||||
end
|
||||
end
|
||||
|
@@ -33,6 +33,7 @@ type
|
||||
rgShadow: TRadioGroup;
|
||||
seRDPPort: TSpinEdit;
|
||||
lRDPPort: TLabel;
|
||||
bLicense: TButton;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure cbAllowTSConnectionsClick(Sender: TObject);
|
||||
procedure seRDPPortChange(Sender: TObject);
|
||||
@@ -40,6 +41,7 @@ type
|
||||
procedure bCancelClick(Sender: TObject);
|
||||
procedure bOKClick(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
procedure bLicenseClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
@@ -55,7 +57,27 @@ var
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
{$R manifest.res}
|
||||
{$R resource.res}
|
||||
|
||||
uses
|
||||
LicenseUnit;
|
||||
|
||||
function ExtractResText(ResName: String): String;
|
||||
var
|
||||
ResStream: TResourceStream;
|
||||
Str: TStringList;
|
||||
begin
|
||||
ResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
|
||||
Str := TStringList.Create;
|
||||
try
|
||||
Str.LoadFromStream(ResStream);
|
||||
except
|
||||
|
||||
end;
|
||||
ResStream.Free;
|
||||
Result := Str.Text;
|
||||
Str.Free;
|
||||
end;
|
||||
|
||||
procedure TMainForm.ReadSettings;
|
||||
var
|
||||
@@ -170,6 +192,13 @@ begin
|
||||
Reg.Free;
|
||||
end;
|
||||
|
||||
procedure TMainForm.bLicenseClick(Sender: TObject);
|
||||
begin
|
||||
LicenseForm.mText.Text := ExtractResText('LICENSE');
|
||||
if LicenseForm.ShowModal <> mrOk then
|
||||
Halt(0);
|
||||
end;
|
||||
|
||||
procedure TMainForm.cbAllowTSConnectionsClick(Sender: TObject);
|
||||
begin
|
||||
if Ready then
|
||||
|
@@ -18,7 +18,8 @@ program RDPConf;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
MainUnit in 'MainUnit.pas' {MainForm};
|
||||
MainUnit in 'MainUnit.pas' {MainForm},
|
||||
LicenseUnit in 'LicenseUnit.pas' {LicenseForm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
@@ -27,5 +28,6 @@ begin
|
||||
Application.MainFormOnTaskbar := True;
|
||||
Application.Title := 'Remote Desktop Protocol Configuration';
|
||||
Application.CreateForm(TMainForm, MainForm);
|
||||
Application.CreateForm(TLicenseForm, LicenseForm);
|
||||
Application.Run;
|
||||
end.
|
||||
|
@@ -41,6 +41,9 @@
|
||||
<DCCReference Include="MainUnit.pas">
|
||||
<Form>MainForm</Form>
|
||||
</DCCReference>
|
||||
<DCCReference Include="LicenseUnit.pas">
|
||||
<Form>LicenseForm</Form>
|
||||
</DCCReference>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
|
Binary file not shown.
BIN
src-rdpconfig/resource.res
Normal file
BIN
src-rdpconfig/resource.res
Normal file
Binary file not shown.
Reference in New Issue
Block a user