Exemple #1
0
    def _importWorkspace(self):
        model.api.showPopup(
            "Be careful that importing could overwrite existing files",
            level="Warning")
        wm = self._main_app.getWorkspaceManager()
        mwin = self._main_app.getMainWindow()

        filename = QFileDialog.getOpenFileName(
            "$HOME/.faraday", "Faraday export file  (*.faraday)", None,
            "import file dialog", "Choose a file to import")
        if filename and filename is not None:
            model.api.log("Import function %s/ %s" %
                          (CONF.getPersistencePath(), filename))

            api.importWorskpace("%s/" % CONF.getPersistencePath(), filename)

            wm.loadWorkspaces()
            w = wm.getActiveWorkspace()
            wm.setActiveWorkspace(w)

            mwin.getWorkspaceTreeView().loadAllWorkspaces()
Exemple #2
0
    def _importWorkspace(self):
        model.api.showPopup("Be careful that importing could overwrite existing files", level="Warning")
        wm = self._main_app.getWorkspaceManager()
        mwin = self._main_app.getMainWindow()

        filename =  QFileDialog.getOpenFileName(
                    "$HOME/.faraday",
                    "Faraday export file  (*.faraday)",
                    None,
                    "import file dialog",
                    "Choose a file to import" );
        if filename and filename is not None:
            model.api.log("Import function %s/ %s" % (CONF.getPersistencePath(),filename))



            api.importWorskpace("%s/" % CONF.getPersistencePath(), filename)

            wm.loadWorkspaces()
            w = wm.getActiveWorkspace()
            wm.setActiveWorkspace(w)


            mwin.getWorkspaceTreeView().loadAllWorkspaces()