Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
e59468f2
Commit
e59468f2
authored
3 years ago
by
Malte E
Browse files
Options
Downloads
Patches
Plain Diff
clean up indentation
parent
fd3efdff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/qml/dialogs/RoomSettings.qml
+204
-204
204 additions, 204 deletions
resources/qml/dialogs/RoomSettings.qml
with
204 additions
and
204 deletions
resources/qml/dialogs/RoomSettings.qml
+
204
−
204
View file @
e59468f2
...
...
@@ -41,105 +41,105 @@ ApplicationWindow {
flickableDirection
:
Flickable
.
VerticalFlick
contentWidth
:
contentLayout1
.
width
contentHeight
:
contentLayout1
.
height
ColumnLayout
{
id
:
contentLayout1
width
:
flickable
.
width
spacing
:
Nheko
.
paddingMedium
Avatar
{
Layout.topMargin
:
Nheko
.
paddingMedium
url
:
roomSettings
.
roomAvatarUrl
.
replace
(
"
mxc://
"
,
"
image://MxcImage/
"
)
roomid
:
roomSettings
.
roomId
displayName
:
roomSettings
.
roomName
height
:
130
width
:
130
Layout.alignment
:
Qt
.
AlignHCenter
onClicked
:
{
if
(
roomSettings
.
canChangeAvatar
)
roomSettings
.
updateAvatar
();
ColumnLayout
{
id
:
contentLayout1
width
:
flickable
.
width
spacing
:
Nheko
.
paddingMedium
Avatar
{
Layout.topMargin
:
Nheko
.
paddingMedium
url
:
roomSettings
.
roomAvatarUrl
.
replace
(
"
mxc://
"
,
"
image://MxcImage/
"
)
roomid
:
roomSettings
.
roomId
displayName
:
roomSettings
.
roomName
height
:
130
width
:
130
Layout.alignment
:
Qt
.
AlignHCenter
onClicked
:
{
if
(
roomSettings
.
canChangeAvatar
)
roomSettings
.
updateAvatar
();
}
}
}
Spinner
{
Layout.alignment
:
Qt
.
AlignHCenter
visible
:
roomSettings
.
isLoading
foreground
:
Nheko
.
colors
.
mid
running
:
roomSettings
.
isLoading
}
Text
{
id
:
errorText
Spinner
{
Layout.alignment
:
Qt
.
AlignHCenter
visible
:
roomSettings
.
isLoading
foreground
:
Nheko
.
colors
.
mid
running
:
roomSettings
.
isLoading
}
color
:
"
red
"
visible
:
opacity
>
0
opacity
:
0
Layout.alignment
:
Qt
.
AlignHCenter
wrapMode
:
Text
.
Wrap
// somehow still doesn't wrap
}
Text
{
id
:
errorText
SequentialAnimation
{
id
:
hideErrorAnimation
color
:
"
red
"
visible
:
opacity
>
0
opacity
:
0
Layout.alignment
:
Qt
.
AlignHCenter
wrapMode
:
Text
.
Wrap
// somehow still doesn't wrap
}
running
:
false
SequentialAnimation
{
id
:
hideErrorAnimation
PauseAnimation
{
duration
:
4000
}
running
:
false
NumberAnimation
{
target
:
errorText
property
:
'
opacity
'
to
:
0
duration
:
1000
}
PauseAnimation
{
duration
:
4000
}
}
NumberAnimation
{
target
:
errorText
property
:
'
opacity
'
to
:
0
duration
:
1000
}
Connections
{
target
:
roomSettings
function
onDisplayError
(
errorMessage
)
{
errorText
.
text
=
errorMessage
;
errorText
.
opacity
=
1
;
hideErrorAnimation
.
restart
();
}
}
Label
{
text
:
roomSettings
.
roomName
Layout.alignment
:
Qt
.
AlignHCenter
font.pixelSize
:
fontMetrics
.
font
.
pixelSize
*
2
Layout.fillWidth
:
true
horizontalAlignment
:
TextEdit
.
AlignHCenter
Connections
{
target
:
roomSettings
function
onDisplayError
(
errorMessage
)
{
errorText
.
text
=
errorMessage
;
errorText
.
opacity
=
1
;
hideErrorAnimation
.
restart
();
}
}
Label
{
text
:
roomSettings
.
roomName
Layout.alignment
:
Qt
.
AlignHCenter
font.pixelSize
:
fontMetrics
.
font
.
pixelSize
*
2
Layout.fillWidth
:
true
horizontalAlignment
:
TextEdit
.
AlignHCenter
}
Label
{
text
:
qsTr
(
"
%n member(s)
"
,
""
,
roomSettings
.
memberCount
)
Layout.alignment
:
Qt
.
AlignHCenter
Label
{
text
:
qsTr
(
"
%n member(s)
"
,
""
,
roomSettings
.
memberCount
)
Layout.alignment
:
Qt
.
AlignHCenter
TapHandler
{
onSingleTapped
:
TimelineManager
.
openRoomMembers
(
Rooms
.
getRoomById
(
roomSettings
.
roomId
))
}
TapHandler
{
onSingleTapped
:
TimelineManager
.
openRoomMembers
(
Rooms
.
getRoomById
(
roomSettings
.
roomId
))
}
CursorShape
{
cursorShape
:
Qt
.
PointingHandCursor
anchors.fill
:
parent
}
CursorShape
{
cursorShape
:
Qt
.
PointingHandCursor
anchors.fill
:
parent
}
ImageButton
{
Layout.alignment
:
Qt
.
AlignHCenter
image
:
"
:/icons/icons/ui/edit.svg
"
visible
:
roomSettings
.
canChangeNameAndTopic
onClicked
:
roomSettings
.
openEditModal
()
}
ImageButton
{
Layout.alignment
:
Qt
.
AlignHCenter
image
:
"
:/icons/icons/ui/edit.svg
"
visible
:
roomSettings
.
canChangeNameAndTopic
onClicked
:
roomSettings
.
openEditModal
()
}
TextArea
{
Layout.fillHeight
:
true
Layout.alignment
:
Qt
.
AlignHCenter
Layout.fillWidth
:
true
Layout.leftMargin
:
Nheko
.
paddingLarge
Layout.rightMargin
:
Nheko
.
paddingLarge
TextArea
{
Layout.fillHeight
:
true
Layout.alignment
:
Qt
.
AlignHCenter
Layout.fillWidth
:
true
Layout.leftMargin
:
Nheko
.
paddingLarge
Layout.rightMargin
:
Nheko
.
paddingLarge
text
:
TimelineManager
.
escapeEmoji
(
roomSettings
.
roomTopic
)
wrapMode
:
TextEdit
.
WordWrap
...
...
@@ -156,167 +156,167 @@ ApplicationWindow {
cursorShape
:
parent
.
hoveredLink
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
}
}
}
GridLayout
{
columns
:
2
rowSpacing
:
Nheko
.
paddingMedium
Layout.margins
:
Nheko
.
paddingMedium
GridLayout
{
columns
:
2
rowSpacing
:
Nheko
.
paddingMedium
Layout.margins
:
Nheko
.
paddingMedium
Label
{
text
:
qsTr
(
"
SETTINGS
"
)
font.bold
:
true
}
Label
{
text
:
qsTr
(
"
SETTINGS
"
)
font.bold
:
true
}
Item
{
Layout.fillWidth
:
true
}
Item
{
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Notifications
"
)
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Notifications
"
)
Layout.fillWidth
:
true
}
ComboBox
{
model
:
[
qsTr
(
"
Muted
"
),
qsTr
(
"
Mentions only
"
),
qsTr
(
"
All messages
"
)]
currentIndex
:
roomSettings
.
notifications
onActivated
:
{
roomSettings
.
changeNotifications
(
index
);
ComboBox
{
model
:
[
qsTr
(
"
Muted
"
),
qsTr
(
"
Mentions only
"
),
qsTr
(
"
All messages
"
)]
currentIndex
:
roomSettings
.
notifications
onActivated
:
{
roomSettings
.
changeNotifications
(
index
);
}
Layout.fillWidth
:
true
}
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Room access
"
)
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Room access
"
)
Layout.fillWidth
:
true
}
ComboBox
{
enabled
:
roomSettings
.
canChangeJoinRules
model
:
{
let
opts
=
[
qsTr
(
"
Anyone and guests
"
),
qsTr
(
"
Anyone
"
),
qsTr
(
"
Invited users
"
)];
if
(
roomSettings
.
supportsKnocking
)
opts
.
push
(
qsTr
(
"
By knocking
"
));
ComboBox
{
enabled
:
roomSettings
.
canChangeJoinRules
model
:
{
let
opts
=
[
qsTr
(
"
Anyone and guests
"
),
qsTr
(
"
Anyone
"
),
qsTr
(
"
Invited users
"
)];
if
(
roomSettings
.
supportsKnocking
)
opts
.
push
(
qsTr
(
"
By knocking
"
));
if
(
roomSettings
.
supportsRestricted
)
opts
.
push
(
qsTr
(
"
Restricted by membership in other rooms
"
));
if
(
roomSettings
.
supportsRestricted
)
opts
.
push
(
qsTr
(
"
Restricted by membership in other rooms
"
));
return
opts
;
}
currentIndex
:
roomSettings
.
accessJoinRules
onActivated
:
{
roomSettings
.
changeAccessRules
(
index
);
return
opts
;
}
currentIndex
:
roomSettings
.
accessJoinRules
onActivated
:
{
roomSettings
.
changeAccessRules
(
index
);
}
Layout.fillWidth
:
true
}
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Encryption
"
)
}
Label
{
text
:
qsTr
(
"
Encryption
"
)
}
ToggleButton
{
id
:
encryptionToggle
ToggleButton
{
id
:
encryptionToggle
checked
:
roomSettings
.
isEncryptionEnabled
onCheckedChanged
:
{
if
(
roomSettings
.
isEncryptionEnabled
)
{
checked
=
true
;
return
;
checked
:
roomSettings
.
isEncryptionEnabled
onCheckedChanged
:
{
if
(
roomSettings
.
isEncryptionEnabled
)
{
checked
=
true
;
return
;
}
confirmEncryptionDialog
.
open
();
}
confirmEncryptionDialog
.
open
();
Layout.alignment
:
Qt
.
AlignRight
}
Layout.alignment
:
Qt
.
AlignRight
}
Platform.MessageDialog
{
id
:
confirmEncryptionDialog
Platform.MessageDialog
{
id
:
confirmEncryptionDialog
title
:
qsTr
(
"
End-to-End Encryption
"
)
text
:
qsTr
(
"
Encryption is currently experimental and things might break unexpectedly. <br>
Please take note that it can't be disabled afterwards.
"
)
modality
:
Qt
.
NonModal
onAccepted
:
{
if
(
roomSettings
.
isEncryptionEnabled
)
return
;
title
:
qsTr
(
"
End-to-End Encryption
"
)
text
:
qsTr
(
"
Encryption is currently experimental and things might break unexpectedly. <br>
Please take note that it can't be disabled afterwards.
"
)
modality
:
Qt
.
NonModal
onAccepted
:
{
if
(
roomSettings
.
isEncryptionEnabled
)
return
;
roomSettings
.
enableEncryption
();
roomSettings
.
enableEncryption
();
}
onRejected
:
{
encryptionToggle
.
checked
=
false
;
}
buttons
:
Platform
.
MessageDialog
.
Ok
|
Platform
.
MessageDialog
.
Cancel
}
onRejected
:
{
encryptionToggle
.
checked
=
false
;
Label
{
text
:
qsTr
(
"
Sticker & Emote Settings
"
)
}
buttons
:
Platform
.
MessageDialog
.
Ok
|
Platform
.
MessageDialog
.
Cancel
}
Label
{
text
:
qsTr
(
"
Sticker & Emote Settings
"
)
}
Button
{
text
:
qsTr
(
"
Change
"
)
ToolTip.text
:
qsTr
(
"
Change what packs are enabled, remove packs or create new ones
"
)
onClicked
:
TimelineManager
.
openImagePackSettings
(
roomSettings
.
roomId
)
Layout.alignment
:
Qt
.
AlignRight
}
Button
{
text
:
qsTr
(
"
Change
"
)
ToolTip.text
:
qsTr
(
"
Change what packs are enabled, remove packs or create new ones
"
)
onClicked
:
TimelineManager
.
openImagePackSettings
(
roomSettings
.
roomId
)
Layout.alignment
:
Qt
.
AlignRight
}
Label
{
text
:
qsTr
(
"
Hidden events
"
)
}
Label
{
text
:
qsTr
(
"
Hidden events
"
)
}
HiddenEventsDialog
{
id
:
hiddenEventsDialog
roomid
:
roomSettings
.
roomId
roomName
:
roomSettings
.
roomName
}
HiddenEventsDialog
{
id
:
hiddenEventsDialog
roomid
:
roomSettings
.
roomId
roomName
:
roomSettings
.
roomName
}
Button
{
text
:
qsTr
(
"
Configure
"
)
ToolTip.text
:
qsTr
(
"
Select events to hide in this room
"
)
onClicked
:
hiddenEventsDialog
.
show
()
Layout.alignment
:
Qt
.
AlignRight
}
Button
{
text
:
qsTr
(
"
Configure
"
)
ToolTip.text
:
qsTr
(
"
Select events to hide in this room
"
)
onClicked
:
hiddenEventsDialog
.
show
()
Layout.alignment
:
Qt
.
AlignRight
}
Item
{
// for adding extra space between sections
Layout.fillWidth
:
true
}
Item
{
// for adding extra space between sections
Layout.fillWidth
:
true
}
Item
{
// for adding extra space between sections
Layout.fillWidth
:
true
}
Item
{
// for adding extra space between sections
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
INFO
"
)
font.bold
:
true
}
Label
{
text
:
qsTr
(
"
INFO
"
)
font.bold
:
true
}
Item
{
Layout.fillWidth
:
true
}
Item
{
Layout.fillWidth
:
true
}
Label
{
text
:
qsTr
(
"
Internal ID
"
)
}
Label
{
text
:
qsTr
(
"
Internal ID
"
)
}
Label
{
text
:
roomSettings
.
roomId
font.pixelSize
:
Math
.
floor
(
fontMetrics
.
font
.
pixelSize
*
0.8
)
Layout.alignment
:
Qt
.
AlignRight
}
Label
{
text
:
roomSettings
.
roomId
font.pixelSize
:
Math
.
floor
(
fontMetrics
.
font
.
pixelSize
*
0.8
)
Layout.alignment
:
Qt
.
AlignRight
}
Label
{
text
:
qsTr
(
"
Room Version
"
)
}
Label
{
text
:
qsTr
(
"
Room Version
"
)
}
Label
{
text
:
roomSettings
.
roomVersion
font.pixelSize
:
fontMetrics
.
font
.
pixelSize
Layout.alignment
:
Qt
.
AlignRight
}
Label
{
text
:
roomSettings
.
roomVersion
font.pixelSize
:
fontMetrics
.
font
.
pixelSize
Layout.alignment
:
Qt
.
AlignRight
}
}
}
}
footer
:
DialogButtonBox
{
standardButtons
:
DialogButtonBox
.
Ok
onAccepted
:
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment