Skip to content

Commit

Permalink
Updated to support Delphi 12.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliDehbansiahkarbon committed Nov 18, 2023
1 parent 6378a1e commit adb430d
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 88 deletions.
2 changes: 1 addition & 1 deletion ChatGptWizard.delphilsp.json

Large diffs are not rendered by default.

134 changes: 132 additions & 2 deletions ChatGptWizard.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<PropertyGroup>
<ProjectGuid>{1AECFF76-9CE1-4FCD-9DAD-92C02EFA586B}</ProjectGuid>
<MainSource>ChatGptWizard.dpk</MainSource>
<ProjectVersion>19.5</ProjectVersion>
<ProjectVersion>20.1</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Release</Config>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Package</AppType>
Expand Down Expand Up @@ -333,6 +333,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDefV21">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
Expand All @@ -353,6 +363,66 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV31">
<Platform Name="Android">
<RemoteDir>res\values-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v26</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconBackground">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconForeground">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconMonochrome">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_AdaptiveIconV33">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v33</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v33</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
Expand All @@ -363,6 +433,16 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_ColorsDark">
<Platform Name="Android">
<RemoteDir>res\values-night-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-night-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
Expand Down Expand Up @@ -533,6 +613,56 @@
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedNotificationIcon">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v24</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v24</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplash">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashDark">
<Platform Name="Android">
<RemoteDir>res\drawable-night-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-night-anydpi-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashV31">
<Platform Name="Android">
<RemoteDir>res\drawable-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_VectorizedSplashV31Dark">
<Platform Name="Android">
<RemoteDir>res\drawable-night-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-night-anydpi-v31</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
Expand Down
1 change: 0 additions & 1 deletion Forms/UChatGPTQFrame.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ object Fram_Question: TFram_Question
FieldName = 'HID'
Origin = 'HID'
ProviderFlags = [pfInWhere, pfInKey]
ReadOnly = True
end
object FDQryHistoryQuestion: TWideMemoField
Alignment = taCenter
Expand Down
14 changes: 14 additions & 0 deletions Forms/UChatGPTQFrame.pas
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ TFram_Question = class(TFrame)
ACaseSensitive: Boolean; ABkColor: TColor; ASelectedBkColor: TColor);
procedure EnableUI(ATaskName: string);
procedure ClearAnswers;
function IslegacyModel: Boolean;
public
procedure InitialFrame;
procedure InitialClassViewMenueItems(AClassList: TClassList);
Expand Down Expand Up @@ -215,6 +216,11 @@ procedure TFram_Question.btnHelpClick(Sender: TObject);

procedure TFram_Question.Btn_AskClick(Sender: TObject);
begin
if IslegacyModel then
begin
ShowMessage('You are trying to use model"' + '+' + TSingletonSettingObj.Instance.Model + '" which is deprecated')
end;

if mmoQuestion.Lines.Text.Trim.IsEmpty then
begin
ShowMessage('Really?!😂' + #13 + 'You need to type a question first.');
Expand Down Expand Up @@ -910,6 +916,14 @@ procedure TFram_Question.InitialFrame;
end;
end;

function TFram_Question.IslegacyModel: Boolean;
begin
with TSingletonSettingObj.Instance do
begin
Result := Model.Equals('text-davinci-003') or URL.Equals('https://api.openai.com/v1/completions');
end;
end;

procedure TFram_Question.JavaClick(Sender: TObject);
begin
if FClassTreeView.Selected <> FClassTreeView.TopItem then
Expand Down
Loading

0 comments on commit adb430d

Please sign in to comment.