def main_setting_agent(): import wx app = wx.App(redirect=False) # frame = wx.Frame(None, -1, 'agent dialog test') # frame.Show() user_plugin_path = 'Dropbox/Office/myNagara/src/plugin_user' user_plugin_abspath = os.path.join(os.environ['HOME'], user_plugin_path ) setting_dialog = SettingDialog() from core import plugin optimize_model_class = plugin.loadSettingModel( 'optimize', user_plugin_abspath) optimize_model = optimize_model_class() optimize_agent_class = plugin.loadSettingAgent( 'optimize', user_plugin_abspath) optimize_agent = optimize_agent_class(setting_dialog, optimize_model) setting_dialog.setAgent(optimize_agent) setting_dialog.start() print optimize_agent.getModel().dump() app.MainLoop()
def showSettingInDialog(self): # load setting agent to_name = self.model.taskobject_name agent_class = plugin.loadSettingAgent(to_name, ) # create dialog setting_dialog = SettingDialog() agent = agent_class(setting_dialog, self.model.setting) # show dialog setting_dialog.start()
def __getSettingAgent(self): if self.setting_agent is None: to_name = self.model.taskobject_name setting_class = plugin.loadSettingAgent(to_name) else: return self.setting_agent