From 21f869ccd0e004752de22a8209e096f4794c41de Mon Sep 17 00:00:00 2001 From: Emanuele Date: Wed, 18 Dec 2019 21:14:44 +0100 Subject: [PATCH] modifica selezione cartelle selezione sorgente e destinazione --- bananaSPLIT/guimain.py | 21 +++++++++++---------- bananaSPLIT/libbananasplit/libconfload.py | 2 -- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/bananaSPLIT/guimain.py b/bananaSPLIT/guimain.py index 16ae630..e08bb0f 100644 --- a/bananaSPLIT/guimain.py +++ b/bananaSPLIT/guimain.py @@ -69,18 +69,12 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): self.logger.debug("Tab Precedente") pass - def openFileDialog(self, name, path): - return PyQt5.QtWidgets.QFileDialog.getExistingDirectory(self,name) - def openLoadPreset(self): self.logger.debug("Apri Carica Preset") - self.logger.debug(str(self.conf.getParam('paths'))) pass def openSavePreset(self): self.logger.debug("Apri Salva Preset") - self.conf.setParam(val="pippo",keys=('paths','INworkPath',)) - self.logger.debug(str(self.conf.getParam('paths'))) pass def openAdvOpt(self): @@ -92,15 +86,22 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow): pass def selezSorg(self): - rv = self.openFileDialog("Seleziona Cartella Sorgente", self.conf.getParam("")) - self.logger.debug("Selezionata Cartella Sorgente: {}".format(rv)) + rv = PyQt5.QtWidgets.QFileDialog.getExistingDirectory(self,"Seleziona Cartella Sorgente",self.conf.getParam('paths','INworkPath')) + if rv is not "": + self.conf.setParam(keys=('paths','INworkPath',), val=rv) + self.logger.debug("Selezionata Cartella Sorgente: {}".format(rv)) pass def selezDest(self): - rv = self.openFileDialog("Seleziona Cartella Destinazione", self.conf.getParam("")) - self.logger.debug("Selezionata Cartella Destinazione: {}".format(rv)) + rv = PyQt5.QtWidgets.QFileDialog.getExistingDirectory(self,"Seleziona Cartella Destinazione",self.conf.getParam('paths','OUTworkPath')) + if rv is not "": + self.conf.setParam(keys=('paths','OUTworkPath',), val=rv) + self.logger.debug("Selezionata Cartella Destinazione: {}".format(rv)) pass + def openFileDialog(self, name, path): + self.log.debug("Apro in directory: {}".format(path)) + return ############################################################# ####################### INTERFACES ########################## diff --git a/bananaSPLIT/libbananasplit/libconfload.py b/bananaSPLIT/libbananasplit/libconfload.py index 7cfd80f..43c3845 100644 --- a/bananaSPLIT/libbananasplit/libconfload.py +++ b/bananaSPLIT/libbananasplit/libconfload.py @@ -4,8 +4,6 @@ Created on 2 nov 2019 @author: Emanuele Trabattoni ''' import json,os,glob,copy -from xml.dom import INUSE_ATTRIBUTE_ERR -from builtins import True class bananaCONF(object): '''