permane il bug per cui dalle avanzate titolo non posso salvare

potrebbe essere il fatto che passa la classe di configurazione non per
puntatore ma per copia
This commit is contained in:
2020-03-08 16:10:43 +01:00
parent 3f3875faf3
commit 09f86c94be
3 changed files with 18 additions and 18 deletions

View File

@@ -3,4 +3,5 @@ encoding//bananaSPLIT/UserInterface/compiledUI/avanzatetitolo.py=utf-8
encoding//bananaSPLIT/UserInterface/compiledUI/avanzatetitolo3.py=utf-8 encoding//bananaSPLIT/UserInterface/compiledUI/avanzatetitolo3.py=utf-8
encoding//bananaSPLIT/UserInterface/compiledUI/mainwindow.py=utf-8 encoding//bananaSPLIT/UserInterface/compiledUI/mainwindow.py=utf-8
encoding//bananaSPLIT/UserInterface/compiledUI/opzioniavanzate.py=utf-8 encoding//bananaSPLIT/UserInterface/compiledUI/opzioniavanzate.py=utf-8
encoding//bananaSPLIT/UserInterface/compiledUI/selezout.py=utf-8
encoding//bananaSPLIT/UserInterface/compiledUI/titolow.py=utf-8 encoding//bananaSPLIT/UserInterface/compiledUI/titolow.py=utf-8

View File

@@ -6,8 +6,6 @@
"INworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles", "INworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles",
"OUTworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles", "OUTworkPath": "D:/Emanuele/Documenti/workspace/bananaSPLIT/TestFiles",
"fileList": [ "fileList": [
".",
"..",
"GUARDIAN 1993.txt", "GUARDIAN 1993.txt",
"GUARDIAN 1996.txt", "GUARDIAN 1996.txt",
"GUARDIAN 1999.txt", "GUARDIAN 1999.txt",
@@ -34,19 +32,19 @@
"language": "scelto da languageconf.json", "language": "scelto da languageconf.json",
"docSep": "\\s*Copyright [(0-9)]+", "docSep": "\\s*Copyright [(0-9)]+",
"dateFormat": "{month} {day:d}, {year:d}{}", "dateFormat": "{month} {day:d}, {year:d}{}",
"outPrefix": "123", "outPrefix": "p",
"outSuffix": "456", "outSuffix": "s",
"outDateType": "jpn", "outDateType": "jpn",
"outNameFormat": "", "outNameFormat": "",
"outDate": true, "outDate": true,
"outNumber": true, "outTitle": true,
"outTitle": false, "outNumber": false,
"numberPos": 1, "numberPos": 1,
"datePos": 2, "datePos": 2,
"titlePos": 3, "titlePos": 3,
"maxTitleLen": 6, "maxTitleLen": 12,
"outNameSep": "_", "outNameSep": ",",
"customSep": "~", "customSep": "=",
"dateFormats": { "dateFormats": {
"jpn": "{year:04d}{month:02d}{day:02d}", "jpn": "{year:04d}{month:02d}{day:02d}",
"it": "{day:02d}{month:02d}{year:04d}", "it": "{day:02d}{month:02d}{year:04d}",

View File

@@ -20,6 +20,7 @@ from libconfload import bananaCONF
from libsplit import bananaSPLITTER from libsplit import bananaSPLITTER
from PyQt5.QtCore import QDir from PyQt5.QtCore import QDir
import copy
class bananaMain(PyQt5.QtWidgets.QMainWindow): class bananaMain(PyQt5.QtWidgets.QMainWindow):
def __init__(self): def __init__(self):
@@ -30,7 +31,6 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
self.conf.open() self.conf.open()
self.conf.use("defaults.json") self.conf.use("defaults.json")
self.conf.use(self.conf.getParam('paths', 'lastUsed')) self.conf.use(self.conf.getParam('paths', 'lastUsed'))
print(self.conf.inUse)
except: except:
sys.exit() sys.exit()
@@ -86,7 +86,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
self.advopt.fillInterface() self.advopt.fillInterface()
def fillFileList(self): def fillFileList(self):
fl = QDir(self.conf.getParam('paths','INworkPath')).entryList() fl = QDir(self.conf.getParam('paths','INworkPath')).entryList(QDir.NoDotAndDotDot | QDir.Files)
self.ui.lst_files.clear() self.ui.lst_files.clear()
for f in fl: for f in fl:
self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f)) self.ui.lst_files.addItem(PyQt5.QtWidgets.QListWidgetItem(f))
@@ -103,8 +103,6 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
pass pass
def openLoadPreset(self): def openLoadPreset(self):
self.logger.debug("Forzo applica a tutte le tab")
self.applica()
self.logger.debug("Apri Carica Preset") self.logger.debug("Apri Carica Preset")
lf = PyQt5.QtWidgets.QFileDialog(self,"Carica Preset",self.conf.getParam('paths', 'configurationPath')) lf = PyQt5.QtWidgets.QFileDialog(self,"Carica Preset",self.conf.getParam('paths', 'configurationPath'))
lf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptOpen) lf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptOpen)
@@ -115,13 +113,14 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
self.logger.debug("Scelto il File: {}".format(cf)) self.logger.debug("Scelto il File: {}".format(cf))
self.conf.open() self.conf.open()
self.conf.use(cf) self.conf.use(cf)
self.logger.debug("Riempio tutte le tab")
self.fillAllInterfaces() self.fillAllInterfaces()
pass pass
def openSavePreset(self): def openSavePreset(self):
self.logger.debug("Apri Salva Preset") self.logger.debug("Apri Salva Preset")
self.logger.debug("Forzo applica a tutte le tab") self.logger.debug("Forzo applica a tutte le tab")
self.applica() self.applicaTutto()
sf = PyQt5.QtWidgets.QFileDialog(self,"Salva Preset",self.conf.getParam('paths', 'configurationPath')) sf = PyQt5.QtWidgets.QFileDialog(self,"Salva Preset",self.conf.getParam('paths', 'configurationPath'))
sf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptSave) sf.setAcceptMode(PyQt5.QtWidgets.QFileDialog.AcceptSave)
sf.setNameFilter("bananaCONF (*.json)") sf.setNameFilter("bananaCONF (*.json)")
@@ -161,7 +160,7 @@ class bananaMain(PyQt5.QtWidgets.QMainWindow):
self.log.debug("Apro in directory: {}".format(path)) self.log.debug("Apro in directory: {}".format(path))
return return
def applica(self): def applicaTutto(self):
self.titolo.applica() self.titolo.applica()
self.titoloav.applica() self.titoloav.applica()
self.selezout.applica() self.selezout.applica()
@@ -233,7 +232,7 @@ class bananaTitolo(PyQt5.QtWidgets.QWidget):
for itmn in range(self.titoloui.lyt_sep.count()): for itmn in range(self.titoloui.lyt_sep.count()):
itm=self.titoloui.lyt_sep.itemAt(itmn).widget() itm=self.titoloui.lyt_sep.itemAt(itmn).widget()
if isinstance(itm, PyQt5.QtWidgets.QRadioButton): if isinstance(itm, PyQt5.QtWidgets.QRadioButton):
if len(itm.text())==1 and itm.isChecked: if len(itm.text())==1 and itm.isChecked():
self.conf.setParam(('docStruct', 'outNameSep'), itm.text()) self.conf.setParam(('docStruct', 'outNameSep'), itm.text())
pass pass
@@ -330,6 +329,8 @@ class bananaTitoloAvanzate(PyQt5.QtWidgets.QWidget):
def returnOk(self): def returnOk(self):
self.log.debug("Avanzate Titolo Accettate") self.log.debug("Avanzate Titolo Accettate")
self.applica() self.applica()
print(self.conf.getParam('docStruct','outPrefix'))
print(self.conf.getParam('docStruct','outSuffix'))
self.hide() self.hide()
pass pass
@@ -367,8 +368,8 @@ class bananaTitoloAvanzate(PyQt5.QtWidgets.QWidget):
else: else:
self.conf.setParam(('docStruct', 'titlePos'), -1) self.conf.setParam(('docStruct', 'titlePos'), -1)
#prefisso e suffisso #prefisso e suffisso
self.conf.setParam(('docStruct', 'outPrefix'), self.titoloavui.txt_prefisso.text()) self.conf.setParam(('docStruct','outPrefix'), self.titoloavui.txt_prefisso.text())
self.conf.setParam(('docStruct', 'outSuffix'), self.titoloavui.txt_suffisso.text()) self.conf.setParam(('docStruct','outSuffix'), self.titoloavui.txt_suffisso.text())
class bananaSelezOut(PyQt5.QtWidgets.QWidget): class bananaSelezOut(PyQt5.QtWidgets.QWidget):