summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/groupdialog.cpp2
-rw-r--r--noncore/settings/usermanager/userdialog.cpp9
-rw-r--r--noncore/settings/usermanager/usermanager.cpp1
3 files changed, 3 insertions, 9 deletions
diff --git a/noncore/settings/usermanager/groupdialog.cpp b/noncore/settings/usermanager/groupdialog.cpp
index b595d31..76810be 100644
--- a/noncore/settings/usermanager/groupdialog.cpp
+++ b/noncore/settings/usermanager/groupdialog.cpp
@@ -1,41 +1,39 @@
/***************************************************************************
* *
* 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 "groupdialog.h"
#include <qlabel.h>
#include <qlayout.h>
#include <qmessagebox.h>
-#include <stdlib.h>
-
#include "passwd.h"
GroupDialog::GroupDialog(QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) {
// GID
QLabel *gidLabel=new QLabel(this,"gid: ");
gidLabel->setText("GroupID: ");
gidLineEdit=new QLineEdit(this,"gid: ");
gidLineEdit->setEnabled(false);
// Groupname
QLabel *groupnameLabel=new QLabel(this,"groupname");
groupnameLabel->setText("Groupname: ");
groupnameLineEdit=new QLineEdit(this,"groupname");
// Widget layout
QVBoxLayout *layout=new QVBoxLayout(this);
layout->setMargin(5);
QHBoxLayout *hlayout=new QHBoxLayout(-1,"hlayout");
layout->addLayout(hlayout);
QVBoxLayout *vlayout1=new QVBoxLayout(-1,"vlayout1");
QVBoxLayout *vlayout2=new QVBoxLayout(-1,"vlayout2");
// First column, labels
vlayout1->addWidget(gidLabel);
vlayout1->addWidget(groupnameLabel);
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 19b0e84..d87a005 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -1,43 +1,40 @@
/***************************************************************************
* *
* 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 <qlayout.h>
#include <qlabel.h>
#include <qmessagebox.h>
#include <qfile.h>
-#include <stdlib.h>
-
-#include <stdio.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#include "passwd.h"
#include <opie/odevice.h>
using namespace Opie;
/**
* UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.
*
*/
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();
@@ -54,93 +51,93 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
/**
* Empty destructor.
*
*/
UserDialog::~UserDialog() {
}
/**
* Creates the first tab, all userinfo is here.
*
*/
void UserDialog::setupTab1() {
QPixmap mypixmap;
QWidget *tabpage = new QWidget(myTabWidget,"page1");
QVBoxLayout *layout = new QVBoxLayout(tabpage);
layout->setMargin(5);
// Picture
picturePushButton = new QPushButton(tabpage,"Label");
picturePushButton->setMinimumSize(48,48);
picturePushButton->setMaximumSize(48,48);
picturePushButton->setPixmap(Resource::loadPixmap("usermanager/usericon")); // Load default usericon.
connect(picturePushButton,SIGNAL(clicked()),this,SLOT(clickedPicture())); // Clicking the picture should invoke pictureselector.
-
+
// Login
QLabel *loginLabel=new QLabel(tabpage,"Login: ");
loginLabel->setText("Login: ");
loginLineEdit=new QLineEdit(tabpage,"Login: ");
// UID
QLabel *uidLabel=new QLabel(tabpage,"uid: ");
uidLabel->setText("UserID: ");
uidLineEdit=new QLineEdit(tabpage,"uid: ");
uidLineEdit->setEnabled(false);
// Username (gecos)
QLabel *gecosLabel=new QLabel(tabpage,"gecos");
gecosLabel->setText("Username: ");
gecosLineEdit=new QLineEdit(tabpage,"gecos");
// Password
QLabel *passwordLabel=new QLabel(tabpage,"password");
passwordLabel->setText("Password: ");
passwordLineEdit=new QLineEdit(tabpage,"password");
passwordLineEdit->setEchoMode(QLineEdit::Password);
// Shell
QLabel *shellLabel=new QLabel(tabpage,"shell");
shellLabel->setText("Shell: ");
shellComboBox=new QComboBox(tabpage,"shell");
shellComboBox->setEditable(true);
shellComboBox->insertItem("/bin/sh");
shellComboBox->insertItem("/bin/ash");
shellComboBox->insertItem("/bin/false");
-
+
// Primary Group
QLabel *groupLabel=new QLabel(tabpage,"group");
groupLabel->setText("Primary group: ");
groupComboBox=new QComboBox(tabpage,"PrimaryGroup");
if(vm==VIEWMODE_NEW) {
// Copy /etc/skel
skelLabel=new QLabel(tabpage,"skel");
skelLabel->setText("Copy /etc/skel: ");
skelCheckBox=new QCheckBox(tabpage);
skelCheckBox->setChecked(true);
}
-
+
// Widget layout
QHBoxLayout *hlayout=new QHBoxLayout(-1,"hlayout");
layout->addWidget(picturePushButton);
layout->addSpacing(5);
layout->addLayout(hlayout);
QVBoxLayout *vlayout1=new QVBoxLayout(-1,"vlayout1");
QVBoxLayout *vlayout2=new QVBoxLayout(-1,"vlayout2");
// First column, labels
vlayout1->addWidget(loginLabel);
vlayout1->addSpacing(5);
vlayout1->addWidget(uidLabel);
vlayout1->addSpacing(5);
vlayout1->addWidget(gecosLabel);
vlayout1->addSpacing(5);
vlayout1->addWidget(passwordLabel);
vlayout1->addSpacing(5);
vlayout1->addWidget(shellLabel);
vlayout1->addSpacing(5);
vlayout1->addWidget(groupLabel);
if(vm==VIEWMODE_NEW) {
vlayout1->addSpacing(5);
vlayout1->addWidget(skelLabel);
}
// Second column, data
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index 5c90525..5411995 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -1,37 +1,36 @@
/***************************************************************************
* *
* 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 "usermanager.h"
#include <qlayout.h>
-#include <stdio.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <qpe/resource.h>
#include <qregexp.h>
/**
* The mainwindow constructor.
*
* @param QWidget *parent
* @param const char *name
* @ param WFlags fl
*
*/
UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWindow(parent, name, fl) {
setCaption(tr("Opie User Manager"));
// Create an instance of the global object 'accounts'. This holds all user/group info, and functions to modify them.
accounts=new Passwd();
accounts->open(); // This actually loads the files /etc/passwd & /etc/group into memory.
// Create the toolbar.
QToolBar *toolbar = new QToolBar(this,"Toolbar");