Jump to content

Does it possible to enable new features in the TServerControlPanelForm?


Tokay

Recommended Posts

  • Tokay changed the title to Does it possible to enable new features in the TServerControlPanelForm?

I've try to open descendant of the TServerControlPanelForm directly from my code (ServerControlPanelForm37.Show), not from the /server link. I also enabled soEnableSessionMonitor and soEnableSessionMonitorAdmin and added code on the descendant OnCreate:

 UniSession.AllowSessionAdmin := True;
 SessionsMenu.Enabled := True;
 ShowSessions1.Enabled := True;
 TermToolButton.Enabled := True;
 ShutdownServer.Enabled := True;

The form shows and all needed menus and contorl is visible and enabled, but when I push the ShowSessions1 menu item, the form and the app is hangs. I used debugger and found that the CP form hangs here: U[I].LockSession (331 line of uniGUIServerCP mofule).

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...
  • 9 months later...

Finally I've found solution.

There is no needed to lock main session. It's already locked. I've added such condition and all's works fine:

      if U[I] <> UniSession then
        U[I].LockSession;

And same for unlocking.

Also I've found better code for the server stopping:

procedure TServerControlPanelForm.ShutdownServerClick(Sender: TObject);
var
  U : TUniGUIServerModule;
begin
  Close;
  U := UniServerInstance;
  if Assigned(U) then U.Terminated := True;
end;

I've found it in the opened sources. Thank you! Source code is very useful.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...