diff options
author | Stefan Hacker <dd0t@users.sourceforge.net> | 2010-01-30 03:50:30 +0300 |
---|---|---|
committer | Stefan Hacker <dd0t@users.sourceforge.net> | 2010-01-30 03:50:30 +0300 |
commit | 03f59308cadd9f922a1a0049d637a67a068742ba (patch) | |
tree | 4a8bd61034075ca560d38571aebab293c8e9f441 /src/mumble/ACLEditor.cpp | |
parent | 107071339b384e5d4253bef905131b26e286cca0 (diff) |
Do not hide group/acl tabs from non-experts and visualize that WriteACL grants all rights by graying out the others if it is set.
Diffstat (limited to 'src/mumble/ACLEditor.cpp')
-rw-r--r-- | src/mumble/ACLEditor.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/mumble/ACLEditor.cpp b/src/mumble/ACLEditor.cpp index cc61b997e..07d39b137 100644 --- a/src/mumble/ACLEditor.cpp +++ b/src/mumble/ACLEditor.cpp @@ -55,11 +55,6 @@ ACLEditor::ACLEditor(int channelparentid, QWidget *p) : QDialog(p) { qtwTab->removeTab(2); qtwTab->removeTab(1); - if (!g.s.bExpert) { - qsbChannelPosition->hide(); - qlChannelPosition->hide(); - } - // Until I come around implementing it hide the password fields qleChannelPassword->hide(); qlChannelPassword->hide(); @@ -87,12 +82,6 @@ ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : Q setupUi(this); - if (!g.s.bExpert) { - qtwTab->removeTab(2); - qtwTab->removeTab(1); - qsbChannelPosition->hide(); - qlChannelPosition->hide(); - } qcbChannelTemporary->hide(); iId = mea.channel_id(); @@ -573,8 +562,10 @@ void ACLEditor::ACLEnableCheck() { int idx; for (idx=0;idx<qlACLAllow.count();idx++) { - qlACLAllow[idx]->setEnabled(ena); - qlACLDeny[idx]->setEnabled(ena); + // Only enable other checkboxes if writeacl isn't set + bool enathis = ena && (qlPerms[idx] == ChanACL::Write || !(as && static_cast<int>(as->pAllow) & ChanACL::Write)); + qlACLAllow[idx]->setEnabled(enathis); + qlACLDeny[idx]->setEnabled(enathis); } if (as) { @@ -815,6 +806,7 @@ void ACLEditor::ACLPermissions_clicked() { a = 0; d = 0; + bool ena = true; for (idx=0;idx<qlACLAllow.count();idx++) { ChanACL::Perm p = qlPerms[idx]; if (qlACLAllow[idx]->isChecked() && qlACLDeny[idx]->isChecked()) { @@ -823,6 +815,13 @@ void ACLEditor::ACLPermissions_clicked() { else qlACLAllow[idx]->setChecked(false); } + + qlACLAllow[idx]->setEnabled(ena); + qlACLDeny[idx]->setEnabled(ena); + + if (p == ChanACL::Write && qlACLAllow[idx]->isChecked()) + ena = false; + if (qlACLAllow[idx]->isChecked()) a |= p; if (qlACLDeny[idx]->isChecked()) |