mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-25 05:47:45 +00:00
Move add/remove buttons for profiles and accounts to the header
This commit is contained in:
parent
c8a81af967
commit
7e58b60297
4 changed files with 67 additions and 88 deletions
|
@ -18,6 +18,17 @@ FormCard.FormCardPage {
|
|||
|
||||
title: i18nc("@title:window", "Edit Account")
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Delete Account")
|
||||
tooltip: !enabled ? i18n("Cannot delete the only account.") : ""
|
||||
icon.name: "delete"
|
||||
enabled: LauncherCore.accountManager.canDelete(page.account)
|
||||
|
||||
onTriggered: deletePrompt.open()
|
||||
}
|
||||
]
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18n("General")
|
||||
}
|
||||
|
@ -226,16 +237,6 @@ FormCard.FormCardPage {
|
|||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.fillWidth: true
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18n("Delete Account")
|
||||
description: !enabled ? i18n("Cannot delete the only account.") : ""
|
||||
icon.name: "delete"
|
||||
enabled: LauncherCore.accountManager.canDelete(page.account)
|
||||
|
||||
Kirigami.PromptDialog {
|
||||
id: deletePrompt
|
||||
|
||||
|
@ -249,8 +250,4 @@ FormCard.FormCardPage {
|
|||
page.Window.window.pageStack.layers.pop();
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: deletePrompt.open()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,6 +18,22 @@ FormCard.FormCardPage {
|
|||
|
||||
title: i18nc("@title:window", "Accounts")
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Add Account…")
|
||||
icon.name: "list-add-symbolic"
|
||||
|
||||
Kirigami.Action {
|
||||
text: i18n("Square Enix")
|
||||
onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix"))
|
||||
}
|
||||
Kirigami.Action {
|
||||
text: i18n("Sapphire")
|
||||
onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire"))
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
@ -55,30 +71,4 @@ FormCard.FormCardPage {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addSquareEnixButton
|
||||
|
||||
text: i18n("Add Square Enix Account")
|
||||
icon.name: "list-add-symbolic"
|
||||
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix"))
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: addSquareEnixButton
|
||||
below: addSapphireButton
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addSapphireButton
|
||||
|
||||
text: i18n("Add Sapphire Account")
|
||||
icon.name: "list-add-symbolic"
|
||||
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire"))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,17 @@ FormCard.FormCardPage {
|
|||
|
||||
title: i18nc("@window:title", "Edit Profile")
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Delete Profile")
|
||||
icon.name: "delete"
|
||||
enabled: LauncherCore.profileManager.canDelete(page.profile)
|
||||
tooltip: !enabled ? i18n("Cannot delete the only profile.") : ""
|
||||
|
||||
onTriggered: deletePrompt.open()
|
||||
}
|
||||
]
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18n("General")
|
||||
}
|
||||
|
@ -267,16 +278,6 @@ FormCard.FormCardPage {
|
|||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
Layout.fillWidth: true
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
text: i18n("Delete Profile")
|
||||
description: !enabled ? i18n("Cannot delete the only profile.") : ""
|
||||
icon.name: "delete"
|
||||
enabled: LauncherCore.profileManager.canDelete(page.profile)
|
||||
|
||||
Kirigami.PromptDialog {
|
||||
id: deletePrompt
|
||||
|
||||
|
@ -290,8 +291,4 @@ FormCard.FormCardPage {
|
|||
page.Window.window.pageStack.layers.pop();
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: deletePrompt.open()
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,17 @@ FormCard.FormCardPage {
|
|||
|
||||
title: i18nc("@title:window", "Profiles")
|
||||
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
text: i18n("Add Profile…")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
page.Window.window.close();
|
||||
LauncherCore.currentProfile = LauncherCore.profileManager.addProfile();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
@ -47,20 +58,4 @@ FormCard.FormCardPage {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addProfileButton
|
||||
|
||||
text: i18n("Add Profile")
|
||||
icon.name: "list-add"
|
||||
onClicked: {
|
||||
page.Window.window.close();
|
||||
LauncherCore.currentProfile = LauncherCore.profileManager.addProfile();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue