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
7c08d889
Commit
7c08d889
authored
2 years ago
by
Marcus Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
print errors on failed dialog creation
Signed-off-by:
Marcus Hoffmann
<
bubu@bubu1.eu
>
parent
5d9895a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#4448
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
resources/qml/RoomList.qml
+16
-8
16 additions, 8 deletions
resources/qml/RoomList.qml
resources/qml/Root.qml
+169
-88
169 additions, 88 deletions
resources/qml/Root.qml
resources/qml/TimelineView.qml
+10
-5
10 additions, 5 deletions
resources/qml/TimelineView.qml
with
195 additions
and
101 deletions
resources/qml/RoomList.qml
+
16
−
8
View file @
7c08d889
...
@@ -470,11 +470,14 @@ Page {
...
@@ -470,11 +470,14 @@ Page {
function
openUserProfile
()
{
function
openUserProfile
()
{
Nheko
.
updateUserProfile
();
Nheko
.
updateUserProfile
();
var
userProfile
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/UserProfile.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/UserProfile.qml
"
)
"
profile
"
:
Nheko
.
currentUser
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
userProfile
=
component
.
createObject
(
timelineRoot
,
{
"
profile
"
:
Nheko
.
currentUser
});
userProfile
.
show
();
userProfile
.
show
();
timelineRoot
.
destroyOnClose
(
userProfile
);
timelineRoot
.
destroyOnClose
(
userProfile
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
...
@@ -790,9 +793,14 @@ Page {
...
@@ -790,9 +793,14 @@ Page {
ToolTip.text
:
qsTr
(
"
Search rooms (Ctrl+K)
"
)
ToolTip.text
:
qsTr
(
"
Search rooms (Ctrl+K)
"
)
Layout.margins
:
Nheko
.
paddingMedium
Layout.margins
:
Nheko
.
paddingMedium
onClicked
:
{
onClicked
:
{
var
quickSwitch
=
Qt
.
createComponent
(
"
qrc:/qml/QuickSwitcher.qml
"
).
createObject
(
timelineRoot
);
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/QuickSwitcher.qml
"
)
quickSwitch
.
open
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClosed
(
quickSwitch
);
var
quickSwitch
=
component
.
createObject
(
timelineRoot
);
quickSwitch
.
open
();
destroyOnClosed
(
quickSwitch
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/qml/Root.qml
+
169
−
88
View file @
7c08d889
...
@@ -51,36 +51,57 @@ Pane {
...
@@ -51,36 +51,57 @@ Pane {
}
}
function
showAliasEditor
(
settings
)
{
function
showAliasEditor
(
settings
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/AliasEditor.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/AliasEditor.qml
"
)
"
roomSettings
"
:
settings
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
dialog
.
show
();
"
roomSettings
"
:
settings
destroyOnClose
(
dialog
);
});
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
showPLEditor
(
settings
)
{
function
showPLEditor
(
settings
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/PowerLevelEditor.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/PowerLevelEditor.qml
"
)
"
roomSettings
"
:
settings
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
dialog
.
show
();
"
roomSettings
"
:
settings
destroyOnClose
(
dialog
);
});
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
showSpacePLApplyPrompt
(
settings
,
editingModel
)
{
function
showSpacePLApplyPrompt
(
settings
,
editingModel
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/PowerLevelSpacesApplyDialog.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/PowerLevelSpacesApplyDialog.qml
"
)
"
roomSettings
"
:
settings
,
if
(
component
.
status
==
Component
.
Ready
)
{
"
editingModel
"
:
editingModel
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
});
"
roomSettings
"
:
settings
,
dialog
.
show
();
"
editingModel
"
:
editingModel
destroyOnClose
(
dialog
);
});
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
showAllowedRoomsEditor
(
settings
)
{
function
showAllowedRoomsEditor
(
settings
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/AllowedRoomsSettingsDialog.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/AllowedRoomsSettingsDialog.qml
"
)
"
roomSettings
"
:
settings
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
dialog
.
show
();
"
roomSettings
"
:
settings
destroyOnClose
(
dialog
);
});
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
Component
{
Component
{
...
@@ -99,9 +120,14 @@ Pane {
...
@@ -99,9 +120,14 @@ Pane {
Shortcut
{
Shortcut
{
sequence
:
"
Ctrl+K
"
sequence
:
"
Ctrl+K
"
onActivated
:
{
onActivated
:
{
var
quickSwitch
=
Qt
.
createComponent
(
"
qrc:/qml/QuickSwitcher.qml
"
).
createObject
(
timelineRoot
);
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/QuickSwitcher.qml
"
)
quickSwitch
.
open
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClosed
(
quickSwitch
);
var
quickSwitch
=
component
.
createObject
(
timelineRoot
);
quickSwitch
.
open
();
destroyOnClosed
(
quickSwitch
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
}
}
...
@@ -123,21 +149,36 @@ Pane {
...
@@ -123,21 +149,36 @@ Pane {
Connections
{
Connections
{
function
onOpenLogoutDialog
()
{
function
onOpenLogoutDialog
()
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/LogoutDialog.qml
"
).
createObject
(
timelineRoot
);
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/LogoutDialog.qml
"
)
dialog
.
open
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClose
(
dialog
);
var
dialog
=
component
.
createObject
(
timelineRoot
);
dialog
.
open
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onOpenJoinRoomDialog
()
{
function
onOpenJoinRoomDialog
()
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/JoinRoomDialog.qml
"
).
createObject
(
timelineRoot
);
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/JoinRoomDialog.qml
"
)
dialog
.
show
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClose
(
dialog
);
var
dialog
=
component
.
createObject
(
timelineRoot
);
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onShowRoomJoinPrompt
(
summary
)
{
function
onShowRoomJoinPrompt
(
summary
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ConfirmJoinRoomDialog.qml
"
).
createObject
(
timelineRoot
,
{
"
summary
"
:
summary
});
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ConfirmJoinRoomDialog.qml
"
)
dialog
.
show
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClose
(
dialog
);
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
"
summary
"
:
summary
});
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
target
:
Nheko
target
:
Nheko
...
@@ -145,11 +186,14 @@ Pane {
...
@@ -145,11 +186,14 @@ Pane {
Connections
{
Connections
{
function
onNewDeviceVerificationRequest
(
flow
)
{
function
onNewDeviceVerificationRequest
(
flow
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/device-verification/DeviceVerification.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/device-verification/DeviceVerification.qml
"
)
"
flow
"
:
flow
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
"
flow
"
:
flow
});
dialog
.
show
();
dialog
.
show
();
destroyOnClose
(
dialog
);
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
target
:
VerificationManager
target
:
VerificationManager
...
@@ -166,73 +210,105 @@ Pane {
...
@@ -166,73 +210,105 @@ Pane {
Connections
{
Connections
{
function
onOpenProfile
(
profile
)
{
function
onOpenProfile
(
profile
)
{
var
userProfile
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/UserProfile.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/UserProfile.qml
"
)
"
profile
"
:
profile
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
userProfile
=
component
.
createObject
(
timelineRoot
,
{
"
profile
"
:
profile
});
userProfile
.
show
();
userProfile
.
show
();
destroyOnClose
(
userProfile
);
destroyOnClose
(
userProfile
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onShowImagePackSettings
(
room
,
packlist
)
{
function
onShowImagePackSettings
(
room
,
packlist
)
{
var
packSet
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ImagePackSettingsDialog.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ImagePackSettingsDialog.qml
"
)
"
room
"
:
room
,
"
packlist
"
:
packlist
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
packSet
=
component
.
createObject
(
timelineRoot
,
{
packSet
.
show
();
"
room
"
:
room
,
destroyOnClose
(
packSet
);
"
packlist
"
:
packlist
});
packSet
.
show
();
destroyOnClose
(
packSet
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onOpenRoomMembersDialog
(
members
,
room
)
{
function
onOpenRoomMembersDialog
(
members
,
room
)
{
var
membersDialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RoomMembers.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RoomMembers.qml
"
)
"
members
"
:
members
,
if
(
component
.
status
==
Component
.
Ready
)
{
"
room
"
:
room
var
membersDialog
=
component
.
createObject
(
timelineRoot
,
{
});
"
members
"
:
members
,
membersDialog
.
show
();
"
room
"
:
room
destroyOnClose
(
membersDialog
);
});
membersDialog
.
show
();
destroyOnClose
(
membersDialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onOpenRoomSettingsDialog
(
settings
)
{
function
onOpenRoomSettingsDialog
(
settings
)
{
var
roomSettings
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RoomSettings.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RoomSettings.qml
"
)
"
roomSettings
"
:
settings
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
roomSettings
=
component
.
createObject
(
timelineRoot
,
{
roomSettings
.
show
();
"
roomSettings
"
:
settings
destroyOnClose
(
roomSettings
);
});
roomSettings
.
show
();
destroyOnClose
(
roomSettings
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onOpenInviteUsersDialog
(
invitees
)
{
function
onOpenInviteUsersDialog
(
invitees
)
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/InviteDialog.qml
"
)
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/InviteDialog.qml
"
)
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
if
(
component
.
status
==
Component
.
Ready
)
{
"
roomId
"
:
Rooms
.
currentRoom
.
roomId
,
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
"
plainRoomName
"
:
Rooms
.
currentRoom
.
plainRoomName
,
"
roomId
"
:
Rooms
.
currentRoom
.
roomId
,
"
invitees
"
:
invitees
"
plainRoomName
"
:
Rooms
.
currentRoom
.
plainRoomName
,
});
"
invitees
"
:
invitees
if
(
component
.
status
!=
Component
.
Ready
)
{
});
console
.
log
(
"
Failed to create component:
"
+
component
.
errorString
());
dialog
.
show
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
dialog
.
show
();
destroyOnClose
(
dialog
);
}
}
function
onOpenLeaveRoomDialog
(
roomid
,
reason
)
{
function
onOpenLeaveRoomDialog
(
roomid
,
reason
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/LeaveRoomDialog.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/LeaveRoomDialog.qml
"
)
"
roomId
"
:
roomid
,
if
(
component
.
status
==
Component
.
Ready
)
{
"
reason
"
:
reason
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
});
"
roomId
"
:
roomid
,
dialog
.
open
();
"
reason
"
:
reason
destroyOnClose
(
dialog
);
});
dialog
.
open
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onShowImageOverlay
(
room
,
eventId
,
url
,
originalWidth
,
proportionalHeight
)
{
function
onShowImageOverlay
(
room
,
eventId
,
url
,
originalWidth
,
proportionalHeight
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ImageOverlay.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/ImageOverlay.qml
"
)
"
room
"
:
room
,
if
(
component
.
status
==
Component
.
Ready
)
{
"
eventId
"
:
eventId
,
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
"
url
"
:
url
,
"
room
"
:
room
,
"
originalWidth
"
:
originalWidth
??
0
,
"
eventId
"
:
eventId
,
"
proportionalHeight
"
:
proportionalHeight
??
0
"
url
"
:
url
,
});
"
originalWidth
"
:
originalWidth
??
0
,
"
proportionalHeight
"
:
proportionalHeight
??
0
dialog
.
showFullScreen
();
}
destroyOnClose
(
dialog
);
);
dialog
.
showFullScreen
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
target
:
TimelineManager
target
:
TimelineManager
...
@@ -241,9 +317,14 @@ Pane {
...
@@ -241,9 +317,14 @@ Pane {
Connections
{
Connections
{
function
onNewInviteState
()
{
function
onNewInviteState
()
{
if
(
CallManager
.
haveCallInvite
&&
Settings
.
mobileMode
)
{
if
(
CallManager
.
haveCallInvite
&&
Settings
.
mobileMode
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/voip/CallInvite.qml
"
).
createObject
(
timelineRoot
);
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/voip/CallInvite.qml
"
)
dialog
.
open
();
if
(
component
.
status
==
Component
.
Ready
)
{
destroyOnClose
(
dialog
);
var
dialog
=
component
.
createObject
(
timelineRoot
);
dialog
.
open
();
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
resources/qml/TimelineView.qml
+
10
−
5
View file @
7c08d889
...
@@ -423,11 +423,16 @@ Item {
...
@@ -423,11 +423,16 @@ Item {
}
}
function
onShowRawMessageDialog
(
rawMessage
)
{
function
onShowRawMessageDialog
(
rawMessage
)
{
var
dialog
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RawMessageDialog.qml
"
).
createObject
(
timelineRoot
,
{
var
component
=
Qt
.
createComponent
(
"
qrc:/qml/dialogs/RawMessageDialog.qml
"
)
"
rawMessage
"
:
rawMessage
if
(
component
.
status
==
Component
.
Ready
)
{
});
var
dialog
=
component
.
createObject
(
timelineRoot
,
{
dialog
.
show
();
"
rawMessage
"
:
rawMessage
timelineRoot
.
destroyOnClose
(
dialog
);
});
dialog
.
show
();
timelineRoot
.
destroyOnClose
(
dialog
);
}
else
{
console
.
error
(
"
Failed to create component:
"
+
component
.
errorString
());
}
}
}
function
onConfetti
()
function
onConfetti
()
...
...
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