Permission model
Add a model for managing permissions (power levels) in rooms. This gets rid of a whole bunch of boiler plate in NeoChat and as a bonus makes it easy to add a feature to allow setting the permission level for any event.
This commit is contained in:
@@ -28,32 +28,14 @@ Kirigami.Dialog {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
ColumnLayout {
|
||||
FormCard.FormComboBoxDelegate {
|
||||
id: powerLevelComboBox
|
||||
|
||||
text: i18n("New power level")
|
||||
model: ListModel {
|
||||
id: powerLevelModel
|
||||
}
|
||||
textRole: "text"
|
||||
valueRole: "powerLevel"
|
||||
|
||||
// Done this way so we can have translated strings.
|
||||
Component.onCompleted: {
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Member (0)"),
|
||||
"powerLevel": 0
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Moderator (50)"),
|
||||
"powerLevel": 50
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Admin (100)"),
|
||||
"powerLevel": 100
|
||||
});
|
||||
}
|
||||
model: PowerLevelModel {}
|
||||
textRole: "name"
|
||||
valueRole: "value"
|
||||
}
|
||||
}
|
||||
customFooterActions: [
|
||||
|
||||
Reference in New Issue
Block a user