コード例 #1
0
ファイル: testplayerextension.py プロジェクト: nacho0605/GSoC
def selfRegister():
  test = TestPlayer()
  
  application = ApplicationLocator.getManager()

  icon = File(os.path.join(os.path.dirname(__file__),"testdata", "testplayer.png")).toURI().toURL()
  
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting.test-" + test.getId(), "action", "tools-test-" + test.getId(), None, icon)
  
  extension = TestExtension()
  actionManager = PluginsLocator.getActionInfoManager()
  action_show = actionManager.createAction(
    extension, 
    "tools-test-" + test.getId(), # Action name
    test.getName(), # Text
    "show", # Action command
    "tools-test-" + test.getId(), # Icon name
    None, # Accelerator
    1009100000, # Position 
    "TestPlayer-" + test.getId() # Tooltip
  )
  action_show = actionManager.registerAction(action_show)
  
  application.addMenu(action_show, "File/TestPlayer/Tests/" + test.getId())
  application.addTool(action_show, test.getId())