COnfiguration and systray
This commit is contained in:
52
Gui/main.qml
52
Gui/main.qml
@@ -62,19 +62,6 @@ ApplicationWindow
|
||||
property alias window: appWindow
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
if(bad_config)
|
||||
{
|
||||
importDialog.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (db_con) appLoader.source= "LoginScreen.qml"
|
||||
else appLoader.source= "NoDbConnection.qml"
|
||||
}
|
||||
}
|
||||
|
||||
Dialog
|
||||
{
|
||||
id: importDialog
|
||||
@@ -127,4 +114,43 @@ ApplicationWindow
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
systray.activated.connect(showWindow)
|
||||
if(bad_config)
|
||||
{
|
||||
importDialog.open()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (db_con) appLoader.source= "LoginScreen.qml"
|
||||
else appLoader.source= "NoDbConnection.qml"
|
||||
}
|
||||
}
|
||||
|
||||
function showWindow(why)
|
||||
{
|
||||
if (why === 3)
|
||||
{
|
||||
systray.setVisible(false)
|
||||
appWindow.show()
|
||||
}
|
||||
}
|
||||
onVisibilityChanged:
|
||||
{
|
||||
if (appWindow.visibility === Window.Minimized && config.systray())
|
||||
{
|
||||
systray.setVisible(true)
|
||||
appWindow.hide()
|
||||
}
|
||||
}
|
||||
|
||||
onClosing: (close) =>
|
||||
{
|
||||
if (false)
|
||||
{
|
||||
console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user