Skip to content

Commit

Permalink
Added Convert to Assembly menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliDehbansiahkarbon committed Nov 18, 2023
1 parent f6b6f2f commit a554aa2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion UChatGptMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TChatGptMenuWizard = class(TInterfacedObject, IOTAWizard)
FSetting: TSingletonSettingObj;

FAskSubMenuH, FAddTestH, FFindBugsH, //These hidden menues usre used for better Ux expreince with shortcuts.
FOptimizeH, FAddCommentsH, FCompleteCodeH: TMenuItem;
FOptimizeH, FAddCommentsH, FCompleteCodeH, FAsmConvert: TMenuItem;

procedure AskMenuClick(Sender: TObject);
procedure ChatGPTDockableMenuClick(Sender: TObject);
Expand Down Expand Up @@ -381,6 +381,15 @@ constructor TChatGptMenuWizard.Create;
FCompleteCodeH.OnClick := AskSubmenuHiddenOnClick;
FCompleteCodeH.Visible := False;
end;

if not Assigned(FAsmConvert) then
begin
FCompleteCodeH := TMenuItem.Create(nil);
FCompleteCodeH.Tag := 8;
FCompleteCodeH.ShortCut := TextToShortCut('Ctrl+Alt+Shift+S');
FCompleteCodeH.OnClick := AskSubmenuHiddenOnClick;
FCompleteCodeH.Visible := False;
end;
{$ENDREGION}

if not Assigned(FAskMenuDockable) then
Expand Down Expand Up @@ -665,6 +674,7 @@ procedure TEditNotifierHelper.OnChatGPTSubMenuClick(Sender: TObject; MenuItem: T
AddMenuItem(MenuItem, 'ChatGPTCompleteCode', 'Complete Code', OnChatGPTContextMenuFixedQuestionClick, 'Ctrl+Alt+Shift+k', 5);
AddMenuItem(MenuItem, 'ChatGPTExplain', 'Explain Code', OnChatGPTContextMenuFixedQuestionClick, 'Ctrl+Alt+Shift+E', 6);
AddMenuItem(MenuItem, 'ChatGPTRefactor', 'Refactor Code', OnChatGPTContextMenuFixedQuestionClick, 'Ctrl+Alt+Shift+R', 7);
AddMenuItem(MenuItem, 'ChatGPTAsm', 'Convert to Assembly', OnChatGPTContextMenuFixedQuestionClick, 'Ctrl+Alt+Shift+S', 8);
end;
end;

Expand Down

0 comments on commit a554aa2

Please sign in to comment.