import QtQuick import QtQuick.Controls import QtQuick.Layouts Item { property alias companyConf: companyConf property alias miscConf: miscConf anchors.fill: parent TabBar { id: bar width: parent.width TabButton { text: qsTr("Benutzer") } TabButton { text: qsTr("Datenbank") } TabButton { text: qsTr("Das Unternehmen") } TabButton { text: qsTr("Sicherung") } TabButton { text: qsTr("Sonstiges") } } StackLayout { id: confContainer anchors.fill: parent currentIndex: bar.currentIndex Item { id: userTab UsersPage { id: usersPage anchors.fill: parent } } Item { id: dbTab DbConfiguration { id: dbConf anchors.fill: parent } } Item { id: companyTab CompanyConf { id: companyConf anchors.fill: parent } } Item { id: backup BackupSettings { id: backupSettings anchors.fill: parent } } Item { id: miscelanea MiscConf { id: miscConf anchors.fill: parent } } } RowLayout { width: parent.width anchors.bottom: parent.bottom Item { Layout.fillWidth: true } Button { text: qsTr("Ablehnen") onClicked: appLoader.source = "Dashboard.qml" } Button { text: qsTr("Speichern") onClicked: { switch (confContainer.currentIndex) { case 1: console.log("Need to update DB paramenters") break case 2: updateCompanyInfo() break case 4: updateMiscConf() break default: console.log("Need to handle users") } } } } function updateCompanyInfo() { var company = {} company['company'] = {} company['company']['NAME'] = companyConf.name.text.trim() company['company']['STREET'] = companyConf.street.text.trim() company['company']['HOUSE'] = companyConf.house.text.trim() company['company']['ZIPCODE'] = companyConf.zipcode.editText? companyConf.zipcode.editText.trim(): companyConf.zipcode.currentText company['company']['CITY'] = companyConf.city.editText? companyConf.city.editText.trim(): companyConf.city.currentText if (company['company']['NAME'] === '' || company['company']['STREET'] === '' || company['company']['HOUSE'] === '' || company['company']['ZIPCODE'] === '' || company['company']['CITY'] === ''); else config.saveCompanyInfo(company) } function updateMiscConf() { var misc = {} misc['misc'] = {} misc['misc']['SYSTRAY'] = miscConf.sysTray.checked config.saveMiscConf(misc) } }