Skip to content

Commit

Permalink
¡Oops! Import/Export soft data frames logic was messed up.
Browse files Browse the repository at this point in the history
* GPL info moved to the  end of files.
* Published properties with default value.
* ETKMagCut: Videogame titles are not saved between sessions.
  • Loading branch information
Chixpy committed Sep 26, 2023
1 parent 029ecf5 commit 57b9e1c
Show file tree
Hide file tree
Showing 127 changed files with 2,143 additions and 1,887 deletions.
2 changes: 1 addition & 1 deletion CHXPas
Submodule CHXPas updated 42 files
+0 −1 .gitignore
+16 −15 Abstract/uaCHXConfig.pas
+16 −15 Abstract/uaCHXStorable.pas
+16 −15 Classes/ucCHXImageList.pas
+16 −15 Forms/ufrCHXForm.pas
+16 −15 Frames/ufCHXAbout.pas
+16 −15 Frames/ufCHXChkLstPropEditor.pas
+16 −15 Frames/ufCHXFileListPreview.pas
+16 −15 Frames/ufCHXFrame.pas
+16 −15 Frames/ufCHXImgListPreview.pas
+16 −15 Frames/ufCHXImgViewer.pas
+16 −15 Frames/ufCHXListPreview.pas
+16 −15 Frames/ufCHXMultiFolderEditor.pas
+18 −17 Frames/ufCHXProgressBar.pas
+16 −15 Frames/ufCHXPropEditor.pas
+16 −15 Frames/ufCHXTagTree.pas
+16 −15 Frames/ufCHXTxtListPreview.pas
+16 −15 Frames/ufCHXVideoListPreview.pas
+16 −15 ScriptManager/frames/ufSMAskMultiFile.pas
+16 −15 ScriptManager/frames/ufSMAskOption.pas
+16 −15 ScriptManager/imports/uPSI_CHXBasic.pas
+16 −15 ScriptManager/imports/uPSI_FPCDateUtils.pas
+16 −15 ScriptManager/imports/uPSI_FPCFileUtil.pas
+16 −15 ScriptManager/imports/uPSI_FPCLazUTF8.pas
+16 −15 ScriptManager/imports/uPSI_FPCStrUtils.pas
+16 −15 ScriptManager/imports/uPSI_FPCSysUtils.pas
+16 −15 ScriptManager/imports/uPSI_u7zWrapper.pas
+23 −20 ScriptManager/imports/uPSI_uCHXFileUtils.pas
+16 −15 ScriptManager/imports/uPSI_uCHXStrUtils.pas
+16 −15 ScriptManager/imports/uPSI_uaCHXStorable.pas
+24 −20 ScriptManager/ucCHXScriptEngine.pas
+16 −15 ScriptManager/ufCHXScriptManager.pas
+16 −15 Units/uCHX7zWrapper.pas
+16 −15 Units/uCHXConst.pas
+18 −18 Units/uCHXDlgUtils.pas
+16 −15 Units/uCHXExecute.pas
+16 −15 Units/uCHXFileUtils.pas
+51 −43 Units/uCHXImageUtils.pas
+28 −16 Units/uCHXMenuUtils.pas
+16 −15 Units/uCHXRscStr.pas
+16 −15 Units/uCHXStrUtils.pas
+23 −2 Units/uCHXVerInfo.pas
45 changes: 23 additions & 22 deletions ETKMagCut/ETKMagCut.lps
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="70"/>
<UsageCount Value="71"/>
</Unit>
<Unit>
<Filename Value="src\forms\ufrMain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmETKMagazineCutter"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<TopLine Value="36"/>
<CursorPos X="40" Y="102"/>
<UsageCount Value="70"/>
<UsageCount Value="71"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit>
Expand All @@ -36,7 +35,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="18"/>
<CursorPos X="3" Y="36"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Frames\ufCHXFrame.pas"/>
Expand All @@ -47,7 +46,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="51"/>
<CursorPos X="29" Y="61"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Frames\ufCHXFileList.pas"/>
Expand All @@ -58,22 +57,22 @@
<EditorIndex Value="-1"/>
<TopLine Value="38"/>
<CursorPos X="5" Y="70"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Misc\uVersionSupport.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="45"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Units\uCHXStrUtils.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="58"/>
<CursorPos X="10" Y="77"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="src\frames\ufEMCMain.pas"/>
Expand All @@ -84,7 +83,7 @@
<EditorIndex Value="2"/>
<TopLine Value="303"/>
<CursorPos X="69" Y="326"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit>
Expand All @@ -93,39 +92,40 @@
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<CursorPos Y="30"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Units\uCHXRscStr.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<CursorPos X="57" Y="21"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Units\uCHXConst.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="15"/>
<CursorPos Y="50"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Units\uCHXImageUtils.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<UsageCount Value="69"/>
<UsageCount Value="70"/>
</Unit>
<Unit>
<Filename Value="src\frames\ufEMCImagePropEditor.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmEMCImagePropEditor"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Frame"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<TopLine Value="122"/>
<CursorPos X="47" Y="139"/>
<UsageCount Value="64"/>
<TopLine Value="357"/>
<CursorPos X="58" Y="365"/>
<UsageCount Value="65"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit>
Expand All @@ -138,7 +138,7 @@
<EditorIndex Value="-1"/>
<TopLine Value="289"/>
<CursorPos X="35" Y="308"/>
<UsageCount Value="63"/>
<UsageCount Value="64"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Frames\ufCHXBGRAImgViewer.pas"/>
Expand All @@ -149,30 +149,31 @@
<EditorIndex Value="-1"/>
<TopLine Value="105"/>
<CursorPos Y="120"/>
<UsageCount Value="59"/>
<UsageCount Value="60"/>
</Unit>
<Unit>
<Filename Value="..\CHXPas\Abstract\uaCHXConfig.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<TopLine Value="19"/>
<CursorPos X="3" Y="34"/>
<UsageCount Value="43"/>
<UsageCount Value="44"/>
</Unit>
<Unit>
<Filename Value="src\classes\ucEMCConfig.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="3"/>
<CursorPos X="18" Y="106"/>
<UsageCount Value="41"/>
<TopLine Value="116"/>
<CursorPos X="76" Y="148"/>
<UsageCount Value="42"/>
<Loaded Value="True"/>
</Unit>
<Unit>
<Filename Value="src\units\uEMCConst.pas"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<CursorPos X="13" Y="31"/>
<UsageCount Value="41"/>
<UsageCount Value="42"/>
</Unit>
</Units>
<RunParams>
Expand Down
10 changes: 0 additions & 10 deletions ETKMagCut/src/classes/ucEMCConfig.pas
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ interface
krsLanguagesKey = 'Languages';
krsTypesKey = 'Types';
krsSystemsKey = 'Systems';
krsVideogamesKey = 'Videogames';

krsFoldersSection = 'Folders';
krsBaseOutFolderKey = 'BaseOutFolder';
Expand All @@ -53,7 +52,6 @@ cEMCConfig = class(caCHXConfig)
FSections: TStringList;
FSystems: TStringList;
FTypes: TStringList;
FVideogames: TStringList;
procedure SetBaseOutFolder(AValue: string);

public
Expand All @@ -73,7 +71,6 @@ cEMCConfig = class(caCHXConfig)
property Languages: TStringList read FLanguages;
property Types: TStringList read FTypes;
property Systems: TStringList read FSystems;
property Videogames: TStringList read FVideogames;
end;

implementation
Expand All @@ -95,7 +92,6 @@ procedure cEMCConfig.LoadFromIni(aIniFile: TMemIniFile);
Languages.CommaText := aIniFile.ReadString(krsListsSection, krsLanguagesKey, Languages.CommaText);
Types.CommaText := aIniFile.ReadString(krsListsSection, krsTypesKey, Types.CommaText);
Systems.CommaText := aIniFile.ReadString(krsListsSection, krsSystemsKey, Systems.CommaText);
Videogames.CommaText := aIniFile.ReadString(krsListsSection, krsVideogamesKey, Videogames.CommaText);
end;

procedure cEMCConfig.ResetDefaultConfig;
Expand All @@ -107,7 +103,6 @@ procedure cEMCConfig.ResetDefaultConfig;
Languages.Clear;
Types.Clear;
Systems.Clear;
Videogames.Clear;
end;

constructor cEMCConfig.Create(aOwner: TComponent);
Expand All @@ -127,9 +122,6 @@ constructor cEMCConfig.Create(aOwner: TComponent);
FSystems := TStringList.Create;
Systems.Sorted := True;
Systems.Duplicates := dupIgnore;
FVideogames := TStringList.Create;
Videogames.Sorted := True;
Videogames.Duplicates := dupIgnore;

inherited Create(aOwner);
end;
Expand All @@ -141,7 +133,6 @@ destructor cEMCConfig.Destroy;
FreeAndNil(FLanguages);
FreeAndNil(FTypes);
FreeAndNil(FSystems);
FreeAndNil(FVideogames);

inherited Destroy;
end;
Expand All @@ -155,7 +146,6 @@ procedure cEMCConfig.SaveToIni(aIniFile: TMemIniFile);
aIniFile.WriteString(krsListsSection, krsLanguagesKey, Languages.CommaText);
aIniFile.WriteString(krsListsSection, krsTypesKey, Types.CommaText);
aIniFile.WriteString(krsListsSection, krsSystemsKey, Systems.CommaText);
aIniFile.WriteString(krsListsSection, krsVideogamesKey, Videogames.CommaText);
end;

end.
9 changes: 5 additions & 4 deletions ETKMagCut/src/frames/ufEMCImagePropEditor.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inherited fmEMCImagePropEditor: TfmEMCImagePropEditor
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 938
DesignLeft = 436
DesignTop = 23
DesignLeft = 437
DesignTop = 4
object lFilename: TLabel[0]
Left = 4
Height = 20
Expand Down Expand Up @@ -490,9 +490,10 @@ inherited fmEMCImagePropEditor: TfmEMCImagePropEditor
end
object pButtons: TPanel[7]
Left = 4
Height = 77
Height = 76
Top = 758
Width = 392
BevelOuter = bvNone
ChildSizing.LeftRightSpacing = 4
ChildSizing.TopBottomSpacing = 4
ChildSizing.HorizontalSpacing = 8
Expand All @@ -501,7 +502,7 @@ inherited fmEMCImagePropEditor: TfmEMCImagePropEditor
ChildSizing.ShrinkHorizontal = crsHomogenousChildResize
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 77
ClientHeight = 76
ClientWidth = 392
TabOrder = 6
object bClearSelection: TButton
Expand Down
4 changes: 1 addition & 3 deletions ETKMagCut/src/frames/ufEMCImagePropEditor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ procedure TfmEMCImagePropEditor.SetEMCConfig(AValue: cEMCConfig);
cbxLanguage.Items.AddStrings(EMCConfig.Languages);
cbxType.Items.AddStrings(EMCConfig.Types);
cbxSystem.Items.AddStrings(EMCConfig.Systems);
cbxGame.Items.AddStrings(EMCConfig.Videogames);
end;

procedure TfmEMCImagePropEditor.SetOnChangeRect(AValue: TEMCProcRectObjCB);
Expand Down Expand Up @@ -499,14 +498,13 @@ procedure TfmEMCImagePropEditor.SaveEMCConfig;
begin
if assigned(EMCConfig) then
begin
EMCConfig.BaseOutFolder := eBaseOutFolder.Text;
EMCConfig.BaseOutFolder := eBaseOutFolder.Text;

EMCConfig.Magazines.AddStrings(cbxMagazine.Items, True);
EMCConfig.Sections.AddStrings(cbxSection.Items, True);
EMCConfig.Languages.AddStrings(cbxLanguage.Items, True);
EMCConfig.Types.AddStrings(cbxType.Items, True);
EMCConfig.Systems.AddStrings(cbxSystem.Items, True);
EMCConfig.Videogames.AddStrings(cbxGame.Items, True);
end;
end;

Expand Down
43 changes: 22 additions & 21 deletions EmutecaCore/Abstracts/uaEmutecaCustomEmu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,12 @@
This file is part of Emuteca Core.
Copyright (C) 2006-2023 Chixpy
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 3 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., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
}
{$mode objfpc}{$H+}

interface

uses Classes, SysUtils, FileUtil, StrUtils, LazUTF8, LazFileUtils,
uses Classes, SysUtils, FileUtil, StrUtils, LazUTF8, LazFileUtils,
IniFiles, lclintf,
// CHX units
uCHXStrUtils, uCHXExecute,
Expand Down Expand Up @@ -211,7 +196,7 @@ caEmutecaCustomEmu = class(caCHXStorableIni)
Only one extension in every string, without dot.
}

property ExitCode: integer read FExitCode write SetExitCode;
property ExitCode: integer read FExitCode write SetExitCode default 0;
{< Code returned by emulator in usual conditions. Emuteca will not show
an error message if this code is returned. }

Expand Down Expand Up @@ -436,8 +421,8 @@ function caEmutecaCustomEmu.Execute(GameFile: string;
ExtractFileDir(ExeFile));
ActualWorkDir := AnsiReplaceText(ActualWorkDir, krsEmutecaROMDirKey,
ExtractFileDir(GameFile));
ActualWorkDir := AnsiReplaceText(ActualWorkDir, krsEmutecaCurrentDirKey,
GetCurrentDirUTF8);
ActualWorkDir := AnsiReplaceText(ActualWorkDir,
krsEmutecaCurrentDirKey, GetCurrentDirUTF8);
ActualWorkDir := SysPath(ActualWorkDir);

// Parameters
Expand Down Expand Up @@ -538,8 +523,8 @@ function caEmutecaCustomEmu.Execute(GameFile: string;
OpenDocument(ActualParam);
end
else
ExecuteCMDString(ActualWorkDir, ExeFile, ActualParam,
sOutput, sError, Result);
ExecuteCMDString(ActualWorkDir, ExeFile, ActualParam, sOutput,
sError, Result);

// TODO: Make this configurable and let open they from GUI
aSL := TStringList.Create;
Expand Down Expand Up @@ -645,3 +630,19 @@ initialization
finalization
UnRegisterClass(caEmutecaCustomEmu);
end.
{
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 3 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., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
}
Loading

0 comments on commit 57b9e1c

Please sign in to comment.