mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 19:20:17 +08:00
Implement issue #963: Open session manager without new main window
This commit is contained in:
@ -132,7 +132,7 @@ object MainForm: TMainForm
|
|||||||
object ToolButton9: TToolButton
|
object ToolButton9: TToolButton
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Action = actOpenSession
|
Action = actSessionManager
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
DropdownMenu = menuConnections
|
DropdownMenu = menuConnections
|
||||||
Style = tbsDropDown
|
Style = tbsDropDown
|
||||||
@ -1531,14 +1531,17 @@ object MainForm: TMainForm
|
|||||||
Caption = '&File'
|
Caption = '&File'
|
||||||
Hint = 'File related commands'
|
Hint = 'File related commands'
|
||||||
OnClick = File1Click
|
OnClick = File1Click
|
||||||
object FileNewItem: TMenuItem
|
object Sessionmanager1: TMenuItem
|
||||||
Tag = 23
|
Action = actSessionManager
|
||||||
Action = actOpenSession
|
|
||||||
end
|
end
|
||||||
object menuConnectTo: TMenuItem
|
object menuConnectTo: TMenuItem
|
||||||
Caption = 'Connect to'
|
Caption = 'Connect to'
|
||||||
Enabled = False
|
Enabled = False
|
||||||
end
|
end
|
||||||
|
object FileNewItem: TMenuItem
|
||||||
|
Tag = 23
|
||||||
|
Action = actNewWindow
|
||||||
|
end
|
||||||
object N1: TMenuItem
|
object N1: TMenuItem
|
||||||
Caption = '-'
|
Caption = '-'
|
||||||
end
|
end
|
||||||
@ -1776,13 +1779,20 @@ object MainForm: TMainForm
|
|||||||
Images = PngImageListMain
|
Images = PngImageListMain
|
||||||
Left = 8
|
Left = 8
|
||||||
Top = 64
|
Top = 64
|
||||||
object actOpenSession: TAction
|
object actSessionManager: TAction
|
||||||
|
Category = 'File'
|
||||||
|
Caption = 'Session manager'
|
||||||
|
Hint = 'Display session manager'
|
||||||
|
ImageIndex = 37
|
||||||
|
OnExecute = actSessionManagerExecute
|
||||||
|
end
|
||||||
|
object actNewWindow: TAction
|
||||||
Category = 'File'
|
Category = 'File'
|
||||||
Caption = 'New &window'
|
Caption = 'New &window'
|
||||||
Hint = 'New window...'
|
Hint = 'New window...'
|
||||||
ImageIndex = 37
|
ImageIndex = 37
|
||||||
ShortCut = 16462
|
ShortCut = 16462
|
||||||
OnExecute = actOpenSessionExecute
|
OnExecute = actNewWindowExecute
|
||||||
end
|
end
|
||||||
object actExitApplication: TAction
|
object actExitApplication: TAction
|
||||||
Category = 'File'
|
Category = 'File'
|
||||||
|
@ -40,7 +40,7 @@ type
|
|||||||
ActionList1: TActionList;
|
ActionList1: TActionList;
|
||||||
actCopy: TAction;
|
actCopy: TAction;
|
||||||
actPaste: TAction;
|
actPaste: TAction;
|
||||||
actOpenSession: TAction;
|
actNewWindow: TAction;
|
||||||
actExitApplication: TAction;
|
actExitApplication: TAction;
|
||||||
Extra1: TMenuItem;
|
Extra1: TMenuItem;
|
||||||
FlushUserPrivileges1: TMenuItem;
|
FlushUserPrivileges1: TMenuItem;
|
||||||
@ -457,6 +457,8 @@ type
|
|||||||
lblRecentFilters: TLabel;
|
lblRecentFilters: TLabel;
|
||||||
Copy2: TMenuItem;
|
Copy2: TMenuItem;
|
||||||
N26: TMenuItem;
|
N26: TMenuItem;
|
||||||
|
actSessionManager: TAction;
|
||||||
|
Sessionmanager1: TMenuItem;
|
||||||
procedure refreshMonitorConfig;
|
procedure refreshMonitorConfig;
|
||||||
procedure loadWindowConfig;
|
procedure loadWindowConfig;
|
||||||
procedure saveWindowConfig;
|
procedure saveWindowConfig;
|
||||||
@ -516,7 +518,8 @@ type
|
|||||||
procedure actImportCSVExecute(Sender: TObject);
|
procedure actImportCSVExecute(Sender: TObject);
|
||||||
procedure actImportSettingsExecute(Sender: TObject);
|
procedure actImportSettingsExecute(Sender: TObject);
|
||||||
procedure actLoadSQLExecute(Sender: TObject);
|
procedure actLoadSQLExecute(Sender: TObject);
|
||||||
procedure actOpenSessionExecute(Sender: TObject);
|
procedure actNewWindowExecute(Sender: TObject);
|
||||||
|
procedure actSessionManagerExecute(Sender: TObject);
|
||||||
procedure actPreferencesExecute(Sender: TObject);
|
procedure actPreferencesExecute(Sender: TObject);
|
||||||
procedure actQueryFindExecute(Sender: TObject);
|
procedure actQueryFindExecute(Sender: TObject);
|
||||||
procedure actQueryReplaceExecute(Sender: TObject);
|
procedure actQueryReplaceExecute(Sender: TObject);
|
||||||
@ -1578,6 +1581,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TMainForm.actSessionManagerExecute(Sender: TObject);
|
||||||
|
var
|
||||||
|
ConnForm: TConnForm;
|
||||||
|
begin
|
||||||
|
ConnForm := TConnForm.Create(Self);
|
||||||
|
if ConnForm.ShowModal <> mrCancel then
|
||||||
|
DoAfterConnect;
|
||||||
|
FreeAndNil(ConnForm);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TMainForm.DoAfterConnect;
|
procedure TMainForm.DoAfterConnect;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
@ -2000,11 +2014,14 @@ begin
|
|||||||
item.Caption := '-';
|
item.Caption := '-';
|
||||||
menuConnections.Items.Add(item);
|
menuConnections.Items.Add(item);
|
||||||
|
|
||||||
// "New window" item
|
// "Session manager" and "New window" items
|
||||||
item := TMenuItem.Create(menuConnections);
|
item := TMenuItem.Create(menuConnections);
|
||||||
item.Action := actOpenSession;
|
item.Action := actSessionManager;
|
||||||
item.Default := True;
|
item.Default := True;
|
||||||
menuConnections.Items.Add(item);
|
menuConnections.Items.Add(item);
|
||||||
|
item := TMenuItem.Create(menuConnections);
|
||||||
|
item.Action := actNewWindow;
|
||||||
|
menuConnections.Items.Add(item);
|
||||||
|
|
||||||
// All sessions
|
// All sessions
|
||||||
if MainReg.OpenKey(REGPATH + REGKEY_SESSIONS, False) then begin
|
if MainReg.OpenKey(REGPATH + REGKEY_SESSIONS, False) then begin
|
||||||
@ -2726,7 +2743,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TMainForm.actOpenSessionExecute(Sender: TObject);
|
procedure TMainForm.actNewWindowExecute(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
debug('perf: new connection clicked.');
|
debug('perf: new connection clicked.');
|
||||||
ShellExec( ExtractFileName(paramstr(0)), ExtractFilePath(paramstr(0)) );
|
ShellExec( ExtractFileName(paramstr(0)), ExtractFilePath(paramstr(0)) );
|
||||||
|
Reference in New Issue
Block a user