From c8b59ecab5c226aaa059d5acaff6633b93ec51d9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 12:13:12 -0600 Subject: Use proper file names for the group permissions editor --- clients/tde/src/part/adminusermgmt/Makefile.am | 2 +- .../tde/src/part/adminusermgmt/groupauthdlg.cpp | 136 +++++++++++++++++++++ clients/tde/src/part/adminusermgmt/groupauthdlg.h | 73 +++++++++++ .../tde/src/part/adminusermgmt/groupauthdlgbase.ui | 65 ++++++++++ clients/tde/src/part/adminusermgmt/part.cpp | 2 +- .../tde/src/part/adminusermgmt/terminatedlg.cpp | 136 --------------------- clients/tde/src/part/adminusermgmt/terminatedlg.h | 73 ----------- .../tde/src/part/adminusermgmt/terminatedlgbase.ui | 65 ---------- 8 files changed, 276 insertions(+), 276 deletions(-) create mode 100644 clients/tde/src/part/adminusermgmt/groupauthdlg.cpp create mode 100644 clients/tde/src/part/adminusermgmt/groupauthdlg.h create mode 100644 clients/tde/src/part/adminusermgmt/groupauthdlgbase.ui delete mode 100644 clients/tde/src/part/adminusermgmt/terminatedlg.cpp delete mode 100644 clients/tde/src/part/adminusermgmt/terminatedlg.h delete mode 100644 clients/tde/src/part/adminusermgmt/terminatedlgbase.ui diff --git a/clients/tde/src/part/adminusermgmt/Makefile.am b/clients/tde/src/part/adminusermgmt/Makefile.am index 21dfe99..c1273d0 100644 --- a/clients/tde/src/part/adminusermgmt/Makefile.am +++ b/clients/tde/src/part/adminusermgmt/Makefile.am @@ -8,4 +8,4 @@ KDE_ICON = libremotelab_adminusermgmt kde_module_LTLIBRARIES = libremotelab_adminusermgmt.la libremotelab_adminusermgmt_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT) -ltdekrbsocket -ltqtrla libremotelab_adminusermgmt_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) $(LIB_TDECORE) $(LIB_TDEUI) -lkio -ltdefx -libremotelab_adminusermgmt_la_SOURCES = part.cpp layout.ui terminatedlg.cpp terminatedlgbase.ui +libremotelab_adminusermgmt_la_SOURCES = part.cpp layout.ui groupauthdlg.cpp groupauthdlgbase.ui diff --git a/clients/tde/src/part/adminusermgmt/groupauthdlg.cpp b/clients/tde/src/part/adminusermgmt/groupauthdlg.cpp new file mode 100644 index 0000000..3633332 --- /dev/null +++ b/clients/tde/src/part/adminusermgmt/groupauthdlg.cpp @@ -0,0 +1,136 @@ +/*************************************************************************** + * Copyright (C) 2013 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "groupauthdlgbase.h" +#include "groupauthdlg.h" + +TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key) : TQListBoxText(listbox, text), m_key(key) { + // +} + +TQListBoxKeyedText::TQListBoxKeyedText(const TQString & text, const TQ_UINT32 key) : TQListBoxText(text), m_key(key) { + // +} + +TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after) : TQListBoxText(listbox, text, after), m_key(key) { + // +} + +TQListBoxKeyedText::~TQListBoxKeyedText() { + // +} + +TQ_UINT32 TQListBoxKeyedText::key() { + return m_key; +} + +GroupPermissionsDialog::GroupPermissionsDialog(TQWidget* parent, const char* name) + : KDialogBase(parent, name, true, i18n("Manage Permissions"), Ok|Cancel, Ok, true) +{ + m_base = new GroupPermissionsDlgBase(this); + m_base->permissionsSelector->availableListBox()->setSelectionMode(TQListBox::Multi); + m_base->permissionsSelector->selectedListBox()->setSelectionMode(TQListBox::Multi); + + setMainWidget(m_base); + + connect(m_base->m_groupName, SIGNAL(textChanged(const TQString&)), this, SLOT(processLockouts())); + m_base->m_groupName->setFocus(); + + processLockouts(); +} + +void GroupPermissionsDialog::processLockouts() { + if (m_base->m_groupName->text() != "") { + enableButtonOK(true); + } + else { + enableButtonOK(false); + } +} + +void GroupPermissionsDialog::setGroupName(TQString name, bool editable) { + m_base->m_groupName->setText(name); + m_base->m_groupName->setEnabled(editable); +} + +TQString GroupPermissionsDialog::groupName() { + return m_base->m_groupName->text(); +} + +void GroupPermissionsDialog::setPermissionsSelectorLabel(TQString label) { + m_base->groupPermissionsSelector->setTitle(label); +} + +void GroupPermissionsDialog::setAvailableServers(TQKeyedStringList list) { + TQListBox* availableListBox = m_base->permissionsSelector->availableListBox(); + for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) { + new TQListBoxKeyedText(availableListBox, (*it).first, (*it).second); + } + availableListBox->sort(true); +} + +void GroupPermissionsDialog::setSelectedServers(TQKeyedStringList list) { + TQListBox* availableListBox = m_base->permissionsSelector->availableListBox(); + TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox(); + for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) { + TQListBoxItem* item = availableListBox->findItem((*it).first, ExactMatch); + if (item) { + delete item; + } + new TQListBoxKeyedText(selectedListBox, (*it).first, (*it).second); + } + availableListBox->sort(true); + selectedListBox->sort(true); +} + +TQKeyedStringList GroupPermissionsDialog::selectedServers() { + TQKeyedStringList list; + TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox(); + TQListBoxItem* item = selectedListBox->firstItem(); + while (item) { + TQListBoxKeyedText* item2 = dynamic_cast(item); + if (item2) { + list.append(TQKeyedStringPair(item2->text(), item2->key())); + } + item = item->next(); + } + return list; +} + +void GroupPermissionsDialog::slotOk() { + accept(); +} + +#include "groupauthdlg.moc" diff --git a/clients/tde/src/part/adminusermgmt/groupauthdlg.h b/clients/tde/src/part/adminusermgmt/groupauthdlg.h new file mode 100644 index 0000000..3290c7f --- /dev/null +++ b/clients/tde/src/part/adminusermgmt/groupauthdlg.h @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (C) 2013 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _GROUPAUTHDIALOG_H_ +#define _GROUPAUTHDIALOG_H_ + +#include +#include + +class GroupPermissionsDlgBase; +class TopLevel; + +typedef TQPair< TQString, TQ_UINT32 > TQKeyedStringPair; +typedef TQValueList< TQKeyedStringPair > TQKeyedStringList; + +class TQListBoxKeyedText : public TQListBoxText +{ + public: + TQListBoxKeyedText(TQListBox* listbox, const TQString & text=TQString::null, const TQ_UINT32 key=0); + TQListBoxKeyedText(const TQString & text=TQString::null, const TQ_UINT32 key=0 ); + TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after); + ~TQListBoxKeyedText(); + + public: + TQ_UINT32 key(); + + private: + TQ_UINT32 m_key; +}; + +class GroupPermissionsDialog : public KDialogBase +{ + Q_OBJECT + + public: + GroupPermissionsDialog(TQWidget* parent = 0, const char* name = 0); + + public: + void setGroupName(TQString name, bool editable); + TQString groupName(); + void setPermissionsSelectorLabel(TQString label); + void setAvailableServers(TQKeyedStringList list); + void setSelectedServers(TQKeyedStringList list); + TQKeyedStringList selectedServers(); + + public slots: + void slotOk(); + + private slots: + void processLockouts(); + + private: + GroupPermissionsDlgBase *m_base; +}; + +#endif diff --git a/clients/tde/src/part/adminusermgmt/groupauthdlgbase.ui b/clients/tde/src/part/adminusermgmt/groupauthdlgbase.ui new file mode 100644 index 0000000..ced61a0 --- /dev/null +++ b/clients/tde/src/part/adminusermgmt/groupauthdlgbase.ui @@ -0,0 +1,65 @@ + +GroupPermissionsDlgBase + + + GroupPermissionsDlgBase + + + + + m_frameTerminate + + + NoFrame + + + Plain + + + + + + + unnamed + + + 0 + + + + m_groupNameLabel + + + Group Name: + + + + + m_groupName + + + + + + + + groupPermissionsSelector + + + + unnamed + + + + permissionsSelector + + + + + + + + + + + diff --git a/clients/tde/src/part/adminusermgmt/part.cpp b/clients/tde/src/part/adminusermgmt/part.cpp index 8426ca0..98a97ab 100644 --- a/clients/tde/src/part/adminusermgmt/part.cpp +++ b/clients/tde/src/part/adminusermgmt/part.cpp @@ -56,7 +56,7 @@ #include "tracewidget.h" #include "floatspinbox.h" #include "layout.h" -#include "terminatedlg.h" +#include "groupauthdlg.h" #define NETWORK_COMM_TIMEOUT_MS 2500 diff --git a/clients/tde/src/part/adminusermgmt/terminatedlg.cpp b/clients/tde/src/part/adminusermgmt/terminatedlg.cpp deleted file mode 100644 index ac1a43f..0000000 --- a/clients/tde/src/part/adminusermgmt/terminatedlg.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Timothy Pearson * - * kb9vqf@pearsoncomputing.net * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "terminatedlgbase.h" -#include "terminatedlg.h" - -TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key) : TQListBoxText(listbox, text), m_key(key) { - // -} - -TQListBoxKeyedText::TQListBoxKeyedText(const TQString & text, const TQ_UINT32 key) : TQListBoxText(text), m_key(key) { - // -} - -TQListBoxKeyedText::TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after) : TQListBoxText(listbox, text, after), m_key(key) { - // -} - -TQListBoxKeyedText::~TQListBoxKeyedText() { - // -} - -TQ_UINT32 TQListBoxKeyedText::key() { - return m_key; -} - -GroupPermissionsDialog::GroupPermissionsDialog(TQWidget* parent, const char* name) - : KDialogBase(parent, name, true, i18n("Manage Permissions"), Ok|Cancel, Ok, true) -{ - m_base = new GroupPermissionsDlgBase(this); - m_base->permissionsSelector->availableListBox()->setSelectionMode(TQListBox::Multi); - m_base->permissionsSelector->selectedListBox()->setSelectionMode(TQListBox::Multi); - - setMainWidget(m_base); - - connect(m_base->m_groupName, SIGNAL(textChanged(const TQString&)), this, SLOT(processLockouts())); - m_base->m_groupName->setFocus(); - - processLockouts(); -} - -void GroupPermissionsDialog::processLockouts() { - if (m_base->m_groupName->text() != "") { - enableButtonOK(true); - } - else { - enableButtonOK(false); - } -} - -void GroupPermissionsDialog::setGroupName(TQString name, bool editable) { - m_base->m_groupName->setText(name); - m_base->m_groupName->setEnabled(editable); -} - -TQString GroupPermissionsDialog::groupName() { - return m_base->m_groupName->text(); -} - -void GroupPermissionsDialog::setPermissionsSelectorLabel(TQString label) { - m_base->groupPermissionsSelector->setTitle(label); -} - -void GroupPermissionsDialog::setAvailableServers(TQKeyedStringList list) { - TQListBox* availableListBox = m_base->permissionsSelector->availableListBox(); - for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) { - new TQListBoxKeyedText(availableListBox, (*it).first, (*it).second); - } - availableListBox->sort(true); -} - -void GroupPermissionsDialog::setSelectedServers(TQKeyedStringList list) { - TQListBox* availableListBox = m_base->permissionsSelector->availableListBox(); - TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox(); - for (TQKeyedStringList::Iterator it = list.begin(); it != list.end(); ++it) { - TQListBoxItem* item = availableListBox->findItem((*it).first, ExactMatch); - if (item) { - delete item; - } - new TQListBoxKeyedText(selectedListBox, (*it).first, (*it).second); - } - availableListBox->sort(true); - selectedListBox->sort(true); -} - -TQKeyedStringList GroupPermissionsDialog::selectedServers() { - TQKeyedStringList list; - TQListBox* selectedListBox = m_base->permissionsSelector->selectedListBox(); - TQListBoxItem* item = selectedListBox->firstItem(); - while (item) { - TQListBoxKeyedText* item2 = dynamic_cast(item); - if (item2) { - list.append(TQKeyedStringPair(item2->text(), item2->key())); - } - item = item->next(); - } - return list; -} - -void GroupPermissionsDialog::slotOk() { - accept(); -} - -#include "terminatedlg.moc" diff --git a/clients/tde/src/part/adminusermgmt/terminatedlg.h b/clients/tde/src/part/adminusermgmt/terminatedlg.h deleted file mode 100644 index df15265..0000000 --- a/clients/tde/src/part/adminusermgmt/terminatedlg.h +++ /dev/null @@ -1,73 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2013 by Timothy Pearson * - * kb9vqf@pearsoncomputing.net * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef _TERMINATEDIALOG_H_ -#define _TERMINATEDIALOG_H_ - -#include -#include - -class GroupPermissionsDlgBase; -class TopLevel; - -typedef TQPair< TQString, TQ_UINT32 > TQKeyedStringPair; -typedef TQValueList< TQKeyedStringPair > TQKeyedStringList; - -class TQListBoxKeyedText : public TQListBoxText -{ - public: - TQListBoxKeyedText(TQListBox* listbox, const TQString & text=TQString::null, const TQ_UINT32 key=0); - TQListBoxKeyedText(const TQString & text=TQString::null, const TQ_UINT32 key=0 ); - TQListBoxKeyedText(TQListBox* listbox, const TQString & text, const TQ_UINT32 key, TQListBoxItem *after); - ~TQListBoxKeyedText(); - - public: - TQ_UINT32 key(); - - private: - TQ_UINT32 m_key; -}; - -class GroupPermissionsDialog : public KDialogBase -{ - Q_OBJECT - - public: - GroupPermissionsDialog(TQWidget* parent = 0, const char* name = 0); - - public: - void setGroupName(TQString name, bool editable); - TQString groupName(); - void setPermissionsSelectorLabel(TQString label); - void setAvailableServers(TQKeyedStringList list); - void setSelectedServers(TQKeyedStringList list); - TQKeyedStringList selectedServers(); - - public slots: - void slotOk(); - - private slots: - void processLockouts(); - - private: - GroupPermissionsDlgBase *m_base; -}; - -#endif diff --git a/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui b/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui deleted file mode 100644 index ced61a0..0000000 --- a/clients/tde/src/part/adminusermgmt/terminatedlgbase.ui +++ /dev/null @@ -1,65 +0,0 @@ - -GroupPermissionsDlgBase - - - GroupPermissionsDlgBase - - - - - m_frameTerminate - - - NoFrame - - - Plain - - - - - - - unnamed - - - 0 - - - - m_groupNameLabel - - - Group Name: - - - - - m_groupName - - - - - - - - groupPermissionsSelector - - - - unnamed - - - - permissionsSelector - - - - - - - - - - - -- cgit v1.2.3