summaryrefslogtreecommitdiff
path: root/noncore/settings/usermanager/usermanager.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/usermanager/usermanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/usermanager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index a1130d4..1d345ee 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -1,41 +1,44 @@
/***************************************************************************
* *
* 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>
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/resource.h>
+using namespace Opie::Core;
+/* QT */
+#include <qlayout.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");
toolbar->setHorizontalStretchable(1); // Is there any other way to get the toolbar to stretch of the full screen!?
adduserToolButton = new QToolButton(Resource::loadPixmap("usermanager/adduser"),"Add User",0,this,SLOT(addUser()),toolbar,"Add User");
edituserToolButton = new QToolButton(Resource::loadPixmap("usermanager/edituser"),"Edit User",0,this,SLOT(editUser()),toolbar,"Edit User");
deleteuserToolButton = new QToolButton(Resource::loadPixmap("usermanager/deleteuser"),"Delete User",0,this,SLOT(delUser()),toolbar,"Delete User");
QToolButton *userstext = new QToolButton(0,"User",0,0,0,toolbar,"User");
@@ -232,26 +235,26 @@ void UserConfig::editGroup() {
int gid;
if(groupsListView->currentItem()) { // Any group selected?
gid=groupsListView->currentItem()->text(0).toInt(); // Get the GID from the listview.
if(GroupDialog::editGroup(gid)) getGroups(); // Bring up the edit group dialog.
} else {
QMessageBox::information(this,"No selection","No group has been selected.");
}
}
void UserConfig::delGroup() {
const char *groupname;
if(groupsListView->currentItem()) { // Any group selected?
groupname=groupsListView->currentItem()->text(1); // Get the groupname from the listview.
if(QMessageBox::warning(this,"Delete group","Are you sure you want to\ndelete the group \""+QString(groupname)+"\" ?","&No","&Yes",0,0,1)) {
// If confirmed, try to delete the group.
if(GroupDialog::delGroup(groupname)) getGroups(); // And also update the view afterwards if the user was deleted.
}
} else {
QMessageBox::information(this,"No selection","No group has been selected.");
}
}
void UserConfig::showUserMenu(QListViewItem *item) {
// userPopupMenu.exec(item->mapToGlobal(QPoint(0,0)));
- qWarning("Pressed!");
+ owarn << "Pressed!" << oendl;
}