summaryrefslogtreecommitdiff
authorumopapisdn <umopapisdn>2002-10-15 11:25:36 (UTC)
committer umopapisdn <umopapisdn>2002-10-15 11:25:36 (UTC)
commitb6fb59110629634056be3dd5c3091e6ed3271fd0 (patch) (unidiff)
treee5ea61782d46b6fbc599d4b27e443d5002035958
parent42ff9036e791321b4938d80c5d8386a76391f56b (diff)
downloadopie-b6fb59110629634056be3dd5c3091e6ed3271fd0.zip
opie-b6fb59110629634056be3dd5c3091e6ed3271fd0.tar.gz
opie-b6fb59110629634056be3dd5c3091e6ed3271fd0.tar.bz2
System checking for OpenZaurus is now done through libopie (ODevice::system)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/usermanager/userdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 42a9144..36bcf86 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -11,32 +11,36 @@
11 11
12#include <qlayout.h> 12#include <qlayout.h>
13#include <qlabel.h> 13#include <qlabel.h>
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15#include <qfile.h> 15#include <qfile.h>
16 16
17#include <stdlib.h> 17#include <stdlib.h>
18 18
19#include <stdio.h> 19#include <stdio.h>
20#include <sys/types.h> 20#include <sys/types.h>
21#include <sys/wait.h> 21#include <sys/wait.h>
22#include <unistd.h> 22#include <unistd.h>
23#include <signal.h> 23#include <signal.h>
24 24
25#include "passwd.h" 25#include "passwd.h"
26 26
27#include <opie/odevice.h>
28using namespace Opie;
29
30
27/** 31/**
28 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups. 32 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.
29 * 33 *
30 */ 34 */
31UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) { 35UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) {
32 QVBoxLayout *layout = new QVBoxLayout(this); 36 QVBoxLayout *layout = new QVBoxLayout(this);
33 myTabWidget=new QTabWidget(this,"User Tab Widget"); 37 myTabWidget=new QTabWidget(this,"User Tab Widget");
34 layout->addWidget(myTabWidget); 38 layout->addWidget(myTabWidget);
35 setupTab1(); 39 setupTab1();
36 setupTab2(); 40 setupTab2();
37 41
38 accounts->groupStringList.sort(); 42 accounts->groupStringList.sort();
39 // And also fill the listview & the combobox with all available groups. 43 // And also fill the listview & the combobox with all available groups.
40 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) { 44 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) {
41 accounts->splitGroupEntry(*it); 45 accounts->splitGroupEntry(*it);
42 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); 46 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
@@ -177,33 +181,34 @@ void UserDialog::setupTab2() {
177 myTabWidget->addTab(tabpage,"User Groups"); 181 myTabWidget->addTab(tabpage,"User Groups");
178} 182}
179 183
180/** 184/**
181 * Static function that creates the userinfo dialog. 185 * Static function that creates the userinfo dialog.
182 * The user will be prompted to add a user. 186 * The user will be prompted to add a user.
183 * 187 *
184 * @param uid This is a suggested available UID. 188 * @param uid This is a suggested available UID.
185 * @param gid This is a suggested available GID. 189 * @param gid This is a suggested available GID.
186 * 190 *
187 * @return <code>true</code> if the user was successfully added, otherwise <code>false</code>. 191 * @return <code>true</code> if the user was successfully added, otherwise <code>false</code>.
188 * 192 *
189 */ 193 */
190bool UserDialog::addUser(int uid, int gid) { 194bool UserDialog::addUser(int uid, int gid) {
191 QCheckListItem *temp; 195 QCheckListItem *temp;
192 QFile ozTest; 196 QFile ozTest;
193 int oz=ozTest.exists("/etc/oz_version"); 197 int oz=false;
198 if(ODevice::inst()->system()==System_OpenZaurus) oz=true;
194 UserDialog *adduserDialog=new UserDialog(); 199 UserDialog *adduserDialog=new UserDialog();
195 adduserDialog->setCaption(tr("Add User")); 200 adduserDialog->setCaption(tr("Add User"));
196 adduserDialog->userID=uid;// Set next available UID as default uid. 201 adduserDialog->userID=uid;// Set next available UID as default uid.
197 adduserDialog->groupID=gid;// Set next available GID as default gid. 202 adduserDialog->groupID=gid;// Set next available GID as default gid.
198 // Insert default group into groupComboBox 203 // Insert default group into groupComboBox
199 adduserDialog->groupComboBox->insertItem("<create new group>",0); 204 adduserDialog->groupComboBox->insertItem("<create new group>",0);
200 adduserDialog->uidLineEdit->setText(QString::number(uid)); 205 adduserDialog->uidLineEdit->setText(QString::number(uid));
201 // If we're running on OZ, add new users to some default groups. 206 // If we're running on OZ, add new users to some default groups.
202 if(oz) { 207 if(oz) {
203 QListViewItemIterator iter( adduserDialog->groupsListView ); 208 QListViewItemIterator iter( adduserDialog->groupsListView );
204 for ( ; iter.current(); ++iter ) { 209 for ( ; iter.current(); ++iter ) {
205 temp=(QCheckListItem*)iter.current(); 210 temp=(QCheckListItem*)iter.current();
206 if (temp->text()=="video") temp->setOn(true); 211 if (temp->text()=="video") temp->setOn(true);
207 if (temp->text()=="audio") temp->setOn(true); 212 if (temp->text()=="audio") temp->setOn(true);
208 if (temp->text()=="time") temp->setOn(true); 213 if (temp->text()=="time") temp->setOn(true);
209 if (temp->text()=="power") temp->setOn(true); 214 if (temp->text()=="power") temp->setOn(true);