Attila Kovacs 629 Posted February 12, 2019 (edited) Is there a way to figure out that the IDE is going to shut down? Possibly before TOTAFileNotification fires. Edited February 12, 2019 by Attila Kovacs Share this post Link to post
Dave Nottage 557 Posted February 12, 2019 (edited) For what purpose? That may define exactly what the add-in should "look for". One way might be to use a timer to monitor the Visible property of the main form. As far as I know, the only time it becomes invisible is when the IDE is shutting down Edited February 12, 2019 by Dave Nottage Share this post Link to post
Attila Kovacs 629 Posted February 12, 2019 (edited) @Dave Nottage I want to suppress some editor related dialogs in my plugon on closing the IDE, but I think I've found a way: TOTAFileNotification yields "projectname.$$$" file is going to be closed at first. Not sure what it is, temp file or what, but it seems always to be the first file to close. It's the .groupproj file instead. Also fine I think. Edited February 12, 2019 by Attila Kovacs Share this post Link to post
Attila Kovacs 629 Posted February 12, 2019 @David Hoyle Quote 18.7 DockFormRefresh procedure TEditorNotifier.DockFormRefresh(const EditWindow: INTAEditWindow; DockForm: TDockableForm); This method seems to be fired when the IDE is closing down and the desktop of being save. I've not been able to get the event to fire for any other situations. The EditWindow is the edit window that the docking operation is be docked to (it's a dock site) and DockForm is the form that is being docked. I'm also getting this event every time I'm closing a file with ctrl-F4. Berlin U2. Share this post Link to post
David Hoyle 68 Posted February 13, 2019 The issue will be the timing of the events. Your main wizard will get destroyed at some point but I assume you are looking for the time period between File | Exit, etc and shutdown. I've not got an IDE available but you could install my notifier plug-in (https://github.com/DGH2112/DGH-IDE-Notifiers) (experimental) and switch on all notifiers and then close down the IDE then examine the log file to see what happens. 1 Share this post Link to post
Attila Kovacs 629 Posted February 13, 2019 @David Hoyle Thx, I was looking everywhere for this notifier! For now I've switched to TOTAFileNotification, and I'm silent between ofnProjectDesktopSave/ofnActiveProjectChanged and the ofnFileClosing with the filename ending with '.dproj'. Yeah, ugly botching, but I have no other choice at the moment... Share this post Link to post
David Hoyle 68 Posted February 13, 2019 @Attila Kovacs Another non-OTA solution might be to try hooking either the IDE's main form CloseQuery event or similar (you will probably need to chain an existing event and restore that event when you plug-in closes) or the events of the TApplication object. Share this post Link to post
Attila Kovacs 629 Posted February 13, 2019 @David Hoyle I was thinking about the same, but, this is a plugin dll for Parnassus Bookmark and I'm not sure that I want to hook it from there... I didn't even look how could I access the main form. Share this post Link to post
David Hoyle 68 Posted February 13, 2019 Main form is call AppBuilder if I remember correctly and is available from the Forms collection in the Screen object. Have a look at my Delphi IDE Explorer plug-in (https://github.com/DGH2112/Delphi-IDE-Explorer). 1 Share this post Link to post
dummzeuch 1505 Posted February 13, 2019 3 hours ago, David Hoyle said: @Attila Kovacs Another non-OTA solution might be to try hooking either the IDE's main form CloseQuery event or similar (you will probably need to chain an existing event and restore that event when you plug-in closes) or the events of the TApplication object. Rather than hooking an event, which might already be hooked, you can create a custom TComponent descendant and set the main window as its parent. The main window will then destroy that component before it gets freed and you can intercept that to do whatever you need. Regarding chaining events, see here for my suggestion to play fair with other plugins. Share this post Link to post
Attila Kovacs 629 Posted February 13, 2019 @dummzeuch The idea is good, but I'm afraid it's too late. Plugins go first. Have to check. Share this post Link to post
Dave Nottage 557 Posted February 13, 2019 5 hours ago, Attila Kovacs said: I didn't even look how could I access the main form Application.MainForm, oddly enough On 2/12/2019 at 8:32 PM, Attila Kovacs said: I want to suppress some editor related dialogs in my plugin on closing the IDE Not really enough to go on - why do they need to be suppressed? i.e. why would they even show at the point when the IDE is shutting down? Share this post Link to post
David Hoyle 68 Posted February 13, 2019 @Dave Nottage Sometimes we for get the simple 🙂 Share this post Link to post