Browse Source

macOS compatibility fixes

Herman Schoenfeld 6 years ago
parent
commit
3137539d4f

+ 4 - 1
.gitignore

@@ -33,7 +33,10 @@ Run*.bat
 ## Bin folders (Unit test projects, etc)
 bin/
 
+## Lazarus macOS files
+src/ppas.sh
+
 ## Delphi files
 __history/
 dunit.ini
-*.res
+*.res

BIN
resources/wallet/logo-128x128.png


BIN
src/PascalCoinWalletLazarus


+ 45 - 0
src/PascalCoinWalletLazarus.app/Contents/Info.plist

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+  <key>CFBundleDevelopmentRegion</key>
+  <string>English</string>
+  <key>CFBundleExecutable</key>
+  <string>PascalCoinWalletLazarus</string>
+  <key>CFBundleName</key>
+  <string>PascalCoinWalletLazarus</string>
+  <key>CFBundleIdentifier</key>
+  <string>com.company.PascalCoinWalletLazarus</string>
+  <key>CFBundleInfoDictionaryVersion</key>
+  <string>6.0</string>
+  <key>CFBundlePackageType</key>
+  <string>APPL</string>
+  <key>CFBundleSignature</key>
+  <string>Pasc</string>
+  <key>CFBundleShortVersionString</key>
+  <string>0.1</string>
+  <key>CFBundleVersion</key>
+  <string>1</string>
+  <key>CSResourcesFileMapped</key>
+  <true/>
+  <key>CFBundleDocumentTypes</key>
+  <array>
+    <dict>
+      <key>CFBundleTypeRole</key>
+      <string>Viewer</string>
+      <key>CFBundleTypeExtensions</key>
+      <array>
+        <string>*</string>
+      </array>
+      <key>CFBundleTypeOSTypes</key>
+      <array>
+        <string>fold</string>
+        <string>disk</string>
+        <string>****</string>
+      </array>
+    </dict>
+  </array>
+  <key>NSHighResolutionCapable</key>
+  <true/>
+</dict>
+</plist>

+ 1 - 0
src/PascalCoinWalletLazarus.app/Contents/MacOS/PascalCoinWalletLazarus

@@ -0,0 +1 @@
+../../../PascalCoinWalletLazarus

+ 1 - 0
src/PascalCoinWalletLazarus.app/Contents/PkgInfo

@@ -0,0 +1 @@
+APPL????

+ 6 - 6
src/config.inc

@@ -40,8 +40,8 @@
 
 }
 
-  {.$DEFINE PRODUCTION}
-  {$DEFINE TESTNET}
+  {$DEFINE PRODUCTION}
+  {.$DEFINE TESTNET}
 
   {$DEFINE OPTIONS_BY_DEFAULT}
   {.$DEFINE DelphiSockets_OpenSSLv10}
@@ -81,11 +81,11 @@ ERROR: You must select ONLY ONE option: PRODUCTION or TESTNET
 ERROR: You must select ONE option!
 {$ENDIF}{$ENDIF}{$ENDIF}{$ENDIF}
 {$IFDEF OPTIONS_BY_DEFAULT}
-  {$ifdef darwin}
+  {$IFDEF DARWIN}
   {$DEFINE Use_CryptoLib4Pascal}
-  {$else}
+  {$ELSE}
   {$DEFINE Use_OpenSSL}
-  {$endif}
+  {$ENDIF}
 
   // By default are: Synapse + OpenSSLv11
   {$IFDEF ANDROID} 
@@ -125,7 +125,7 @@ ERROR: You must select ONE option!
   {$ENDIF}
 {$ENDIF}
 
-{$ifNdef FPC}
+{$IFNDEF FPC}
   // We are on Delphi compiler
   {$IF Defined(ANDROID) or Defined(MACOS) or Defined(IOS) }
     // On Delphi and Android/IOS/MAC environment, AnsiString is not available and use DelphiSockets instead of Synapse

+ 7 - 6
src/gui-classic/UFRMWallet.pas

@@ -241,9 +241,9 @@ type
     Procedure FinishedLoadingApp;
     Procedure FillAccountInformation(Const Strings : TStrings; Const AccountNumber : Cardinal);
     Procedure FillOperationInformation(Const Strings : TStrings; Const OperationResume : TOperationResume);
+    Procedure InitMacOSMenu;
     {$IFDEF TESTNET}
     Procedure InitMenuForTesting;
-    Procedure InitMacOSMenu;
     Procedure Test_RandomOperations(Sender: TObject);
     Procedure Test_AskForFreeAccount(Sender: TObject);
     {$IFDEF TESTING_NO_POW_CHECK}
@@ -965,16 +965,16 @@ begin
 end;
 
 Procedure TFRMWallet.InitMacOSMenu;
-{$ifdef fpc}
+{$IFDEF FPC}
 var
   mi : TMenuItem;
   app : TMenuItem;
-{$endif}
+{$ENDIF}
 begin
-  {$ifdef fpc}
-  {$ifndef darwin}
+  {$IFDEF FPC}
+  {$IFNDEF DARWIN}
   Exit;
-  {$endif}
+  {$ENDIF}
   app := TMenuItem.Create(MainMenu);
   app := TMenuItem.Create(MainMenu);
   app.Caption:=#$EF#$A3#$BF;
@@ -1010,6 +1010,7 @@ begin
   {$endif}
 end;
 
+
 {$IFDEF TESTNET}
 procedure TFRMWallet.InitMenuForTesting;
 var mi : TMenuItem;

BIN
src/pascalcoin_wallet_classic.ico


+ 7 - 6
src/pascalcoin_wallet_classic.lpi

@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="10"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <General>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
+        <CompatibilityMode Value="True"/>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
-      <Title Value="PascalCoinWalletLazarus"/>
+      <Title Value="PascalCoinWallet"/>
       <ResourceType Value="res"/>
       <Icon Value="0"/>
     </General>
@@ -31,9 +31,10 @@
       <Version Value="2"/>
     </PublishOptions>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     <RequiredPackages Count="1">
       <Item1>

BIN
src/pascalcoin_wallet_classic.res