Skip to content

Commit

Permalink
updated visible logic of button 'set up later'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronoaer committed Oct 1, 2023
1 parent ed1afa7 commit 784ae0d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
12 changes: 12 additions & 0 deletions client/ui/controllers/pageController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ PageController::PageController(const QSharedPointer<ServersModel> &serversModel,
connect(this, &PageController::raiseMainWindow, []() { setDockIconVisible(true); });
connect(this, &PageController::hideMainWindow, []() { setDockIconVisible(false); });
#endif

m_bConnectTrigger = false;
}

QString PageController::getInitialPage()
Expand Down Expand Up @@ -145,3 +147,13 @@ void PageController::drawerClose()
m_drawerLayer = 0;
}
}

bool PageController::isConnectTrigger()
{
return m_bConnectTrigger;
}

void PageController::setConnectTrigger(bool trigger)
{
m_bConnectTrigger = trigger;
}
6 changes: 6 additions & 0 deletions client/ui/controllers/pageController.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ public slots:
void drawerOpen();
void drawerClose();


bool isConnectTrigger();
void setConnectTrigger(bool trigger);

signals:
void goToPage(PageLoader::PageEnum page, bool slide = true);
void goToStartPage();
Expand Down Expand Up @@ -120,6 +124,8 @@ public slots:

PageLoader::PageEnum m_currentRootPage;
int m_drawerLayer;

bool m_bConnectTrigger;
};

#endif // PAGECONTROLLER_H
2 changes: 2 additions & 0 deletions client/ui/qml/Components/ConnectButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ Button {

onClicked: {
if (!ContainersModel.isAnyContainerInstalled()) {
PageController.setConnectTrigger(true)

ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex()
PageController.goToPage(PageEnum.PageSetupWizardEasy)

Expand Down
11 changes: 10 additions & 1 deletion client/ui/qml/Pages2/PageSetupWizardEasy.qml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,16 @@ PageType {
textColor: "#D7D8DB"
borderWidth: 1

visible: ContainersModel.isAnyContainerInstalled()
visible: {
if (PageController.isConnectTrigger()) {
PageController.setConnectTrigger(false)

return ContainersModel.isAnyContainerInstalled()
}


return true
}

text: qsTr("Set up later")

Expand Down

0 comments on commit 784ae0d

Please sign in to comment.