Hot Door CORE Forum

Full Version: Dialog-at-startup conundrum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a base class for preferences that, on startup, checks if there's an update available for the plugin. If there is, it displays a dialog for the user offering to fetch the update.

The problem is, under Windows, the dialog sometimes appears behind the splash screen and to the user, it seems like Illustrator froze as it was launching. It works fine in Mac OS, BTW. Is there any way to force a dialog window in Windows to become frontmost?

I thought I had a workaround, but that failed:

Using a timer, I could have that dialog automatically dismiss after a period of time, or have the plugin check for updates shortly after the plugin loads, except that to register the timer I need access to the plugin instance. This class is sub-classed and then referenced by any number of other plugins, so I can't get to its this->__corePlug to access the dispatcher.

For now, I'm afraid I have to stop informing Windows users of available updates.

Any suggestions would be much appreciated!
This may not be the best approach, but it works. In my Preferences class, I define the timer

    this->startupMsgTimer = hdi::core::Timer("startupMsgTimer", 60, HDI_CORE_CALLBACK(myPrefs, this, showDelayedMessages));
    HDI_CORE_PLUGIN->dispatcher()->registerTimer(this->startupMsgTimer);

Startup messages are queued in a string vector, and shown in hdi::core::alert::message() when showDelayedMessages is called. The timer is also deactivated so it won't run again.

Of course, I unregister and destroy the timer at shutdown.

I hope this is useful to someone.