diff --git a/components/heidisql/include/const.inc b/components/heidisql/include/const.inc index 62346da3..d63b2612 100644 --- a/components/heidisql/include/const.inc +++ b/components/heidisql/include/const.inc @@ -167,6 +167,8 @@ const REGNAME_USERMNGR_WINHEIGHT = 'Usermanager_WindowHeight'; REGNAME_SELECTDBO_WINWIDTH = 'SelectDBO_WindowWidth'; REGNAME_SELECTDBO_WINHEIGHT = 'SelectDBO_WindowHeight'; + REGNAME_SESSMNGR_WINWIDTH = 'SessionManager_WindowWidth'; + REGNAME_SESSMNGR_WINHEIGHT = 'SessionManager_WindowHeight'; REGNAME_COPYTABLE_STRUCDATA = 'CopyTable_Option_StructureData'; REGVAL_COPYTABLE_STRUCTURE = 0; REGVAL_COPYTABLE_STRUCTURE_AND_DATA = 1; diff --git a/source/connections.dfm b/source/connections.dfm index ac021d51..5aa38fbd 100644 --- a/source/connections.dfm +++ b/source/connections.dfm @@ -19,6 +19,7 @@ object connform: Tconnform ShowHint = True OnCloseQuery = FormCloseQuery OnCreate = FormCreate + OnDestroy = FormDestroy OnShow = FormShow DesignSize = ( 494 diff --git a/source/connections.pas b/source/connections.pas index 92b1b041..860ce81e 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -69,6 +69,7 @@ type NewNode: PVirtualNode; OldColumn, NewColumn: TColumnIndex; var Allowed: Boolean); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); + procedure FormDestroy(Sender: TObject); private { Private declarations } FLoaded: Boolean; @@ -110,6 +111,8 @@ begin // Fix GUI stuff InheritFont(Font); SetWindowSizeGrip(Handle, True); + Width := GetRegValue(REGNAME_SESSMNGR_WINWIDTH, Width); + Height := GetRegValue(REGNAME_SESSMNGR_WINHEIGHT, Height); FixVT(ListSessions); ListSessions.OnGetHint := Mainform.vstGetHint; FLoaded := False; @@ -123,6 +126,15 @@ begin end; +procedure Tconnform.FormDestroy(Sender: TObject); +begin + // Save GUI stuff + OpenRegistry; + MainReg.WriteInteger(REGNAME_SESSMNGR_WINWIDTH, Width); + MainReg.WriteInteger(REGNAME_SESSMNGR_WINHEIGHT, Height); +end; + + procedure Tconnform.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin // Modifications? Ask if they should be saved.