2023-07-18 11:15:04 +09:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
|
|
import SortFilterProxyModel 0.2
|
|
|
|
|
|
|
|
|
|
import PageEnum 1.0
|
|
|
|
|
import ContainerProps 1.0
|
2024-07-07 13:42:38 +03:00
|
|
|
import Style 1.0
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
import "./"
|
|
|
|
|
import "../Controls2"
|
|
|
|
|
import "../Controls2/TextTypes"
|
|
|
|
|
import "../Config"
|
|
|
|
|
import "../Components"
|
|
|
|
|
|
|
|
|
|
PageType {
|
|
|
|
|
id: root
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: InstallController
|
|
|
|
|
|
|
|
|
|
function onUpdateContainerFinished() {
|
2023-07-31 20:38:13 +09:00
|
|
|
PageController.showNotificationMessage(qsTr("Settings updated successfully"))
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
BackButtonType {
|
|
|
|
|
id: backButton
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.topMargin: 20
|
2025-08-06 04:35:51 +02:00
|
|
|
|
|
|
|
|
onFocusChanged: {
|
|
|
|
|
if (this.activeFocus) {
|
|
|
|
|
listView.positionViewAtBeginning()
|
|
|
|
|
}
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
ListViewType {
|
|
|
|
|
id: listView
|
2023-07-18 11:15:04 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
anchors.top: backButton.bottom
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.left: parent.left
|
2023-07-18 11:15:04 +09:00
|
|
|
|
2025-08-06 04:35:51 +02:00
|
|
|
header: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2023-07-18 11:15:04 +09:00
|
|
|
|
2025-05-02 23:54:36 -07:00
|
|
|
BaseHeaderType {
|
2023-07-18 11:15:04 +09:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
|
|
|
|
|
headerText: qsTr("Tor website settings")
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model: 1 // fake model to force the ListView to be created without a model
|
|
|
|
|
|
|
|
|
|
delegate: ColumnLayout { // TODO(CyAn84): add DelegateChooser after migrate to 6.9
|
|
|
|
|
width: listView.width
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
LabelWithButtonType {
|
2024-04-18 17:54:55 +04:00
|
|
|
id: websiteName
|
2025-08-06 04:35:51 +02:00
|
|
|
|
2023-07-18 11:15:04 +09:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 32
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.bottomMargin: 24
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
text: qsTr("Website address")
|
|
|
|
|
descriptionText: {
|
2024-04-01 20:20:02 +07:00
|
|
|
var containerIndex = ContainersModel.getProcessedContainerIndex()
|
2023-12-08 13:50:03 +07:00
|
|
|
var config = ContainersModel.getContainerConfig(containerIndex)
|
2023-07-18 11:15:04 +09:00
|
|
|
return config[ContainerProps.containerTypeToString(containerIndex)]["site"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
descriptionOnTop: true
|
2024-08-20 16:54:05 +07:00
|
|
|
textColor: AmneziaStyle.color.goldenApricot
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
rightImageSource: "qrc:/images/controls/copy.svg"
|
2024-08-20 16:54:05 +07:00
|
|
|
rightImageColor: AmneziaStyle.color.paleGray
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
clickedFunction: function() {
|
2023-10-14 23:59:46 +01:00
|
|
|
GC.copyToClipBoard(descriptionText)
|
2023-08-16 22:45:05 +05:00
|
|
|
PageController.showNotificationMessage(qsTr("Copied"))
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
}
|
2025-08-06 04:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
footer: ColumnLayout {
|
|
|
|
|
width: listView.width
|
2023-07-18 11:15:04 +09:00
|
|
|
|
|
|
|
|
ParagraphTextType {
|
|
|
|
|
Layout.fillWidth: true
|
2025-08-06 04:35:51 +02:00
|
|
|
Layout.topMargin: 16
|
2023-07-18 11:15:04 +09:00
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
|
|
|
|
|
onLinkActivated: Qt.openUrlExternally(link)
|
|
|
|
|
textFormat: Text.RichText
|
2024-01-30 20:22:26 +02:00
|
|
|
text: qsTr("Use <a href=\"https://www.torproject.org/download/\" style=\"color: #FBB26A;\">Tor Browser</a> to open this URL.")
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ParagraphTextType {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
|
2024-01-30 20:22:26 +02:00
|
|
|
text: qsTr("After creating your onion site, it takes a few minutes for the Tor network to make it available for use.")
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ParagraphTextType {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: 16
|
|
|
|
|
Layout.leftMargin: 16
|
|
|
|
|
Layout.rightMargin: 16
|
|
|
|
|
|
2023-10-14 23:59:46 +01:00
|
|
|
text: qsTr("When configuring WordPress set the this onion address as domain.")
|
2023-07-18 11:15:04 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|