COnfiguration and systray
This commit is contained in:
@@ -4,6 +4,8 @@ import QtQuick.Layouts
|
||||
|
||||
Item
|
||||
{
|
||||
property alias companyConf: companyConf
|
||||
property alias miscConf: miscConf
|
||||
anchors.fill: parent
|
||||
TabBar
|
||||
{
|
||||
@@ -27,6 +29,10 @@ Item
|
||||
text: qsTr("Sicherung")
|
||||
}
|
||||
|
||||
TabButton
|
||||
{
|
||||
text: qsTr("Sonstiges")
|
||||
}
|
||||
}
|
||||
|
||||
StackLayout
|
||||
@@ -72,6 +78,15 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: miscelanea
|
||||
MiscConf
|
||||
{
|
||||
id: miscConf
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
@@ -101,7 +116,10 @@ Item
|
||||
break
|
||||
|
||||
case 2:
|
||||
console.log("Need to update company's info.")
|
||||
updateCompanyInfo()
|
||||
break
|
||||
case 4:
|
||||
updateMiscConf()
|
||||
break
|
||||
default:
|
||||
console.log("Need to handle users")
|
||||
@@ -109,4 +127,28 @@ Item
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user