diff options
author | Tim Cooper <tim.cooper@layeh.com> | 2015-11-17 01:13:48 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2015-11-22 16:17:39 +0300 |
commit | 84b1bcecef790a84d10b2d1f2060c1681a2bb836 (patch) | |
tree | afd76f37553f0d7dd0d3880334ae710ffd8de476 /src/mumble/ACLEditor.cpp | |
parent | 07a142d1b8bb6aa2823179b3b89b41a5c914a87b (diff) |
Add per-channel user limit
Diffstat (limited to 'src/mumble/ACLEditor.cpp')
-rw-r--r-- | src/mumble/ACLEditor.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mumble/ACLEditor.cpp b/src/mumble/ACLEditor.cpp index 12efb369e..a0cce815e 100644 --- a/src/mumble/ACLEditor.cpp +++ b/src/mumble/ACLEditor.cpp @@ -63,6 +63,9 @@ ACLEditor::ACLEditor(int channelparentid, QWidget *p) : QDialog(p) { qleChannelPassword->hide(); qlChannelPassword->hide(); + qlChannelMaxUsers->hide(); + qsbChannelMaxUsers->hide(); + qlChannelID->hide(); qleChannelName->setFocus(); @@ -104,6 +107,15 @@ ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : Q qsbChannelPosition->setRange(INT_MIN, INT_MAX); qsbChannelPosition->setValue(pChannel->iPosition); + if (g.sh->uiVersion >= 0x010300) { + qsbChannelMaxUsers->setRange(0, INT_MAX); + qsbChannelMaxUsers->setValue(pChannel->uiMaxUsers); + qsbChannelMaxUsers->setSpecialValueText(tr("Default server value")); + } else { + qlChannelMaxUsers->hide(); + qsbChannelMaxUsers->hide(); + } + QGridLayout *grid = new QGridLayout(qgbACLpermissions); l = new QLabel(tr("Deny"), qgbACLpermissions); @@ -282,6 +294,10 @@ void ACLEditor::accept() { mpcs.set_position(qsbChannelPosition->value()); needs_update = true; } + if (pChannel->uiMaxUsers != static_cast<unsigned int>(qsbChannelMaxUsers->value())) { + mpcs.set_max_users(qsbChannelMaxUsers->value()); + needs_update = true; + } if (needs_update) g.sh->sendMessage(mpcs); |