Browse Source

Merge downstream

Herman Schoenfeld 6 years ago
parent
commit
45f9c8f31f

+ 49 - 1
src/gui-experimental/UFRMMainForm.pas

@@ -121,6 +121,7 @@ type
     procedure Test_CreateABlock(Sender: TObject);
     {$ENDIF}
     {$ENDIF}
+    Procedure InitMacOSMenu;
   protected
     procedure RefreshConnectionStatusDisplay;
     procedure RefreshWalletLockIcon;
@@ -137,7 +138,7 @@ implementation
 
 {$R *.lfm}
 
-uses LCLIntf, UUserInterface, UThread, UOpTransaction, UWizard, UTime;
+uses LCLIntf, LCLType, UUserInterface, UThread, UOpTransaction, UWizard, UTime;
 
 const
   CT_FOOTER_TOOLBAR_LEFT_PADDING = 8;
@@ -174,6 +175,7 @@ begin
   // Things for testing purposes only
   InitMenuForTesting;
   {$ENDIF}
+  InitMacOSMenu;
 end;
 
 procedure TFRMMainForm.FormCloseQuery(Sender: TObject; var CanClose: boolean);
@@ -522,5 +524,51 @@ end;
 
 {%endregion}
 
+Procedure TFRMMainForm.InitMacOSMenu;
+{$ifdef fpc}
+var
+  mi : TMenuItem;
+  app : TMenuItem;
+{$endif}
+begin
+  {$ifdef fpc}
+  {$ifndef darwin}
+  Exit;
+  {$endif}
+  app := TMenuItem.Create(meMainMenu);
+  app := TMenuItem.Create(meMainMenu);
+  app.Caption:=#$EF#$A3#$BF;
+
+  miAbout.Parent.Remove(miAbout);
+  app.Add(miAbout);
+  {$IFDEF TESTNET}
+  // Things for testing purposes only
+  miAboutMenu.caption := 'Testing';
+  {$ELSE}
+  miAboutMenu.Visible:=false;
+  {$ENDIF}
+
+  // Move "Options" to "Prefernces"
+  mi := TMenuItem.Create(meMainMenu);
+  mi.Caption:='-';
+  app.Add(mi);
+  miOptions.Parent.Remove(miOptions);
+  miOptions.Caption:='Preferences...';
+  miOptions.ShortCut:=Menus.ShortCut(VK_OEM_COMMA, [ssMeta]);
+  app.Add(miOptions);
+
+  MiOperationsExplorer.ShortCut:=Menus.ShortCut(VK_E, [ssMeta]);
+  miOptions.ShortCut:=Menus.ShortCut(VK_OEM_COMMA, [ssMeta]); // match preferences
+  miPrivatekeys.ShortCut:=Menus.Shortcut(VK_P, [ssMeta]);
+
+  N1.Visible:=false;
+  MiClose.Visible:=false;
+
+  meMainMenu.Items.Insert(0, app);
+
+  paWalletPanel.Caption:='';
+  {$endif}
+end;
+
 end.
 

+ 2 - 0
src/gui-experimental/UFRMPascalCoinWalletConfig.lfm

@@ -124,6 +124,7 @@ object FRMPascalCoinWalletConfig: TFRMPascalCoinWalletConfig
     ModalResult = 1
     OnClick = bbOkClick
     TabOrder = 16
+    Caption = 'OK'
   end
   object bbCancel: TBitBtn
     Left = 278
@@ -134,6 +135,7 @@ object FRMPascalCoinWalletConfig: TFRMPascalCoinWalletConfig
     Kind = bkCancel
     ModalResult = 2
     TabOrder = 17
+    Caption = 'Cancel'
   end
   object udInternetServerPort: TUpDown
     Left = 256

+ 3 - 2
src/gui-experimental/core.utils/UCoreUtils.pas

@@ -238,7 +238,8 @@ var
 begin
   Balance := CT_BalanceSummary_Nil;
   LAccs := Disposables.AddObject(TList<TAccount>.Create) as TList<TAccount>;
-//  TNode.Node.Bank.SafeBox.StartThreadSafe;
+
+  TNode.Node.Bank.SafeBox.StartThreadSafe;
   LMemPool := TNode.Node.LockMempoolRead;
   try
     for i := 0 to TWallet.Keys.Count - 1 do
@@ -257,7 +258,7 @@ begin
     end;
   finally
     TNode.Node.UnlockMempoolRead;
-//    TNode.Node.Bank.SafeBox.EndThreadSave;
+    TNode.Node.Bank.SafeBox.EndThreadSave;
   end;
   LAccs.Sort(TAccountComparer.Create);
   Result := LAccs.ToArray;