cose con i file di configurazione, non funziona bene la scrittura
This commit is contained in:
@@ -21,6 +21,7 @@ from libsplit import bananaSPLITTER
|
||||
|
||||
from PyQt5.QtCore import QDir,pyqtSignal
|
||||
from slugify import slugify
|
||||
|
||||
class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
def __init__(self):
|
||||
PyQt5.QtWidgets.QMainWindow.__init__(self)
|
||||
@@ -65,7 +66,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
self.ui.actionSalva_Preset.triggered.connect(self.openSavePreset)
|
||||
|
||||
#riempi pagine di interfaccia
|
||||
self.fillInterface()
|
||||
self.fillAllInterfaces()
|
||||
pass
|
||||
|
||||
def fillInterface(self):
|
||||
@@ -75,6 +76,13 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
self.ui.lbl_dest.setText(self.conf.getParam('paths','OUTworkPath'))
|
||||
except:
|
||||
self.log.critical("MainWindow: Configurazione non accettata")
|
||||
|
||||
def fillAllInterfaces(self):
|
||||
self.fillInterface()
|
||||
self.titolo.fillInterface()
|
||||
self.titoloav.fillInterface()
|
||||
self.selezout.fillInterface()
|
||||
self.advopt.fillInterface()
|
||||
|
||||
def nextTab(self):
|
||||
self.ui.wgt_main.setCurrentIndex(self.ui.wgt_main.currentIndex()+1)
|
||||
@@ -93,7 +101,11 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
lf.setFileMode(PyQt5.QtWidgets.QFileDialog.ExistingFile)
|
||||
lf.setNameFilter("bananaCONF (*.json)")
|
||||
if lf.exec():
|
||||
self.logger.debug("Scelto il File: {}".format(next(lf.selectedFiles())))
|
||||
cf = str(lf.selectedFiles()[0].split('/')[-1])
|
||||
self.logger.debug("Scelto il File: {}".format(cf))
|
||||
self.conf.open()
|
||||
self.conf.use(cf)
|
||||
self.fillAllInterfaces()
|
||||
pass
|
||||
|
||||
def openSavePreset(self):
|
||||
@@ -103,6 +115,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
|
||||
sf.setNameFilter("bananaCONF (*.json)")
|
||||
if sf.exec():
|
||||
rv=str(sf.selectedFiles()[0])
|
||||
self.conf.setParam(('paths','lastUsed'),rv)
|
||||
self.logger.debug("Scrivi il File: {}".format(rv))
|
||||
self.conf.save(fName=rv)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user