Add settings button on PageStart
Disable some items when no Server has been set
This commit is contained in:
parent
ab39802512
commit
e6a4d79b86
4 changed files with 22 additions and 1 deletions
|
@ -13,6 +13,7 @@ GeneralSettingsLogic::GeneralSettingsLogic(UiLogic *logic, QObject *parent):
|
|||
void GeneralSettingsLogic::onUpdatePage()
|
||||
{
|
||||
uiLogic()->selectedServerIndex = m_settings->defaultServerIndex();
|
||||
set_existsAnyServer(uiLogic()->selectedServerIndex >= 0);
|
||||
uiLogic()->selectedDockerContainer = m_settings->defaultContainer(m_settings->defaultServerIndex());
|
||||
|
||||
set_pushButtonGeneralSettingsShareConnectionEnable(m_settings->haveAuthData(m_settings->defaultServerIndex()));
|
||||
|
|
|
@ -10,6 +10,7 @@ class GeneralSettingsLogic : public PageLogicBase
|
|||
Q_OBJECT
|
||||
|
||||
AUTO_PROPERTY(bool, pushButtonGeneralSettingsShareConnectionEnable)
|
||||
AUTO_PROPERTY(bool, existsAnyServer)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void onUpdatePage() override;
|
||||
|
|
|
@ -85,6 +85,7 @@ PageBase {
|
|||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/vpn_key_black_24dp.svg"
|
||||
text: qsTr("Server Settings")
|
||||
enabled: GeneralSettingsLogic.existsAnyServer
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
}
|
||||
|
@ -101,7 +102,8 @@ PageBase {
|
|||
Layout.preferredHeight: 30
|
||||
icon.source: "qrc:/images/svg/share_black_24dp.svg"
|
||||
text: qsTr("Share connection")
|
||||
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable
|
||||
enabled: GeneralSettingsLogic.pushButtonGeneralSettingsShareConnectionEnable &&
|
||||
GeneralSettingsLogic.existsAnyServer
|
||||
onClicked: {
|
||||
GeneralSettingsLogic.onPushButtonGeneralSettingsShareConnectionClicked()
|
||||
}
|
||||
|
|
|
@ -15,6 +15,23 @@ PageBase {
|
|||
visible: pageLoader.depth > 1
|
||||
}
|
||||
|
||||
ImageButtonType {
|
||||
anchors {
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
width: 41
|
||||
height: 41
|
||||
imgMarginHover: 8
|
||||
imgMargin: 9
|
||||
icon.source: "qrc:/images/settings_grey.png"
|
||||
visible: !GeneralSettingsLogic.existsAnyServer
|
||||
onClicked: {
|
||||
UiLogic.goToPage(PageEnum.GeneralSettings)
|
||||
}
|
||||
}
|
||||
|
||||
Caption {
|
||||
id: caption
|
||||
text: start_switch_page.checked ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue