Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

UserDialog Class Reference

#include </home/clem/local/src/opie/noncore/settings/usermanager/userdialog.h>

Collaboration diagram for UserDialog:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UserDialog (int viewmode=VIEWMODE_NEW, QWidget *parent=0, const char *name=0, bool modal=true, WFlags fl=0)
 ~UserDialog ()

Static Public Member Functions

static bool addUser (int uid, int gid)
static bool editUser (const char *username)
static bool delUser (const char *username)

Private Types

enum  VIEWMODE { VIEWMODE_NEW, VIEWMODE_EDIT }

Private Slots

void clickedPicture (void)

Private Member Functions

void setupTab1 (void)
void setupTab2 (void)
void accept (void)

Private Attributes

QTabWidget * myTabWidget
QPushButton * picturePushButton
QLineEdit * loginLineEdit
QLineEdit * uidLineEdit
QLineEdit * gecosLineEdit
QLineEdit * passwordLineEdit
QComboBox * shellComboBox
QComboBox * groupComboBox
QLabel * skelLabel
QCheckBox * skelCheckBox
QListView * groupsListView
QStringList groupMembers
QString pictureLocation
QImage userImage
int groupID
int userID
int vm

Member Enumeration Documentation

enum UserDialog::VIEWMODE [private]
 

Enumeration values:
VIEWMODE_NEW 
VIEWMODE_EDIT 

Definition at line 46 of file userdialog.h.


Constructor & Destructor Documentation

UserDialog::UserDialog int  viewmode = VIEWMODE_NEW,
QWidget *  parent = 0,
const char *  name = 0,
bool  modal = true,
WFlags  fl = 0
 

UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.

Definition at line 37 of file userdialog.cpp.

References accounts, QValueList< T >::begin(), QValueList< T >::end(), QString::find(), Passwd::gr_name, groupComboBox, groupsListView, Passwd::groupStringList, myTabWidget, setupTab1(), setupTab2(), QPEApplication::showDialog(), QStringList::sort(), Passwd::splitGroupEntry(), and vm.

Referenced by addUser(), and editUser().

UserDialog::~UserDialog  ) 
 

Empty destructor.

Definition at line 64 of file userdialog.cpp.


Member Function Documentation

void UserDialog::accept void   )  [private]
 

"OK" has been clicked. Verify some information before closing the dialog.

Definition at line 455 of file userdialog.cpp.

References loginLineEdit.

bool UserDialog::addUser int  uid,
int  gid
[static]
 

Static function that creates the userinfo dialog. The user will be prompted to add a user.

Parameters:
uid This is a suggested available UID.
gid This is a suggested available GID.
Returns:
true if the user was successfully added, otherwise false.

Definition at line 211 of file userdialog.cpp.

References accounts, Passwd::addGroupMember(), Passwd::addUser(), d, QDir::exists(), Passwd::findGroup(), Passwd::findUser(), gecosLineEdit, Passwd::gr_gid, groupComboBox, groupID, groupsListView, Opie::ODevice::inst(), QString::latin1(), loginLineEdit, QDir::mkdir(), QString::number(), oendl, owarn, passwordLineEdit, Passwd::pw_dir, Passwd::pw_gid, Passwd::pw_name, Passwd::pw_uid, QPEApplication::qpeDir(), shellComboBox, skelCheckBox, QString::sprintf(), Opie::Core::System_OpenZaurus, tr, uidLineEdit, UserDialog(), userID, userImage, and VIEWMODE_NEW.

Referenced by UserConfig::addUser().

void UserDialog::clickedPicture void   )  [private, slot]
 

This slot is called when the usericon is clicked, this loads (should) the iconselector.

Definition at line 470 of file userdialog.cpp.

References OFileSelector::EXTENDED, OFileDialog::getOpenFileName(), QString::isEmpty(), QString::null, picturePushButton, and userImage.

Referenced by setupTab1().

bool UserDialog::delUser const char *  username  )  [static]
 

Deletes the user account.

Parameters:
username User to be deleted.
Returns:
true if the user was successfully deleted, otherwise false.

Definition at line 305 of file userdialog.cpp.

References accounts, Passwd::delUser(), and Passwd::findUser().

Referenced by UserConfig::delUser().

bool UserDialog::editUser const char *  username  )  [static]
 

This displays a confirmation dialog wether a user should be deleted or not. (And also deletes the account)

Parameters:
username User to be deleted.
Returns:
true if the user was successfully deleted, otherwise false.

Definition at line 331 of file userdialog.cpp.

References accounts, Passwd::addGroupMember(), QValueList< T >::begin(), crypt(), Passwd::crypt_make_salt(), d, Passwd::delGroupMember(), QValueList< T >::end(), QDir::exists(), Passwd::findGroup(), Passwd::findUser(), gecosLineEdit, Passwd::gr_gid, Passwd::gr_name, QStringList::grep(), groupComboBox, groupsListView, Passwd::groupStringList, i, loginLineEdit, QDir::mkdir(), QString::number(), oendl, owarn, passwordLineEdit, Passwd::pw_gecos, Passwd::pw_gid, Passwd::pw_name, Passwd::pw_passwd, Passwd::pw_shell, Passwd::pw_uid, QPEApplication::qpeDir(), shellComboBox, tr, uidLineEdit, Passwd::updateUser(), UserDialog(), userImage, and VIEWMODE_EDIT.

Referenced by UserConfig::editUser().

void UserDialog::setupTab1 void   )  [private]
 

Creates the first tab, all userinfo is here.

Definition at line 71 of file userdialog.cpp.

References clickedPicture(), gecosLineEdit, groupComboBox, Opie::Core::OResource::loadPixmap(), loginLineEdit, myTabWidget, passwordLineEdit, picturePushButton, shellComboBox, skelCheckBox, skelLabel, uidLineEdit, VIEWMODE_NEW, and vm.

Referenced by UserDialog().

void UserDialog::setupTab2 void   )  [private]
 

Creates the second tab containing additional groups for the user.

Definition at line 181 of file userdialog.cpp.

References groupsListView, and myTabWidget.

Referenced by UserDialog().


Member Data Documentation

QLineEdit* UserDialog::gecosLineEdit [private]
 

Definition at line 32 of file userdialog.h.

Referenced by addUser(), editUser(), and setupTab1().

QComboBox* UserDialog::groupComboBox [private]
 

Definition at line 35 of file userdialog.h.

Referenced by addUser(), editUser(), setupTab1(), and UserDialog().

int UserDialog::groupID [private]
 

Definition at line 43 of file userdialog.h.

Referenced by addUser().

QStringList UserDialog::groupMembers [private]
 

Definition at line 40 of file userdialog.h.

QListView* UserDialog::groupsListView [private]
 

Definition at line 38 of file userdialog.h.

Referenced by addUser(), editUser(), setupTab2(), and UserDialog().

QLineEdit* UserDialog::loginLineEdit [private]
 

Definition at line 30 of file userdialog.h.

Referenced by accept(), addUser(), editUser(), and setupTab1().

QTabWidget* UserDialog::myTabWidget [private]
 

Definition at line 26 of file userdialog.h.

Referenced by setupTab1(), setupTab2(), and UserDialog().

QLineEdit* UserDialog::passwordLineEdit [private]
 

Definition at line 33 of file userdialog.h.

Referenced by addUser(), editUser(), and setupTab1().

QString UserDialog::pictureLocation [private]
 

Definition at line 41 of file userdialog.h.

QPushButton* UserDialog::picturePushButton [private]
 

Definition at line 29 of file userdialog.h.

Referenced by clickedPicture(), and setupTab1().

QComboBox* UserDialog::shellComboBox [private]
 

Definition at line 34 of file userdialog.h.

Referenced by addUser(), editUser(), and setupTab1().

QCheckBox* UserDialog::skelCheckBox [private]
 

Definition at line 37 of file userdialog.h.

Referenced by addUser(), and setupTab1().

QLabel* UserDialog::skelLabel [private]
 

Definition at line 36 of file userdialog.h.

Referenced by setupTab1().

QLineEdit* UserDialog::uidLineEdit [private]
 

Definition at line 31 of file userdialog.h.

Referenced by addUser(), editUser(), and setupTab1().

int UserDialog::userID [private]
 

Definition at line 44 of file userdialog.h.

Referenced by addUser().

QImage UserDialog::userImage [private]
 

Definition at line 42 of file userdialog.h.

Referenced by addUser(), clickedPicture(), and editUser().

int UserDialog::vm [private]
 

Definition at line 45 of file userdialog.h.

Referenced by setupTab1(), and UserDialog().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:54:51 2005 for OPIE by  doxygen 1.4.2