-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add notification for add to steam to clarify that it also works on ex…
…isting shortcuts to get the official artwork + controller layout + give option to remind me later for remote play setup question
- Loading branch information
Showing
10 changed files
with
210 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
import QtQuick | ||
import QtQuick.Layouts | ||
import QtQuick.Controls | ||
import QtQuick.Controls.Material | ||
import "controls" as C | ||
|
||
import org.streetpea.chiaking | ||
|
||
Dialog { | ||
id: dialog | ||
property alias text: label.text | ||
property var remotePlay | ||
property var callback | ||
property bool newDialogOpen: false | ||
property Item restoreFocusItem | ||
parent: Overlay.overlay | ||
x: Math.round((root.width - width) / 2) | ||
y: Math.round((root.height - height) / 2) | ||
modal: true | ||
Material.roundedScale: Material.MediumScale | ||
onOpened: label.forceActiveFocus(Qt.TabFocusReason) | ||
onAccepted: { | ||
newDialogOpen = true; | ||
restoreFocus(); | ||
callback(); | ||
} | ||
onRejected: { | ||
if(dialog.remotePlay) | ||
Chiaki.settings.remotePlayAsk = false; | ||
else | ||
Chiaki.settings.addSteamShortcutAsk = false; | ||
} | ||
onClosed: { | ||
if(newDialogOpen) | ||
return; | ||
restoreFocus(); | ||
if(!remotePlay && Chiaki.settings.remotePlayAsk) | ||
{ | ||
if(!Chiaki.settings.psnRefreshToken || !Chiaki.settings.psnAuthToken || !Chiaki.settings.psnAuthTokenExpiry || !Chiaki.settings.psnAccountId) | ||
root.showRemindDialog(qsTr("Remote Play via PSN"), qsTr("Would you like to connect to PSN to play outside of your home network without port forwarding?") + "\n\n" + qsTr("(Note: If you select no now and want to do this later, go to the Config section of the settings.)"), true, () => root.showPSNTokenDialog(false)); | ||
else | ||
Chiaki.settings.remotePlayAsk = false; | ||
} | ||
} | ||
|
||
function restoreFocus() { | ||
if (restoreFocusItem) | ||
restoreFocusItem.forceActiveFocus(Qt.TabFocusReason); | ||
label.focus = false; | ||
} | ||
|
||
Component.onCompleted: { | ||
header.horizontalAlignment = Text.AlignHCenter; | ||
// Qt 6.6: Workaround dialog background becoming immediately transparent during close animation | ||
header.background = null; | ||
} | ||
|
||
ColumnLayout { | ||
spacing: 20 | ||
|
||
Label { | ||
id: label | ||
Keys.onEscapePressed: dialog.reject() | ||
Keys.onReturnPressed: dialog.accept() | ||
Keys.onYesPressed: dialog.close() | ||
} | ||
|
||
RowLayout { | ||
Layout.alignment: Qt.AlignCenter | ||
spacing: 20 | ||
|
||
Button { | ||
text: qsTr("Yes") | ||
Material.background: Material.accent | ||
flat: true | ||
leftPadding: 50 | ||
onClicked: dialog.accept() | ||
Material.roundedScale: Material.SmallScale | ||
|
||
Image { | ||
anchors { | ||
left: parent.left | ||
verticalCenter: parent.verticalCenter | ||
leftMargin: 12 | ||
} | ||
width: 28 | ||
height: 28 | ||
sourceSize: Qt.size(width, height) | ||
source: root.controllerButton("cross") | ||
} | ||
} | ||
|
||
Button { | ||
Material.background: Material.accent | ||
text: qsTr("No") | ||
flat: true | ||
leftPadding: 50 | ||
onClicked: dialog.reject() | ||
Material.roundedScale: Material.SmallScale | ||
|
||
Image { | ||
anchors { | ||
left: parent.left | ||
verticalCenter: parent.verticalCenter | ||
leftMargin: 12 | ||
} | ||
width: 28 | ||
height: 28 | ||
sourceSize: Qt.size(width, height) | ||
source: root.controllerButton("moon") | ||
} | ||
} | ||
|
||
Button { | ||
Material.background: Material.accent | ||
text: qsTr("Remind Me Later") | ||
flat: true | ||
leftPadding: 50 | ||
onClicked: dialog.close() | ||
Material.roundedScale: Material.SmallScale | ||
|
||
Image { | ||
anchors { | ||
left: parent.left | ||
verticalCenter: parent.verticalCenter | ||
leftMargin: 12 | ||
} | ||
width: 28 | ||
height: 28 | ||
sourceSize: Qt.size(width, height) | ||
source: root.controllerButton("pyramid") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters