diff options
author | Timothy Pearson <[email protected]> | 2012-05-29 23:16:59 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-05-29 23:16:59 -0500 |
commit | a890828d5269f6535567dcb3498eba62d5335ee1 (patch) | |
tree | 6ebcb734c94463ced7f6cb04daf05656ff267ad2 /src/groupconfigdlg.cpp | |
parent | a6d06dfe2ab0aadb6b0987fb7f96e8f3c9841846 (diff) | |
download | kcmldapmanager-a890828d5269f6535567dcb3498eba62d5335ee1.tar.gz kcmldapmanager-a890828d5269f6535567dcb3498eba62d5335ee1.zip |
Can now add and delete groups
Diffstat (limited to 'src/groupconfigdlg.cpp')
-rw-r--r-- | src/groupconfigdlg.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/groupconfigdlg.cpp b/src/groupconfigdlg.cpp index 94b70e4..5629d2e 100644 --- a/src/groupconfigdlg.cpp +++ b/src/groupconfigdlg.cpp @@ -45,10 +45,13 @@ GroupConfigDialog::GroupConfigDialog(LDAPGroupInfo group, LDAPConfig* parent, co m_base->addToGroup->setText(i18n("-->")); m_base->removeFromGroup->setText(i18n("<--")); - m_base->groupName->setEnabled(false); + if (group.distinguishedName != "") { + m_base->groupName->setEnabled(false); + } connect(m_base->addToGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(addSelectedUserToGroup())); connect(m_base->removeFromGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedUserFromGroup())); + connect(m_base->groupName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts())); // Update fields m_base->groupName->setText(m_group.name); @@ -72,7 +75,7 @@ GroupConfigDialog::GroupConfigDialog(LDAPGroupInfo group, LDAPConfig* parent, co } void GroupConfigDialog::slotOk() { - int i; + unsigned int i; // Update data m_group.gid = m_base->groupID->value(); @@ -85,11 +88,22 @@ void GroupConfigDialog::slotOk() { } m_group.userlist = userlist; + // Special handler for new group + if (m_group.distinguishedName == "") { + m_group.name = m_base->groupName->text(); + } + accept(); } void GroupConfigDialog::processLockouts() { - // + // Special handler for new group + if ((m_group.distinguishedName == "") && (m_base->groupName->text() == "")) { + enableButton(KDialogBase::Ok, false); + } + else { + enableButton(KDialogBase::Ok, true); + } } void GroupConfigDialog::addSelectedUserToGroup() { |