summaryrefslogtreecommitdiff
path: root/noncore/settings/usermanager/userdialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/userdialog.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 5854fe0..3616507 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -2,48 +2,46 @@
* *
* 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. *
* *
***************************************************************************/
#include "userdialog.h"
#include "passwd.h"
/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/odevice.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
/* QT */
#include <qlayout.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <qfile.h>
/* STD */
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
-
-using namespace Opie::Core;
-
-
/**
* UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.
*
*/
-using namespace Opie::Ui;
UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl)
{
vm=viewmode;
QVBoxLayout *layout = new QVBoxLayout(this);
myTabWidget=new QTabWidget(this,"User Tab Widget");
layout->addWidget(myTabWidget);
setupTab1();
setupTab2();
accounts->groupStringList.sort();
// And also fill the listview & the combobox with all available groups.
for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it)
@@ -236,25 +234,25 @@ bool UserDialog::addUser(int uid, int gid)
if (temp->text()=="power") temp->setOn(true);
if (temp->text()=="input") temp->setOn(true);
if (temp->text()=="sharp") temp->setOn(true);
if (temp->text()=="tty") temp->setOn(true);
}
}
// Show the dialog!
if(!(adduserDialog->exec())) return false;
if((adduserDialog->groupComboBox->currentItem()!=0))
{
accounts->findGroup(adduserDialog->groupComboBox->currentText());
adduserDialog->groupID=accounts->gr_gid;
- qWarning(QString::number(accounts->gr_gid));
+ owarn << QString::number(accounts->gr_gid) << oendl;
}
if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(),
adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),
QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText())))
{
QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user.");
return false;
}
// Add User to additional groups.
QListViewItemIterator it( adduserDialog->groupsListView );
for ( ; it.current(); ++it )
@@ -365,40 +363,40 @@ bool UserDialog::editUser(const char *username)
{
edituserDialog->groupComboBox->insertItem("<Undefined group>",0);
edituserDialog->groupComboBox->setCurrentItem(0);
}
// Select the groups in the listview, to which the user belongs.
QCheckListItem *temp;
// BAH!!! QRegExp in qt2 sucks... or maybe I do... can't figure out how to check for EITHER end of input ($) OR a comma, so here we do two different QRegExps instead.
QRegExp userRegExp(QString("[:,]%1$").arg(username)); // The end of line variant.
QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
{ // Iterate over all of them.
- qWarning(*it);
+ owarn << *it << oendl;
QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
for ( ; lvit.current(); ++lvit )
{
if(lvit.current()->text(0)==(*it).left((*it).find(":")))
{
temp=(QCheckListItem*)lvit.current();
temp->setOn(true); // If we find a line with that groupname, select it.;
}
}
}
userRegExp=QRegExp(QString("[:,]%1,").arg(username)); // And the other one. (not end of line.)
tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
{ // Iterate over all of them.
- qWarning(*it);
+ owarn << *it << oendl;
QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
for ( ; lvit.current(); ++lvit )
{
if(lvit.current()->text(0)==(*it).left((*it).find(":")))
{
temp=(QCheckListItem*)lvit.current();
temp->setOn(true); // If we find a line with that groupname, select it.;
}
}
}
if(!(edituserDialog->exec())) return false; // SHOW THE DIALOG!