author | drw <drw> | 2005-06-09 21:34:17 (UTC) |
---|---|---|
committer | drw <drw> | 2005-06-09 21:34:17 (UTC) |
commit | 9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62 (patch) (unidiff) | |
tree | 874045053074a769c6dc634f9c7a7175e191ac99 /noncore/settings/usermanager | |
parent | d5c8de3585a6e94c18156e51299f1e49cc992285 (diff) | |
download | opie-9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62.zip opie-9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62.tar.gz opie-9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62.tar.bz2 |
Resource -> OResource
Diffstat (limited to 'noncore/settings/usermanager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 3 | ||||
-rw-r--r-- | noncore/settings/usermanager/usermanager.cpp | 44 |
2 files changed, 31 insertions, 16 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index 9dfb2af..3654639 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -13,6 +13,7 @@ | |||
13 | /* OPIE */ | 13 | /* OPIE */ |
14 | #include <opie2/odebug.h> | 14 | #include <opie2/odebug.h> |
15 | #include <opie2/odevice.h> | 15 | #include <opie2/odevice.h> |
16 | #include <opie2/oresource.h> | ||
16 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
17 | using namespace Opie::Core; | 18 | using namespace Opie::Core; |
18 | using namespace Opie::Ui; | 19 | using namespace Opie::Ui; |
@@ -78,7 +79,7 @@ void UserDialog::setupTab1() | |||
78 | picturePushButton = new QPushButton(tabpage,"Label"); | 79 | picturePushButton = new QPushButton(tabpage,"Label"); |
79 | picturePushButton->setMinimumSize(48,48); | 80 | picturePushButton->setMinimumSize(48,48); |
80 | picturePushButton->setMaximumSize(48,48); | 81 | picturePushButton->setMaximumSize(48,48); |
81 | picturePushButton->setPixmap(Resource::loadPixmap("usermanager/usericon")); // Load default usericon. | 82 | picturePushButton->setPixmap(Opie::Core::OResource::loadPixmap("usermanager/usericon")); // Load default usericon. |
82 | connect(picturePushButton,SIGNAL(clicked()),this,SLOT(clickedPicture())); // Clicking the picture should invoke pictureselector. | 83 | connect(picturePushButton,SIGNAL(clicked()),this,SLOT(clickedPicture())); // Clicking the picture should invoke pictureselector. |
83 | 84 | ||
84 | // Login | 85 | // Login |
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp index 1d345ee..2c046b1 100644 --- a/noncore/settings/usermanager/usermanager.cpp +++ b/noncore/settings/usermanager/usermanager.cpp | |||
@@ -11,9 +11,9 @@ | |||
11 | 11 | ||
12 | /* OPIE */ | 12 | /* OPIE */ |
13 | #include <opie2/odebug.h> | 13 | #include <opie2/odebug.h> |
14 | #include <qpe/resource.h> | 14 | #include <opie2/oresource.h> |
15 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
16 | 16 | #include <qpe/qpeapplication.h> | |
17 | /* QT */ | 17 | /* QT */ |
18 | #include <qlayout.h> | 18 | #include <qlayout.h> |
19 | #include <qmessagebox.h> | 19 | #include <qmessagebox.h> |
@@ -36,19 +36,33 @@ UserConfig::UserConfig(QWidget* parent, const char* name, WFlags fl) : QMainWind | |||
36 | accounts->open();// This actually loads the files /etc/passwd & /etc/group into memory. | 36 | accounts->open();// This actually loads the files /etc/passwd & /etc/group into memory. |
37 | 37 | ||
38 | // Create the toolbar. | 38 | // Create the toolbar. |
39 | setToolBarsMovable( false ); | ||
40 | bool useBigIcon = qApp->desktop()->size().width() > 330; | ||
39 | QToolBar *toolbar = new QToolBar(this,"Toolbar"); | 41 | QToolBar *toolbar = new QToolBar(this,"Toolbar"); |
40 | toolbar->setHorizontalStretchable(1); // Is there any other way to get the toolbar to stretch of the full screen!? | 42 | toolbar->setHorizontalStretchable( true ); |
41 | adduserToolButton = new QToolButton(Resource::loadPixmap("usermanager/adduser"),"Add User",0,this,SLOT(addUser()),toolbar,"Add User"); | 43 | adduserToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/adduser", Opie::Core::OResource::SmallIcon), |
42 | edituserToolButton = new QToolButton(Resource::loadPixmap("usermanager/edituser"),"Edit User",0,this,SLOT(editUser()),toolbar,"Edit User"); | 44 | "Add User",0,this,SLOT(addUser()),toolbar,"Add User"); |
43 | deleteuserToolButton = new QToolButton(Resource::loadPixmap("usermanager/deleteuser"),"Delete User",0,this,SLOT(delUser()),toolbar,"Delete User"); | 45 | adduserToolButton->setUsesBigPixmap( useBigIcon ); |
44 | QToolButton *userstext = new QToolButton(0,"User",0,0,0,toolbar,"User"); | 46 | edituserToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/edituser", Opie::Core::OResource::SmallIcon), |
45 | userstext->setUsesTextLabel(true); | 47 | "Edit User",0,this,SLOT(editUser()),toolbar,"Edit User"); |
48 | edituserToolButton->setUsesBigPixmap( useBigIcon ); | ||
49 | deleteuserToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/deleteuser", Opie::Core::OResource::SmallIcon), | ||
50 | "Delete User",0,this,SLOT(delUser()),toolbar,"Delete User"); | ||
51 | deleteuserToolButton->setUsesBigPixmap( useBigIcon ); | ||
52 | //QToolButton *userstext = new QToolButton(0,"User",0,0,0,toolbar,"User"); | ||
53 | //userstext->setUsesTextLabel(true); | ||
46 | toolbar->addSeparator(); | 54 | toolbar->addSeparator(); |
47 | addgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/addgroup"),"Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group"); | 55 | addgroupToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/addgroup", Opie::Core::OResource::SmallIcon), |
48 | editgroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/editgroup"),"Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group"); | 56 | "Add Group",0,this,SLOT(addGroup()),toolbar,"Add Group"); |
49 | deletegroupToolButton = new QToolButton(Resource::loadPixmap("usermanager/deletegroup"),"Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group"); | 57 | addgroupToolButton->setUsesBigPixmap( useBigIcon ); |
50 | QToolButton *groupstext = new QToolButton(0,"Group",0,0,0,toolbar,"Group"); | 58 | editgroupToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/editgroup", Opie::Core::OResource::SmallIcon), |
51 | groupstext->setUsesTextLabel(true); | 59 | "Edit Group",0,this,SLOT(editGroup()),toolbar,"Edit Group"); |
60 | editgroupToolButton->setUsesBigPixmap( useBigIcon ); | ||
61 | deletegroupToolButton = new QToolButton(Opie::Core::OResource::loadPixmap("usermanager/deletegroup", Opie::Core::OResource::SmallIcon), | ||
62 | "Delete Group",0,this,SLOT(delGroup()),toolbar,"Delete Group"); | ||
63 | deletegroupToolButton->setUsesBigPixmap( useBigIcon ); | ||
64 | //QToolButton *groupstext = new QToolButton(0,"Group",0,0,0,toolbar,"Group"); | ||
65 | //groupstext->setUsesTextLabel(true); | ||
52 | addToolBar(toolbar,"myToolBar"); | 66 | addToolBar(toolbar,"myToolBar"); |
53 | 67 | ||
54 | // Add a tabwidget and all the tabs. | 68 | // Add a tabwidget and all the tabs. |
@@ -132,8 +146,8 @@ void UserConfig::getUsers() { | |||
132 | new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); | 146 | new QListViewItem(usersListView,QString::number(accounts->pw_uid),accounts->pw_name,accounts->pw_gecos); |
133 | if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ? | 147 | if((accounts->pw_uid>=500) && (accounts->pw_uid<65000)) {// Is this user a "normal" user ? |
134 | mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon. | 148 | mytext=QString(accounts->pw_name)+" - ("+QString(accounts->pw_gecos)+")"; // The string displayed next to the icon. |
135 | 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. | 149 | if(!(mypixmap.load("/opt/QtPalmtop/pics/users/"+accounts->pw_name+".png"))) { // Is there an icon for this user? Opie::Core::OResource::loadPixmap is caching, doesn't work. |
136 | mypixmap=Resource::loadPixmap(QString("usermanager/usericon"));// If this user has no icon, load the default icon. | 150 | mypixmap=Opie::Core::OResource::loadPixmap("usermanager/usericon", Opie::Core::OResource::SmallIcon);// If this user has no icon, load the default icon. |
137 | } | 151 | } |
138 | listviewitem=new QListViewItem(usersIconView,"",mytext);// Add the icon+text to the qiconview. | 152 | listviewitem=new QListViewItem(usersIconView,"",mytext);// Add the icon+text to the qiconview. |
139 | listviewitem->setPixmap(0,mypixmap); | 153 | listviewitem->setPixmap(0,mypixmap); |