Only show room pack button, when you can actually create one

pull/841/head
Nicolas Werner 3 years ago
parent a0699f5247
commit d46e517e3a
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 3
      resources/qml/Root.qml
  2. 2
      resources/qml/dialogs/ImagePackSettingsDialog.qml
  3. 3
      src/timeline/TimelineViewManager.cpp
  4. 2
      src/timeline/TimelineViewManager.h

@ -192,8 +192,9 @@ Page {
userProfile.show();
}
function onShowImagePackSettings(packlist) {
function onShowImagePackSettings(room, packlist) {
var packSet = packSettingsComponent.createObject(timelineRoot, {
"room": room,
"packlist": packlist
});
packSet.show();

@ -12,6 +12,7 @@ import im.nheko 1.0
ApplicationWindow {
id: win
property Room room
property ImagePackListModel packlist
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.3)
property SingleImagePackModel currentPack: packlist.packAt(currentPackIndex)
@ -85,6 +86,7 @@ ApplicationWindow {
dialog.show();
}
width: packlistC.width
visible: room.permissions.canChange(MtxEvent.ImagePackInRoom)
text: qsTr("New room pack")
}

@ -418,7 +418,8 @@ TimelineViewManager::openImageOverlay(QString mxcUrl, QString eventId)
void
TimelineViewManager::openImagePackSettings(QString roomid)
{
emit showImagePackSettings(new ImagePackListModel(roomid.toStdString(), this));
auto room = rooms_->getRoomById(roomid).get();
emit showImagePackSettings(room, new ImagePackListModel(roomid.toStdString(), this));
}
void

@ -91,7 +91,7 @@ signals:
void openRoomSettingsDialog(RoomSettings *settings);
void openInviteUsersDialog(InviteesModel *invitees);
void openProfile(UserProfile *profile);
void showImagePackSettings(ImagePackListModel *packlist);
void showImagePackSettings(TimelineModel *room, ImagePackListModel *packlist);
void openLeaveRoomDialog(QString roomid);
public slots:

Loading…
Cancel
Save