summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-14 16:01:52 (UTC)
committer zecke <zecke>2004-03-14 16:01:52 (UTC)
commitf12af18557c8f376f0c6c30e80a85737ff6c592e (patch) (unidiff)
treed60806f34f4ff6af82491579e80c9ef72cd4071e
parent13aeeabab5f2a6262b33de83cc9559a49365e325 (diff)
downloadopie-f12af18557c8f376f0c6c30e80a85737ff6c592e.zip
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.gz
opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.bz2
Make use of ODP
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp3
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp7
-rw-r--r--noncore/settings/aqpkg/ipkg.h8
-rw-r--r--noncore/settings/aqpkg/main.cpp1
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp4
-rw-r--r--noncore/settings/backup/main.cpp1
-rw-r--r--noncore/settings/doctab/main.cpp1
-rw-r--r--noncore/settings/language/main.cpp1
-rw-r--r--noncore/settings/mediummount/main.cpp1
-rw-r--r--noncore/settings/netsystemtime/main.cpp1
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp6
-rw-r--r--noncore/settings/netsystemtime/mainwindow.h9
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/main.cpp1
-rw-r--r--noncore/settings/networksettings/networksettings.pro2
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp1
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.h6
-rw-r--r--noncore/settings/packagemanager/installdlg.cpp3
-rw-r--r--noncore/settings/packagemanager/main.cpp1
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp1
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h2
-rw-r--r--noncore/settings/packagemanager/packageinfodlg.cpp1
-rw-r--r--noncore/settings/sound/main.cpp1
-rw-r--r--noncore/settings/sshkeys/sshkeys.cpp15
-rw-r--r--noncore/settings/sshkeys/sshkeys.h10
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp21
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.h22
-rw-r--r--noncore/settings/sysinfo/main.cpp1
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp10
-rw-r--r--noncore/settings/sysinfo/modulesinfo.h10
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp11
-rw-r--r--noncore/settings/sysinfo/processinfo.h10
-rw-r--r--noncore/settings/sysinfo/sysinfo.cpp1
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp2
-rw-r--r--noncore/settings/usermanager/main.cpp1
-rw-r--r--noncore/settings/usermanager/userdialog.cpp3
37 files changed, 115 insertions, 68 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index d2babb4..da21cef 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -36,48 +36,49 @@
36#include <qpe/fileselector.h> 36#include <qpe/fileselector.h>
37#include <qpe/qpeapplication.h> 37#include <qpe/qpeapplication.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39#include <qpe/storage.h> 39#include <qpe/storage.h>
40#endif 40#endif
41 41
42#include <qcheckbox.h> 42#include <qcheckbox.h>
43#include <qcombobox.h> 43#include <qcombobox.h>
44#include <qdialog.h> 44#include <qdialog.h>
45#include <qfileinfo.h> 45#include <qfileinfo.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qmultilineedit.h> 47#include <qmultilineedit.h>
48#include <qlabel.h> 48#include <qlabel.h>
49#include <qlayout.h> 49#include <qlayout.h>
50#include <qpushbutton.h> 50#include <qpushbutton.h>
51 51
52#include "datamgr.h" 52#include "datamgr.h"
53#include "destination.h" 53#include "destination.h"
54#include "instoptionsimpl.h" 54#include "instoptionsimpl.h"
55#include "installdlgimpl.h" 55#include "installdlgimpl.h"
56#include "ipkg.h" 56#include "ipkg.h"
57#include "utils.h" 57#include "utils.h"
58#include "global.h" 58#include "global.h"
59 59
60using namespace Opie::Ui;
60enum { 61enum {
61 MAXLINES = 100, 62 MAXLINES = 100,
62}; 63};
63 64
64InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManager *dataManager, const char *title ) 65InstallDlgImpl::InstallDlgImpl( const QList<InstallData> &packageList, DataManager *dataManager, const char *title )
65 : QWidget( 0, 0, 0 ) 66 : QWidget( 0, 0, 0 )
66{ 67{
67 setCaption( title ); 68 setCaption( title );
68 init( TRUE ); 69 init( TRUE );
69 70
70 pIpkg = 0; 71 pIpkg = 0;
71 upgradePackages = false; 72 upgradePackages = false;
72 dataMgr = dataManager; 73 dataMgr = dataManager;
73 74
74 QString defaultDest = "root"; 75 QString defaultDest = "root";
75#ifdef QWS 76#ifdef QWS
76 Config cfg( "aqpkg" ); 77 Config cfg( "aqpkg" );
77 cfg.setGroup( "settings" ); 78 cfg.setGroup( "settings" );
78 defaultDest = cfg.readEntry( "dest", "root" ); 79 defaultDest = cfg.readEntry( "dest", "root" );
79 80
80 // Grab flags - Turn MAKE_LINKS on by default (if no flags found) 81 // Grab flags - Turn MAKE_LINKS on by default (if no flags found)
81 flags = cfg.readNumEntry( "installFlags", 0 ); 82 flags = cfg.readNumEntry( "installFlags", 0 );
82 infoLevel = cfg.readNumEntry( "infoLevel", 1 ); 83 infoLevel = cfg.readNumEntry( "infoLevel", 1 );
83#else 84#else
@@ -212,49 +213,49 @@ void InstallDlgImpl :: optionsSelected()
212 if ( opt.exec() == QDialog::Accepted ) 213 if ( opt.exec() == QDialog::Accepted )
213 { 214 {
214 // set options selected from dialog 215 // set options selected from dialog
215 flags = opt.getFlags(); 216 flags = opt.getFlags();
216 infoLevel = opt.getInfoLevel(); 217 infoLevel = opt.getInfoLevel();
217 218
218#ifdef QWS 219#ifdef QWS
219 Config cfg( "aqpkg" ); 220 Config cfg( "aqpkg" );
220 cfg.setGroup( "settings" ); 221 cfg.setGroup( "settings" );
221 cfg.writeEntry( "installFlags", flags ); 222 cfg.writeEntry( "installFlags", flags );
222 cfg.writeEntry( "infoLevel", infoLevel ); 223 cfg.writeEntry( "infoLevel", infoLevel );
223#endif 224#endif
224 } 225 }
225 } 226 }
226 else // Save output 227 else // Save output
227 { 228 {
228 QMap<QString, QStringList> map; 229 QMap<QString, QStringList> map;
229 map.insert( tr( "All" ), QStringList() ); 230 map.insert( tr( "All" ), QStringList() );
230 QStringList text; 231 QStringList text;
231 text << "text/*"; 232 text << "text/*";
232 map.insert(tr( "Text" ), text ); 233 map.insert(tr( "Text" ), text );
233 text << "*"; 234 text << "*";
234 map.insert( tr( "All" ), text ); 235 map.insert( tr( "All" ), text );
235 236
236 QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); 237 QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
237 if( !filename.isEmpty() ) 238 if( !filename.isEmpty() )
238 { 239 {
239 QString currentFileName = QFileInfo( filename ).fileName(); 240 QString currentFileName = QFileInfo( filename ).fileName();
240 DocLnk doc; 241 DocLnk doc;
241 doc.setType( "text/plain" ); 242 doc.setType( "text/plain" );
242 doc.setFile( filename ); 243 doc.setFile( filename );
243 doc.setName( currentFileName ); 244 doc.setName( currentFileName );
244 FileManager fm; 245 FileManager fm;
245 fm.saveFile( doc, output->text() ); 246 fm.saveFile( doc, output->text() );
246 } 247 }
247 } 248 }
248} 249}
249 250
250void InstallDlgImpl :: installSelected() 251void InstallDlgImpl :: installSelected()
251{ 252{
252 if ( btnInstall->text() == tr( "Abort" ) ) 253 if ( btnInstall->text() == tr( "Abort" ) )
253 { 254 {
254 if ( pIpkg ) 255 if ( pIpkg )
255 { 256 {
256 displayText( tr( "\n**** User Clicked ABORT ***" ) ); 257 displayText( tr( "\n**** User Clicked ABORT ***" ) );
257 pIpkg->abort(); 258 pIpkg->abort();
258 displayText( tr( "**** Process Aborted ****" ) ); 259 displayText( tr( "**** Process Aborted ****" ) );
259 } 260 }
260 261
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 866afed..0091a3b 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -21,48 +21,49 @@
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include <opie2/oprocess.h> 30#include <opie2/oprocess.h>
31 31
32#ifdef QWS 32#ifdef QWS
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34#else 34#else
35#include <qapplication.h> 35#include <qapplication.h>
36#endif 36#endif
37#include <qdir.h> 37#include <qdir.h>
38#include <qfile.h> 38#include <qfile.h>
39#include <qtextstream.h> 39#include <qtextstream.h>
40 40
41#include "utils.h" 41#include "utils.h"
42#include "ipkg.h" 42#include "ipkg.h"
43#include "global.h" 43#include "global.h"
44 44
45using namespace Opie::Core;
45Ipkg :: Ipkg() 46Ipkg :: Ipkg()
46{ 47{
47 proc = 0; 48 proc = 0;
48} 49}
49 50
50Ipkg :: ~Ipkg() 51Ipkg :: ~Ipkg()
51{ 52{
52} 53}
53 54
54// Option is what we are going to do - install, upgrade, download, reinstall 55// Option is what we are going to do - install, upgrade, download, reinstall
55// package is the package name to install - either a fully qualified path and ipk 56// package is the package name to install - either a fully qualified path and ipk
56// file (if stored locally) or just the name of the package (for a network package) 57// file (if stored locally) or just the name of the package (for a network package)
57// packageName is the package name - (for a network package this will be the same as 58// packageName is the package name - (for a network package this will be the same as
58// package parameter) 59// package parameter)
59// dest is the destination alias (from ipk.conf) 60// dest is the destination alias (from ipk.conf)
60// destDir is the dir that the destination alias points to (used to link to root) 61// destDir is the dir that the destination alias points to (used to link to root)
61// flags is the ipkg options flags 62// flags is the ipkg options flags
62// dir is the directory to run ipkg in (defaults to "") 63// dir is the directory to run ipkg in (defaults to "")
63void Ipkg :: runIpkg() 64void Ipkg :: runIpkg()
64{ 65{
65 error = false; 66 error = false;
66 QStringList commands; 67 QStringList commands;
67 68
68 QDir::setCurrent( "/tmp" ); 69 QDir::setCurrent( "/tmp" );
@@ -267,55 +268,55 @@ void Ipkg :: removeStatusEntry()
267 268
268 readFile.close(); 269 readFile.close();
269 writeFile.close(); 270 writeFile.close();
270 271
271 // Remove old status file and put tmp stats file in its place 272 // Remove old status file and put tmp stats file in its place
272 remove( statusFile ); 273 remove( statusFile );
273 rename( outStatusFile, statusFile ); 274 rename( outStatusFile, statusFile );
274 } 275 }
275 276
276int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ ) 277int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
277{ 278{
278 // If one is already running - should never be but just to be safe 279 // If one is already running - should never be but just to be safe
279 if ( proc ) 280 if ( proc )
280 { 281 {
281 delete proc; 282 delete proc;
282 proc = 0; 283 proc = 0;
283 } 284 }
284 285
285 // OK we're gonna use OProcess to run this thing 286 // OK we're gonna use OProcess to run this thing
286 proc = new OProcess(); 287 proc = new OProcess();
287 aborted = false; 288 aborted = false;
288 289
289 290
290 // Connect up our slots 291 // Connect up our slots
291 connect(proc, SIGNAL(processExited(OProcess*)), 292 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
292 this, SLOT( processFinished())); 293 this, SLOT( processFinished()));
293 294
294 connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)), 295 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
295 this, SLOT(commandStdout(OProcess*,char*,int))); 296 this, SLOT(commandStdout(OProcess*,char*,int)));
296 297
297 connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)), 298 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
298 this, SLOT(commandStderr(OProcess*,char*,int))); 299 this, SLOT(commandStderr(OProcess*,char*,int)));
299 300
300 for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it ) 301 for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it )
301 { 302 {
302 *proc << (*it).latin1(); 303 *proc << (*it).latin1();
303 } 304 }
304 305
305 // Start the process going 306 // Start the process going
306 finished = false; 307 finished = false;
307 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) 308 if(!proc->start(OProcess::NotifyOnExit, OProcess::All))
308 { 309 {
309 emit outputText( tr("Couldn't start ipkg process" ) ); 310 emit outputText( tr("Couldn't start ipkg process" ) );
310 } 311 }
311} 312}
312 313
313void Ipkg::commandStdout(OProcess*, char *buffer, int buflen) 314void Ipkg::commandStdout(OProcess*, char *buffer, int buflen)
314{ 315{
315 QString lineStr = buffer; 316 QString lineStr = buffer;
316 if ( lineStr[buflen-1] == '\n' ) 317 if ( lineStr[buflen-1] == '\n' )
317 buflen --; 318 buflen --;
318 lineStr = lineStr.left( buflen ); 319 lineStr = lineStr.left( buflen );
319 emit outputText( lineStr ); 320 emit outputText( lineStr );
320 321
321 // check if we are installing dependant packages 322 // check if we are installing dependant packages
diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h
index f892038..e216d17 100644
--- a/noncore/settings/aqpkg/ipkg.h
+++ b/noncore/settings/aqpkg/ipkg.h
@@ -26,79 +26,79 @@
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#ifndef IPKG_H 30#ifndef IPKG_H
31#define IPKG_H 31#define IPKG_H
32 32
33 33
34/** 34/**
35 *@author Andy Qua 35 *@author Andy Qua
36 */ 36 */
37 37
38#include <qobject.h> 38#include <qobject.h>
39#include <qstring.h> 39#include <qstring.h>
40#include <qstringlist.h> 40#include <qstringlist.h>
41#include <qlist.h> 41#include <qlist.h>
42 42
43#define FORCE_DEPENDS 0x0001 43#define FORCE_DEPENDS 0x0001
44#define FORCE_REMOVE 0x0002 44#define FORCE_REMOVE 0x0002
45#define FORCE_REINSTALL 0x0004 45#define FORCE_REINSTALL 0x0004
46#define FORCE_OVERWRITE 0x0008 46#define FORCE_OVERWRITE 0x0008
47#define MAKE_LINKS 0x0010 47#define MAKE_LINKS 0x0010
48#define VERBOSE_WGET 0x0020 48#define VERBOSE_WGET 0x0020
49 49
50class OProcess; 50namespace Opie {namespace Core {class OProcess;}}
51 51
52class Ipkg : public QObject 52class Ipkg : public QObject
53{ 53{
54 Q_OBJECT 54 Q_OBJECT
55public: 55public:
56 Ipkg(); 56 Ipkg();
57 ~Ipkg(); 57 ~Ipkg();
58 void runIpkg(); 58 void runIpkg();
59 void createSymLinks(); 59 void createSymLinks();
60 60
61 void setOption( const char *opt ) { option = opt; } 61 void setOption( const char *opt ) { option = opt; }
62 void setPackage( const char *pkg ) { package = pkg; } 62 void setPackage( const char *pkg ) { package = pkg; }
63 void setDestination( const char *dest ) { destination = dest; } 63 void setDestination( const char *dest ) { destination = dest; }
64 void setDestinationDir( const char *dir ) { destDir = dir; } 64 void setDestinationDir( const char *dir ) { destDir = dir; }
65 void setFlags( int fl, int il ) { flags = fl; infoLevel = il; } 65 void setFlags( int fl, int il ) { flags = fl; infoLevel = il; }
66 void setRuntimeDirectory( const char *dir ) { runtimeDir = dir; } 66 void setRuntimeDirectory( const char *dir ) { runtimeDir = dir; }
67 67
68signals: 68signals:
69 void outputText( const QString &text ); 69 void outputText( const QString &text );
70 void ipkgFinished(); 70 void ipkgFinished();
71 71
72public slots: 72public slots:
73 void commandStdout(OProcess*, char *buffer, int buflen); 73 void commandStdout(Opie::Core::OProcess*, char *buffer, int buflen);
74 void commandStderr(OProcess*, char *buffer, int buflen); 74 void commandStderr(Opie::Core::OProcess*, char *buffer, int buflen);
75 void processFinished(); 75 void processFinished();
76 void abort(); 76 void abort();
77 77
78 78
79private: 79private:
80 bool createLinks; 80 bool createLinks;
81 bool aborted; 81 bool aborted;
82 bool error; 82 bool error;
83 QString option; 83 QString option;
84 QString package; 84 QString package;
85 QString destination; 85 QString destination;
86 QString destDir; 86 QString destDir;
87 QString runtimeDir; 87 QString runtimeDir;
88 OProcess *proc; 88 Opie::Core::OProcess *proc;
89 int flags; 89 int flags;
90 int infoLevel; 90 int infoLevel;
91 bool finished; 91 bool finished;
92 92
93 QList<QString> *dependantPackages; 93 QList<QString> *dependantPackages;
94 94
95 int executeIpkgCommand( QStringList &cmd, const QString option ); 95 int executeIpkgCommand( QStringList &cmd, const QString option );
96 void removeStatusEntry(); 96 void removeStatusEntry();
97 void linkPackage( const QString &packFileName, const QString &dest, const QString &destDir ); 97 void linkPackage( const QString &packFileName, const QString &dest, const QString &destDir );
98 QStringList* getList( const QString &packageFilename, const QString &destDir ); 98 QStringList* getList( const QString &packageFilename, const QString &destDir );
99 void processFileList( const QStringList *fileList, const QString &destDir ); 99 void processFileList( const QStringList *fileList, const QString &destDir );
100 void processLinkDir( const QString &file, const QString &baseDir, const QString &destDir ); 100 void processLinkDir( const QString &file, const QString &baseDir, const QString &destDir );
101 101
102}; 102};
103 103
104#endif 104#endif
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp
index b391714..d27479c 100644
--- a/noncore/settings/aqpkg/main.cpp
+++ b/noncore/settings/aqpkg/main.cpp
@@ -14,25 +14,26 @@
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "mainwin.h" 30#include "mainwin.h"
31 31
32#include <opie2/oapplicationfactory.h> 32#include <opie2/oapplicationfactory.h>
33 33
34/* be less intrusive for translation -zecke */ 34/* be less intrusive for translation -zecke */
35extern QString LOCAL_SERVER; 35extern QString LOCAL_SERVER;
36extern QString LOCAL_IPKGS; 36extern QString LOCAL_IPKGS;
37 37
38using namespace Opie::Core;
38OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 39OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index b9dbb6e..2f35617 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -31,60 +31,62 @@
31#include "global.h" 31#include "global.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/otabwidget.h> 34#include <opie2/otabwidget.h>
35#ifdef QWS 35#ifdef QWS
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/resource.h> 37#include <qpe/resource.h>
38#endif 38#endif
39#include <qpe/qpeapplication.h> 39#include <qpe/qpeapplication.h>
40 40
41/* QT */ 41/* QT */
42#include <qcheckbox.h> 42#include <qcheckbox.h>
43#include <qgroupbox.h> 43#include <qgroupbox.h>
44#include <qlabel.h> 44#include <qlabel.h>
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qlistbox.h> 47#include <qlistbox.h>
48#include <qpushbutton.h> 48#include <qpushbutton.h>
49 49
50/* STD */ 50/* STD */
51#include <fstream> 51#include <fstream>
52#include <algorithm> 52#include <algorithm>
53using namespace std; 53using namespace std;
54 54
55using namespace Opie::Ui;
56using namespace Opie::Ui;
55SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) 57SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl )
56 : QDialog( parent, name, modal, fl ) 58 : QDialog( parent, name, modal, fl )
57{ 59{
58 setCaption( tr( "Configuration" ) ); 60 setCaption( tr( "Configuration" ) );
59 61
60 // Setup layout to make everything pretty 62 // Setup layout to make everything pretty
61 QVBoxLayout *layout = new QVBoxLayout( this ); 63 QVBoxLayout *layout = new QVBoxLayout( this );
62 layout->setMargin( 2 ); 64 layout->setMargin( 2 );
63 layout->setSpacing( 4 ); 65 layout->setSpacing( 4 );
64 66
65 // Setup tabs for all info 67 // Setup tabs for all info
66 Opie::OTabWidget *tabwidget = new Opie::OTabWidget( this ); 68 OTabWidget *tabwidget = new OTabWidget( this );
67 layout->addWidget( tabwidget ); 69 layout->addWidget( tabwidget );
68 70
69 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); 71 tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) );
70 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); 72 tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) );
71 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); 73 tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) );
72 tabwidget->setCurrentTab( tr( "Servers" ) ); 74 tabwidget->setCurrentTab( tr( "Servers" ) );
73 75
74 dataMgr = dataManager; 76 dataMgr = dataManager;
75 setupData(); 77 setupData();
76 changed = false; 78 changed = false;
77 newserver = false; 79 newserver = false;
78 newdestination = false; 80 newdestination = false;
79} 81}
80 82
81SettingsImpl :: ~SettingsImpl() 83SettingsImpl :: ~SettingsImpl()
82{ 84{
83} 85}
84 86
85bool SettingsImpl :: showDlg() 87bool SettingsImpl :: showDlg()
86{ 88{
87 QPEApplication::execDialog( this ); 89 QPEApplication::execDialog( this );
88 if ( changed ) 90 if ( changed )
89 dataMgr->writeOutIpkgConf(); 91 dataMgr->writeOutIpkgConf();
90 92
diff --git a/noncore/settings/backup/main.cpp b/noncore/settings/backup/main.cpp
index c254865..6246fd5 100644
--- a/noncore/settings/backup/main.cpp
+++ b/noncore/settings/backup/main.cpp
@@ -1,8 +1,9 @@
1#include "backuprestore.h" 1#include "backuprestore.h"
2#include "qnetworkprotocol.h" 2#include "qnetworkprotocol.h"
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include <opie2/oapplicationfactory.h> 4#include <opie2/oapplicationfactory.h>
5 5
6 6
7using namespace Opie::Core;
7OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<BackupAndRestore> ) 8OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<BackupAndRestore> )
8 9
diff --git a/noncore/settings/doctab/main.cpp b/noncore/settings/doctab/main.cpp
index 13591e0..75d9fcb 100644
--- a/noncore/settings/doctab/main.cpp
+++ b/noncore/settings/doctab/main.cpp
@@ -1,25 +1,26 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "doctab.h" 21#include "doctab.h"
22 22
23#include <opie2/oapplicationfactory.h> 23#include <opie2/oapplicationfactory.h>
24 24
25using namespace Opie::Core;
25OPIE_EXPORT_APP( OApplicationFactory<DocTabSettings> ) 26OPIE_EXPORT_APP( OApplicationFactory<DocTabSettings> )
diff --git a/noncore/settings/language/main.cpp b/noncore/settings/language/main.cpp
index 17f7433..ec8366e 100644
--- a/noncore/settings/language/main.cpp
+++ b/noncore/settings/language/main.cpp
@@ -1,25 +1,26 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "settings.h" 21#include "settings.h"
22 22
23#include <opie2/oapplicationfactory.h> 23#include <opie2/oapplicationfactory.h>
24 24
25using namespace Opie::Core;
25OPIE_EXPORT_APP( OApplicationFactory<LanguageSettings> ) 26OPIE_EXPORT_APP( OApplicationFactory<LanguageSettings> )
diff --git a/noncore/settings/mediummount/main.cpp b/noncore/settings/mediummount/main.cpp
index 8261490..5d188a9 100644
--- a/noncore/settings/mediummount/main.cpp
+++ b/noncore/settings/mediummount/main.cpp
@@ -1,8 +1,9 @@
1#include "mediumwidget.h" 1#include "mediumwidget.h"
2#include "mediumglobal.h" 2#include "mediumglobal.h"
3#include "mainwindow.h" 3#include "mainwindow.h"
4 4
5#include <opie2/oapplicationfactory.h> 5#include <opie2/oapplicationfactory.h>
6 6
7using namespace Opie::Core;
7OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MediumMountSetting::MainWindow> ) 8OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MediumMountSetting::MainWindow> )
8 9
diff --git a/noncore/settings/netsystemtime/main.cpp b/noncore/settings/netsystemtime/main.cpp
index 4a2d17c..dbcdc17 100644
--- a/noncore/settings/netsystemtime/main.cpp
+++ b/noncore/settings/netsystemtime/main.cpp
@@ -9,25 +9,26 @@
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30 30
31#include <opie2/oapplicationfactory.h> 31#include <opie2/oapplicationfactory.h>
32 32
33using namespace Opie::Core;
33OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 34OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index c995d6e..ba96f33 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -27,48 +27,50 @@
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30#include "timetabwidget.h" 30#include "timetabwidget.h"
31#include "formattabwidget.h" 31#include "formattabwidget.h"
32#include "settingstabwidget.h" 32#include "settingstabwidget.h"
33#include "ntptabwidget.h" 33#include "ntptabwidget.h"
34#include "predicttabwidget.h" 34#include "predicttabwidget.h"
35 35
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/datebookdb.h> 37#include <qpe/datebookdb.h>
38#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
39#include <qpe/qpedialog.h> 39#include <qpe/qpedialog.h>
40 40
41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43#endif 43#endif
44 44
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qmessagebox.h> 46#include <qmessagebox.h>
47#include <qsocket.h> 47#include <qsocket.h>
48#include <qstring.h> 48#include <qstring.h>
49#include <qtimer.h> 49#include <qtimer.h>
50 50
51using namespace Opie::Ui;
52using namespace Opie::Core;
51MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) 53MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f )
52 : QDialog( 0x0, 0x0, TRUE, 0 ) 54 : QDialog( 0x0, 0x0, TRUE, 0 )
53{ 55{
54 setCaption( tr( "SystemTime" ) ); 56 setCaption( tr( "SystemTime" ) );
55 57
56 QVBoxLayout *layout = new QVBoxLayout( this ); 58 QVBoxLayout *layout = new QVBoxLayout( this );
57 layout->setMargin( 2 ); 59 layout->setMargin( 2 );
58 layout->setSpacing( 4 ); 60 layout->setSpacing( 4 );
59 61
60 // Create main tabbed control 62 // Create main tabbed control
61 mainWidget = new OTabWidget( this ); 63 mainWidget = new OTabWidget( this );
62 64
63 // Default object pointers to null 65 // Default object pointers to null
64 ntpProcess = 0x0; 66 ntpProcess = 0x0;
65 ntpTab = 0x0; 67 ntpTab = 0x0;
66 68
67 // Add tab widgets 69 // Add tab widgets
68 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) ); 70 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) );
69 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) ); 71 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) );
70 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) ); 72 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) );
71 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) ); 73 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) );
72 Config config( "ntp" ); 74 Config config( "ntp" );
73 config.setGroup( "settings" ); 75 config.setGroup( "settings" );
74 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) ); 76 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) );
@@ -167,51 +169,51 @@ void MainWindow::runNTP()
167 switch ( 169 switch (
168 QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No ) 170 QMessageBox::warning( this, tr( "Continue?" ), msg, QMessageBox::Yes, QMessageBox::No )
169 ) 171 )
170 { 172 {
171 case QMessageBox::Yes: break; 173 case QMessageBox::Yes: break;
172 case QMessageBox::No: return; 174 case QMessageBox::No: return;
173 default: return; 175 default: return;
174 } 176 }
175 } 177 }
176 178
177 QString srv = settingsTab->ntpServer(); 179 QString srv = settingsTab->ntpServer();
178 180
179 // Send information to time server tab if enabled 181 // Send information to time server tab if enabled
180 if ( ntpTabEnabled ) 182 if ( ntpTabEnabled )
181 { 183 {
182 ntpTab->setStartTime( QDateTime::currentDateTime().toString() ); 184 ntpTab->setStartTime( QDateTime::currentDateTime().toString() );
183 QString output = tr( "Running:\nntpdate " ); 185 QString output = tr( "Running:\nntpdate " );
184 output.append( srv ); 186 output.append( srv );
185 ntpTab->addNtpOutput( output ); 187 ntpTab->addNtpOutput( output );
186 } 188 }
187 189
188 if ( !ntpProcess ) 190 if ( !ntpProcess )
189 { 191 {
190 ntpProcess = new OProcess(); 192 ntpProcess = new OProcess();
191 connect( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), 193 connect( ntpProcess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
192 this, SLOT(slotNtpOutput(OProcess*,char*,int)) ); 194 this, SLOT(slotNtpOutput(OProcess*,char*,int)) );
193 connect( ntpProcess, SIGNAL(processExited(OProcess*)), 195 connect( ntpProcess, SIGNAL(processExited(Opie::Core::OProcess*)),
194 this, SLOT(slotNtpFinished(OProcess*)) ); 196 this, SLOT(slotNtpFinished(OProcess*)) );
195 } 197 }
196 198
197 else 199 else
198 ntpProcess->clearArguments(); 200 ntpProcess->clearArguments();
199 201
200 *ntpProcess << "ntpdate" << srv; 202 *ntpProcess << "ntpdate" << srv;
201 bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput ); 203 bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput );
202 if ( !ret ) 204 if ( !ret )
203 { 205 {
204 QMessageBox::critical( this, tr( "Error" ), tr( "Error while getting time from network." ) ); 206 QMessageBox::critical( this, tr( "Error" ), tr( "Error while getting time from network." ) );
205 if ( ntpTabEnabled ) 207 if ( ntpTabEnabled )
206 ntpTab->addNtpOutput( tr( "Error while executing ntpdate" ) ); 208 ntpTab->addNtpOutput( tr( "Error while executing ntpdate" ) );
207 } 209 }
208} 210}
209 211
210bool MainWindow::ntpDelayElapsed() 212bool MainWindow::ntpDelayElapsed()
211{ 213{
212 // Determine if time elapsed is greater than time delay 214 // Determine if time elapsed is greater than time delay
213 Config config( "ntp" ); 215 Config config( "ntp" );
214 config.setGroup( "lookups" ); 216 config.setGroup( "lookups" );
215 _lookupDiff = TimeConversion::toUTC( QDateTime::currentDateTime() ) - config.readNumEntry( "time", 0 ); 217 _lookupDiff = TimeConversion::toUTC( QDateTime::currentDateTime() ) - config.readNumEntry( "time", 0 );
216 if ( _lookupDiff < 0 ) 218 if ( _lookupDiff < 0 )
217 return true; 219 return true;
diff --git a/noncore/settings/netsystemtime/mainwindow.h b/noncore/settings/netsystemtime/mainwindow.h
index d4a9713..8701803 100644
--- a/noncore/settings/netsystemtime/mainwindow.h
+++ b/noncore/settings/netsystemtime/mainwindow.h
@@ -19,81 +19,80 @@
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef MAINWINDOW_H 29#ifndef MAINWINDOW_H
30#define MAINWINDOW_H 30#define MAINWINDOW_H
31 31
32#include <qdialog.h> 32#include <qdialog.h>
33 33
34#include <opie2/oprocess.h> 34#include <opie2/oprocess.h>
35#include <opie2/otabwidget.h> 35#include <opie2/otabwidget.h>
36 36
37class TimeTabWidget; 37class TimeTabWidget;
38class FormatTabWidget; 38class FormatTabWidget;
39class SettingsTabWidget; 39class SettingsTabWidget;
40class NTPTabWidget; 40class NTPTabWidget;
41class PredictTabWidget; 41class PredictTabWidget;
42 42
43using Opie::OTabWidget;
44 43
45class QDateTime; 44class QDateTime;
46class QSocket; 45class QSocket;
47class QTimer; 46class QTimer;
48 47
49class MainWindow : public QDialog 48class MainWindow : public QDialog
50{ 49{
51 Q_OBJECT 50 Q_OBJECT
52 51
53public: 52public:
54 MainWindow( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0); 53 MainWindow( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0);
55 ~MainWindow(); 54 ~MainWindow();
56 static QString appName() { return QString::fromLatin1("systemtime"); } 55 static QString appName() { return QString::fromLatin1("systemtime"); }
57 56
58protected: 57protected:
59 void accept(); 58 void accept();
60 void reject(); 59 void reject();
61 60
62private: 61private:
63 OTabWidget *mainWidget; 62 Opie::Ui::OTabWidget *mainWidget;
64 63
65 TimeTabWidget *timeTab; 64 TimeTabWidget *timeTab;
66 FormatTabWidget *formatTab; 65 FormatTabWidget *formatTab;
67 SettingsTabWidget *settingsTab; 66 SettingsTabWidget *settingsTab;
68 NTPTabWidget *ntpTab; 67 NTPTabWidget *ntpTab;
69 PredictTabWidget *predictTab; 68 PredictTabWidget *predictTab;
70 69
71 bool ntpTabEnabled; 70 bool ntpTabEnabled;
72 bool predictTabEnabled; 71 bool predictTabEnabled;
73 72
74 OProcess *ntpProcess; 73 Opie::Core::OProcess *ntpProcess;
75 QTimer *ntpTimer; 74 QTimer *ntpTimer;
76 QSocket *ntpSock; 75 QSocket *ntpSock;
77 int ntpDelay; 76 int ntpDelay;
78 bool ntpInteractive; 77 bool ntpInteractive;
79 QString ntpOutput; 78 QString ntpOutput;
80 int _lookupDiff; 79 int _lookupDiff;
81 80
82 void runNTP(); 81 void runNTP();
83 bool ntpDelayElapsed(); 82 bool ntpDelayElapsed();
84 83
85private slots: 84private slots:
86 void slotSetTime( const QDateTime & ); 85 void slotSetTime( const QDateTime & );
87 void slotQCopReceive( const QCString &, const QByteArray & ); 86 void slotQCopReceive( const QCString &, const QByteArray & );
88 void slotDisplayNTPTab( bool ); 87 void slotDisplayNTPTab( bool );
89 void slotDisplayPredictTab( bool ); 88 void slotDisplayPredictTab( bool );
90 void slotGetNTPTime(); 89 void slotGetNTPTime();
91 void slotTimerGetNTPTime(); 90 void slotTimerGetNTPTime();
92 void slotProbeNTPServer(); 91 void slotProbeNTPServer();
93 void slotNtpOutput( OProcess *, char *, int ); 92 void slotNtpOutput( Opie::Core::OProcess *, char *, int );
94 void slotNtpFinished( OProcess* ); 93 void slotNtpFinished( Opie::Core::OProcess* );
95 void slotNTPDelayChanged( int ); 94 void slotNTPDelayChanged( int );
96 void slotCheckNtp( int ); 95 void slotCheckNtp( int );
97}; 96};
98 97
99#endif 98#endif
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 05340e4..7c2f85c 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -1,48 +1,50 @@
1#include "interfacesetupimp.h" 1#include "interfacesetupimp.h"
2#include "interface.h" 2#include "interface.h"
3 3
4#include <qcheckbox.h> 4#include <qcheckbox.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qspinbox.h> 6#include <qspinbox.h>
7#include <qgroupbox.h> 7#include <qgroupbox.h>
8#include <qlabel.h> 8#include <qlabel.h>
9 9
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11 11
12#include <opie2/oprocess.h> 12#include <opie2/oprocess.h>
13 13
14#ifdef QWS 14#ifdef QWS
15#include <opie2/owait.h> 15#include <opie2/owait.h>
16#include <qpe/global.h> 16#include <qpe/global.h>
17#include <qapplication.h> 17#include <qapplication.h>
18#endif 18#endif
19 19
20#define DNSSCRIPT "changedns" 20#define DNSSCRIPT "changedns"
21 21
22/** 22/**
23 * Constuctor. Set up the connection. A profile must be set. 23 * Constuctor. Set up the connection. A profile must be set.
24 */ 24 */
25using namespace Opie::Ui;
26using namespace Opie::Core;
25InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ 27InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){
26 if (j == 0) { 28 if (j == 0) {
27 delInterfaces = true; 29 delInterfaces = true;
28 interfaces = new Interfaces; 30 interfaces = new Interfaces;
29 } 31 }
30} 32}
31 33
32/** 34/**
33 * Destructor 35 * Destructor
34 */ 36 */
35InterfaceSetupImp::~InterfaceSetupImp(){ 37InterfaceSetupImp::~InterfaceSetupImp(){
36 if(delInterfaces) { 38 if(delInterfaces) {
37 delete interfaces; 39 delete interfaces;
38 } 40 }
39} 41}
40 42
41/** 43/**
42 * Save the current settings, then write out the interfaces file and close. 44 * Save the current settings, then write out the interfaces file and close.
43 */ 45 */
44bool InterfaceSetupImp::saveChanges(){ 46bool InterfaceSetupImp::saveChanges(){
45 bool error; 47 bool error;
46 QString iface = interfaces->getInterfaceName(error); 48 QString iface = interfaces->getInterfaceName(error);
47 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); 49 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() );
48 if(!saveSettings()) 50 if(!saveSettings())
diff --git a/noncore/settings/networksettings/main.cpp b/noncore/settings/networksettings/main.cpp
index bc11ab4..e4153c3 100644
--- a/noncore/settings/networksettings/main.cpp
+++ b/noncore/settings/networksettings/main.cpp
@@ -1,6 +1,7 @@
1#include "mainwindowimp.h" 1#include "mainwindowimp.h"
2#include <opie2/oapplicationfactory.h> 2#include <opie2/oapplicationfactory.h>
3 3
4using namespace Opie::Core;
4OPIE_EXPORT_APP( OApplicationFactory<MainWindowImp> ) 5OPIE_EXPORT_APP( OApplicationFactory<MainWindowImp> )
5 6
6 7
diff --git a/noncore/settings/networksettings/networksettings.pro b/noncore/settings/networksettings/networksettings.pro
index 5db2d6b..281629c 100644
--- a/noncore/settings/networksettings/networksettings.pro
+++ b/noncore/settings/networksettings/networksettings.pro
@@ -1,12 +1,12 @@
1CONFIG = qt warn_on debug quick-app 1CONFIG = qt warn_on debug quick-app
2HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h module.h 2HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h module.h
3SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp 3SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp
4INCLUDEPATH += $(OPIEDIR)/include interfaces/ 4INCLUDEPATH += $(OPIEDIR)/include interfaces/ .
5DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan/ ppp/ 5DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan/ ppp/
6LIBS += -lqpe -L$(OPIEDIR)/plugins/networksettings -Linterfaces/ -linterfaces -lopiecore2 -lopieui2 6LIBS += -lqpe -L$(OPIEDIR)/plugins/networksettings -Linterfaces/ -linterfaces -lopiecore2 -lopieui2
7INTERFACES = mainwindow.ui addconnection.ui 7INTERFACES = mainwindow.ui addconnection.ui
8TARGET = networksettings 8TARGET = networksettings
9 9
10 10
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 95f4abe..80a9927 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -4,48 +4,49 @@
4#include <qfile.h> 4#include <qfile.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qtextstream.h> 6#include <qtextstream.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qspinbox.h> 10#include <qspinbox.h>
11#include <qradiobutton.h> 11#include <qradiobutton.h>
12#include <qcheckbox.h> 12#include <qcheckbox.h>
13#include <qtabwidget.h> 13#include <qtabwidget.h>
14#include <qcombobox.h> 14#include <qcombobox.h>
15 15
16#ifdef QWS 16#ifdef QWS
17 #include <opie2/oprocess.h> 17 #include <opie2/oprocess.h>
18#else 18#else
19 #define OProcess KProcess 19 #define OProcess KProcess
20 #include <kprocess.h> 20 #include <kprocess.h>
21#endif 21#endif
22 22
23#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 23#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
24 24
25/** 25/**
26 * Constructor, read in the wireless.opts file for parsing later. 26 * Constructor, read in the wireless.opts file for parsing later.
27 */ 27 */
28using namespace Opie::Core;
28WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") { 29WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") {
29 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i); 30 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);
30 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 31 tabWidget->insertTab(interfaceSetup, "TCP/IP");
31 32
32 // Read in the config file. 33 // Read in the config file.
33 QString wlanFile = WIRELESS_OPTS; 34 QString wlanFile = WIRELESS_OPTS;
34 QFile file(wlanFile); 35 QFile file(wlanFile);
35 if (file.open(IO_ReadOnly)){ 36 if (file.open(IO_ReadOnly)){
36 QTextStream stream( &file ); 37 QTextStream stream( &file );
37 QString line = ""; 38 QString line = "";
38 while ( !stream.eof() ) { 39 while ( !stream.eof() ) {
39 line += stream.readLine(); 40 line += stream.readLine();
40 line += "\n"; 41 line += "\n";
41 } 42 }
42 file.close(); 43 file.close();
43 settingsFileText = QStringList::split("\n", line, true); 44 settingsFileText = QStringList::split("\n", line, true);
44 parseSettingFile(); 45 parseSettingFile();
45 } 46 }
46 else 47 else
47 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); 48 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1());
48 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); 49 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
49} 50}
50 51
51void WLANImp::typeChanged(int mod){ 52void WLANImp::typeChanged(int mod){
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index dd1db28..eeebe7f 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -21,48 +21,50 @@
21#include <qpushbutton.h> 21#include <qpushbutton.h>
22#include <qcheckbox.h> 22#include <qcheckbox.h>
23#include <qtabwidget.h> 23#include <qtabwidget.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25#include <qlistview.h> 25#include <qlistview.h>
26#include <qvbox.h> 26#include <qvbox.h>
27#include <qprogressbar.h> 27#include <qprogressbar.h>
28 28
29#ifdef QWS 29#ifdef QWS
30 #include <qpe/resource.h> 30 #include <qpe/resource.h>
31 #include <opie2/oprocess.h> 31 #include <opie2/oprocess.h>
32 #include <opie2/onetwork.h> 32 #include <opie2/onetwork.h>
33 #include <opie2/opcap.h> 33 #include <opie2/opcap.h>
34#else 34#else
35 #define OProcess KProcess 35 #define OProcess KProcess
36 #include <kprocess.h> 36 #include <kprocess.h>
37#endif 37#endif
38 38
39#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 39#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
40#define PREUP "/etc/network/if-pre-up.d/wireless-tools" 40#define PREUP "/etc/network/if-pre-up.d/wireless-tools"
41 41
42/** 42/**
43 * Constructor, read in the wireless.opts file for parsing later. 43 * Constructor, read in the wireless.opts file for parsing later.
44 */ 44 */
45using namespace Opie::Net;
46using namespace Opie::Core;
45WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { 47WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") {
46 interfaces = new Interfaces(); 48 interfaces = new Interfaces();
47 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 49 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
48 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 50 tabWidget->insertTab(interfaceSetup, "TCP/IP");
49 51
50 // Check sanity - the existance of the wireless-tools if-pre-up script 52 // Check sanity - the existance of the wireless-tools if-pre-up script
51 QFile file(QString(PREUP)); 53 QFile file(QString(PREUP));
52 if (file.exists()) { 54 if (file.exists()) {
53 qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); 55 qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools"));
54 } 56 }
55 57
56 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); 58 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) );
57 connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); 59 connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) );
58 netView->setColumnAlignment( col_chn, AlignCenter ); 60 netView->setColumnAlignment( col_chn, AlignCenter );
59 netView->setItemMargin( 3 ); 61 netView->setItemMargin( 3 );
60 netView->setAllColumnsShowFocus( true ); 62 netView->setAllColumnsShowFocus( true );
61 63
62} 64}
63 65
64WLANImp::~WLANImp() { 66WLANImp::~WLANImp() {
65//FIXME: delete interfaces; 67//FIXME: delete interfaces;
66} 68}
67 69
68/** 70/**
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.h b/noncore/settings/networksettings/wlan/wlanimp2.h
index a777203..c3d1eee 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.h
+++ b/noncore/settings/networksettings/wlan/wlanimp2.h
@@ -1,52 +1,52 @@
1#ifndef WLANIMP_H 1#ifndef WLANIMP_H
2#define WLANIMP_H 2#define WLANIMP_H
3 3
4#include "wlan.h" 4#include "wlan.h"
5#include "interfaces.h" 5#include "interfaces.h"
6#include <qstringlist.h> 6#include <qstringlist.h>
7#include <opie2/onetutils.h> 7#include <opie2/onetutils.h>
8 8
9class InterfaceSetupImp; 9class InterfaceSetupImp;
10class Interface; 10class Interface;
11class Config; 11class Config;
12class OPacket; 12namespace Opie {namespace Net {class OPacket;}}
13class QListViewItem; 13class QListViewItem;
14 14
15const int col_mode= 0; 15const int col_mode= 0;
16const int col_ssid = 1; 16const int col_ssid = 1;
17const int col_chn = 2; 17const int col_chn = 2;
18const int col_mac = 3; 18const int col_mac = 3;
19 19
20class WLANImp : public WLAN { 20class WLANImp : public WLAN {
21 Q_OBJECT 21 Q_OBJECT
22 22
23public: 23public:
24 WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); 24 WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 );
25 ~WLANImp(); 25 ~WLANImp();
26 void setProfile(const QString &profile); 26 void setProfile(const QString &profile);
27 27
28public slots: 28public slots:
29 void rescanNeighbourhood(); 29 void rescanNeighbourhood();
30 void selectNetwork( QListViewItem* ); 30 void selectNetwork( QListViewItem* );
31 31
32protected: 32protected:
33 void accept(); 33 void accept();
34 34
35private: 35private:
36 void parseOpts(); 36 void parseOpts();
37 void writeOpts(); 37 void writeOpts();
38 38
39 void parseKeyStr(QString keystr); 39 void parseKeyStr(QString keystr);
40 40
41 void handlePacket( OPacket* ); 41 void handlePacket( Opie::Net::OPacket* );
42 void displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const OMacAddress& mac ); 42 void displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const Opie::Net::OMacAddress& mac );
43 43
44 InterfaceSetupImp *interfaceSetup; 44 InterfaceSetupImp *interfaceSetup;
45 Interfaces *interfaces; 45 Interfaces *interfaces;
46 Interface *interface; 46 Interface *interface;
47 47
48 QString currentProfile; 48 QString currentProfile;
49}; 49};
50 50
51#endif 51#endif
52 52
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp
index aedd972..4a55c10 100644
--- a/noncore/settings/packagemanager/installdlg.cpp
+++ b/noncore/settings/packagemanager/installdlg.cpp
@@ -28,48 +28,49 @@
28*/ 28*/
29 29
30#include "installdlg.h" 30#include "installdlg.h"
31 31
32#include <sys/vfs.h> 32#include <sys/vfs.h>
33 33
34#include <qapplication.h> 34#include <qapplication.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qfileinfo.h> 36#include <qfileinfo.h>
37#include <qgroupbox.h> 37#include <qgroupbox.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlayout.h> 39#include <qlayout.h>
40#include <qmap.h> 40#include <qmap.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qpushbutton.h> 42#include <qpushbutton.h>
43 43
44#include <qpe/fileselector.h> 44#include <qpe/fileselector.h>
45#include <qpe/resource.h> 45#include <qpe/resource.h>
46#include <qpe/storage.h> 46#include <qpe/storage.h>
47 47
48#include <opie2/ofiledialog.h> 48#include <opie2/ofiledialog.h>
49 49
50#include "opackagemanager.h" 50#include "opackagemanager.h"
51 51
52using namespace Opie::Ui;
52InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo, 53InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &caption, bool showDestInfo,
53 OPackage::Command command1, QStringList *packages1, 54 OPackage::Command command1, QStringList *packages1,
54 OPackage::Command command2, QStringList *packages2, 55 OPackage::Command command2, QStringList *packages2,
55 OPackage::Command command3, QStringList *packages3 ) 56 OPackage::Command command3, QStringList *packages3 )
56 : QWidget( 0x0 ) 57 : QWidget( 0x0 )
57 , m_packman( pm ) 58 , m_packman( pm )
58 , m_numCommands( 0 ) 59 , m_numCommands( 0 )
59 , m_currCommand( 0 ) 60 , m_currCommand( 0 )
60{ 61{
61 // Save command/package list information 62 // Save command/package list information
62 if ( command1 != OPackage::NotDefined ) 63 if ( command1 != OPackage::NotDefined )
63 { 64 {
64 m_command[ m_numCommands ] = command1; 65 m_command[ m_numCommands ] = command1;
65 m_packages[ m_numCommands ] = packages1; 66 m_packages[ m_numCommands ] = packages1;
66 ++m_numCommands; 67 ++m_numCommands;
67 } 68 }
68 if ( command2 != OPackage::NotDefined ) 69 if ( command2 != OPackage::NotDefined )
69 { 70 {
70 m_command[ m_numCommands ] = command2; 71 m_command[ m_numCommands ] = command2;
71 m_packages[ m_numCommands ] = packages2; 72 m_packages[ m_numCommands ] = packages2;
72 ++m_numCommands; 73 ++m_numCommands;
73 } 74 }
74 if ( command3 != OPackage::NotDefined ) 75 if ( command3 != OPackage::NotDefined )
75 { 76 {
@@ -254,48 +255,48 @@ void InstallDlg::slotBtnStart()
254 m_btnOptions->setEnabled( true ); 255 m_btnOptions->setEnabled( true );
255 m_btnOptions->setText( tr( "Save output" ) ); 256 m_btnOptions->setText( tr( "Save output" ) );
256 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); 257 m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) );
257} 258}
258 259
259void InstallDlg::slotBtnOptions() 260void InstallDlg::slotBtnOptions()
260{ 261{
261 QString btnText = m_btnOptions->text(); 262 QString btnText = m_btnOptions->text();
262 if ( btnText == tr( "Options" ) ) 263 if ( btnText == tr( "Options" ) )
263 { 264 {
264 // Display configuration dialog (only options tab is enabled) 265 // Display configuration dialog (only options tab is enabled)
265 m_packman->configureDlg( true ); 266 m_packman->configureDlg( true );
266 return; 267 return;
267 } 268 }
268 269
269 // Save output was clicked 270 // Save output was clicked
270 QMap<QString, QStringList> map; 271 QMap<QString, QStringList> map;
271 map.insert( tr( "All" ), QStringList() ); 272 map.insert( tr( "All" ), QStringList() );
272 QStringList text; 273 QStringList text;
273 text << "text/*"; 274 text << "text/*";
274 map.insert(tr( "Text" ), text ); 275 map.insert(tr( "Text" ), text );
275 text << "*"; 276 text << "*";
276 map.insert( tr( "All" ), text ); 277 map.insert( tr( "All" ), text );
277 278
278 QString filename = Opie::OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map ); 279 QString filename = OFileDialog::getSaveFileName( 2, "/", "ipkg-output", map );
279 if( !filename.isEmpty() ) 280 if( !filename.isEmpty() )
280 { 281 {
281 QString currentFileName = QFileInfo( filename ).fileName(); 282 QString currentFileName = QFileInfo( filename ).fileName();
282 DocLnk doc; 283 DocLnk doc;
283 doc.setType( "text/plain" ); 284 doc.setType( "text/plain" );
284 doc.setFile( filename ); 285 doc.setFile( filename );
285 doc.setName( currentFileName ); 286 doc.setName( currentFileName );
286 FileManager fm; 287 FileManager fm;
287 fm.saveFile( doc, m_output->text() ); 288 fm.saveFile( doc, m_output->text() );
288 } 289 }
289} 290}
290 291
291void InstallDlg::slotOutput( char *msg ) 292void InstallDlg::slotOutput( char *msg )
292{ 293{
293 // Allow processing of other events 294 // Allow processing of other events
294 qApp->processEvents(); 295 qApp->processEvents();
295 296
296 QString lineStr = msg; 297 QString lineStr = msg;
297 if ( lineStr[lineStr.length()-1] == '\n' ) 298 if ( lineStr[lineStr.length()-1] == '\n' )
298 lineStr.truncate( lineStr.length() - 1 ); 299 lineStr.truncate( lineStr.length() - 1 );
299 m_output->append( lineStr ); 300 m_output->append( lineStr );
300 m_output->setCursorPosition( m_output->numLines(), 0 ); 301 m_output->setCursorPosition( m_output->numLines(), 0 );
301} 302}
diff --git a/noncore/settings/packagemanager/main.cpp b/noncore/settings/packagemanager/main.cpp
index 18ed644..c050e1a 100644
--- a/noncore/settings/packagemanager/main.cpp
+++ b/noncore/settings/packagemanager/main.cpp
@@ -10,25 +10,26 @@
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "mainwindow.h" 30#include "mainwindow.h"
31 31
32#include <opie2/oapplicationfactory.h> 32#include <opie2/oapplicationfactory.h>
33 33
34using namespace Opie::Core;
34OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 35OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index 84c6de4..592de3e 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -21,48 +21,49 @@
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "oipkgconfigdlg.h" 32#include "oipkgconfigdlg.h"
33 33
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qgroupbox.h> 36#include <qgroupbox.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qlineedit.h> 38#include <qlineedit.h>
39#include <qlistbox.h> 39#include <qlistbox.h>
40#include <qpushbutton.h> 40#include <qpushbutton.h>
41#include <qscrollview.h> 41#include <qscrollview.h>
42 42
43#include <qpe/resource.h> 43#include <qpe/resource.h>
44 44
45using namespace Opie::Ui;
45OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent ) 46OIpkgConfigDlg::OIpkgConfigDlg( OIpkg *ipkg, bool installOptions, QWidget *parent )
46 : QDialog( parent, QString::null, true ) 47 : QDialog( parent, QString::null, true )
47 , m_ipkg( ipkg ) 48 , m_ipkg( ipkg )
48 , m_configs( 0x0 ) 49 , m_configs( 0x0 )
49 , m_installOptions( installOptions ) 50 , m_installOptions( installOptions )
50 , m_serverNew( false ) 51 , m_serverNew( false )
51 , m_serverCurrent( -1 ) 52 , m_serverCurrent( -1 )
52 , m_destNew( false ) 53 , m_destNew( false )
53 , m_destCurrent( -1 ) 54 , m_destCurrent( -1 )
54 , m_layout( this, 2, 4 ) 55 , m_layout( this, 2, 4 )
55 , m_tabWidget( this ) 56 , m_tabWidget( this )
56{ 57{
57 setCaption( tr( "Configuration" ) ); 58 setCaption( tr( "Configuration" ) );
58 59
59 // Initialize configuration widgets 60 // Initialize configuration widgets
60 if ( !installOptions ) 61 if ( !installOptions )
61 { 62 {
62 initServerWidget(); 63 initServerWidget();
63 initDestinationWidget(); 64 initDestinationWidget();
64 initProxyWidget(); 65 initProxyWidget();
65 } 66 }
66 initOptionsWidget(); 67 initOptionsWidget();
67 68
68 // Load configuration information 69 // Load configuration information
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h
index 88e020a..0aba898 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.h
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.h
@@ -53,49 +53,49 @@ public:
53 OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 ); 53 OIpkgConfigDlg( OIpkg *ipkg = 0x0, bool installOptions = false, QWidget *parent = 0x0 );
54 54
55protected slots: 55protected slots:
56 void accept(); 56 void accept();
57 void reject(); 57 void reject();
58 58
59private: 59private:
60 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options 60 OIpkg *m_ipkg; // Pointer to Ipkg class for retrieving/saving configuration options
61 OConfItemList *m_configs; // Local list of configuration items 61 OConfItemList *m_configs; // Local list of configuration items
62 62
63 bool m_installOptions; // If true, will only display the Options tab 63 bool m_installOptions; // If true, will only display the Options tab
64 64
65 // Server cached information 65 // Server cached information
66 bool m_serverNew; // Indicates if server information is for a new server 66 bool m_serverNew; // Indicates if server information is for a new server
67 int m_serverCurrent; // Index of currently selected server in m_serverList 67 int m_serverCurrent; // Index of currently selected server in m_serverList
68 QString m_serverCurrName; // Name of currently selected server in m_serverList 68 QString m_serverCurrName; // Name of currently selected server in m_serverList
69 69
70 // Destination cached information 70 // Destination cached information
71 bool m_destNew; // Indicates if destination information is for a new destination 71 bool m_destNew; // Indicates if destination information is for a new destination
72 int m_destCurrent; // Index of currently selected destination in m_destList 72 int m_destCurrent; // Index of currently selected destination in m_destList
73 QString m_destCurrName; // Name of currently selected destination in m_destList 73 QString m_destCurrName; // Name of currently selected destination in m_destList
74 74
75 // UI controls 75 // UI controls
76 QVBoxLayout m_layout; // Main dialog layout control 76 QVBoxLayout m_layout; // Main dialog layout control
77 OTabWidget m_tabWidget; // Main tab widget control 77 Opie::Ui::OTabWidget m_tabWidget; // Main tab widget control
78 QWidget *m_serverWidget; // Widget containing server configuration controls 78 QWidget *m_serverWidget; // Widget containing server configuration controls
79 QWidget *m_destWidget; // Widget containing destination configuration controls 79 QWidget *m_destWidget; // Widget containing destination configuration controls
80 QWidget *m_proxyWidget; // Widget containing proxy configuration controls 80 QWidget *m_proxyWidget; // Widget containing proxy configuration controls
81 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls 81 QWidget *m_optionsWidget; // Widget containing ipkg execution configuration controls
82 82
83 // Server configuration UI controls 83 // Server configuration UI controls
84 QListBox *m_serverList; // Server list selection 84 QListBox *m_serverList; // Server list selection
85 QLineEdit *m_serverName; // Server name edit box 85 QLineEdit *m_serverName; // Server name edit box
86 QLineEdit *m_serverLocation; // Server location URL edit box 86 QLineEdit *m_serverLocation; // Server location URL edit box
87 QCheckBox *m_serverActive; // Activate server check box 87 QCheckBox *m_serverActive; // Activate server check box
88 88
89 // Destination configuration UI controls 89 // Destination configuration UI controls
90 QListBox *m_destList; // Destination list selection 90 QListBox *m_destList; // Destination list selection
91 QLineEdit *m_destName; // Destination name edit box 91 QLineEdit *m_destName; // Destination name edit box
92 QLineEdit *m_destLocation; // Destination location URL edit box 92 QLineEdit *m_destLocation; // Destination location URL edit box
93 QCheckBox *m_destActive; // Activate destination check box 93 QCheckBox *m_destActive; // Activate destination check box
94 94
95 // Proxy server configuration UI controls 95 // Proxy server configuration UI controls
96 QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box 96 QLineEdit *m_proxyHttpServer; // HTTP proxy server URL edit box
97 QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box 97 QCheckBox *m_proxyHttpActive; // Activate HTTP proxy check box
98 QLineEdit *m_proxyFtpServer; // FTP proxy server edit box 98 QLineEdit *m_proxyFtpServer; // FTP proxy server edit box
99 QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box 99 QCheckBox *m_proxyFtpActive; // Activate FTP proxy check box
100 QLineEdit *m_proxyUsername; // Proxy server username edit box 100 QLineEdit *m_proxyUsername; // Proxy server username edit box
101 QLineEdit *m_proxyPassword; // Proxy server password edit box 101 QLineEdit *m_proxyPassword; // Proxy server password edit box
diff --git a/noncore/settings/packagemanager/packageinfodlg.cpp b/noncore/settings/packagemanager/packageinfodlg.cpp
index 7abd17e..73d3de7 100644
--- a/noncore/settings/packagemanager/packageinfodlg.cpp
+++ b/noncore/settings/packagemanager/packageinfodlg.cpp
@@ -17,48 +17,49 @@
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "packageinfodlg.h" 30#include "packageinfodlg.h"
31#include "opackage.h" 31#include "opackage.h"
32#include "opackagemanager.h" 32#include "opackagemanager.h"
33 33
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36 36
37#include <qpe/resource.h> 37#include <qpe/resource.h>
38 38
39#include <opie2/otabwidget.h> 39#include <opie2/otabwidget.h>
40 40
41using namespace Opie::Ui;
41PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package ) 42PackageInfoDlg::PackageInfoDlg( QWidget *parent, OPackageManager *pm, const QString &package )
42 : QWidget( 0x0 ) 43 : QWidget( 0x0 )
43 , m_packman( pm ) 44 , m_packman( pm )
44 , m_information( this ) 45 , m_information( this )
45 , m_files( this ) 46 , m_files( this )
46{ 47{
47 // Initialize UI 48 // Initialize UI
48 if ( parent ) 49 if ( parent )
49 parent->setCaption( package ); 50 parent->setCaption( package );
50 51
51 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 ); 52 QVBoxLayout *layout = new QVBoxLayout( this, 4, 2 );
52 53
53 OTabWidget *tabWidget = new OTabWidget( this ); 54 OTabWidget *tabWidget = new OTabWidget( this );
54 layout->addWidget( tabWidget ); 55 layout->addWidget( tabWidget );
55 56
56 // Information tab 57 // Information tab
57 m_information.reparent( tabWidget, QPoint( 0, 0 ) ); 58 m_information.reparent( tabWidget, QPoint( 0, 0 ) );
58 m_information.setReadOnly( true ); 59 m_information.setReadOnly( true );
59 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) ); 60 tabWidget->addTab( &m_information, "UtilsIcon", tr( "Information" ) );
60 61
61 // Retrive package information 62 // Retrive package information
62 m_package = m_packman->findPackage( package ); 63 m_package = m_packman->findPackage( package );
63 if ( !m_package ) 64 if ( !m_package )
64 { 65 {
diff --git a/noncore/settings/sound/main.cpp b/noncore/settings/sound/main.cpp
index 49497c3..946bb3a 100644
--- a/noncore/settings/sound/main.cpp
+++ b/noncore/settings/sound/main.cpp
@@ -1,28 +1,29 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "soundsettings.h" 21#include "soundsettings.h"
22 22
23#include <opie2/oapplicationfactory.h> 23#include <opie2/oapplicationfactory.h>
24 24
25using namespace Opie::Core;
25OPIE_EXPORT_APP( OApplicationFactory<SoundSettings> ) 26OPIE_EXPORT_APP( OApplicationFactory<SoundSettings> )
26 27
27 28
28 29
diff --git a/noncore/settings/sshkeys/sshkeys.cpp b/noncore/settings/sshkeys/sshkeys.cpp
index e76fd6b..31f6b85 100644
--- a/noncore/settings/sshkeys/sshkeys.cpp
+++ b/noncore/settings/sshkeys/sshkeys.cpp
@@ -12,104 +12,105 @@
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
21#include "sshkeys.h" 21#include "sshkeys.h"
22 22
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qmultilineedit.h> 24#include <qmultilineedit.h>
25#include <qpushbutton.h> 25#include <qpushbutton.h>
26#include <qlistview.h> 26#include <qlistview.h>
27#include <qcombobox.h> 27#include <qcombobox.h>
28 28
29#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/stat.h> 30#include <sys/stat.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <unistd.h> 32#include <unistd.h>
33#include <stdio.h> 33#include <stdio.h>
34#include <ctype.h> 34#include <ctype.h>
35 35
36using namespace Opie::Core;
36static char *keynames[] = { "identity", "id_rsa", "id_dsa" }; 37static char *keynames[] = { "identity", "id_rsa", "id_dsa" };
37 38
38SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl ) 39SSHKeysApp::SSHKeysApp( QWidget* parent, const char* name, WFlags fl )
39 : SSHKeysBase( parent, name, fl ) 40 : SSHKeysBase( parent, name, fl )
40{ 41{
41 char *home = getenv("HOME"); 42 char *home = getenv("HOME");
42 unsigned i; 43 unsigned i;
43 44
44 connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton())); 45 connect(AddButton, SIGNAL(clicked()), this, SLOT(doAddButton()));
45 connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton())); 46 connect(RefreshListButton, SIGNAL(clicked()), this, SLOT(doRefreshListButton()));
46 connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton())); 47 connect(RemoveAllButton, SIGNAL(clicked()), this, SLOT(doRemoveAllButton()));
47 48
48 connect(&addprocess, SIGNAL(receivedStdout(OProcess*,char*,int)), 49 connect(&addprocess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
49 this, SLOT(log_sshadd_output(OProcess*,char*,int))); 50 this, SLOT(log_sshadd_output(OProcess*,char*,int)));
50 connect(&addprocess, SIGNAL(receivedStderr(OProcess*,char*,int)), 51 connect(&addprocess, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
51 this, SLOT(log_sshadd_stderr(OProcess*,char*,int))); 52 this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
52 connect(&addprocess, SIGNAL(processExited(OProcess*)), 53 connect(&addprocess, SIGNAL(processExited(Opie::Core::OProcess*)),
53 this, SLOT(ssh_add_exited(OProcess*))); 54 this, SLOT(ssh_add_exited(OProcess*)));
54 55
55 connect(KeyFileName, SIGNAL(textChanged(const QString&)), 56 connect(KeyFileName, SIGNAL(textChanged(const QString&)),
56 this, SLOT(add_text_changed(const QString&))); 57 this, SLOT(add_text_changed(const QString&)));
57 58
58 if (home) { 59 if (home) {
59 for (i = 0; i < sizeof(keynames)/sizeof(keynames[0]); i++) { 60 for (i = 0; i < sizeof(keynames)/sizeof(keynames[0]); i++) {
60 char thiskeyname[32]; 61 char thiskeyname[32];
61 62
62 thiskeyname[31] = 0; 63 thiskeyname[31] = 0;
63 snprintf(thiskeyname, 31, "%s/.ssh/%s", home, keynames[i]); 64 snprintf(thiskeyname, 31, "%s/.ssh/%s", home, keynames[i]);
64 if (!access(thiskeyname, R_OK)) { 65 if (!access(thiskeyname, R_OK)) {
65 KeyFileName->insertItem(thiskeyname); 66 KeyFileName->insertItem(thiskeyname);
66 } 67 }
67 } 68 }
68 } 69 }
69 70
70 doRefreshListButton(); 71 doRefreshListButton();
71} 72}
72 73
73SSHKeysApp::~SSHKeysApp() 74SSHKeysApp::~SSHKeysApp()
74{ 75{
75} 76}
76 77
77void SSHKeysApp::doRefreshListButton() 78void SSHKeysApp::doRefreshListButton()
78{ 79{
79 OProcess sshadd_process; 80 OProcess sshadd_process;
80 QListViewItem *t = KeyList->firstChild(); 81 QListViewItem *t = KeyList->firstChild();
81 82
82 while(t) { 83 while(t) {
83 QListViewItem *next = t->nextSibling(); 84 QListViewItem *next = t->nextSibling();
84 KeyList->takeItem(t); 85 KeyList->takeItem(t);
85 delete(t); 86 delete(t);
86 t = next; 87 t = next;
87 } 88 }
88 89
89 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), 90 connect(&sshadd_process, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
90 this, SLOT(get_list_keys_output(OProcess*,char*,int))); 91 this, SLOT(get_list_keys_output(OProcess*,char*,int)));
91 connect(&sshadd_process, SIGNAL(receivedStderr(OProcess*,char*,int)), 92 connect(&sshadd_process, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
92 this, SLOT(log_sshadd_stderr(OProcess*,char*,int))); 93 this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
93 94
94 keystate = KeySize; 95 keystate = KeySize;
95 incoming_keyname=""; 96 incoming_keyname="";
96 incoming_keysize=""; 97 incoming_keysize="";
97 incoming_keyfingerprint=""; 98 incoming_keyfingerprint="";
98 99
99// log_text("Running ssh-add -l"); 100// log_text("Running ssh-add -l");
100 sshadd_process << "ssh-add" << "-l"; 101 sshadd_process << "ssh-add" << "-l";
101 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); 102 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
102 if (!ret) { 103 if (!ret) {
103 log_text(tr("Error running ssh-add")); 104 log_text(tr("Error running ssh-add"));
104 return; 105 return;
105 } 106 }
106 flush_sshadd_output(); 107 flush_sshadd_output();
107 if (sshadd_process.exitStatus() == 2) { 108 if (sshadd_process.exitStatus() == 2) {
108 setEnabled(FALSE); 109 setEnabled(FALSE);
109 } 110 }
110} 111}
111 112
112void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen) 113void SSHKeysApp::get_list_keys_output(OProcess *proc, char *buffer, int buflen)
113{ 114{
114 int i; 115 int i;
115 (void) proc; 116 (void) proc;
@@ -256,38 +257,38 @@ void SSHKeysApp::doAddButton()
256// log_text(QString(tr("Running ssh-add -- ")) + KeyFileName->currentText()); 257// log_text(QString(tr("Running ssh-add -- ")) + KeyFileName->currentText());
257 } else { 258 } else {
258 addprocess << "ssh-add"; 259 addprocess << "ssh-add";
259// log_text(tr("Running ssh-add")); 260// log_text(tr("Running ssh-add"));
260 } 261 }
261 bool ret = addprocess.start(OProcess::NotifyOnExit, OProcess::AllOutput); 262 bool ret = addprocess.start(OProcess::NotifyOnExit, OProcess::AllOutput);
262 if (!ret) { 263 if (!ret) {
263 log_text(tr("Error running ssh-add")); 264 log_text(tr("Error running ssh-add"));
264 doRefreshListButton(); 265 doRefreshListButton();
265 setEnabled(TRUE); 266 setEnabled(TRUE);
266 } 267 }
267 flush_sshadd_output(); 268 flush_sshadd_output();
268} 269}
269 270
270void SSHKeysApp::log_text(const char *text) 271void SSHKeysApp::log_text(const char *text)
271{ 272{
272 TextOutput->append(text); 273 TextOutput->append(text);
273 TextOutput->setCursorPosition(TextOutput->numLines()+1, 0, FALSE); 274 TextOutput->setCursorPosition(TextOutput->numLines()+1, 0, FALSE);
274} 275}
275 276
276void SSHKeysApp::doRemoveAllButton() 277void SSHKeysApp::doRemoveAllButton()
277{ 278{
278 OProcess sshadd_process; 279 OProcess sshadd_process;
279 280
280 connect(&sshadd_process, SIGNAL(receivedStdout(OProcess*,char*,int)), 281 connect(&sshadd_process, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
281 this, SLOT(log_sshadd_output(OProcess*,char*,int))); 282 this, SLOT(log_sshadd_output(OProcess*,char*,int)));
282 connect(&sshadd_process, SIGNAL(receivedStderr(OProcess*,char*,int)), 283 connect(&sshadd_process, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
283 this, SLOT(log_sshadd_stderr(OProcess*,char*,int))); 284 this, SLOT(log_sshadd_stderr(OProcess*,char*,int)));
284 285
285// log_text(tr("Running ssh-add -D")); 286// log_text(tr("Running ssh-add -D"));
286 sshadd_process << "ssh-add" << "-D"; 287 sshadd_process << "ssh-add" << "-D";
287 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput); 288 bool ret = sshadd_process.start(OProcess::Block, OProcess::AllOutput);
288 if (!ret) { 289 if (!ret) {
289 log_text(tr("Error running ssh-add")); 290 log_text(tr("Error running ssh-add"));
290 } 291 }
291 flush_sshadd_output(); 292 flush_sshadd_output();
292 doRefreshListButton(); 293 doRefreshListButton();
293} 294}
diff --git a/noncore/settings/sshkeys/sshkeys.h b/noncore/settings/sshkeys/sshkeys.h
index 7483bbc..519f540 100644
--- a/noncore/settings/sshkeys/sshkeys.h
+++ b/noncore/settings/sshkeys/sshkeys.h
@@ -22,40 +22,40 @@
22#ifndef SSHKEYSAPP_H 22#ifndef SSHKEYSAPP_H
23#define SSHKEYSAPP_H 23#define SSHKEYSAPP_H
24 24
25#include "sshkeysbase.h" 25#include "sshkeysbase.h"
26 26
27#include <opie2/oprocess.h> 27#include <opie2/oprocess.h>
28 28
29class SSHKeysApp : public SSHKeysBase 29class SSHKeysApp : public SSHKeysBase
30{ 30{
31 Q_OBJECT 31 Q_OBJECT
32 32
33 public: 33 public:
34 SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 34 SSHKeysApp( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
35 ~SSHKeysApp(); 35 ~SSHKeysApp();
36 36
37 private: 37 private:
38 void log_text(const char *text); 38 void log_text(const char *text);
39 void flush_sshadd_output(void); 39 void flush_sshadd_output(void);
40 40
41 enum { Noise, KeyName, KeySize, KeyFingerprint } keystate; 41 enum { Noise, KeyName, KeySize, KeyFingerprint } keystate;
42 QString incoming_keyname; 42 QString incoming_keyname;
43 QString incoming_keysize; 43 QString incoming_keysize;
44 QString incoming_keyfingerprint; 44 QString incoming_keyfingerprint;
45 QString incoming_noise; 45 QString incoming_noise;
46 OProcess addprocess; 46 Opie::Core::OProcess addprocess;
47 QString pending_stdout; 47 QString pending_stdout;
48 QString pending_stderr; 48 QString pending_stderr;
49 49
50 private slots: 50 private slots:
51 void doAddButton(); 51 void doAddButton();
52 void doRefreshListButton(); 52 void doRefreshListButton();
53 void doRemoveAllButton(); 53 void doRemoveAllButton();
54 void get_list_keys_output(OProcess *proc, char *buffer, int buflen); 54 void get_list_keys_output(Opie::Core::OProcess *proc, char *buffer, int buflen);
55 void log_sshadd_output(OProcess *proc, char *buffer, int buflen); 55 void log_sshadd_output(Opie::Core::OProcess *proc, char *buffer, int buflen);
56 void log_sshadd_stderr(OProcess *proc, char *buffer, int buflen); 56 void log_sshadd_stderr(Opie::Core::OProcess *proc, char *buffer, int buflen);
57 void ssh_add_exited(OProcess *proc); 57 void ssh_add_exited(Opie::Core::OProcess *proc);
58 void add_text_changed(const QString &text); 58 void add_text_changed(const QString &text);
59}; 59};
60#endif 60#endif
61 61
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 3c2c15f..2a52b00 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -30,49 +30,52 @@
30/* QT */ 30/* QT */
31#include <qclipboard.h> 31#include <qclipboard.h>
32#include <qcolor.h> 32#include <qcolor.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qdirectpainter_qws.h> 34#include <qdirectpainter_qws.h>
35#include <qfile.h> 35#include <qfile.h>
36#include <qtextstream.h> 36#include <qtextstream.h>
37#include <qfiledialog.h> 37#include <qfiledialog.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qlayout.h> 39#include <qlayout.h>
40#include <qpainter.h> 40#include <qpainter.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwhatsthis.h> 43#include <qwhatsthis.h>
44 44
45/* STD */ 45/* STD */
46#include <time.h> 46#include <time.h>
47#include <stdio.h> 47#include <stdio.h>
48#include <stdlib.h> 48#include <stdlib.h>
49#include <math.h> 49#include <math.h>
50#if defined (__GNUC__) && (__GNUC__ < 3) 50#if defined (__GNUC__) && (__GNUC__ < 3)
51extern double round(double); 51extern double round(double);
52#endif 52#endif
53 53
54using namespace Opie::Ui;
55using namespace Opie::Core;
54extern "C" 56extern "C"
57
55{ 58{
56 void BenchFFT( void ); 59 void BenchFFT( void );
57 double dhry_main( int ); 60 double dhry_main( int );
58} 61}
59 62
60#define DHRYSTONE_RUNS 20000000 63#define DHRYSTONE_RUNS 20000000
61#define TEST_DURATION 3 64#define TEST_DURATION 3
62 65
63#define BUFF_SIZE 8192 66#define BUFF_SIZE 8192
64#define FILE_SIZE 1024 * 1024 // 1Mb 67#define FILE_SIZE 1024 * 1024 // 1Mb
65 68
66//=========================================================================== 69//===========================================================================
67 70
68class BenchmarkPaintWidget : public QWidget 71class BenchmarkPaintWidget : public QWidget
69{ 72{
70 public: 73 public:
71 BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever ) 74 BenchmarkPaintWidget() : QWidget( 0, "Benchmark Paint Widget", WStyle_Customize|WStyle_StaysOnTop|WPaintUnclipped|WPaintClever )
72 { 75 {
73 resize( QApplication::desktop()->size() ); 76 resize( QApplication::desktop()->size() );
74 show(); 77 show();
75 p.begin( this ); 78 p.begin( this );
76 }; 79 };
77 80
78 ~BenchmarkPaintWidget() 81 ~BenchmarkPaintWidget()
@@ -154,54 +157,54 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
154 QHBoxLayout* hb = new QHBoxLayout( vb ); 157 QHBoxLayout* hb = new QHBoxLayout( vb );
155 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); 158 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
156 hb->addWidget( machineCombo, 2 ); 159 hb->addWidget( machineCombo, 2 );
157 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); 160 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
158 } 161 }
159 162
160 vb->addWidget( startButton, 2 ); 163 vb->addWidget( startButton, 2 );
161} 164}
162 165
163 166
164BenchmarkInfo::~BenchmarkInfo() 167BenchmarkInfo::~BenchmarkInfo()
165{} 168{}
166 169
167 170
168void BenchmarkInfo::machineActivated( int index ) 171void BenchmarkInfo::machineActivated( int index )
169{ 172{
170 QStringList* results = machines[ machineCombo->text( index ) ]; 173 QStringList* results = machines[ machineCombo->text( index ) ];
171 if ( !results ) 174 if ( !results )
172 { 175 {
173 qDebug( "sysinfo: no results available." ); 176 qDebug( "sysinfo: no results available." );
174 return; 177 return;
175 } 178 }
176 QStringList::Iterator it = results->begin(); 179 QStringList::Iterator it = results->begin();
177 test_alu->setText( 2, *(it++) ); 180 test_alu->setText( 2, *(it++) );
178 test_fpu->setText( 2, *(it++) ); 181 test_fpu->setText( 2, *(it++) );
179 test_txt->setText( 2, *(it++) ); 182 test_txt->setText( 2, *(it++) );
180 test_gfx->setText( 2, *(it++) ); 183 test_gfx->setText( 2, *(it++) );
181 test_ram->setText( 2, *(it++) ); 184 test_ram->setText( 2, *(it++) );
182 test_sd->setText( 2, *(it++) ); 185 test_sd->setText( 2, *(it++) );
183 test_cf->setText( 2, *(it++) ); 186 test_cf->setText( 2, *(it++) );
184} 187}
185 188
186 189
187void BenchmarkInfo::run() 190void BenchmarkInfo::run()
188{ 191{
189 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); 192 startButton->setText( "> Don't touch! Running Tests! Don't touch! <" );
190 qApp->processEvents(); 193 qApp->processEvents();
191 QTime t; 194 QTime t;
192 195
193 if ( test_alu->isOn() ) 196 if ( test_alu->isOn() )
194 { 197 {
195 int d = round( dhry_main( DHRYSTONE_RUNS ) ); 198 int d = round( dhry_main( DHRYSTONE_RUNS ) );
196 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) ); 199 test_alu->setText( 1, QString( "%1 dhrys" ).arg( QString::number( d ) ) );
197 test_alu->setOn( false ); 200 test_alu->setOn( false );
198 } 201 }
199 202
200 if ( test_fpu->isOn() ) 203 if ( test_fpu->isOn() )
201 { 204 {
202 t.start(); 205 t.start();
203 BenchFFT(); 206 BenchFFT();
204 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) ); 207 test_fpu->setText( 1, QString( "%1 secs" ).arg( QString::number( t.elapsed() / 1000.0 ) ) );
205 test_fpu->setOn( false ); 208 test_fpu->setOn( false );
206 } 209 }
207 210
@@ -238,124 +241,124 @@ void BenchmarkInfo::run()
238 241
239 startButton->setText( tr( "&Start Tests!" ) ); 242 startButton->setText( tr( "&Start Tests!" ) );
240} 243}
241 244
242 245
243int BenchmarkInfo::textRendering( int seconds ) 246int BenchmarkInfo::textRendering( int seconds )
244{ 247{
245 QTime t; 248 QTime t;
246 t.start(); 249 t.start();
247 int stop = t.elapsed() + seconds * 1000; 250 int stop = t.elapsed() + seconds * 1000;
248 251
249 int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; 252 int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 };
250 int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; 253 int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 };
251 int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; 254 int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 };
252 const QString text( "Opie Benchmark Test" ); 255 const QString text( "Opie Benchmark Test" );
253 256
254 int w = QApplication::desktop()->width(); 257 int w = QApplication::desktop()->width();
255 int h = QApplication::desktop()->height(); 258 int h = QApplication::desktop()->height();
256 259
257 srand( time( NULL ) ); 260 srand( time( NULL ) );
258 261
259 BenchmarkPaintWidget bpw; 262 BenchmarkPaintWidget bpw;
260 263
261 int loops = 0; 264 int loops = 0;
262 265
263 while ( t.elapsed() < stop ) 266 while ( t.elapsed() < stop )
264 { 267 {
265 int k = rand() % 9; 268 int k = rand() % 9;
266 int s = rand() % 100; 269 int s = rand() % 100;
267 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); 270 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) );
268 bpw.p.setFont( QFont( "Vera", s ) ); 271 bpw.p.setFont( QFont( "Vera", s ) );
269 bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); 272 bpw.p.drawText( rand() % w, rand() % h, text, text.length() );
270 ++loops; 273 ++loops;
271 } 274 }
272 275
273 return loops * text.length(); 276 return loops * text.length();
274} 277}
275 278
276int BenchmarkInfo::gfxRendering( int seconds ) 279int BenchmarkInfo::gfxRendering( int seconds )
277{ 280{
278 int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; 281 int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 };
279 int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 }; 282 int gg[] = { 0, 255, 0, 0, 255, 255, 0, 128, 128 };
280 int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 }; 283 int bb[] = { 0, 0, 255, 0, 0, 255, 255, 128, 0 };
281 284
282 int w = QApplication::desktop()->width(); 285 int w = QApplication::desktop()->width();
283 int h = QApplication::desktop()->height(); 286 int h = QApplication::desktop()->height();
284 287
285 srand( time( NULL ) ); 288 srand( time( NULL ) );
286 289
287 BenchmarkPaintWidget bpw; 290 BenchmarkPaintWidget bpw;
288 291
289 QTime t; 292 QTime t;
290 t.start(); 293 t.start();
291 int stop = t.elapsed() + seconds*1000; 294 int stop = t.elapsed() + seconds*1000;
292 int loops = 0; 295 int loops = 0;
293 296
294 while ( t.elapsed() < stop ) 297 while ( t.elapsed() < stop )
295 { 298 {
296 int k = rand() % 9; 299 int k = rand() % 9;
297 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); 300 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) );
298 bpw.p.drawLine( rand()%w, rand()%h, rand()%w, rand()%h ); 301 bpw.p.drawLine( rand()%w, rand()%h, rand()%w, rand()%h );
299 ++loops; 302 ++loops;
300 } 303 }
301 304
302 t.restart(); 305 t.restart();
303 stop = t.elapsed() + seconds*1000; 306 stop = t.elapsed() + seconds*1000;
304 307
305 while ( t.elapsed() < stop ) 308 while ( t.elapsed() < stop )
306 { 309 {
307 int k = rand() % 9; 310 int k = rand() % 9;
308 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); 311 bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) );
309 bpw.p.drawArc( rand()%w, rand()%h, rand()%w, rand()%h, 360 * 16, 360 * 16 ); 312 bpw.p.drawArc( rand()%w, rand()%h, rand()%w, rand()%h, 360 * 16, 360 * 16 );
310 ++loops; 313 ++loops;
311 } 314 }
312 315
313 QBrush br1; 316 QBrush br1;
314 br1.setStyle( SolidPattern ); 317 br1.setStyle( SolidPattern );
315 t.restart(); 318 t.restart();
316 stop = t.elapsed() + seconds*1000; 319 stop = t.elapsed() + seconds*1000;
317 320
318 while ( t.elapsed() < stop ) 321 while ( t.elapsed() < stop )
319 { 322 {
320 int k = rand() % 9; 323 int k = rand() % 9;
321 br1.setColor( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); 324 br1.setColor( QColor( rr[ k ], gg[ k ], bb[ k ] ) );
322 bpw.p.fillRect( rand()%w, rand()%h, rand()%w, rand()%h, br1 ); 325 bpw.p.fillRect( rand()%w, rand()%h, rand()%w, rand()%h, br1 );
323 ++loops; 326 ++loops;
324 } 327 }
325 328
326 QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); 329 QPixmap p = Resource::loadPixmap( "sysinfo/pattern" );
327 t.restart(); 330 t.restart();
328 stop = t.elapsed() + seconds*1000; 331 stop = t.elapsed() + seconds*1000;
329 332
330 while ( t.elapsed() < stop ) 333 while ( t.elapsed() < stop )
331 { 334 {
332 bpw.p.drawPixmap( rand()%w, rand()%h, p ); 335 bpw.p.drawPixmap( rand()%w, rand()%h, p );
333 ++loops; 336 ++loops;
334 } 337 }
335 338
336 return loops; 339 return loops;
337 340
338} 341}
339 342
340void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) 343void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item )
341{ 344{
342 QTime time; 345 QTime time;
343 time.start(); 346 time.start();
344 if ( writeFile( fname ) && 347 if ( writeFile( fname ) &&
345 readFile( fname ) ) 348 readFile( fname ) )
346 { 349 {
347 QFile::remove( fname ); 350 QFile::remove( fname );
348 item->setText( 1, QString( "%1 kb/sec" ).arg( QString::number( 1024.0 / ( time.elapsed() / 1000.0 ) ) ) ); 351 item->setText( 1, QString( "%1 kb/sec" ).arg( QString::number( 1024.0 / ( time.elapsed() / 1000.0 ) ) ) );
349 item->setOn( false ); 352 item->setOn( false );
350 } 353 }
351 else 354 else
352 { 355 {
353 item->setText( 1, tr( "error" ) ); 356 item->setText( 1, tr( "error" ) );
354 } 357 }
355} 358}
356 359
357char FileBuf[ BUFF_SIZE + 1 ]; 360char FileBuf[ BUFF_SIZE + 1 ];
358 361
359bool BenchmarkInfo::writeFile( const QString& w_path ) 362bool BenchmarkInfo::writeFile( const QString& w_path )
360{ 363{
361 int i; 364 int i;
diff --git a/noncore/settings/sysinfo/benchmarkinfo.h b/noncore/settings/sysinfo/benchmarkinfo.h
index c3d44ec..0a61134 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.h
+++ b/noncore/settings/sysinfo/benchmarkinfo.h
@@ -2,68 +2,68 @@
2** BenchmarkInfo 2** BenchmarkInfo
3** 3**
4** A benchmark for Qt/Embedded 4** A benchmark for Qt/Embedded
5** 5**
6** Copyright (C) 2004 Michael Lauer <mickey@vanille.de> 6** Copyright (C) 2004 Michael Lauer <mickey@vanille.de>
7** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp> 7** Inspired by ZBench (C) 2002 Satoshi <af230533@im07.alpha-net.ne.jp>
8** 8**
9** This file may be distributed and/or modified under the terms of the 9** This file may be distributed and/or modified under the terms of the
10** GNU General Public License version 2 as published by the Free Software 10** GNU General Public License version 2 as published by the Free Software
11** Foundation and appearing in the file LICENSE.GPL included in the 11** Foundation and appearing in the file LICENSE.GPL included in the
12** packaging of this file. 12** packaging of this file.
13** 13**
14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16** 16**
17**********************************************************************/ 17**********************************************************************/
18 18
19#include <qwidget.h> 19#include <qwidget.h>
20#include <qdialog.h> 20#include <qdialog.h>
21#include <qdict.h> 21#include <qdict.h>
22#include <qstringlist.h> 22#include <qstringlist.h>
23 23
24class QClipboard; 24class QClipboard;
25class QComboBox; 25class QComboBox;
26class OCheckListItem; 26namespace Opie {namespace Ui {class OCheckListItem;}}
27class QPushButton; 27class QPushButton;
28class OListView; 28namespace Opie {namespace Ui {class OListView;}}
29 29
30class BenchmarkInfo : public QWidget 30class BenchmarkInfo : public QWidget
31{ 31{
32 Q_OBJECT 32 Q_OBJECT
33 33
34public: 34public:
35 BenchmarkInfo( QWidget *parent = 0, const char *name = 0, int wFlags = 0 ); 35 BenchmarkInfo( QWidget *parent = 0, const char *name = 0, int wFlags = 0 );
36 ~BenchmarkInfo(); 36 ~BenchmarkInfo();
37 37
38 OCheckListItem* test_alu; 38 Opie::Ui::OCheckListItem* test_alu;
39 OCheckListItem* test_fpu; 39 Opie::Ui::OCheckListItem* test_fpu;
40 OCheckListItem* test_txt; 40 Opie::Ui::OCheckListItem* test_txt;
41 OCheckListItem* test_gfx; 41 Opie::Ui::OCheckListItem* test_gfx;
42 OCheckListItem* test_ram; 42 Opie::Ui::OCheckListItem* test_ram;
43 OCheckListItem* test_sd; 43 Opie::Ui::OCheckListItem* test_sd;
44 OCheckListItem* test_cf; 44 Opie::Ui::OCheckListItem* test_cf;
45 45
46 bool main_rd; 46 bool main_rd;
47 bool main_wt; 47 bool main_wt;
48 bool sd_rd; 48 bool sd_rd;
49 bool sd_wt; 49 bool sd_wt;
50 bool cf_rd; 50 bool cf_rd;
51 bool cf_wt; 51 bool cf_wt;
52 52
53 QClipboard* clb; 53 QClipboard* clb;
54 QComboBox* machineCombo; 54 QComboBox* machineCombo;
55 OListView* tests; 55 Opie::Ui::OListView* tests;
56 QPushButton* startButton; 56 QPushButton* startButton;
57 QDict <QStringList> machines; 57 QDict <QStringList> machines;
58 58
59 int textRendering( int ); 59 int textRendering( int );
60 int gfxRendering( int ); 60 int gfxRendering( int );
61 void performFileTest( const QString& fname, OCheckListItem* item ); 61 void performFileTest( const QString& fname, Opie::Ui::OCheckListItem* item );
62 62
63private slots: 63private slots:
64 bool writeFile( const QString& ); 64 bool writeFile( const QString& );
65 bool readFile( const QString& ); 65 bool readFile( const QString& );
66 void run(); 66 void run();
67 void machineActivated( int ); 67 void machineActivated( int );
68}; 68};
69 69
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp
index 3a7b1b1..8ebac20 100644
--- a/noncore/settings/sysinfo/main.cpp
+++ b/noncore/settings/sysinfo/main.cpp
@@ -2,25 +2,26 @@
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "sysinfo.h" 21#include "sysinfo.h"
22 22
23#include <opie2/oapplicationfactory.h> 23#include <opie2/oapplicationfactory.h>
24 24
25 25
26using namespace Opie::Core;
26OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> ) 27OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> )
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index dfe48e1..71cefcb 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -15,72 +15,73 @@
15** packaging of this file. 15** packaging of this file.
16** 16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "modulesinfo.h" 22#include "modulesinfo.h"
23#include "detail.h" 23#include "detail.h"
24 24
25/* OPIE */ 25/* OPIE */
26#include <opie2/olistview.h> 26#include <opie2/olistview.h>
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28 28
29/* QT */ 29/* QT */
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qtextview.h> 35#include <qtextview.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38 38
39using namespace Opie::Ui;
39ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 40ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
40 : QWidget( parent, name, fl ) 41 : QWidget( parent, name, fl )
41{ 42{
42 QGridLayout *layout = new QGridLayout( this ); 43 QGridLayout *layout = new QGridLayout( this );
43 layout->setSpacing( 4 ); 44 layout->setSpacing( 4 );
44 layout->setMargin( 4 ); 45 layout->setMargin( 4 );
45 46
46 ModulesView = new OListView( this ); 47 ModulesView = new OListView( this );
47 int colnum = ModulesView->addColumn( tr( "Module" ) ); 48 int colnum = ModulesView->addColumn( tr( "Module" ) );
48 colnum = ModulesView->addColumn( tr( "Size" ) ); 49 colnum = ModulesView->addColumn( tr( "Size" ) );
49 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 50 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
50 colnum = ModulesView->addColumn( tr( "Use#" ) ); 51 colnum = ModulesView->addColumn( tr( "Use#" ) );
51 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 52 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
52 colnum = ModulesView->addColumn( tr( "Used by" ) ); 53 colnum = ModulesView->addColumn( tr( "Used by" ) );
53 ModulesView->setAllColumnsShowFocus( TRUE ); 54 ModulesView->setAllColumnsShowFocus( TRUE );
54 layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 ); 55 layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 );
55 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) ); 56 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) );
56 57
57 // Test if we have /sbin/modinfo, and if so, allow module detail window 58 // Test if we have /sbin/modinfo, and if so, allow module detail window
58 if ( QFile::exists( "/sbin/modinfo" ) ) 59 if ( QFile::exists( "/sbin/modinfo" ) )
59 { 60 {
60 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); 61 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
61 connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), 62 connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
62 this, SLOT( viewModules(OListViewItem*) ) ); 63 this, SLOT( viewModules(QListViewItem*) ) );
63 } 64 }
64 65
65 CommandCB = new QComboBox( FALSE, this ); 66 CommandCB = new QComboBox( FALSE, this );
66 CommandCB->insertItem( "modprobe -r" ); 67 CommandCB->insertItem( "modprobe -r" );
67 CommandCB->insertItem( "rmmod" ); 68 CommandCB->insertItem( "rmmod" );
68 // I can't think of other useful commands yet. Anyone? 69 // I can't think of other useful commands yet. Anyone?
69 layout->addWidget( CommandCB, 1, 0 ); 70 layout->addWidget( CommandCB, 1, 0 );
70 QWhatsThis::add( CommandCB, tr( "Select a command here and then click the Send button to the right to send the command to module selected above." ) ); 71 QWhatsThis::add( CommandCB, tr( "Select a command here and then click the Send button to the right to send the command to module selected above." ) );
71 72
72 QPushButton *btn = new QPushButton( this ); 73 QPushButton *btn = new QPushButton( this );
73 btn->setMinimumSize( QSize( 50, 24 ) ); 74 btn->setMinimumSize( QSize( 50, 24 ) );
74 btn->setMaximumSize( QSize( 50, 24 ) ); 75 btn->setMaximumSize( QSize( 50, 24 ) );
75 btn->setText( tr( "Send" ) ); 76 btn->setText( tr( "Send" ) );
76 connect( btn, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); 77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) );
77 layout->addWidget( btn, 1, 1 ); 78 layout->addWidget( btn, 1, 1 );
78 QWhatsThis::add( btn, tr( "Click here to send the selected command to the module selected above." ) ); 79 QWhatsThis::add( btn, tr( "Click here to send the selected command to the module selected above." ) );
79 80
80 QTimer *t = new QTimer( this ); 81 QTimer *t = new QTimer( this );
81 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); 82 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) );
82 t->start( 5000 ); 83 t->start( 5000 );
83 84
84 updateData(); 85 updateData();
85 86
86 ModulesDtl = new Detail(); 87 ModulesDtl = new Detail();
@@ -142,48 +143,53 @@ void ModulesInfo::slotSendClicked()
142 if ( !ModulesView->currentItem() ) 143 if ( !ModulesView->currentItem() )
143 { 144 {
144 return; 145 return;
145 } 146 }
146 147
147 QString capstr = tr( "You really want to execute\n%1 for this module?" ).arg( CommandCB->currentText() ); 148 QString capstr = tr( "You really want to execute\n%1 for this module?" ).arg( CommandCB->currentText() );
148 149
149 QString modname = ModulesView->currentItem()->text( 0 ); 150 QString modname = ModulesView->currentItem()->text( 0 );
150 151
151 if ( QMessageBox::warning( this, modname, capstr, 152 if ( QMessageBox::warning( this, modname, capstr,
152 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) 153 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
153 { 154 {
154 QString command = "/sbin/"; 155 QString command = "/sbin/";
155 command.append( CommandCB->currentText() ); 156 command.append( CommandCB->currentText() );
156 command.append( " " ); 157 command.append( " " );
157 command.append( modname ); 158 command.append( modname );
158 159
159 FILE* stream = popen( command, "r" ); 160 FILE* stream = popen( command, "r" );
160 if ( stream ) 161 if ( stream )
161 pclose( stream ); 162 pclose( stream );
162 } 163 }
163 164
164} 165}
165 166
167void ModulesInfo::viewModules( QListViewItem *module ) {
168 if ( !module )
169 return;
170 viewModules( static_cast<OListViewItem*>( module ) );
171}
166void ModulesInfo::viewModules( OListViewItem *modules ) 172void ModulesInfo::viewModules( OListViewItem *modules )
167{ 173{
168 QString modname = modules->text( 0 ); 174 QString modname = modules->text( 0 );
169 QString capstr = "Module: "; 175 QString capstr = "Module: ";
170 capstr.append( modname ); 176 capstr.append( modname );
171 ModulesDtl->setCaption( capstr ); 177 ModulesDtl->setCaption( capstr );
172 QString command = "/sbin/modinfo "; 178 QString command = "/sbin/modinfo ";
173 command.append( modname ); 179 command.append( modname );
174 FILE* modinfo = popen( command, "r" ); 180 FILE* modinfo = popen( command, "r" );
175 181
176 if ( modinfo ) 182 if ( modinfo )
177 { 183 {
178 char line[200]; 184 char line[200];
179 ModulesDtl->detailView->setText( " Details:\n------------\n" ); 185 ModulesDtl->detailView->setText( " Details:\n------------\n" );
180 186
181 while( true ) 187 while( true )
182 { 188 {
183 int success = fscanf( modinfo, "%[^\n]\n", line ); 189 int success = fscanf( modinfo, "%[^\n]\n", line );
184 if ( success == EOF ) 190 if ( success == EOF )
185 break; 191 break;
186 ModulesDtl->detailView->append( line ); 192 ModulesDtl->detailView->append( line );
187 } 193 }
188 194
189 pclose( modinfo ); 195 pclose( modinfo );
diff --git a/noncore/settings/sysinfo/modulesinfo.h b/noncore/settings/sysinfo/modulesinfo.h
index 78dce73..b816b41 100644
--- a/noncore/settings/sysinfo/modulesinfo.h
+++ b/noncore/settings/sysinfo/modulesinfo.h
@@ -5,47 +5,49 @@
5** 5**
6** Copyright (C) 2002, Michael Lauer 6** Copyright (C) 2002, Michael Lauer
7** mickey@tm.informatik.uni-frankfurt.de 7** mickey@tm.informatik.uni-frankfurt.de
8** http://www.Vanille.de 8** http://www.Vanille.de
9** 9**
10** Based on ProcessInfo by Dan Williams <williamsdr@acm.org> 10** Based on ProcessInfo by Dan Williams <williamsdr@acm.org>
11** 11**
12** This file may be distributed and/or modified under the terms of the 12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software 13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#ifndef MODULESINFO_H 22#ifndef MODULESINFO_H
23#define MODULESINFO_H 23#define MODULESINFO_H
24 24
25#include <qwidget.h> 25#include <qwidget.h>
26 26
27class Detail; 27class Detail;
28class QComboBox; 28class QComboBox;
29class OListView; 29class QListViewItem;
30class OListViewItem; 30namespace Opie {namespace Ui {class OListView;}}
31namespace Opie {namespace Ui {class OListViewItem;}}
31 32
32class ModulesInfo : public QWidget 33class ModulesInfo : public QWidget
33{ 34{
34 Q_OBJECT 35 Q_OBJECT
35public: 36public:
36 ModulesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 37 ModulesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
37 ~ModulesInfo(); 38 ~ModulesInfo();
38 39
39private: 40private:
40 OListView* ModulesView; 41 Opie::Ui::OListView* ModulesView;
41 QComboBox* CommandCB; 42 QComboBox* CommandCB;
42 43
43 Detail* ModulesDtl; 44 Detail* ModulesDtl;
44 45
45private slots: 46private slots:
46 void updateData(); 47 void updateData();
47 void slotSendClicked(); 48 void slotSendClicked();
48 void viewModules( OListViewItem * ); 49 void viewModules( QListViewItem* );
50 void viewModules( Opie::Ui::OListViewItem * );
49}; 51};
50 52
51#endif 53#endif
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index dd9a05d..e887267 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -17,67 +17,68 @@
17** 17**
18**********************************************************************/ 18**********************************************************************/
19 19
20#include "processinfo.h" 20#include "processinfo.h"
21#include "detail.h" 21#include "detail.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/olistview.h> 24#include <opie2/olistview.h>
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26 26
27/* QT */ 27/* QT */
28#include <qcombobox.h> 28#include <qcombobox.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qmessagebox.h> 31#include <qmessagebox.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qtextview.h> 33#include <qtextview.h>
34#include <qtimer.h> 34#include <qtimer.h>
35#include <qwhatsthis.h> 35#include <qwhatsthis.h>
36 36
37/* STD */ 37/* STD */
38#include <sys/types.h> 38#include <sys/types.h>
39#include <signal.h> 39#include <signal.h>
40 40
41using namespace Opie::Ui;
41ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) 42ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
42 : QWidget( parent, name, fl ) 43 : QWidget( parent, name, fl )
43{ 44{
44 QGridLayout *layout = new QGridLayout( this ); 45 QGridLayout *layout = new QGridLayout( this );
45 layout->setSpacing( 4 ); 46 layout->setSpacing( 4 );
46 layout->setMargin( 4 ); 47 layout->setMargin( 4 );
47 48
48 49
49 ProcessView = new OListView( this, "ProcessView" ); 50 ProcessView = new OListView( this, "ProcessView" );
50 int colnum = ProcessView->addColumn( tr( "PID" ) ); 51 int colnum = ProcessView->addColumn( tr( "PID" ) );
51 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 52 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
52 colnum = ProcessView->addColumn( tr( "Command" ),96 ); 53 colnum = ProcessView->addColumn( tr( "Command" ),96 );
53 colnum = ProcessView->addColumn( tr( "Status" ) ); 54 colnum = ProcessView->addColumn( tr( "Status" ) );
54 colnum = ProcessView->addColumn( tr( "Time" ) ); 55 colnum = ProcessView->addColumn( tr( "Time" ) );
55 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 56 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
56 ProcessView->setAllColumnsShowFocus( TRUE ); 57 ProcessView->setAllColumnsShowFocus( TRUE );
57 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); 58 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold );
58 connect( ProcessView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), 59 connect( ProcessView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
59 this, SLOT( viewProcess(OListViewItem*) ) ); 60 this, SLOT( viewProcess(QListViewItem*) ) );
60 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); 61 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 );
61 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) ); 62 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) );
62 63
63 SignalCB = new QComboBox( FALSE, this, "SignalCB" ); 64 SignalCB = new QComboBox( FALSE, this, "SignalCB" );
64 SignalCB->insertItem( " 1: SIGHUP" ); 65 SignalCB->insertItem( " 1: SIGHUP" );
65 SignalCB->insertItem( " 2: SIGINT" ); 66 SignalCB->insertItem( " 2: SIGINT" );
66 SignalCB->insertItem( " 3: SIGQUIT" ); 67 SignalCB->insertItem( " 3: SIGQUIT" );
67 SignalCB->insertItem( " 5: SIGTRAP" ); 68 SignalCB->insertItem( " 5: SIGTRAP" );
68 SignalCB->insertItem( " 6: SIGABRT" ); 69 SignalCB->insertItem( " 6: SIGABRT" );
69 SignalCB->insertItem( " 9: SIGKILL" ); 70 SignalCB->insertItem( " 9: SIGKILL" );
70 SignalCB->insertItem( "14: SIGALRM" ); 71 SignalCB->insertItem( "14: SIGALRM" );
71 SignalCB->insertItem( "15: SIGTERM" ); 72 SignalCB->insertItem( "15: SIGTERM" );
72 SignalCB->insertItem( "18: SIGCONT" ); 73 SignalCB->insertItem( "18: SIGCONT" );
73 SignalCB->insertItem( "19: SIGSTOP" ); 74 SignalCB->insertItem( "19: SIGSTOP" );
74 layout->addWidget( SignalCB, 1, 0 ); 75 layout->addWidget( SignalCB, 1, 0 );
75 QWhatsThis::add( SignalCB, tr( "Select a signal here and then click the Send button to the right to send to this process." ) ); 76 QWhatsThis::add( SignalCB, tr( "Select a signal here and then click the Send button to the right to send to this process." ) );
76 77
77 SendButton = new QPushButton( this, "SendButton" ); 78 SendButton = new QPushButton( this, "SendButton" );
78 SendButton->setMinimumSize( QSize( 50, 24 ) ); 79 SendButton->setMinimumSize( QSize( 50, 24 ) );
79 SendButton->setMaximumSize( QSize( 50, 24 ) ); 80 SendButton->setMaximumSize( QSize( 50, 24 ) );
80 SendButton->setText( tr( "Send" ) ); 81 SendButton->setText( tr( "Send" ) );
81 connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); 82 connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) );
82 layout->addWidget( SendButton, 1, 1 ); 83 layout->addWidget( SendButton, 1, 1 );
83 QWhatsThis::add( SendButton, tr( "Click here to send the selected signal to this process." ) ); 84 QWhatsThis::add( SendButton, tr( "Click here to send the selected signal to this process." ) );
@@ -164,43 +165,49 @@ void ProcessInfo::slotSendClicked()
164 OListViewItem *currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() ); 165 OListViewItem *currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() );
165 if ( !currprocess ) 166 if ( !currprocess )
166 { 167 {
167 return; 168 return;
168 } 169 }
169 170
170 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() ); 171 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() );
171 172
172 173
173 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr, 174 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr,
174 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) 175 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
175 { 176 {
176 currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() ); 177 currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() );
177 if ( currprocess ) 178 if ( currprocess )
178 { 179 {
179 QString sigstr = SignalCB->currentText(); 180 QString sigstr = SignalCB->currentText();
180 sigstr.truncate(2); 181 sigstr.truncate(2);
181 int sigid = sigstr.toUInt(); 182 int sigid = sigstr.toUInt();
182 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid ); 183 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid );
183 } 184 }
184 } 185 }
185 186
186} 187}
187 188
189void ProcessInfo::viewProcess( QListViewItem* process ) {
190 if ( !process )
191 return;
192 viewProcess( static_cast<OListViewItem*>( process ) );
193}
194
188void ProcessInfo::viewProcess( OListViewItem *process ) 195void ProcessInfo::viewProcess( OListViewItem *process )
189{ 196{
190 QString pid= process->text( 0 ).stripWhiteSpace(); 197 QString pid= process->text( 0 ).stripWhiteSpace();
191 QString command = process->text( 1 ); 198 QString command = process->text( 1 );
192 ProcessDtl->setCaption( pid + " - " + command ); 199 ProcessDtl->setCaption( pid + " - " + command );
193 FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r"); 200 FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r");
194 if ( statfile ) 201 if ( statfile )
195 { 202 {
196 char line[81]; 203 char line[81];
197 fgets( line, 81, statfile ); 204 fgets( line, 81, statfile );
198 ProcessDtl->detailView->setText( line ); 205 ProcessDtl->detailView->setText( line );
199 while ( fgets( line, 81, statfile ) ) 206 while ( fgets( line, 81, statfile ) )
200 { 207 {
201 ProcessDtl->detailView->append( line ); 208 ProcessDtl->detailView->append( line );
202 } 209 }
203 fclose( statfile ); 210 fclose( statfile );
204 } 211 }
205 QPEApplication::showWidget( ProcessDtl ); 212 QPEApplication::showWidget( ProcessDtl );
206} 213}
diff --git a/noncore/settings/sysinfo/processinfo.h b/noncore/settings/sysinfo/processinfo.h
index 6e7acd5..0a1682b 100644
--- a/noncore/settings/sysinfo/processinfo.h
+++ b/noncore/settings/sysinfo/processinfo.h
@@ -3,48 +3,50 @@
3** 3**
4** Display process information 4** Display process information
5** 5**
6** Copyright (C) 2002, Dan Williams 6** Copyright (C) 2002, Dan Williams
7** williamsdr@acm.org 7** williamsdr@acm.org
8** http://draknor.net 8** http://draknor.net
9** 9**
10** This file may be distributed and/or modified under the terms of the 10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software 11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the 12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file. 13** packaging of this file.
14** 14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17** 17**
18**********************************************************************/ 18**********************************************************************/
19 19
20#ifndef PROCESSINFO_H 20#ifndef PROCESSINFO_H
21#define PROCESSINFO_H 21#define PROCESSINFO_H
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24 24
25class Detail; 25class Detail;
26class QComboBox; 26class QComboBox;
27class OListView; 27class QListViewItem;
28class OListViewItem; 28namespace Opie {namespace Ui {class OListView;}}
29namespace Opie {namespace Ui {class OListViewItem;}}
29 30
30class ProcessInfo : public QWidget 31class ProcessInfo : public QWidget
31{ 32{
32 Q_OBJECT 33 Q_OBJECT
33public: 34public:
34 ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 35 ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
35 ~ProcessInfo(); 36 ~ProcessInfo();
36 37
37private: 38private:
38 OListView* ProcessView; 39 Opie::Ui::OListView* ProcessView;
39 QComboBox* SignalCB; 40 QComboBox* SignalCB;
40 QPushButton* SendButton; 41 QPushButton* SendButton;
41 42
42 Detail *ProcessDtl; 43 Detail *ProcessDtl;
43 44
44private slots: 45private slots:
45 void updateData(); 46 void updateData();
46 void slotSendClicked(); 47 void slotSendClicked();
47 void viewProcess( OListViewItem * ); 48 void viewProcess( QListViewItem* );
49 void viewProcess( Opie::Ui::OListViewItem * );
48}; 50};
49 51
50#endif 52#endif
diff --git a/noncore/settings/sysinfo/sysinfo.cpp b/noncore/settings/sysinfo/sysinfo.cpp
index fda6352..4c58999 100644
--- a/noncore/settings/sysinfo/sysinfo.cpp
+++ b/noncore/settings/sysinfo/sysinfo.cpp
@@ -17,48 +17,49 @@
17** not clear to you. 17** not clear to you.
18** 18**
19********************************************************************** 19**********************************************************************
20** 20**
21** Enhancements by: Dan Williams, <williamsdr@acm.org> 21** Enhancements by: Dan Williams, <williamsdr@acm.org>
22** 22**
23**********************************************************************/ 23**********************************************************************/
24 24
25#include "memory.h" 25#include "memory.h"
26#include "load.h" 26#include "load.h"
27#include "storage.h" 27#include "storage.h"
28#include "processinfo.h" 28#include "processinfo.h"
29#include "modulesinfo.h" 29#include "modulesinfo.h"
30#include "benchmarkinfo.h" 30#include "benchmarkinfo.h"
31#include "versioninfo.h" 31#include "versioninfo.h"
32#include "sysinfo.h" 32#include "sysinfo.h"
33 33
34#include <opie2/otabwidget.h> 34#include <opie2/otabwidget.h>
35 35
36#include <qpe/config.h> 36#include <qpe/config.h>
37#include <qpe/resource.h> 37#include <qpe/resource.h>
38 38
39#include <qlayout.h> 39#include <qlayout.h>
40 40
41using namespace Opie::Ui;
41SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags ) 42SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags )
42 : QWidget( parent, name, WStyle_ContextHelp ) 43 : QWidget( parent, name, WStyle_ContextHelp )
43{ 44{
44 setIcon( Resource::loadPixmap( "system_icon" ) ); 45 setIcon( Resource::loadPixmap( "system_icon" ) );
45 setCaption( tr("System Info") ); 46 setCaption( tr("System Info") );
46 47
47 resize( 220, 180 ); 48 resize( 220, 180 );
48 49
49 Config config( "qpe" ); 50 Config config( "qpe" );
50 config.setGroup( "Appearance" ); 51 config.setGroup( "Appearance" );
51 bool advanced = config.readBoolEntry( "Advanced", TRUE ); 52 bool advanced = config.readBoolEntry( "Advanced", TRUE );
52 53
53 QVBoxLayout *lay = new QVBoxLayout( this ); 54 QVBoxLayout *lay = new QVBoxLayout( this );
54 OTabWidget *tab = new OTabWidget( this, "tabwidget", OTabWidget::Global ); 55 OTabWidget *tab = new OTabWidget( this, "tabwidget", OTabWidget::Global );
55 lay->addWidget( tab ); 56 lay->addWidget( tab );
56 57
57 tab->addTab( new MemoryInfo( tab ), "sysinfo/memorytabicon", tr("Memory") ); 58 tab->addTab( new MemoryInfo( tab ), "sysinfo/memorytabicon", tr("Memory") );
58#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 59#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
59 tab->addTab( new FileSysInfo( tab ), "sysinfo/storagetabicon", tr("Storage") ); 60 tab->addTab( new FileSysInfo( tab ), "sysinfo/storagetabicon", tr("Storage") );
60#endif 61#endif
61 tab->addTab( new LoadInfo( tab ), "sysinfo/cputabicon", tr("CPU") ); 62 tab->addTab( new LoadInfo( tab ), "sysinfo/cputabicon", tr("CPU") );
62 if ( advanced ) 63 if ( advanced )
63 { 64 {
64 tab->addTab( new ProcessInfo( tab ), "sysinfo/processtabicon", tr("Process") ); 65 tab->addTab( new ProcessInfo( tab ), "sysinfo/processtabicon", tr("Process") );
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index 4bebd06..6764aa6 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -12,49 +12,49 @@
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "versioninfo.h" 21#include "versioninfo.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/odevice.h> 24#include <opie2/odevice.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/version.h> 26#include <qpe/version.h>
27 27
28/* QT */ 28/* QT */
29#include <qfile.h> 29#include <qfile.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qscrollview.h> 32#include <qscrollview.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qwhatsthis.h> 34#include <qwhatsthis.h>
35 35
36using namespace Opie; 36using namespace Opie::Core;
37 37
38VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) 38VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
39 : QWidget( parent, name, f ) 39 : QWidget( parent, name, f )
40{ 40{
41 setMinimumSize( 200, 150 ); 41 setMinimumSize( 200, 150 );
42 42
43 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 43 QVBoxLayout *tmpvb = new QVBoxLayout( this );
44 QScrollView *sv = new QScrollView( this ); 44 QScrollView *sv = new QScrollView( this );
45 tmpvb->addWidget( sv, 0, 0 ); 45 tmpvb->addWidget( sv, 0, 0 );
46 sv->setResizePolicy( QScrollView::AutoOneFit ); 46 sv->setResizePolicy( QScrollView::AutoOneFit );
47 sv->setFrameStyle( QFrame::NoFrame ); 47 sv->setFrameStyle( QFrame::NoFrame );
48 QWidget *container = new QWidget( sv->viewport() ); 48 QWidget *container = new QWidget( sv->viewport() );
49 sv->addChild( container ); 49 sv->addChild( container );
50 50
51 QVBoxLayout *vb = new QVBoxLayout( container, 3 ); 51 QVBoxLayout *vb = new QVBoxLayout( container, 3 );
52 52
53 QString kernelVersionString; 53 QString kernelVersionString;
54 QFile file( "/proc/version" ); 54 QFile file( "/proc/version" );
55 if ( file.open( IO_ReadOnly ) ) 55 if ( file.open( IO_ReadOnly ) )
56 { 56 {
57 QTextStream t( &file ); 57 QTextStream t( &file );
58 QStringList strList; 58 QStringList strList;
59 59
60 strList = QStringList::split( " " , t.read(), false ); 60 strList = QStringList::split( " " , t.read(), false );
diff --git a/noncore/settings/usermanager/main.cpp b/noncore/settings/usermanager/main.cpp
index d7147d1..807d528 100644
--- a/noncore/settings/usermanager/main.cpp
+++ b/noncore/settings/usermanager/main.cpp
@@ -1,14 +1,15 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10#include "usermanager.h" 10#include "usermanager.h"
11 11
12#include <opie2/oapplicationfactory.h> 12#include <opie2/oapplicationfactory.h>
13 13
14using namespace Opie::Core;
14OPIE_EXPORT_APP( OApplicationFactory<UserConfig> ) 15OPIE_EXPORT_APP( OApplicationFactory<UserConfig> )
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index eb9a289..5854fe0 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -6,55 +6,56 @@
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10#include "userdialog.h" 10#include "userdialog.h"
11#include "passwd.h" 11#include "passwd.h"
12 12
13/* OPIE */ 13/* OPIE */
14#include <opie2/odevice.h> 14#include <opie2/odevice.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16 16
17/* QT */ 17/* QT */
18#include <qlayout.h> 18#include <qlayout.h>
19#include <qlabel.h> 19#include <qlabel.h>
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qfile.h> 21#include <qfile.h>
22 22
23/* STD */ 23/* STD */
24#include <sys/types.h> 24#include <sys/types.h>
25#include <sys/wait.h> 25#include <sys/wait.h>
26#include <unistd.h> 26#include <unistd.h>
27#include <signal.h> 27#include <signal.h>
28 28
29 29
30using namespace Opie; 30using namespace Opie::Core;
31 31
32 32
33/** 33/**
34 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups. 34 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.
35 * 35 *
36 */ 36 */
37using namespace Opie::Ui;
37UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) 38UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl)
38{ 39{
39 vm=viewmode; 40 vm=viewmode;
40 QVBoxLayout *layout = new QVBoxLayout(this); 41 QVBoxLayout *layout = new QVBoxLayout(this);
41 myTabWidget=new QTabWidget(this,"User Tab Widget"); 42 myTabWidget=new QTabWidget(this,"User Tab Widget");
42 layout->addWidget(myTabWidget); 43 layout->addWidget(myTabWidget);
43 setupTab1(); 44 setupTab1();
44 setupTab2(); 45 setupTab2();
45 46
46 accounts->groupStringList.sort(); 47 accounts->groupStringList.sort();
47 // And also fill the listview & the combobox with all available groups. 48 // And also fill the listview & the combobox with all available groups.
48 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) 49 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it)
49 { 50 {
50 accounts->splitGroupEntry(*it); 51 accounts->splitGroupEntry(*it);
51 if(accounts->gr_name.find(QRegExp("^#"),0)) 52 if(accounts->gr_name.find(QRegExp("^#"),0))
52 { // Skip commented lines. 53 { // Skip commented lines.
53 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); 54 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
54 groupComboBox->insertItem(accounts->gr_name); 55 groupComboBox->insertItem(accounts->gr_name);
55 } 56 }
56 } 57 }
57 QPEApplication::showDialog( this ); 58 QPEApplication::showDialog( this );
58} 59}
59 60
60/** 61/**