PropertiesDlg changed: retrieve additional information about the user, use QSettings to store the derived parameters
This commit is contained in:
parent
3fe1e3906e
commit
9d1a78222e
@ -31,7 +31,8 @@ from PySide.QtGui import (QAction,
|
||||
QToolBar,
|
||||
QVBoxLayout,
|
||||
QWidget)
|
||||
from PySide.QtCore import (Qt,
|
||||
from PySide.QtCore import (QSettings,
|
||||
Qt,
|
||||
QUrl,
|
||||
SIGNAL,
|
||||
SLOT)
|
||||
@ -72,17 +73,17 @@ class PropertiesDlg(QDialog):
|
||||
|
||||
self.setWindowTitle("{0} Properties".format(appName))
|
||||
|
||||
tabWidget = QTabWidget()
|
||||
tabWidget.addTab(InputsTab(self), "Inputs")
|
||||
tabWidget.addTab(OutputsTab(self), "Outputs")
|
||||
tabWidget.addTab(PhasesTab(self), "Phases")
|
||||
tabWidget.addTab(GraphicsTab(self), "Graphics")
|
||||
self.tabWidget = QTabWidget()
|
||||
self.tabWidget.addTab(InputsTab(self), "Inputs")
|
||||
self.tabWidget.addTab(OutputsTab(self), "Outputs")
|
||||
self.tabWidget.addTab(PhasesTab(self), "Phases")
|
||||
self.tabWidget.addTab(GraphicsTab(self), "Graphics")
|
||||
self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok |
|
||||
QDialogButtonBox.Apply |
|
||||
QDialogButtonBox.Close)
|
||||
|
||||
layout = QVBoxLayout()
|
||||
layout.addWidget(tabWidget)
|
||||
layout.addWidget(self.tabWidget)
|
||||
layout.addWidget(self.buttonBox)
|
||||
self.setLayout(layout)
|
||||
|
||||
@ -92,23 +93,40 @@ class PropertiesDlg(QDialog):
|
||||
SIGNAL("clicked()"), self.apply)
|
||||
self.connect(self.buttonBox, SIGNAL("rejected()"),
|
||||
self, SLOT("reject()"))
|
||||
pass
|
||||
|
||||
def apply(self):
|
||||
pass
|
||||
settings = QSettings()
|
||||
for widint in range(self.tabWidget.count()):
|
||||
curwid = self.tabWidget.widget(widint)
|
||||
values = self.getValues(curwid)
|
||||
settings.setValue()
|
||||
|
||||
|
||||
class InputsTab(QWidget):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
def __init__(self, parent):
|
||||
super(InputsTab, self).__init__(parent)
|
||||
|
||||
settings = QSettings()
|
||||
fulluser = settings.value("user/FullName")
|
||||
login = settings.value("user/Login")
|
||||
|
||||
fullNameLabel = QLabel("Full name for user '{0}'".format(login))
|
||||
|
||||
parent.fullNameEdit = QLineEdit()
|
||||
parent.fullNameEdit.setText(fulluser)
|
||||
|
||||
dataroot = settings.value("data/dataRoot")
|
||||
dataDirLabel = QLabel("data directory:")
|
||||
dataDirEdit = QLineEdit()
|
||||
parent.dataDirEdit = QLineEdit()
|
||||
parent.dataDirEdit.setText(dataroot)
|
||||
parent.dataDirEdit.selectAll()
|
||||
|
||||
layout = QGridLayout()
|
||||
layout.addWidget(dataDirLabel, 0, 0)
|
||||
layout.addWidget(dataDirEdit, 0, 1)
|
||||
layout.addWidget(parent.dataDirEdit, 0, 1)
|
||||
layout.addWidget(fullNameLabel, 1, 0)
|
||||
layout.addWidget(parent.fullNameEdit, 1, 1)
|
||||
|
||||
self.setLayout(layout)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user