Reloading an extension (.mxt) during development.

andy's Avatar

andy

31 Jan, 2021 12:17 PM

Currently the only way I can update my extension under development is to close MD and restart it. Using the 'Add From File' option doesn't reload the extension. During the development process, updating the extension is something that occurs frequently and any time saved is valuable.

Is there a procedure to conveniently reload an extension under development without closing-reopening MD?

  1. 1 Posted by Stuart Beesley ... on 31 Jan, 2021 01:03 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Is this java or python?

  2. 2 Posted by andy on 31 Jan, 2021 01:14 PM

    andy's Avatar

    java

  3. 3 Posted by andy on 31 Jan, 2021 04:00 PM

    andy's Avatar

    This is a Java extension.

    currently after making a code change i must:
    - remove extension
    - make change (involves visible changes to summary page)
    - install extension
    - force an update to summary page (move extension up-down in preferences).

    This is fine; but looking for a single-action like "update" which also refreshed the summary page.

    Thanks.

  4. 4 Posted by Stuart Beesley ... on 31 Jan, 2021 04:29 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    FYI - With Python extensions it works as I think the PY interpreter gets reloaded....

  5. 5 Posted by Mike Bray (Quot... on 31 Jan, 2021 07:53 PM

    Mike Bray (Quote Loader Author)'s Avatar

    You have to restart MD. When MD starts it loads each extension and calls the init function. This loads the class into the JVM and thus will remain loaded until MD restarts. The purpose behind thus is so the extension can be called when the data file is opened. When you select an extension the Invoke method is called.

  6. Support Staff 6 Posted by Sean Reilly on 31 Jan, 2021 10:09 PM

    Sean Reilly's Avatar

    Hi Andy,

    To load the new code you'll need to either go through the Extensions menu to load the extension, or you might be able to double-click on the extension, or drag it from the file browser into the main app window to present the load-extension window. Clicking OK/Install in that window will unload the existing extension and load the new code.

    Thanks,
    Sean

  7. 7 Posted by andy on 01 Feb, 2021 01:17 AM

    andy's Avatar

    Thanks - the drag-drop method is very helpful. The only thing missing which is not a big deal is when the drag-drop occurs the 'getGUIView' is not invoked so an action is needed to force it - such as 'up-down' on the summary page preferences. I'm including my sequence (with lifecycle events) for any future readers; thanks for all the help everyone. (To verify changes are in fact loaded I used the console with an updated message.):

    - start MD (extension not installed)
    - drag-drop my extension into main window
        - ackknowledge prompts
    - following 'FeatureModule' lifecycle vents called in my extension:
        - getBuild
        - getVendor
        - getDescription
        - init
        - getBuild
        - getBuild
        - getVendor
        - getDescription
    - add my extension to summary page
        - getGUIView

    - make change and rebuild

    - drop-drop updated extension.
        - acknowledge prompts

    - following 'FeatureModule' events called:
        - getBuild
        - getVendor
        - getDescription
        - getBuild
        - getVendor
        - getDescription
        - unload
        - init
        - getBuild
        - getBuild
        - getVendor
        - getDescription

    - here i must use 'Preferences | Summary Page | (up down)' to force a refresh on screen
        - getGUIView

    - restart MD (NOT REQUIRED but showing lifecycle events)
        - init
        - handleEvent("md:file:opening")
        - getGUIView
        - getBuild
        - getBuild
        - handleEvent("md:account:root")
        - getGUIView
        - handleEvent("md:file:opened")

    == minor bug ==

    - After removing my extension, restarting MD and reinstalling my extension, the extension shows up in the column previously assigned and not in the "available items" _and_ it is not shown. A simple "up-down" change refreshes.

  8. andy closed this discussion on 01 Feb, 2021 03:30 AM.

  9. Stuart Beesley (Mr Toolbox) re-opened this discussion on 21 Mar, 2021 11:10 PM

  10. 8 Posted by Stuart Beesley ... on 21 Mar, 2021 11:10 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Andy, did you solve this? I have the same problem.. that is to get the Home Screen to reload and therefore load the new HomePageView.. Currently I double-click an account in the side bar, which loads a new UI and thus the new view... I wish there was a refresh / reload current Home Screen method... Did you solve this?

  11. 9 Posted by andy on 22 Mar, 2021 01:48 AM

    andy's Avatar

    No, the "nudge" is still necessary for the 'getGUIView' to be invoked (aka refresh).

    I have since switched to using Eclipse for development (took me a while to get it configured properly) and running/debugging means I'm restarting which avoids the issue during development - and avoids re-deployment altogether.

  12. 10 Posted by Stuart Beesley ... on 23 Mar, 2021 09:20 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    This seems to help:

    from com.moneydance.apps.md.controller import URLUtil
    moneydance.showURL(URLUtil.getMoneydanceURL("gohome"))

    if not on the Home Screen, then great... But if on the Home Screen, you navigate away and then back....

  13. System closed this discussion on 22 Jun, 2021 09:20 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac