Skip to content
Permalink
Browse files

Add "Switch to query/results" item to "Go to" menu. Closes #698

  • Loading branch information...
ansgarbecker committed Jul 14, 2019
1 parent df6a566 commit 0a1299ddebeabcaed095cf224bc06460e9f9fdb1
Showing with 41 additions and 1 deletion.
  1. +4 −1 out/locale/en/LC_MESSAGES/default.po
  2. +9 −0 source/main.dfm
  3. +28 −0 source/main.pas
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2019-07-12 18:20+0200\n"
"PO-Revision-Date: 2019-07-14 19:26+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -6246,6 +6246,9 @@ msgstr "Go to database tree"
msgid "Go to table filter"
msgstr "Go to table filter"

msgid "Switch to query/results"
msgstr "Switch to query/results"

msgid "Tab 1"
msgstr "Tab 1"

@@ -2161,6 +2161,9 @@ object MainForm: TMainForm
object actGotoDbTree1: TMenuItem
Action = actGotoDbTree
end
object Switchtoqueryresults1: TMenuItem
Action = actGoToQueryResults
end
object actGotoTab11: TMenuItem
Action = actGotoTab1
end
@@ -3059,6 +3062,12 @@ object MainForm: TMainForm
ShortCut = 16437
OnExecute = actGotoTabNumberExecute
end
object actGoToQueryResults: TAction
Category = 'Various'
Caption = 'Switch to query/results'
ShortCut = 117
OnExecute = actGoToQueryResultsExecute
end
object actCopyRows: TAction
Category = 'Various'
Caption = 'Copy selected rows'
@@ -649,6 +649,8 @@ TMainForm = class(TForm)
TimerStoreTabs: TTimer;
Duplicaterowwithkeys1: TMenuItem;
imgDonate: TImage;
actGoToQueryResults: TAction;
Switchtoqueryresults1: TMenuItem;
procedure actCreateDBObjectExecute(Sender: TObject);
procedure menuConnectionsPopup(Sender: TObject);
procedure actExitApplicationExecute(Sender: TObject);
@@ -1017,6 +1019,7 @@ TMainForm = class(TForm)
procedure SynMemoQueryKeyPress(Sender: TObject; var Key: Char);
procedure filterQueryHelpersChange(Sender: TObject);
procedure TimerStoreTabsTimer(Sender: TObject);
procedure actGoToQueryResultsExecute(Sender: TObject);
private
// Executable file details
FAppVerMajor: Integer;
@@ -1423,6 +1426,31 @@ procedure TMainForm.actGotoFilterExecute(Sender: TObject);
end;


procedure TMainForm.actGoToQueryResultsExecute(Sender: TObject);
var
Tab: TQueryTab;
Grid: TVirtualStringTree;
begin
// Switch between query editor and result grid
if QueryTabActive then begin
Tab := ActiveQueryTab;
if Tab.Memo.Focused then begin
if Tab.ActiveResultTab <> nil then begin
Grid := Tab.ActiveResultTab.Grid;
Grid.SetFocus;
if Grid.FocusedNode = nil then
SelectNode(Grid, 0);
end else begin
MessageBeep(MB_ICONASTERISK);
end;
end else begin
Tab.Memo.SetFocus;
end;
end else begin
MessageBeep(MB_ICONASTERISK);
end;
end;

procedure TMainForm.actGotoTabNumberExecute(Sender: TObject);
var
i, Visibles, WantedIndex: Integer;

0 comments on commit 0a1299d

Please sign in to comment.
You can’t perform that action at this time.