Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions src/app/global/local_account_sensitive_settings.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ const LSS_KEY_ACTIVE_SECTION* = "activeSection"
const DEFAULT_ACTIVE_SECTION = ""
const LAST_SECTION_CHAT = "LastSectionChat"
const DEFAULT_ACTIVE_CHAT = ""
const LSS_KEY_SHOW_BROWSER_SELECTOR* = "showBrowserSelector"
const DEFAULT_SHOW_BROWSER_SELECTOR = true
const LSS_KEY_OPEN_LINKS_IN_STATUS* = "openLinksInStatus"
const DEFAULT_OPEN_LINKS_IN_STATUS = true
const DEFAULT_OPEN_LINKS_IN_STATUS = false
const LSS_KEY_SHOULD_SHOW_FAVORITES_BAR* = "shouldShowFavoritesBar"
const DEFAULT_SHOULD_SHOW_FAVORITES_BAR = true
const LSS_KEY_BROWSER_HOMEPAGE* = "browserHomepage"
Expand Down Expand Up @@ -325,19 +324,6 @@ QtObject:
write = setActiveSection
notify = activeSectionChanged

proc showBrowserSelectorChanged*(self: LocalAccountSensitiveSettings) {.signal.}
proc getShowBrowserSelector*(self: LocalAccountSensitiveSettings): bool {.slot.} =
getSettingsProp[bool](self, LSS_KEY_SHOW_BROWSER_SELECTOR, newQVariant(DEFAULT_SHOW_BROWSER_SELECTOR))
proc setShowBrowserSelector*(self: LocalAccountSensitiveSettings, value: bool) {.slot.} =
setSettingsProp(self, LSS_KEY_SHOW_BROWSER_SELECTOR, newQVariant(value)):
self.showBrowserSelectorChanged()

QtProperty[bool] showBrowserSelector:
read = getShowBrowserSelector
write = setShowBrowserSelector
notify = showBrowserSelectorChanged


proc openLinksInStatusChanged*(self: LocalAccountSensitiveSettings) {.signal.}
proc getOpenLinksInStatus*(self: LocalAccountSensitiveSettings): bool {.slot.} =
getSettingsProp[bool](self, LSS_KEY_OPEN_LINKS_IN_STATUS, newQVariant(DEFAULT_OPEN_LINKS_IN_STATUS))
Expand Down Expand Up @@ -603,7 +589,6 @@ QtObject:
of LSS_KEY_SHOW_DELETE_MESSAGE_WARNING: self.showDeleteMessageWarningChanged()
of LSS_KEY_DOWNLOAD_CHANNEL_MESSAGES_ENABLED: self.downloadChannelMessagesEnabledChanged()
of LSS_KEY_ACTIVE_SECTION: self.activeSectionChanged()
of LSS_KEY_SHOW_BROWSER_SELECTOR: self.showBrowserSelectorChanged()
of LSS_KEY_OPEN_LINKS_IN_STATUS: self.openLinksInStatusChanged()
of LSS_KEY_SHOULD_SHOW_FAVORITES_BAR: self.shouldShowFavoritesBarChanged()
of LSS_KEY_BROWSER_HOMEPAGE: self.browserHomepageChanged()
Expand All @@ -629,4 +614,4 @@ QtObject:
self.settingsFileDir = os.joinPath(DATADIR, "qt")

proc delete*(self: LocalAccountSensitiveSettings) =
self.QObject.delete
self.QObject.delete
54 changes: 54 additions & 0 deletions storybook/pages/ConfirmExternalLinkPopupPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls

import shared.popups

import Storybook

SplitView {

Logs { id: logs }

Item {
SplitView.fillWidth: true
SplitView.fillHeight: true

PopupBackground {
anchors.fill: parent
}

Button {
anchors.centerIn: parent
text: "Reopen"

onClicked: popup.open()
}

ConfirmExternalLinkPopup {
id: popup

closePolicy: Popup.CloseOnEscape
modal: false
visible: true

link: "https://etherscan.io/token/0xdac17f958d2ee523a220622064597c13d831ec7"
domain: "etherscan.io"

onOpenExternalLink: logs.logEvent("onOpenExternalLink called with link: " + link)
onSaveDomainToUnfurledWhitelist: logs.logEvent("onSaveDomainToUnfurledWhitelist called with domain: " + domain)
}
}

LogsAndControlsPanel {
id: logsAndControlsPanel

SplitView.minimumHeight: 100
SplitView.preferredHeight: 200

logsView.logText: logs.logText
}
}

// category: Popups
// https://www.figma.com/design/idUoxN7OIW2Jpp3PMJ1Rl8/Settings----Desktop-Legacy?node-id=27093-584044&m=dev
3 changes: 1 addition & 2 deletions storybook/pages/KeycardIntroPagePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Item {
displayPromoBanner: ctrlDisplayPromo.checked
onEmptyKeycardDetected: console.warn("!!! EMPTY DETECTED")
onNotEmptyKeycardDetected: console.warn("!!! NOT EMPTY DETECTED")
onOpenLink: Qt.openUrlExternally(link)
onOpenLinkWithConfirmation: Qt.openUrlExternally(link)
onRequestOpenLink: Qt.openUrlExternally(link)
onKeycardFactoryResetRequested: console.warn("!!! FACTORY RESET")
onUnblockWithSeedphraseRequested: console.warn("!!! UNBLOCK WITH SEEDPHRASE")
onUnblockWithPukRequested: console.warn("!!! UNBLOCK WITH PUK")
Expand Down
2 changes: 2 additions & 0 deletions storybook/pages/PrivacyAndSecurityViewPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ SplitView {
SplitView.fillHeight: true
contentWidth: parent.width

privacySectionTitle: "Privacy"
whitelistedDomainsModel: ["example1.com", "example2.com", "example3.com"]
isStatusNewsViaRSSEnabled: true
isCentralizedMetricsEnabled: true
thirdpartyServicesEnabled: ctrlThirdpartyServicesEnabled.checked
Expand Down
4 changes: 2 additions & 2 deletions storybook/pages/ProfileSocialLinksPanelPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ SplitView {

Connections {
target: Global
function onOpenLink(link) {
logs.logEvent("Global::openLink", ["link"], [link])
function onRequestOpenLink(link) {
logs.logEvent("Global::onRequestOpenLink", ["link"], [link])
}
}

Expand Down
4 changes: 1 addition & 3 deletions storybook/qmlTests/tests/tst_BuyCryptoModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Item {
SignalSpy {
id: notificationSpy
target: Global
signalName: "openLinkWithConfirmation"
signalName: "requestOpenLink"
}

TestCase {
Expand Down Expand Up @@ -250,7 +250,6 @@ Item {
verify(controlUnderTest.rightButtons[0].loading)
tryCompare(notificationSpy, "count", 1)
compare(notificationSpy.signalArguments[0][0], "xxxx")
compare(notificationSpy.signalArguments[0][1], modelData.hostname)
notificationSpy.clear()

// popup should be closed
Expand All @@ -274,7 +273,6 @@ Item {
verify(loadingIndicator.visible)
tryCompare(notificationSpy, "count", 1)
compare(notificationSpy.signalArguments[0][0], "xxxx")
compare(notificationSpy.signalArguments[0][1], modelData.hostname)
notificationSpy.clear()

// popup should be closed
Expand Down
2 changes: 1 addition & 1 deletion storybook/qmlTests/tests/tst_SendSignModal.qml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Item {
SignalSpy {
id: signalSpyOpenLink
target: Global
signalName: "openLinkWithConfirmation"
signalName: "requestOpenLink"
}

property SendSignModal controlUnderTest: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ import StatusQ.Core.Theme
font.pixelSize: Theme.primaryTextFontSize
font.weight: Font.Normal
text: draggableDelegate.asideText
onClicked: Global.openLink(model.url)
onClicked: Global.requestOpenLink(model.url)
},
StatusFlatRoundButton {
icon.name: "edit_pencil"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ StatusSectionLayout {
id: newsMessagePopup

NewsMessagePopup {
onLinkClicked: Global.openLinkWithConfirmation(link, StatusQUtils.StringUtils.extractDomainFromLink(link));
onLinkClicked: Global.requestOpenLink(link)
}
}

Expand Down
66 changes: 0 additions & 66 deletions ui/app/AppLayouts/Chat/popups/ChooseBrowserPopup.qml

This file was deleted.

1 change: 0 additions & 1 deletion ui/app/AppLayouts/Chat/popups/qmldir
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
PinnedMessagesPopup 1.0 PinnedMessagesPopup.qml
PaymentRequestModal 1.0 PaymentRequestModal.qml
ChooseBrowserPopup 1.0 ChooseBrowserPopup.qml
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Chat/views/ChatHeaderContentView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ RowLayout {
break;
}
}
onLinkActivated: Global.openLink(link)
onLinkActivated: Global.requestOpenLink(link)
}
}

Expand Down
8 changes: 3 additions & 5 deletions ui/app/AppLayouts/Communities/controls/Options.qml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ ColumnLayout {
text: qsTr("Learn more about token-gating")
font.pixelSize: Theme.primaryTextFontSize
normalColor: linkColor
onClicked: Global.openLinkWithConfirmation(d.aboutPermissionsLink,
StatusQUtils.StringUtils.extractDomainFromLink(d.aboutPermissionsLink))
onClicked: Global.requestOpenLink(d.aboutPermissionsLink)
}

StatusIcon {
Expand All @@ -127,8 +126,7 @@ ColumnLayout {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor

onClicked: Global.openLinkWithConfirmation(d.aboutPermissionsLink,
StatusQUtils.StringUtils.extractDomainFromLink(d.aboutPermissionsLink))
onClicked: Global.requestOpenLink(d.aboutPermissionsLink)
}
}
}
Expand All @@ -139,7 +137,7 @@ ColumnLayout {
id: messageHistoryInfoPopupComponent

EnableFullMessageHistoryPopup {
onAccepted: Global.openLinkWithConfirmation(d.aboutHistoryServiceLink, StatusQUtils.StringUtils.extractDomainFromLink(d.aboutHistoryServiceLink))
onAccepted: Global.requestOpenLink(d.aboutHistoryServiceLink)
onClosed: destroy()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ StackLayout {
}
onImportControlNodeClicked: root.importControlNodeClicked()
onFinaliseOwnershipTransferClicked: root.finaliseOwnershipClicked()
onLearnMoreClicked: Global.openLink(Constants.statusHelpLinkPrefix + "communities/about-the-control-node-in-status-communities")
onLearnMoreClicked: Global.requestOpenLink(Constants.statusHelpLinkPrefix + "communities/about-the-control-node-in-status-communities")
}
}

Expand Down
4 changes: 2 additions & 2 deletions ui/app/AppLayouts/Communities/popups/CreateChannelPopup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ StatusStackModal {
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Qt.AlignHCenter
text: qsTr("Export the Discord channel’s chat history data using %1").arg("<a href='https://github.com/Tyrrrz/DiscordChatExporter/releases/tag/2.40.4'>DiscordChatExporter</a>")
onLinkActivated: Global.openLink(link)
onLinkActivated: Global.requestOpenLink(link)
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
Expand All @@ -441,7 +441,7 @@ StatusStackModal {
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Qt.AlignHCenter
text: qsTr("Refer to this <a href='https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Readme.md'>documentation</a> if you have any queries")
onLinkActivated: Global.openLink(link)
onLinkActivated: Global.requestOpenLink(link)
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ StatusStackModal {
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Qt.AlignHCenter
text: qsTr("Export your Discord JSON data using %1").arg("<a href='https://github.com/Tyrrrz/DiscordChatExporter/releases/tag/2.40.4'>DiscordChatExporter</a>")
onLinkActivated: link => Global.openLink(link)
onLinkActivated: link => Global.requestOpenLink(link)
HoverHandler {
id: handler1
}
Expand All @@ -172,7 +172,7 @@ StatusStackModal {
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Qt.AlignHCenter
text: qsTr("Refer to this <a href='https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Readme.md'>documentation</a> if you have any queries")
onLinkActivated: link => Global.openLink(link)
onLinkActivated: link => Global.requestOpenLink(link)
HoverHandler {
id: handler2
}
Expand Down
6 changes: 2 additions & 4 deletions ui/app/AppLayouts/Communities/views/CommunitiesGridView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,8 @@ StatusScrollView {
PromotionalCommunityCard {
width: d.delegateWidth

onLearnMore: Global.openLinkWithConfirmation(d.learnAboutCommunitiesVoteLink,
StringUtils.extractDomainFromLink(d.learnAboutCommunitiesVoteLink))
onInitiateVote: Global.openLinkWithConfirmation(d.voteCommunityLink,
StringUtils.extractDomainFromLink(d.voteCommunityLink))
onLearnMore: Global.requestOpenLink(d.learnAboutCommunitiesVoteLink)
onInitiateVote: Global.requestOpenLink(d.voteCommunityLink)
}

Repeater {
Expand Down
5 changes: 1 addition & 4 deletions ui/app/AppLayouts/Onboarding/OnboardingLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,7 @@ Page {
target: onboardingFlow.topLevelItem
ignoreUnknownSignals: true

function onOpenLink(link: string) {
Qt.openUrlExternally(link)
}
function onOpenLinkWithConfirmation(link: string, domain: string) {
function onRequestOpenLink(link: string) {
Qt.openUrlExternally(link)
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Onboarding/pages/KeycardBasePage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ OnboardingPage {
color: Theme.palette.baseColor1
horizontalAlignment: Text.AlignHCenter
visible: !!text
onLinkActivated: openLinkWithConfirmation(link, SQUtils.StringUtils.extractDomainFromLink(link))
onLinkActivated: requestOpenLink(link)

HoverHandler {
// Qt CSS doesn't support custom cursor shape
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Onboarding/pages/KeycardIntroPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ KeycardBasePage {
icon.name: "external-link"
icon.width: 24
icon.height: 24
onClicked: openLink("https://keycard.tech/")
onClicked: requestOpenLink("https://keycard.tech/")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/AppLayouts/Onboarding/pages/KeycardLostPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ KeycardBasePage {
icon.name: "external-link"
icon.width: 24
icon.height: 24
onClicked: openLink("https://keycard.tech/")
onClicked: requestOpenLink("https://keycard.tech/")
}
}
3 changes: 1 addition & 2 deletions ui/app/AppLayouts/Onboarding/pages/OnboardingPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import QtQuick.Controls
import StatusQ.Core.Theme

Page {
signal openLink(string link)
signal openLinkWithConfirmation(string link, string domain)
signal requestOpenLink(string link)

implicitWidth: 1200
implicitHeight: 700
Expand Down
Loading