Diffstat (limited to 'noncore/settings/usermanager/usermanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/usermanager.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp index ed18b7f..2735e6a 100644 --- a/noncore/settings/usermanager/usermanager.cpp +++ b/noncore/settings/usermanager/usermanager.cpp @@ -73,5 +73,6 @@ void UserConfig::setupTabAccounts() { - usersIconView=new QIconView(tabpage,"users"); - usersIconView->setItemTextPos(QIconView::Right); - usersIconView->setArrangement(QIconView::LeftToRight); + usersIconView=new QListView(tabpage,"users"); + usersIconView->addColumn("Icon"); + usersIconView->addColumn("Username"); + usersIconView->setAllColumnsShowFocus(true); layout->addWidget(usersIconView); @@ -114,3 +115,4 @@ void UserConfig::getUsers() { QPixmap mypixmap; - + QListViewItem *listviewitem; + // Empty the iconview & the listview. @@ -126,8 +128,7 @@ void UserConfig::getUsers() { 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? Resource::loadPixmap is caching, doesn't work. - if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { -// if(mypixmap.isNull()) { + if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { // Is there an icon for this user? Resource::loadPixmap is caching, doesn't work. 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. + listviewitem=new QListViewItem(usersIconView,"",mytext); // Add the icon+text to the qiconview. + listviewitem->setPixmap(0,mypixmap); } @@ -149,3 +150,3 @@ void UserConfig::editUser() { if(usersIconView->currentItem()) { // Any icon selected? - username=usersIconView->currentItem()->text(); // Get the text associated with the icon. + username=usersIconView->currentItem()->text(1); // Get the text associated with the icon. username=username.left(username.find(" - (",0,true)); // Strip out the username. @@ -179,3 +180,3 @@ void UserConfig::delUser() { if(usersIconView->currentItem()) { // Anything selected? - username=usersIconView->currentItem()->text(); // Get string associated with icon. + username=usersIconView->currentItem()->text(1); // Get string associated with icon. username=username.left(username.find(" - (",0,true)); // Strip out the username. |