The problem is, the function that invokes the dialog to get the password returns immediately and the program continues from there (without the password). When the dialog is finished, it returns the response via a callback function. So, there's no way to sit and wait for the password within the file opening code because no new input events will be handled until the process returns control back to the main InkView event loop. The code will have to be able to start the dialog, continue on without opening the file, and then re-try again from the callback function when the password is returned. Currently, it's all nested inside logic that assumes the opening either works or the program quits, with no second chances. It's rejigging that logic that's the difficulty.
|