summaryrefslogtreecommitdiff
authordrw <drw>2004-02-22 00:50:59 (UTC)
committer drw <drw>2004-02-22 00:50:59 (UTC)
commit9ab4aa3df617519bdf4309303725abc802fbc704 (patch) (side-by-side diff)
tree42f80b5b426c9c2dfeeee0d758a81a15f8031a1c
parentb7f37da2a6266326102cda0dc4569033e3d3f9d0 (diff)
downloadopie-9ab4aa3df617519bdf4309303725abc802fbc704.zip
opie-9ab4aa3df617519bdf4309303725abc802fbc704.tar.gz
opie-9ab4aa3df617519bdf4309303725abc802fbc704.tar.bz2
User Manager: libopie->libopie2
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/usermanager/main.cpp4
-rw-r--r--noncore/settings/usermanager/opie-usermanager.control2
-rw-r--r--noncore/settings/usermanager/userdialog.cpp2
-rw-r--r--noncore/settings/usermanager/userdialog.h2
-rw-r--r--noncore/settings/usermanager/usermanager.pro2
5 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/usermanager/main.cpp b/noncore/settings/usermanager/main.cpp
index 515ea9a..d7147d1 100644
--- a/noncore/settings/usermanager/main.cpp
+++ b/noncore/settings/usermanager/main.cpp
@@ -1,14 +1,14 @@
/***************************************************************************
* *
* 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 <qpe/qpeapplication.h>
-#include <opie/oapplicationfactory.h>
+
+#include <opie2/oapplicationfactory.h>
OPIE_EXPORT_APP( OApplicationFactory<UserConfig> )
diff --git a/noncore/settings/usermanager/opie-usermanager.control b/noncore/settings/usermanager/opie-usermanager.control
index 5061366..52930d2 100644
--- a/noncore/settings/usermanager/opie-usermanager.control
+++ b/noncore/settings/usermanager/opie-usermanager.control
@@ -1,10 +1,10 @@
Package: opie-usermanager
Files: plugins/application/libusermanager.so* bin/usermanager apps/Settings/usermanager.desktop pics/usermanager/*
Priority: optional
Section: opie/settings
-Depends: task-opie-minimal
+Depends: task-opie-minimal, libopiecore2, libopieui2
Architecture: arm
Maintainer: Ted Parnefors <zaurus@bredband.net>
License: GPL
Description: User/Group manager for Opie.
Version: $QPE_VERSION$EXTRAVERSION
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
@@ -1,142 +1,142 @@
/***************************************************************************
* *
* 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 <opie/odevice.h>
+#include <opie2/odevice.h>
#include <qpe/qpeapplication.h>
/* 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;
/**
* 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();
// And also fill the listview & the combobox with all available groups.
for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it)
{
accounts->splitGroupEntry(*it);
if(accounts->gr_name.find(QRegExp("^#"),0))
{ // Skip commented lines.
new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
groupComboBox->insertItem(accounts->gr_name);
}
}
QPEApplication::showDialog( this );
}
/**
* 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);
diff --git a/noncore/settings/usermanager/userdialog.h b/noncore/settings/usermanager/userdialog.h
index 3272afc..a94e49b 100644
--- a/noncore/settings/usermanager/userdialog.h
+++ b/noncore/settings/usermanager/userdialog.h
@@ -1,67 +1,67 @@
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
#ifndef USERDIALOG_H
#define USERDIALOG_H
#include <qdialog.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qtabwidget.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qpe/resource.h>
-#include <opie/ofiledialog.h>
+#include <opie2/ofiledialog.h>
class UserDialog : public QDialog
{
Q_OBJECT
private:
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;
enum VIEWMODE {
VIEWMODE_NEW,
VIEWMODE_EDIT
};
void setupTab1(void);
void setupTab2(void);
void accept(void);
private slots:
void clickedPicture(void);
public:
UserDialog( int viewmode=VIEWMODE_NEW, QWidget* parent = 0, const char* name = 0, bool modal=true, WFlags fl = 0 );
~UserDialog();
static bool addUser(int uid, int gid);
static bool editUser(const char *username);
static bool delUser(const char *username);
};
#endif
diff --git a/noncore/settings/usermanager/usermanager.pro b/noncore/settings/usermanager/usermanager.pro
index 0b2f056..f20c9c3 100644
--- a/noncore/settings/usermanager/usermanager.pro
+++ b/noncore/settings/usermanager/usermanager.pro
@@ -1,10 +1,10 @@
#CONFIG = qt warn_on debug
CONFIG = qt warn_on release quick-app
HEADERS = usermanager.h userdialog.h groupdialog.h passwd.h
SOURCES = usermanager.cpp userdialog.cpp groupdialog.cpp passwd.cpp main.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
-LIBS += -lqpe -lopie -lcrypt
+LIBS += -lqpe -lopiecore2 -lopieui2 -lcrypt
TARGET = usermanager
include ( $(OPIEDIR)/include.pro )