author | umopapisdn <umopapisdn> | 2002-09-28 22:28:39 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2002-09-28 22:28:39 (UTC) |
commit | aa347496d408431d85ff2d7a2cf60479407620af (patch) (unidiff) | |
tree | 64e7fed8efd41d2c4b3bdf26c863a5486ee0ede3 /noncore/settings/usermanager/usermanager.cpp | |
parent | 7980189a2cb34e2864c339ef68bfbe7fb4910750 (diff) | |
download | opie-aa347496d408431d85ff2d7a2cf60479407620af.zip opie-aa347496d408431d85ff2d7a2cf60479407620af.tar.gz opie-aa347496d408431d85ff2d7a2cf60479407620af.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/settings/usermanager/usermanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/usermanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp index 87dd7f1..ed18b7f 100644 --- a/noncore/settings/usermanager/usermanager.cpp +++ b/noncore/settings/usermanager/usermanager.cpp | |||
@@ -70,12 +70,13 @@ void UserConfig::setupTabAccounts() { | |||
70 | QWidget *tabpage = new QWidget(this); | 70 | QWidget *tabpage = new QWidget(this); |
71 | QVBoxLayout *layout = new QVBoxLayout(tabpage); | 71 | QVBoxLayout *layout = new QVBoxLayout(tabpage); |
72 | layout->setMargin(5); | 72 | layout->setMargin(5); |
73 | 73 | ||
74 | usersIconView=new QIconView(tabpage,"users"); | 74 | usersIconView=new QIconView(tabpage,"users"); |
75 | usersIconView->setItemTextPos(QIconView::Right); | 75 | usersIconView->setItemTextPos(QIconView::Right); |
76 | usersIconView->setArrangement(QIconView::LeftToRight); | ||
76 | layout->addWidget(usersIconView); | 77 | layout->addWidget(usersIconView); |
77 | 78 | ||
78 | myTabWidget->addTab(tabpage,"Users"); | 79 | myTabWidget->addTab(tabpage,"Users"); |
79 | } | 80 | } |
80 | 81 | ||
81 | void UserConfig::setupTabAllUsers() { | 82 | void UserConfig::setupTabAllUsers() { |
@@ -120,20 +121,22 @@ void UserConfig::getUsers() { | |||
120 | availableUID=500; | 121 | availableUID=500; |
121 | for(QStringList::Iterator it=accounts->passwdStringList.begin(); it!=accounts->passwdStringList.end(); ++it) { | 122 | for(QStringList::Iterator it=accounts->passwdStringList.begin(); it!=accounts->passwdStringList.end(); ++it) { |
122 | accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.) | 123 | accounts->splitPasswdEntry(*it); // Split the string into it's components and store in variables in the accounts object. ("pr_name" and so on.) |
123 | new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); | 124 | new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); |
124 | if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ? | 125 | if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ? |
125 | mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon. | 126 | mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon. |
126 | mypixmap=Resource::loadPixmap(QString("users/"+accounts->pw_name));// Is there an icon for this user? | 127 | // mypixmap=Resource::loadPixmap(QString("users/"+accounts->pw_name));// Is there an icon for this user? Resource::loadPixmap is caching, doesn't work. |
127 | if(mypixmap.isNull()) { | 128 | if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { |
129 | // if(mypixmap.isNull()) { | ||
128 | mypixmap=Resource::loadPixmap(QString("usermanager/usericon"));// If this user has no icon, load the default icon. | 130 | mypixmap=Resource::loadPixmap(QString("usermanager/usericon"));// If this user has no icon, load the default icon. |
129 | } | 131 | } |
130 | new QIconViewItem(usersIconView,mytext,mypixmap);// Add the icon+text to the qiconview. | 132 | new QIconViewItem(usersIconView,mytext,mypixmap);// Add the icon+text to the qiconview. |
131 | } | 133 | } |
132 | 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. | 134 | 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. |
133 | } | 135 | } |
136 | usersIconView->sort(); | ||
134 | } | 137 | } |
135 | 138 | ||
136 | void UserConfig::addUser() { | 139 | void UserConfig::addUser() { |
137 | if(UserDialog::addUser(availableUID,availableGID)) {// Add the user to the system, also send next available UID and GID. | 140 | if(UserDialog::addUser(availableUID,availableGID)) {// Add the user to the system, also send next available UID and GID. |
138 | getUsers(); // Update users views. | 141 | getUsers(); // Update users views. |
139 | getGroups(); // Update groups view. | 142 | getGroups(); // Update groups view. |