Skip to content

Commit

Permalink
Corrections and improvements for #73
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Marder committed Oct 26, 2017
1 parent 106602e commit cb23eaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Lib/UIRibbon.Register.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ implementation

uses
Classes, UIRibbon, SysUtils, UIRibbonActions, System.Actions, System.Win.Registry,
Winapi.ShellAPI, Winapi.Windows, UIRibbonUtils, ToolsApi, Vcl.Dialogs;
Winapi.ShellAPI, Winapi.Windows, UIRibbonUtils, ToolsApi, Vcl.Dialogs,
System.IOUtils;

procedure Register;
var
Expand Down Expand Up @@ -92,10 +93,12 @@ procedure TMyRibbonFrameworkEditor.ExecuteVerb(pIndex: Integer);
begin
inherited;
lRibbon := (Self.Component as TUiRibbon);
if lRibbon.RibbonSourceFile.IsEmpty or not FileExists(lRibbon.RibbonSourceFile) then
if lRibbon.RibbonSourceFile.IsEmpty or
not FileExists(TPath.Combine(ExtractFilePath(getActiveProject.FileName), lRibbon.RibbonSourceFile))
then
lRibbon.RibbonSourceFile := BrowseForXmlFile();
case pIndex of
0: ShellExecute(0, 'open', PChar(GetDesignerPath()), PChar('"'+lRibbon.RibbonSourceFile+'"'), nil, SW_SHOWNORMAL);
0: ShellExecute(0, 'open', PChar(GetDesignerPath()), PChar('"'+ TPath.Combine(ExtractFilePath(getActiveProject.FileName), lRibbon.RibbonSourceFile) +'"'), nil, SW_SHOWNORMAL);
end;
end;

Expand Down

0 comments on commit cb23eaf

Please sign in to comment.