Disable Servers settings item when no server has been set
Fix the logic of *Add Server* to comeback to start page instead of push when no server is set
This commit is contained in:
parent
c38e47b726
commit
4ba1f47423
1 changed files with 7 additions and 1 deletions
|
@ -120,6 +120,7 @@ PageBase {
|
|||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/format_list_bulleted_black_24dp.svg"
|
||||
text: qsTr("Servers")
|
||||
enabled: GeneralSettingsLogic.existsAnyServer
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.ServersList)
|
||||
}
|
||||
|
@ -137,7 +138,12 @@ PageBase {
|
|||
icon.source: "qrc:/images/svg/control_point_black_24dp.svg"
|
||||
text: qsTr("Add server")
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
if(GeneralSettingsLogic.existsAnyServer)
|
||||
// If there is any server set we will go to Start Page
|
||||
UiLogic.goToPage(PageEnum.Start)
|
||||
else
|
||||
// Else just come back to start page
|
||||
UiLogic.closePage()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue