summaryrefslogtreecommitdiff
path: root/noncore/settings/usermanager/userdialog.cpp
Unidiff
Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/userdialog.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 08de352..eb9a289 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -13,3 +13,3 @@
13/* OPIE */ 13/* OPIE */
14#include <opie/odevice.h> 14#include <opie2/odevice.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
@@ -51,3 +51,3 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
51 if(accounts->gr_name.find(QRegExp("^#"),0)) 51 if(accounts->gr_name.find(QRegExp("^#"),0))
52 {// Skip commented lines. 52 { // Skip commented lines.
53 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); 53 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
@@ -81,4 +81,4 @@ void UserDialog::setupTab1()
81 picturePushButton->setMaximumSize(48,48); 81 picturePushButton->setMaximumSize(48,48);
82 picturePushButton->setPixmap(Resource::loadPixmap("usermanager/usericon"));// Load default usericon. 82 picturePushButton->setPixmap(Resource::loadPixmap("usermanager/usericon")); // Load default usericon.
83 connect(picturePushButton,SIGNAL(clicked()),this,SLOT(clickedPicture()));// Clicking the picture should invoke pictureselector. 83 connect(picturePushButton,SIGNAL(clicked()),this,SLOT(clickedPicture())); // Clicking the picture should invoke pictureselector.
84 84
@@ -202,3 +202,3 @@ void UserDialog::setupTab2()
202 * Static function that creates the userinfo dialog. 202 * Static function that creates the userinfo dialog.
203 * The user will be prompted to add a user. 203 * The user will be prompted to add a user.
204 * 204 *
@@ -219,4 +219,4 @@ bool UserDialog::addUser(int uid, int gid)
219 adduserDialog->setCaption(tr("Add User")); 219 adduserDialog->setCaption(tr("Add User"));
220 adduserDialog->userID=uid;// Set next available UID as default uid. 220 adduserDialog->userID=uid; // Set next available UID as default uid.
221 adduserDialog->groupID=gid;// Set next available GID as default gid. 221 adduserDialog->groupID=gid; // Set next available GID as default gid.
222 // Insert default group into groupComboBox 222 // Insert default group into groupComboBox
@@ -273,3 +273,3 @@ bool UserDialog::addUser(int uid, int gid)
273 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; 273 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png";
274 // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48); 274 // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48);
275 adduserDialog->userImage.save(filename,"PNG"); 275 adduserDialog->userImage.save(filename,"PNG");
@@ -286,3 +286,3 @@ bool UserDialog::addUser(int uid, int gid)
286 286
287 command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1());// Bug in busybox, ".*" includes parent directory, does this work as a workaround? 287 command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1()); // Bug in busybox, ".*" includes parent directory, does this work as a workaround?
288 system(command_cp); 288 system(command_cp);
@@ -307,5 +307,5 @@ bool UserDialog::delUser(const char *username)
307 if((accounts->findUser(username))) 307 if((accounts->findUser(username)))
308 {// Does that user exist? 308 { // Does that user exist?
309 if(!(accounts->delUser(username))) 309 if(!(accounts->delUser(username)))
310 {// Delete the user. 310 { // Delete the user.
311 QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+"."); 311 QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+".");
@@ -334,7 +334,7 @@ bool UserDialog::editUser(const char *username)
334 // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here. 334 // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here.
335 UserDialog *edituserDialog=new UserDialog(VIEWMODE_EDIT);// Create Dialog 335 UserDialog *edituserDialog=new UserDialog(VIEWMODE_EDIT); // Create Dialog
336 edituserDialog->setCaption(tr("Edit User")); 336 edituserDialog->setCaption(tr("Edit User"));
337 accounts->findUser(username);// Locate user in database and fill variables in 'accounts' object. 337 accounts->findUser(username); // Locate user in database and fill variables in 'accounts' object.
338 if(!(accounts->findGroup(accounts->pw_gid))) 338 if(!(accounts->findGroup(accounts->pw_gid)))
339 {// Locate the user's primary group, and fill group variables in 'accounts' object. 339 { // Locate the user's primary group, and fill group variables in 'accounts' object.
340 invalid_group=1; 340 invalid_group=1;
@@ -371,8 +371,8 @@ bool UserDialog::editUser(const char *username)
371 // 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. 371 // 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.
372 QRegExp userRegExp(QString("[:,]%1$").arg(username));// The end of line variant. 372 QRegExp userRegExp(QString("[:,]%1$").arg(username)); // The end of line variant.
373 QStringList tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. 373 QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
374 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) 374 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
375 {// Iterate over all of them. 375 { // Iterate over all of them.
376 qWarning(*it); 376 qWarning(*it);
377 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. 377 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
378 for ( ; lvit.current(); ++lvit ) 378 for ( ; lvit.current(); ++lvit )
@@ -382,3 +382,3 @@ bool UserDialog::editUser(const char *username)
382 temp=(QCheckListItem*)lvit.current(); 382 temp=(QCheckListItem*)lvit.current();
383 temp->setOn(true);// If we find a line with that groupname, select it.; 383 temp->setOn(true); // If we find a line with that groupname, select it.;
384 } 384 }
@@ -386,8 +386,8 @@ bool UserDialog::editUser(const char *username)
386 } 386 }
387 userRegExp=QRegExp(QString("[:,]%1,").arg(username));// And the other one. (not end of line.) 387 userRegExp=QRegExp(QString("[:,]%1,").arg(username)); // And the other one. (not end of line.)
388 tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. 388 tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
389 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) 389 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
390 {// Iterate over all of them. 390 { // Iterate over all of them.
391 qWarning(*it); 391 qWarning(*it);
392 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. 392 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
393 for ( ; lvit.current(); ++lvit ) 393 for ( ; lvit.current(); ++lvit )
@@ -397,3 +397,3 @@ bool UserDialog::editUser(const char *username)
397 temp=(QCheckListItem*)lvit.current(); 397 temp=(QCheckListItem*)lvit.current();
398 temp->setOn(true);// If we find a line with that groupname, select it.; 398 temp->setOn(true); // If we find a line with that groupname, select it.;
399 } 399 }
@@ -402,5 +402,5 @@ bool UserDialog::editUser(const char *username)
402 402
403 if(!(edituserDialog->exec())) return false;// SHOW THE DIALOG! 403 if(!(edituserDialog->exec())) return false; // SHOW THE DIALOG!
404 404
405 accounts->findUser(username);// Fill user variables in 'acccounts' object. 405 accounts->findUser(username); // Fill user variables in 'acccounts' object.
406 accounts->pw_name=edituserDialog->loginLineEdit->text(); 406 accounts->pw_name=edituserDialog->loginLineEdit->text();
@@ -412,4 +412,4 @@ bool UserDialog::editUser(const char *username)
412 if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) 412 if(accounts->findGroup(edituserDialog->groupComboBox->currentText()))
413 {// Fill all group variables in 'accounts' object. 413 { // Fill all group variables in 'accounts' object.
414 accounts->pw_gid=accounts->gr_gid;// Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group. 414 accounts->pw_gid=accounts->gr_gid; // Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group.
415 } 415 }
@@ -444,3 +444,3 @@ bool UserDialog::editUser(const char *username)
444 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"; 444 QString filename="/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png";
445 // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48); 445 // edituserDialog->userImage=edituserDialog->userImage.smoothScale(48,48);
446 edituserDialog->userImage.save(filename,"PNG"); 446 edituserDialog->userImage.save(filename,"PNG");
@@ -481,3 +481,3 @@ void UserDialog::clickedPicture()
481 { 481 {
482 // userImage=userImage.smoothScale(48,48); 482 // userImage=userImage.smoothScale(48,48);
483 QPixmap *picture; 483 QPixmap *picture;