def selfRegister():
    application = ApplicationLocator.getManager()
    i18n = ToolsLocator.getI18nManager()

    icon_show = File(
        gvsig.getResource(__file__, "images",
                          "fieldcalculator16x16.png")).toURI().toURL()

    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.field-calculator-tool", "action",
                              "tools-field-calculator-tool", None, icon_show)

    extension = FieldCalculatorToolExtension()

    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        extension,
        "tools-field-calculator-tool",  # Action name
        i18n.getTranslation("_Field_Calculator_Tool"),  # Text
        "show",  # Action command
        "tools-field-calculator-tool",  # Icon name
        None,  # Accelerator
        501100000,  # Position 
        "_Field_Calculator_Tool"  # Tooltip
    )
    action_show = actionManager.registerAction(action_show)
    application.addMenu(action_show, "Table/_Field_Calculator_Tool")
    application.addTool(
        action_show,
        "table_tools")  #/ )#i18n.getTranslation("_Field_Calculator_Tool"))
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    quickinfo_icon = File(
        gvsig.getResource(__file__, "images",
                          "sentineldownloader.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.sentineldownloader", "action",
                              "tools-sentineldownloader", None, quickinfo_icon)

    reportbypoint_extension = SentinelDownloaderExtension()
    reportbypoint_action = actionManager.createAction(
        reportbypoint_extension,
        "tools-sentineldownloader",  # Action name
        "Sentinel Downloader",  # Text
        "settool-sentineldownloader",  # Action command
        "tools-sentineldownloader",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Sentinel_Downloader")  # Tooltip
    )
    reportbypoint_action = actionManager.registerAction(reportbypoint_action)
    application.addMenu(reportbypoint_action, "tools/_Sentinel_Downloader")
    application.addSelectableTool(reportbypoint_action, "SentinelDownloader")
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            "table-import-fields.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.ImportFieldsExtension", "action",
                              "table-import-fields", None, icon)

    #
    # Creamos la accion
    extension = ImportFieldsExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "table-import-fields",  # Action name
        "_Import_fields",  # Text
        "table-import-fields",  # Action command
        "table-import-fields",  # Icon name
        None,  # Accelerator
        508200000,  # Position 
        "_Show_the_import_fields_dialog"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "Table/_Import_fields")
Exemplo n.º 4
0
def selfRegister():
    application = ApplicationLocator.getManager()
    i18n = ToolsLocator.getI18nManager()

    icon_show = File(gvsig.getResource(__file__, "images",
                                       "snap16x16.png")).toURI().toURL()

    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.quick-snapping-tool", "action",
                              "tools-quick-snapping-tool", None, icon_show)

    extension = QuickSnappingToolExtension()

    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        extension,
        "tools-quick-snapping-tool",  # Action name
        i18n.getTranslation("_Quick_Snapping_Tool"),  # Text
        "show",  # Action command
        "tools-quick-snapping-tool",  # Icon name
        None,  # Accelerator
        1009000000,  # Position 
        "Quick Snapping Tool"  # Tooltip
    )
    action_show = actionManager.registerAction(action_show)
    application.addTool(action_show,
                        i18n.getTranslation("_Quick_Snapping_Tool"))
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    quickinfo_icon = File(
        gvsig.getResource(__file__, "images",
                          "reportbypoint1.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.reportbypoint", "action",
                              "tools-reportbypoint", None, quickinfo_icon)

    reportbypoint_extension = ReportByPointExtension()
    reportbypoint_action = actionManager.createAction(
        reportbypoint_extension,
        "tools-reportbypoint",  # Action name
        "Show report by point",  # Text
        "settool-reportbypoint",  # Action command
        "tools-reportbypoint",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Report_by_point_info")  # Tooltip
    )
    reportbypoint_action = actionManager.registerAction(reportbypoint_action)

    # Añadimos la entrada "Report by point" en el menu herramientas
    application.addMenu(
        reportbypoint_action,
        "tools/" + i18n.getTranslation("_Report_by_point_info"))
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(reportbypoint_action, "ReportByPoint")
Exemplo n.º 6
0
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            "mobile-forms-designer.png")).toURI().toURL()
    print "ICON:", icon
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.MobileFormsExtension", "action",
                              "mobile-forms-designer", None, icon)

    #
    # Creamos la accion
    extension = MobileFormsExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "mobile-forms-designer",  # Action name
        "Mobile forms designer",  # Text
        "mobile-forms-designer",  # Action command
        "mobile-forms-designer",  # Icon name
        None,  # Accelerator
        650151000,  # Position 
        "_Show_mobile_forms_designer"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action,
                        "HMachine/GvSIG Mobile-Geopaparazzi/Forms designer")
Exemplo n.º 7
0
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())
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    cadastralparcelsdownloader_icon = File(
        gvsig.getResource(__file__, "images",
                          "cadastralparcelsdownloader.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.cadastralparcelsdownloader", "action",
                              "tools-cadastralparcelsdownloader", None,
                              cadastralparcelsdownloader_icon)

    cadastralparcelsdownloader_extension = CadastralDownloaderExtension()
    cadastralparcelsdownloader_action = actionManager.createAction(
        cadastralparcelsdownloader_extension,
        "tools-cadastralparcelsdownloader",  # Action name
        "Show cadastral parcels downloader",  # Text
        "settool-cadastralparcelsdownloader",  # Action command
        "tools-cadastralparcelsdownloader",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Show_cadastral_parcels_downloader")  # Tooltip
    )
    cadastralparcelsdownloader_action = actionManager.registerAction(
        cadastralparcelsdownloader_action)

    # Añadimos la entrada "Quickinfo" en el menu herramientas
    application.addMenu(cadastralparcelsdownloader_action,
                        "tools/_cadastralparcelsdownloader")
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(cadastralparcelsdownloader_action,
                                  "CadastralParcelsDownloader")
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos los iconos en el tema de iconos
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    icon = File(getResource(__file__, "images",
                            "dbeaver16x16.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.DBeaverExtension", "action",
                              "dbeaver-launch", None, icon)

    #
    # Creamos la accion
    actionManager = PluginsLocator.getActionInfoManager()
    extension = DBeaverExtension()

    action = actionManager.createAction(
        extension,
        "dbeaver-launch",  # Action name
        "DBeaver",  # Text
        "dbeaver-launch",  # Action command
        "dbeaver-launch",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_DBeaver_database_administrator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "tools/DBeaver")
def selfRegister():
  application = ApplicationLocator.getManager()

  #
  # Registramos las traducciones
  i18n = ToolsLocator.getI18nManager()
  i18n.addResourceFamily("text",File(getResource(__file__,"i18n")))

  #
  # Registramos los iconos en el tema de iconos
  icon = File(getResource(__file__,"images","view-time-add-basic-support-to-datasource.png")).toURI().toURL()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting.addBasicTimeSupportToDatasource", "action", "view-time-add-basic-support-to-datasource", None, icon)

  #
  # Creamos la accion 
  extension = AddBasicTimeSupportToDatasourceExtension()
  actionManager = PluginsLocator.getActionInfoManager()
  action = actionManager.createAction(
    extension, 
    "view-time-add-basic-support-to-datasource", # Action name
    "Add basic support", # Text
    "view-time-add-basic-support-to-datasource", # Action command
    "view-time-add-basic-support-to-datasource", # Icon name
    None, # Accelerator
    650151000, # Position 
    "_Add_basic_time_support_to_vectorial_layer" # Tooltip
  )
  action = actionManager.registerAction(action)
  application.addMenu(action, "View/Time/_Add_basic_time_support")
Exemplo n.º 11
0
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    exportmaptiles_icon = File(
        gvsig.getResource(__file__, "images",
                          "exportmaptiles.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.exportmaptiles", "action",
                              "tools-exportmaptiles", None,
                              exportmaptiles_icon)

    exportmaptiles_extension = ExportMapTilesPanelExtension()
    exportmaptiles_action = actionManager.createAction(
        exportmaptiles_extension,
        "tools-exportmaptiles",  # Action name
        "Export map tiles",  # Text
        "settool-exportmaptiles",  # Action command
        "tools-exportmaptiles",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Export_map_tiles")  # Tooltip
    )
    exportmaptiles_action = actionManager.registerAction(exportmaptiles_action)

    # Añadimos la entrada "Quickinfo" en el menu herramientas
    application.addMenu(exportmaptiles_action, "tools/_ExportMapTiles")
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(exportmaptiles_action, "ExportMapTiles")
Exemplo n.º 12
0
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(
        getResource(__file__, "images",
                    "view-query-coordinate-capture.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.CoordinateCaptureExtension", "action",
                              "view-query-coordinate-capture", None, icon)

    #
    # Creamos la accion
    extension = CoordinateCaptureExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "view-query-coordinate-capture",  # Action name
        "Coordinate capture",  # Text
        "view-query-coordinate-capture",  # Action command
        "view-query-coordinate-capture",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_coordinate_capture"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "View/Query/Coordinate capture")
def selfRegister():
  selfRegisterI18n()
  i18n = ToolsLocator.getI18nManager()
  application = ApplicationLocator.getManager()
  actionManager = PluginsLocator.getActionInfoManager()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

  toolfinder_icon = File(gvsig.getResource(__file__,"images","toolFinder.png")).toURI().toURL()
  iconTheme.registerDefault("scripting.toolfinder", "action", "tools-toolfinder", None, toolfinder_icon) #quickinfo_icon)

  mytool_extension = ToolFinderExtension()
  mytool_action = actionManager.createAction(
    mytool_extension,
    "tools-toolfinder",   # Action name
    "Tool finder",   # Text
    "settool-toolfinder", # Action command
    "tools-toolfinder",   # Icon name
    None,                # Accelerator
    1009000000,          # Position
    i18n.getTranslation("_Tool_finder")    # Tooltip
  )
  mytool_action = actionManager.registerAction(mytool_action)

  # Añadimos la entrada en el menu herramientas
  application.addMenu(mytool_action, "tools/"+i18n.getTranslation("_Tool_finder"))
 def txtCodAccidente_change(self, *args):
   iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
   if self.txtCodAccidente.getText()=="":
     icon = iconTheme.get("accidentcondition-tabtick-disabled")
     self.tabPanel.setIconAt(0, icon)
   else:
     icon = iconTheme.get("accidentcondition-tabtick-enabled")
     self.tabPanel.setIconAt(0, icon)
Exemplo n.º 15
0
 def checkModify(self):
   iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
   if(self.pickerFechaDesde.isEmpty() and
     self.pickerFechaHasta.isEmpty() and
     self.tipoAccidente.getSelectedItem().getValue()==''):
       icon = iconTheme.get("accidentcondition-tabtick-disabled")
       self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
       return False
   else:
       icon = iconTheme.get("accidentcondition-tabtick-enabled")
       self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
       return True
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    moduleId = "sigpac2csv"
    actionName = "tools-sigpac-sigpac2csv"
    tooltip_key = i18n.getTranslation("_Convert_SIGPAC_XML_to_gvSIG_format")
    menu_entry = "tools/SIGPAC/_Convert_XML_to_gvSIG"

    extension = SIGPAC2CSVExtension()

    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            actionName + ".png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting." + moduleId, "action", actionName,
                              None, icon)

    action = actionManager.createAction(
        extension,
        actionName,  # Action name
        tooltip_key,  # Text
        actionName,  # Action command
        actionName,  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation(tooltip_key)  # Tooltip
    )
    action = actionManager.registerAction(action)

    # Añadimos la entrada en el menu herramientas
    application.addMenu(action, menu_entry)
def selfRegister():
  iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
  icon1 = File(getResource(__file__,"imagenes","accidentcondition-tabtick-enabled.png")).toURI().toURL()
  icon2 = File(getResource(__file__,"imagenes","accidentcondition-tabtick-disabled.png")).toURI().toURL()
  icon3 = File(getResource(__file__,"imagenes","search-simplifiedcondition-add-accumulate.png")).toURI().toURL()
  icon4 = File(getResource(__file__,"imagenes","search-simplifiedcondition-clear-accumulate.png")).toURI().toURL()
  icon5 = File(getResource(__file__,"imagenes","search-simplifiedcondition-edit-accumulate.png")).toURI().toURL()
  
  iconTheme.registerDefault("scripting.arena2reader", "action", "accidentcondition-tabtick-enabled", None, icon1)
  iconTheme.registerDefault("scripting.arena2reader", "action", "accidentcondition-tabtick-disabled", None, icon2)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-add-accumulate", None, icon3)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-clear-accumulate", None, icon4)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-edit-accumulate", None, icon5)
def selfRegister():
  i18n = ToolsLocator.getI18nManager()
  moduleId = "SelectTableDuplicates"
  actionName = "selection-table-select-duplicatesnofirst"
  tooltip_key =  i18n.getTranslation("_Select_all_duplicates_except_the_first")
  menu_entry = "Selection/_Select_table_duplicates/_Select_all_duplicates_except_the_first"
  
  extension = SelectTableDuplicatesExtension()

  application = ApplicationLocator.getManager()
  actionManager = PluginsLocator.getActionInfoManager()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

  #
  # Registramos los iconos en el tema de iconos
  icon = File(getResource(__file__,"images",actionName + ".png")).toURI().toURL()
  
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting." + moduleId, "action", actionName, None, icon)

  action = actionManager.createAction(
    extension,
    actionName,    # Action name
    tooltip_key,   # Text
    actionName,    # Action command
    actionName,    # Icon name
    None,          # Accelerator
    300450200,     # Position
    i18n.getTranslation(tooltip_key)    # Tooltip
  )
  action = actionManager.registerAction(action)

  # Añadimos la entrada en el menu herramientas
  application.addMenu(action, menu_entry)
  # Añadimos la accion como un boton en la barra de herramientas.
  #application.addTool(action, "selection")
  application.getMainFrame().addTool(action,"selection","selection-table-duplicates");
  application.refreshMenusAndToolBars()
Exemplo n.º 19
0
def getIconFromLayer(layer):
  global mapContextManager
  global iconTheme
  if layer == None:
    return None
  if isinstance(layer, FLyrDefault) and layer.getTocImageIcon() != None:
      if iconTheme == None:
          iconName = layer.getTocImageIcon()
          iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
          icon = iconTheme.get(iconName)      
          return icon
          
  if isinstance(layer, SingleLayer) and layer.getDataStore()!=None:
    providerName = layer.getDataStore().getProviderName()
    if providerName != None:
      if mapContextManager == None:
        mapContextManager = MapContextLocator.getMapContextManager()
      iconName = mapContextManager.getIconLayer(providerName)
      if iconTheme == None:
        iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
      icon = iconTheme.get(iconName)
      return icon
  return None
Exemplo n.º 20
0
  def checkModify(self):
    iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()

    if (self.categoria.getSelectedItem().getValue() == "" and
        self.peligrosas.isSelected()==False and
        self.mortales.getText()=="" and
        self.graves.getText()=="" and
        self.leves.getText()==""):
          icon = iconTheme.get("accidentcondition-tabtick-disabled")
          self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
          return False
    else:
        icon = iconTheme.get("accidentcondition-tabtick-enabled")
        self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
        return True
def getIconFromLayer(layer):
    global mapContextManager
    global iconTheme
    if layer == None or layer.getDataStore() == None:
        return None
    providerName = layer.getDataStore().getProviderName()
    if providerName != None:
        if mapContextManager == None:
            mapContextManager = MapContextLocator.getMapContextManager()
        iconName = mapContextManager.getIconLayer(providerName)
        if iconTheme == None:
            iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
        icon = iconTheme.get(iconName)
        return icon
    return
Exemplo n.º 22
0
 def checkModify(self):
   iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
   if (self.provincia.getSelectedItem().getValue()=="" and
       self.titularidad.getSelectedItem().getValue()=="" and
       self.carretera.getText()=="" and
       self.pki.getText()=="" and
       self.pkiu.getText()=="" and
       self.pkf.getText()=="" and
       self.pkfu.getText()=="" and
       self.sentido.getSelectedItem().getValue()==""):
         icon = iconTheme.get("accidentcondition-tabtick-disabled")
         self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
         return False
   else:
     icon = iconTheme.get("accidentcondition-tabtick-enabled")
     self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
     return True
Exemplo n.º 23
0
def selfRegister():
    application = ApplicationLocator.getManager()
    icon = File(os.path.join(os.path.dirname(__file__), "icon.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("Games", "action", "Games", None, icon)
    gameExtension = GameExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        gameExtension, 
        "Games", # Action name
        "Games", # Text
        "show", # Action command
        "Games", # Icon name
        None, # Accelerator
        1009100000, # Position 
        "Games" # Tooltip
        )
    action_show = actionManager.registerAction(action_show)
    application.addTool(action_show, "Games")
def registerAction():
    #application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    icon = File(
        getResource(__file__, "images",
                    "arena2-importer-showimporter.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.Arena2ImporterExtension", "action",
                              "arena2-importer-showimporter", None, icon)
    icon = File(
        getResource(__file__, "images",
                    "arena2-importer-showtablecreator.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.Arena2ImporterExtension", "action",
                              "arena2-importer-showtablecreator", None, icon)
    icon = File(
        getResource(__file__, "images",
                    "arena2-importer-showvalidator.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.Arena2ImporterExtension", "action",
                              "arena2-importer-showvalidator", None, icon)
    #
    # Creamos la accion
    actionManager = PluginsLocator.getActionInfoManager()
    extension = Arena2ImporterExtension()

    action = actionManager.createAction(
        extension,
        "arena2-importer-showimporter",  # Action name
        "ARENA2 importardor",  # Text
        "arena2-importer-showimporter",  # Action command
        "arena2-importer-showimporter",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_ARENA2_import_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "arena2-importer-showtablecreator",  # Action name
        "ARENA2 Creador de tablas",  # Text
        "arena2-importer-showtablecreator",  # Action command
        "arena2-importer-showtablecreator",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_ARENA2_tables_creator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "arena2-importer-showvalidator",  # Action name
        "ARENA2 validator",  # Text
        "arena2-importer-showvalidator",  # Action command
        "arena2-importer-showvalidator",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_ARENA2_validator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)
  def initComponents(self):

    swingManager = ToolsSwingLocator.getToolsSwingManager()
    swingManager.translate(self.tabPanel)
    swingManager.translate(self.btnClearAccumulate)
    swingManager.translate(self.btnEditAccumulate)
    swingManager.translate(self.btnAddAccumulate)
    swingManager.translate(self.lblCodAccidente)
    swingManager.translate(self.lblPuede_utilizar_porcentage_como_comodin)
    swingManager.translate(self.lblProvincia)
    swingManager.translate(self.lblTitularidad)
    swingManager.translate(self.lblCarretera)
    swingManager.translate(self.lblPkInicio)
    swingManager.translate(self.lblPkFin)
    swingManager.translate(self.lblSentido)
    swingManager.translate(self.lblFechaDesde)
    swingManager.translate(self.lblFechaHasta)
    swingManager.translate(self.lblTipoAccidente)
    swingManager.translate(self.lblCategoria)
    swingManager.translate(self.lblMortales)
    swingManager.translate(self.lblGraves)
    swingManager.translate(self.lblLeves)

    iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
    icon = iconTheme.get("accidentcondition-tabtick-disabled")
    self.tabPanel.setIconAt(0, icon)
    self.tabPanel.setIconAt(1, icon)
    self.tabPanel.setIconAt(2, icon)
    self.tabPanel.setIconAt(3, icon)

    icon1 = iconTheme.get("search-simplifiedcondition-add-accumulate")
    icon2 = iconTheme.get("search-simplifiedcondition-clear-accumulate")
    icon3 = iconTheme.get("search-simplifiedcondition-edit-accumulate")
    
    self.btnClearAccumulate.setIcon(icon2)
    self.btnEditAccumulate.setIcon(icon3)
    self.btnAddAccumulate.setIcon(icon1)
    
    self.tabControllerCarretera = TabControllerCarretera(
        self.store,
        self.tabPanel,
        self.cboProvincia,
        self.cboTitularidad,
        self.txtCarretera,
        self.txtPkInicio,
        self.txtPkInicioUmbral,
        self.txtPkFin,
        self.txtPkFinUmbral,
        self.cboSentido)

    self.tabControllerFecha = TabControllerFecha(
      self.store,
      self.tabPanel,
      self.txtFechaDesde,
      self.btnFechaDesde,
      self.txtFechaHasta,
      self.btnFechaHasta,
      self.cboTipoAccidente)

    self.tabControllerVictimas = TabControllerVictimas( 
      self.store,
      self.tabPanel,
      self.cboCategoria,
      self.chkPeligrosas,
      self.cboMortalesOperador,
      self.txtMortales,
      self.cboOperator1,
      self.cboGravesOperador,
      self.txtGraves,
      self.cboOperator2,
      self.cboLevesOperador,
      self.txtLeves)
def selfRegister():

    config = AccidentRateConfig()
    config.readConfig()
    if not config.getboolean("ARENA2", "alreadyDisabled"):
        disableArena2()
        config.set("ARENA2", "alreadyDisabled", "false")
        config.writeConfig()

    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    icon = File(
        getResource(__file__, "images",
                    "accidentrate-importer-showimporter.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-importer-showimporter", None, icon)

    icon = File(
        getResource(
            __file__, "images",
            "accidentrate-importer-showtablecreator.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-importer-showtablecreator", None,
                              icon)

    icon = File(
        getResource(
            __file__, "images",
            "accidentrate-closingdate-showdialog.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-closingdate-showdialog", None,
                              icon)

    icon = File(getResource(__file__, "images",
                            "accidentrate-search.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-search", None, icon)

    icon = File(getResource(__file__, "images",
                            "accidentrate-addlayer.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-addlayer", None, icon)

    #
    # Creamos la accion
    actionManager = PluginsLocator.getActionInfoManager()
    extension = AccidentRateExtension()

    action = actionManager.createAction(
        extension,
        "accidentrate-importer-showtablecreator",  # Action name
        "Creador de las tablas de accidentes",  # Text
        "accidentrate-importer-showtablecreator",  # Action command
        "accidentrate-importer-showtablecreator",  # Icon name
        None,  # Accelerator
        1009000901,  # Position 
        "_Show_the_accidents_tables_creator_tool"  # Tooltip
    )

    action = actionManager.registerAction(action)
    application.addMenu(
        action,
        u"_AccidentRate/Administration/Gesti\u00F3n de accidentes/Crear tablas de accidentes"
    )

    action = actionManager.createAction(
        extension,
        "accidentrate-importer-showimporter",  # Action name
        "Importador de accidentes",  # Text
        "accidentrate-importer-showimporter",  # Action command
        "accidentrate-importer-showimporter",  # Icon name
        None,  # Accelerator
        1009000902,  # Position 
        "_Show_the_accidents_import_tool"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(
        action,
        u"_AccidentRate/Administration/Gesti\u00F3n de accidentes/Importador de accidentes"
    )

    action = actionManager.createAction(
        extension,
        "accidentrate-closingdate-showdialog",  # Action name
        "Administrar fecha de cierre",  # Text
        "accidentrate-closingdate-showdialog",  # Action command
        "accidentrate-closingdate-showdialog",  # Icon name
        None,  # Accelerator
        1009000903,  # Position 
        "_Show_the_accidents_closing_date_tool"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(
        action,
        u"_AccidentRate/Administration/Gesti\u00F3n de accidentes/Fecha de cierre"
    )

    action = actionManager.createAction(
        extension,
        "accidentrate-search",  # Action name
        "Busqueda de accidentes",  # Text
        "accidentrate-search",  # Action command
        "accidentrate-search",  # Icon name
        None,  # Accelerator
        1009000100,  # Position 
        "Busqueda de accidentes"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(
        action,
        u"_AccidentRate/Gesti\u00F3n de accidentes/Busqueda de accidentes")

    action = actionManager.createAction(
        extension,
        "accidentrate-addlayer",  # Action name
        "Añadir capa de accidentes",  # Text
        "accidentrate-addlayer",  # Action command
        "accidentrate-addlayer",  # Icon name
        None,  # Accelerator
        1009000200,  # Position 
        "Añadir capa de accidentes"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(
        action,
        u"_AccidentRate/Gesti\u00F3n de accidentes/A\u00F1adir capa de accidentes"
    )
Exemplo n.º 27
0
def registerActions():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    icon = File(
        getResource(__file__, "images",
                    "accidentrate-importer-showimporter.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-importer-showimporter", None, icon)

    icon = File(
        getResource(
            __file__, "images",
            "accidentrate-importer-showtablecreator.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-importer-showtablecreator", None,
                              icon)

    icon = File(
        getResource(
            __file__, "images",
            "accidentrate-closingdate-showdialog.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-closingdate-showdialog", None,
                              icon)

    icon = File(getResource(__file__, "images",
                            "accidentrate-search.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-search", None, icon)

    icon = File(getResource(__file__, "images",
                            "accidentrate-addlayer.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-addlayer", None, icon)

    icon = File(
        getResource(__file__, "images",
                    "arena2-importer-showvalidator.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.AccidentRateExtension", "action",
                              "accidentrate-importer-showvalidator", None,
                              icon)
    #
    # Creamos la accion
    actionManager = PluginsLocator.getActionInfoManager()
    extension = AccidentRateExtension()

    action = actionManager.createAction(
        extension,
        "accidentrate-importer-showtablecreator",  # Action name
        "Creador de las tablas de accidentes",  # Text
        "accidentrate-importer-showtablecreator",  # Action command
        "accidentrate-importer-showtablecreator",  # Icon name
        None,  # Accelerator
        1009000901,  # Position 
        "_Show_the_accidents_tables_creator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "accidentrate-importer-showimporter",  # Action name
        "Importador de accidentes",  # Text
        "accidentrate-importer-showimporter",  # Action command
        "accidentrate-importer-showimporter",  # Icon name
        None,  # Accelerator
        1009000902,  # Position 
        "_Show_the_accidents_import_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "accidentrate-closingdate-showdialog",  # Action name
        "Administrar fecha de cierre",  # Text
        "accidentrate-closingdate-showdialog",  # Action command
        "accidentrate-closingdate-showdialog",  # Icon name
        None,  # Accelerator
        1009000903,  # Position 
        "_Show_the_accidents_closing_date_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "accidentrate-search",  # Action name
        "Busqueda de accidentes",  # Text
        "accidentrate-search",  # Action command
        "accidentrate-search",  # Icon name
        None,  # Accelerator
        1009000100,  # Position 
        "Busqueda de accidentes"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "accidentrate-addlayer",  # Action name
        "Añadir capa de accidentes",  # Text
        "accidentrate-addlayer",  # Action command
        "accidentrate-addlayer",  # Icon name
        None,  # Accelerator
        1009000200,  # Position 
        "Añadir capa de accidentes"  # Tooltip
    )
    action = actionManager.registerAction(action, True)

    action = actionManager.createAction(
        extension,
        "accidentrate-importer-showvalidator",  # Action name
        "ARENA2 validator",  # Text
        "accidentrate-importer-showvalidator",  # Action command
        "accidentrate-importer-showvalidator",  # Icon name
        None,  # Accelerator
        1009000904,  # Position 
        "_Show_the_ARENA2_validator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action, True)
Exemplo n.º 28
0
def getIconByName(iconName):
  global iconTheme
  if iconTheme == None:
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  icon = iconTheme.get(iconName)
  return icon