Diffstat (limited to 'noncore/settings/usermanager/userdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index b7827a4..90e27d5 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp @@ -36,2 +36,3 @@ UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) + accounts->groupStringList.sort(); // And also fill the listview & the combobox with all available groups. @@ -39,3 +40,2 @@ UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) accounts->splitGroupEntry(*it); - //new QListViewItem(groupsListView,accounts->gr_name); new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); @@ -43,3 +43,2 @@ UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) } - showMaximized(); @@ -107,2 +106,10 @@ void UserDialog::setupTab1() { + // Copy /etc/skel + QLabel *skelLabel=new QLabel(tabpage,"skel"); + skelLabel->setText("Copy /etc/skel: "); + skelCheckBox=new QCheckBox(tabpage); + skelCheckBox->setChecked(true); + skelLabel->setDisabled(true); + skelCheckBox->setDisabled(true); + // Widget layout @@ -126,2 +133,4 @@ void UserDialog::setupTab1() { vlayout1->addWidget(groupLabel); + vlayout1->addSpacing(5); + vlayout1->addWidget(skelLabel); // Second column, data @@ -138,2 +147,4 @@ void UserDialog::setupTab1() { vlayout2->addWidget(groupComboBox); + vlayout2->addSpacing(5); + vlayout2->addWidget(skelCheckBox); hlayout->addLayout(vlayout1); @@ -250,2 +261,3 @@ bool UserDialog::delUser(const char *username) { bool UserDialog::editUser(const char *username) { + int invalid_group=0; UserDialog *edituserDialog=new UserDialog(); // Create Dialog @@ -253,3 +265,5 @@ bool UserDialog::editUser(const char *username) { accounts->findUser(username); // Locate user in database and fill variables in 'accounts' object. - accounts->findGroup(accounts->pw_gid); // Locate the user's primary group, and fill group variables in 'accounts' object. + if(!(accounts->findGroup(accounts->pw_gid))) { // Locate the user's primary group, and fill group variables in 'accounts' object. + invalid_group=1; + } // Fill widgets with userinfo. @@ -269,3 +283,8 @@ bool UserDialog::editUser(const char *username) { edituserDialog->groupComboBox->setCurrentItem(i); + break; + } } + if(invalid_group) { + edituserDialog->groupComboBox->insertItem("<Undefined group>",0); + edituserDialog->groupComboBox->setCurrentItem(0); } @@ -294,4 +313,5 @@ bool UserDialog::editUser(const char *username) { accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt(); - accounts->findGroup(edituserDialog->groupComboBox->currentText()); // Fill all group variables in 'accounts' object. - accounts->pw_gid=accounts->gr_gid; + if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) { // Fill all group variables in 'accounts' object. + accounts->pw_gid=accounts->gr_gid; // Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group. + } accounts->pw_gecos=edituserDialog->gecosLineEdit->text(); |