Add refresh button

pull/1/head
Timothy Pearson 12 years ago
parent 9b5b856690
commit f2a7ce2afc

@ -157,6 +157,14 @@
<string>Delete</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="3" colspan="0">
<property name="name">
<cstring>user_buttonRefresh</cstring>
</property>
<property name="text">
<string>Refresh</string>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">
@ -413,6 +421,14 @@
<string>Delete</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="3" colspan="0">
<property name="name">
<cstring>group_buttonRefresh</cstring>
</property>
<property name="text">
<string>Refresh</string>
</property>
</widget>
<widget class="TQGroupBox" row="1" column="0" colspan="3">
<property name="name">
<cstring>groupGroupDetails</cstring>
@ -603,6 +619,14 @@
<string>Delete</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="3" colspan="0">
<property name="name">
<cstring>machine_buttonRefresh</cstring>
</property>
<property name="text">
<string>Refresh</string>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">
@ -795,6 +819,14 @@
<string>Delete</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="3" colspan="0">
<property name="name">
<cstring>service_buttonRefresh</cstring>
</property>
<property name="text">
<string>Refresh</string>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">

@ -116,6 +116,11 @@ LDAPConfig::LDAPConfig(TQWidget *parent, const char *name, const TQStringList&)
connect(base->machine_buttonDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedMachine()));
connect(base->service_buttonDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedService()));
connect(base->user_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
connect(base->group_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
connect(base->machine_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
connect(base->service_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
load();
KAboutData* about = new KAboutData("ldapmanager", I18N_NOOP("TDE LDAP Realm Manager"), "0.1",
@ -194,29 +199,33 @@ void LDAPConfig::save() {
}
void LDAPConfig::processLockouts() {
bool connected = (!(!m_ldapmanager));
TQListViewItem* lvi = base->user_list->selectedItem();
if (lvi) {
LDAPUserInfo user = selectedUser();
base->user_buttonModify->setEnabled(true);
base->user_buttonModify->setEnabled(connected);
base->user_buttonDelete->setEnabled(!user.tde_builtin_account);
}
else {
base->user_buttonModify->setEnabled(false);
base->user_buttonDelete->setEnabled(false);
}
base->user_buttonAdd->setEnabled(true);
base->user_buttonAdd->setEnabled(connected);
base->user_buttonRefresh->setEnabled(connected);
lvi = base->group_list->selectedItem();
if (lvi) {
LDAPGroupInfo group = selectedGroup();
base->group_buttonModify->setEnabled(true);
base->group_buttonModify->setEnabled(connected);
base->group_buttonDelete->setEnabled(!group.tde_builtin_account);
}
else {
base->group_buttonModify->setEnabled(false);
base->group_buttonDelete->setEnabled(false);
}
base->group_buttonAdd->setEnabled(true);
base->group_buttonAdd->setEnabled(connected);
base->group_buttonRefresh->setEnabled(connected);
lvi = base->machine_list->selectedItem();
if (lvi) {
@ -232,6 +241,7 @@ void LDAPConfig::processLockouts() {
// Think about it...yes you can add the 'add' feature...kadmin 'ank --random-key host/HOSTNAME.FQDN'...
base->machine_buttonAdd->setEnabled(false);
base->machine_buttonModify->setEnabled(false);
base->machine_buttonRefresh->setEnabled(connected);
lvi = base->service_list->selectedItem();
if (lvi) {
@ -241,10 +251,11 @@ void LDAPConfig::processLockouts() {
else {
base->service_buttonDelete->setEnabled(false);
}
base->service_buttonAdd->setEnabled(true);
base->service_buttonAdd->setEnabled(connected);
// FIXME
// Disable service modify as it is not implemented
base->service_buttonModify->setEnabled(false);
base->service_buttonRefresh->setEnabled(connected);
}
void LDAPConfig::connectToRealm(const TQString& realm) {
@ -271,6 +282,8 @@ void LDAPConfig::connectToRealm(const TQString& realm) {
updateAllInformation();
}
processLockouts();
}
void LDAPConfig::abortConnection() {
@ -317,24 +330,40 @@ void LDAPConfig::updateAllInformation() {
}
int LDAPConfig::populateUsers() {
if (!m_ldapmanager) {
return -1;
}
int retcode;
m_userInfoList = m_ldapmanager->users(&retcode);
return retcode;
}
int LDAPConfig::populateGroups() {
if (!m_ldapmanager) {
return -1;
}
int retcode;
m_groupInfoList = m_ldapmanager->groups(&retcode);
return retcode;
}
int LDAPConfig::populateMachines() {
if (!m_ldapmanager) {
return -1;
}
int retcode;
m_machineInfoList = m_ldapmanager->machines(&retcode);
return retcode;
}
int LDAPConfig::populateServices() {
if (!m_ldapmanager) {
return -1;
}
int retcode;
m_serviceInfoList = m_ldapmanager->services(&retcode);
return retcode;

Loading…
Cancel
Save