Remotely open new view from XMLRPC-Server in own thread

27 views
Skip to first unread message

Sebastian Stetter

unread,
Sep 15, 2015, 3:44:04 PM9/15/15
to Project Camelot
Hi!
I want to trigger an OpenNewView Action through XMLRPC. I get the server started in my application_admin.py, but I don't know how to trigger an Action from outside the GUI in camleot. Any pointers?



       

Erik Janssens

unread,
Sep 19, 2015, 4:21:36 AM9/19/15
to Project Camelot
Hello Sebastian,

Actions are always triggered from within the GUI.  There are however some
workarounds, they all involve creating a an action with a custom 'render' method
that returns a custom widget :

1. the widget could have a timer defined that triggers the gui_run of the action
    every now and then.  the action then checks if there is a pending xmlrpc request,
    end handles it.

2. the widget could have a slot to trigger the gui_run of the action.  the thread running
    the xmlrpc server could then emit a signal that is connected throught the slot.
    Qt signal-slots work cross-threads.  So the xmlrpc server could run in its own thread,
    keeping it always responsive.

Cheers,

Erik

Sebastian Stetter

unread,
Sep 20, 2015, 6:06:28 PM9/20/15
to Project Camelot
Thanks for your reply, Erik!
Sonds like it requires a little more tinkering...
I'll post an example code here when I figured it out.

Sebastian
Reply all
Reply to author
Forward
0 new messages