author | umopapisdn <umopapisdn> | 2002-10-15 11:25:36 (UTC) |
---|---|---|
committer | umopapisdn <umopapisdn> | 2002-10-15 11:25:36 (UTC) |
commit | b6fb59110629634056be3dd5c3091e6ed3271fd0 (patch) (side-by-side diff) | |
tree | e5ea61782d46b6fbc599d4b27e443d5002035958 | |
parent | 42ff9036e791321b4938d80c5d8386a76391f56b (diff) | |
download | opie-b6fb59110629634056be3dd5c3091e6ed3271fd0.zip opie-b6fb59110629634056be3dd5c3091e6ed3271fd0.tar.gz opie-b6fb59110629634056be3dd5c3091e6ed3271fd0.tar.bz2 |
System checking for OpenZaurus is now done through libopie (ODevice::system)
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 7 |
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 @@ #include <qlayout.h> #include <qlabel.h> #include <qmessagebox.h> #include <qfile.h> #include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <signal.h> #include "passwd.h" +#include <opie/odevice.h> +using namespace Opie; + + /** * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups. * */ UserDialog::UserDialog(QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) { QVBoxLayout *layout = new QVBoxLayout(this); myTabWidget=new QTabWidget(this,"User Tab Widget"); layout->addWidget(myTabWidget); setupTab1(); setupTab2(); accounts->groupStringList.sort(); // And also fill the listview & the combobox with all available groups. for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) { accounts->splitGroupEntry(*it); new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); @@ -177,33 +181,34 @@ void UserDialog::setupTab2() { myTabWidget->addTab(tabpage,"User Groups"); } /** * Static function that creates the userinfo dialog. * The user will be prompted to add a user. * * @param uid This is a suggested available UID. * @param gid This is a suggested available GID. * * @return <code>true</code> if the user was successfully added, otherwise <code>false</code>. * */ bool UserDialog::addUser(int uid, int gid) { QCheckListItem *temp; QFile ozTest; - int oz=ozTest.exists("/etc/oz_version"); + int oz=false; + if(ODevice::inst()->system()==System_OpenZaurus) oz=true; UserDialog *adduserDialog=new UserDialog(); adduserDialog->setCaption(tr("Add User")); adduserDialog->userID=uid; // Set next available UID as default uid. adduserDialog->groupID=gid; // Set next available GID as default gid. // Insert default group into groupComboBox adduserDialog->groupComboBox->insertItem("<create new group>",0); adduserDialog->uidLineEdit->setText(QString::number(uid)); // If we're running on OZ, add new users to some default groups. if(oz) { QListViewItemIterator iter( adduserDialog->groupsListView ); for ( ; iter.current(); ++iter ) { temp=(QCheckListItem*)iter.current(); if (temp->text()=="video") temp->setOn(true); if (temp->text()=="audio") temp->setOn(true); if (temp->text()=="time") temp->setOn(true); if (temp->text()=="power") temp->setOn(true); |