summaryrefslogtreecommitdiff
authorumopapisdn <umopapisdn>2002-09-24 21:48:42 (UTC)
committer umopapisdn <umopapisdn>2002-09-24 21:48:42 (UTC)
commit0792061c7f1758216f9d31314dc2c1bdabda653f (patch) (side-by-side diff)
treedf041dfd0c7144db69cb1a9a419cf28a87741d96
parent5fb5e6b63bbbffcc240380c57f186991253d0bd2 (diff)
downloadopie-0792061c7f1758216f9d31314dc2c1bdabda653f.zip
opie-0792061c7f1758216f9d31314dc2c1bdabda653f.tar.gz
opie-0792061c7f1758216f9d31314dc2c1bdabda653f.tar.bz2
Fixed searchpath for icons.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/usermanager.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index 883e5d7..87dd7f1 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -15,57 +15,57 @@
#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.
QPEToolBar *toolbar = new QPEToolBar(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("userconfig/adduser"),"Add User",0,this,SLOT(addUser()),toolbar,"Add User");
- edituserToolButton = new QToolButton(Resource::loadPixmap("userconfig/edituser"),"Edit User",0,this,SLOT(editUser()),toolbar,"Edit User");
- deleteuserToolButton = new QToolButton(Resource::loadPixmap("userconfig/deleteuser"),"Delete User",0,this,SLOT(delUser()),toolbar,"Delete User");
+ 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");
userstext->setUsesTextLabel(true);
toolbar->addSeparator();
- addgroupToolButton = new QToolButton(Resource::loadPixmap("userconfig/addgroup"),"Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group");
- editgroupToolButton = new QToolButton(Resource::loadPixmap("userconfig/editgroup"),"Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group");
- deletegroupToolButton = new QToolButton(Resource::loadPixmap("userconfig/deletegroup"),"Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group");
+ addgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/addgroup"),"Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group");
+ editgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/editgroup"),"Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group");
+ deletegroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/deletegroup"),"Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group");
QToolButton *groupstext = new QToolButton(0,"Group",0,0,0,toolbar,"Group");
groupstext->setUsesTextLabel(true);
addToolBar(toolbar,"myToolBar");
// Add a tabwidget and all the tabs.
myTabWidget = new QTabWidget(this,"My Tab Widget");
setupTabAccounts();
setupTabAllUsers();
setupTabAllGroups();
getUsers(); // Fill out the iconview & listview with all users.
getGroups(); // Fill out the group listview with all groups.
setCentralWidget(myTabWidget);
}
UserConfig::~UserConfig() {
accounts->close();
delete accounts;
}
void UserConfig::setupTabAccounts() {
QWidget *tabpage = new QWidget(this);
QVBoxLayout *layout = new QVBoxLayout(tabpage);
@@ -104,49 +104,49 @@ void UserConfig::setupTabAllGroups() {
groupsListView->addColumn("Groupname");
layout->addWidget(groupsListView);
groupsListView->setSorting(1,1);
groupsListView->setAllColumnsShowFocus(true);
myTabWidget->addTab(tabpage,"All Groups");
}
void UserConfig::getUsers() {
QString mytext;
QPixmap mypixmap;
// Empty the iconview & the listview.
usersIconView->clear();
usersListView->clear();
// availableUID is used as a deposite for the next available UID on the system, this should start at an ID over 500.
availableUID=500;
for(QStringList::Iterator it=accounts->passwdStringList.begin(); it!=accounts->passwdStringList.end(); ++it) {
accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.)
new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos);
if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) { // Is this user a "normal" user ?
mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon.
mypixmap=Resource::loadPixmap(QString("users/"+accounts->pw_name)); // Is there an icon for this user?
if(mypixmap.isNull()) {
- mypixmap=Resource::loadPixmap(QString("userconfig/usericon")); // If this user has no icon, load the default icon.
+ mypixmap=Resource::loadPixmap(QString("usermanager/usericon")); // If this user has no icon, load the default icon.
}
new QIconViewItem(usersIconView,mytext,mypixmap); // Add the icon+text to the qiconview.
}
if((accounts->pw_uid>=availableUID) && (accounts->pw_uid<65000)) availableUID=accounts->pw_uid+1; // Increase 1 to the latest know UID to get a free uid.
}
}
void UserConfig::addUser() {
if(UserDialog::addUser(availableUID,availableGID)) { // Add the user to the system, also send next available UID and GID.
getUsers(); // Update users views.
getGroups(); // Update groups view.
}
}
void UserConfig::editUser() {
QString username;
if(myTabWidget->currentPageIndex()==0) { // Users
if(usersIconView->currentItem()) { // Any icon selected?
username=usersIconView->currentItem()->text(); // Get the text associated with the icon.
username=username.left(username.find(" - (",0,true)); // Strip out the username.
if(UserDialog::editUser(username)) { // Bring up the userinfo dialog.
// If there were any changed also update the views.
getUsers();
getGroups();