mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: MacOS: Service PopUp Menu i18n (#538)
This commit is contained in:
parent
b944c7d35b
commit
ec621657ff
4 changed files with 8 additions and 5 deletions
|
|
@ -61,9 +61,10 @@ end;
|
|||
|
||||
type TMacosServiceMenuHelper = class
|
||||
oldMenuPopupHandler: TNotifyEvent;
|
||||
serviceSubMenuCaption: String;
|
||||
procedure attachServicesMenu( Sender:TObject);
|
||||
public
|
||||
procedure PopUp( menu:TPopupMenu );
|
||||
procedure PopUp( menu:TPopupMenu; caption:String );
|
||||
end;
|
||||
|
||||
procedure InitNSServiceProvider(
|
||||
|
|
@ -92,7 +93,7 @@ begin
|
|||
oldMenuPopupHandler:= nil;
|
||||
|
||||
// attach the Services Sub Menu by calling NSApplication.setServicesMenu()
|
||||
servicesItem:= TPopupMenu(Sender).Items.Find('Services');
|
||||
servicesItem:= TPopupMenu(Sender).Items.Find(serviceSubMenuCaption);
|
||||
if servicesItem<>nil then
|
||||
begin
|
||||
subMenu:= TCocoaMenu.alloc.initWithTitle(NSString.string_);
|
||||
|
|
@ -101,12 +102,13 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TMacosServiceMenuHelper.PopUp( menu:TPopupMenu );
|
||||
procedure TMacosServiceMenuHelper.PopUp( menu:TPopupMenu; caption:String );
|
||||
begin
|
||||
// because the menu item handle will be destroyed in TPopupMenu.PopUp()
|
||||
// we can only call NSApplication.setServicesMenu() in OnMenuPopupHandler()
|
||||
oldMenuPopupHandler:= OnMenuPopupHandler;
|
||||
OnMenuPopupHandler:= attachServicesMenu;
|
||||
serviceSubMenuCaption:= caption;
|
||||
menu.PopUp();
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ begin
|
|||
|
||||
// attach Services Menu in TMacosServiceMenuHelper
|
||||
mi:=TMenuItem.Create(Self);
|
||||
mi.Caption:='Services';
|
||||
mi.Caption:=uLng.rsMenuMacOsServices;
|
||||
Self.Items.Add(mi);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
|
|
|||
|
|
@ -715,7 +715,7 @@ begin
|
|||
ShellContextMenu.OnClose := CloseEvent;
|
||||
// Show context menu
|
||||
{$IF DEFINED(DARWIN)}
|
||||
MacosServiceMenuHelper.PopUp( ShellContextMenu );
|
||||
MacosServiceMenuHelper.PopUp( ShellContextMenu, uLng.rsMenuMacOsServices );
|
||||
{$ELSE}
|
||||
ShellContextMenu.PopUp(X, Y);
|
||||
{$ENDIF}
|
||||
|
|
|
|||
|
|
@ -363,6 +363,7 @@ resourcestring
|
|||
rsMnuEdit = 'Edit';
|
||||
rsMnuOpenWith = 'Open with';
|
||||
rsMnuOpenWithOther = 'Other...';
|
||||
rsMenuMacOsServices = 'Services';
|
||||
rsMnuMount = 'Mount';
|
||||
rsMnuUmount = 'Unmount';
|
||||
rsMnuNoMedia = 'No media available';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue