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