Exemplo n.º 1
0
    def __init__(self, controller, parent=None):
        self.builder = Gtk.Builder()
        self.builder.add_from_file(os.path.join(ResourcesConfiguration.getStaticResources(),
                                                "ui",
                                                "availablePluginsDialog.glade"))
        self._getObjects(self.builder, ["availablePluginsDialog", "pluginsListStore"])
        self.controller = controller
        self.builder.connect_signals(self.controller)

        # Retrieve the list of available plugins and display it
        availablePlugins = NetzobPlugin.getLoadedPlugins(NetzobPlugin)
        for plugin in availablePlugins:
            # add plugin in the list store
            i = self.pluginsListStore.append()
            self.pluginsListStore.set(i, 0, str(plugin.getName()))
            self.pluginsListStore.set(i, 1, str(plugin.getVersion()))
            self.pluginsListStore.set(i, 2, str(plugin.getDescription()))

        self.availablePluginsDialog.set_transient_for(parent)
Exemplo n.º 2
0
    def __init__(self, controller, parent=None):
        self.builder = Gtk.Builder()
        self.builder.add_from_file(
            os.path.join(ResourcesConfiguration.getStaticResources(), "ui",
                         "availablePluginsDialog.glade"))
        self._getObjects(self.builder,
                         ["availablePluginsDialog", "pluginsListStore"])
        self.controller = controller
        self.builder.connect_signals(self.controller)

        # Retrieve the list of available plugins and display it
        availablePlugins = NetzobPlugin.getLoadedPlugins(NetzobPlugin)
        for plugin in availablePlugins:
            # add plugin in the list store
            i = self.pluginsListStore.append()
            self.pluginsListStore.set(i, 0, str(plugin.getName()))
            self.pluginsListStore.set(i, 1, str(plugin.getVersion()))
            self.pluginsListStore.set(i, 2, str(plugin.getDescription()))

        self.availablePluginsDialog.set_transient_for(parent)
Exemplo n.º 3
0
    def importMessagesFromFile_activate_cb(self, action):
        """Execute all the plugins associated with
        file import."""
        if self.getCurrentProject() is None:
            NetzobErrorMessage(_("No project selected."))
            return

        importerPlugins = NetzobPlugin.getLoadedPlugins(FileImporterPlugin)
        if len(importerPlugins) < 1:
            NetzobErrorMessage(_("No importer plugin available."))
            return

        chooser = ImportFileChooserDialog(importerPlugins)
        res = chooser.run()
        plugin = None
        if res == chooser.RESPONSE_OK:
            (filePathList, plugin) = chooser.getFilenameListAndPlugin()
        chooser.destroy()
        if plugin is not None:
            plugin.setFinish_cb(self.view.updateSymbolList)
            plugin.importFile(filePathList)
Exemplo n.º 4
0
    def importMessagesFromFile_activate_cb(self, action):
        """Execute all the plugins associated with
        file import."""
        if self.getCurrentProject() is None:
            NetzobErrorMessage(_("No project selected."))
            return

        importerPlugins = NetzobPlugin.getLoadedPlugins(FileImporterPlugin)
        if len(importerPlugins) < 1:
            NetzobErrorMessage(_("No importer plugin available."))
            return

        chooser = ImportFileChooserDialog(importerPlugins)
        res = chooser.run()
        plugin = None
        if res == chooser.RESPONSE_OK:
            (filePathList, plugin) = chooser.getFilenameListAndPlugin()
        chooser.destroy()
        if plugin is not None:
            plugin.setFinish_cb(self.view.updateSymbolList)
            plugin.importFile(filePathList)