Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay Management / Outbox Model #41

Merged
merged 6 commits into from
Nov 12, 2024
Merged
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
6 changes: 5 additions & 1 deletion futr.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,15 @@ executable futr
Nostr.GiftWrap
Nostr.Keys
Nostr.Profile
Nostr.Publisher
Nostr.RelayConnection
Nostr.RelayPool
Nostr.Subscription
Nostr.WebSocket
Nostr.Types
Nostr.Util
Presentation.KeyMgmt
Presentation.RelayMgmt
RelayMgmt
Types
TimeFormatter
UI
Expand Down Expand Up @@ -97,6 +100,7 @@ executable futr
libsecp256k1 >=0.2.1 && <0.3,
memory >=0.18 && <0.19,
network >= 3.2.4.0 && <3.3,
network-uri >=2.6.4.2 && <2.7,
random >=1.2.1.2 && <1.3,
scientific >=0.3.8.0 && <0.4,
stm >=2.5.1.0 && <2.6,
Expand Down
1 change: 1 addition & 0 deletions resources/icons/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/check_circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/save.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/sync.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/wifi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/icons/wifi_off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion resources/qml/content/Chat.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Rectangle {
model: AutoListModel {
id: messagesModel
source: messages
mode: AutoListModel.ByKey
}

delegate: Item {
Expand All @@ -79,7 +80,7 @@ Rectangle {
}
width: Math.min(Math.max(messageContent.implicitWidth, timestampText.implicitWidth) + 24, parent.width * 0.8)
height: messageContent.height + timestampText.height + 20
color: modelData && modelData.isOwnMessage ? Material.accentColor : Material.dividerColor
color: modelData.isOwnMessage ? Material.accentColor : Material.dividerColor
radius: 10

ColumnLayout {
Expand Down
46 changes: 46 additions & 0 deletions resources/qml/content/DMRelays.ui.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Layouts 1.15
import QtGraphicalEffects 1.15

import Futr 1.0

Rectangle {
id: root
color: Material.backgroundColor
radius: 5
border.color: Material.dividerColor
border.width: 1

property bool hasValidInputs: false

ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 10
spacing: 10

Text {
Layout.fillWidth: true
text: qsTr("You are not set up to receive private messsages yet.")
font: Constants.largeFont
color: Material.foreground
wrapMode: Text.WordWrap
}

Button {
text: qsTr("Setup now")
onClicked: relayMgmtDialog.open()
}

Text {
Layout.fillWidth: true
text: qsTr("If you believe this message is incorrect, it might be because we can't access your preferred DM relays from your profile, your internet connection is slow, or the necessary settings file is missing from your computer.")
font: Constants.smallFont
color: Material.foreground
wrapMode: Text.WordWrap
}
}
}
12 changes: 7 additions & 5 deletions resources/qml/content/Dialogs/LoginErrorDialog.ui.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ Dialog {
standardButtons: Dialog.Ok
modal: true
anchors.centerIn: parent
width: Math.min(parent.width - 40, 300)
height: 160

property string errorMessage: ""

width: Math.min(parent.width - 200, 400)
height: Math.min(contentColumn.implicitHeight + 80, parent.height - 40)

ColumnLayout {
id: contentColumn
width: parent.width
spacing: 10
anchors.fill: parent
anchors.margins: 0

Text {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
Layout.preferredWidth: contentColumn.width
horizontalAlignment: Text.AlignLeft
text: errorMessage
color: Material.foreground
font.pixelSize: 14
Expand Down
Loading