summaryrefslogtreecommitdiff
path: root/noncore
authorar <ar>2004-02-21 16:02:01 (UTC)
committer ar <ar>2004-02-21 16:02:01 (UTC)
commitdb2afda83e495bff9fc19fa14a30072f1cd4c67a (patch) (unidiff)
tree0281ec10dad24d83179283370661ae9225016de0 /noncore
parent460258f203be746ff79e14f32a823f381b8ea513 (diff)
downloadopie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.zip
opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.gz
opie-db2afda83e495bff9fc19fa14a30072f1cd4c67a.tar.bz2
improve support for BigScreen
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp162
-rw-r--r--noncore/settings/appearance2/stylelistitem.h8
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp20
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp16
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp38
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp35
-rw-r--r--noncore/settings/backup/backuprestore.cpp17
-rw-r--r--noncore/settings/networksettings/ppp/devices.cpp25
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp233
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp16
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp14
-rw-r--r--noncore/settings/usermanager/userdialog.cpp149
12 files changed, 462 insertions, 271 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 9e5eede..ba12e55 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -29,2 +29,26 @@
29 29
30#include "appearance.h"
31#include "editScheme.h"
32#include "stylelistitem.h"
33#include "decolistitem.h"
34#include "colorlistitem.h"
35#include "exceptlistitem.h"
36#include "sample.h"
37
38/* OPIE */
39#include <opie/ofontselector.h>
40#include <opie/odevice.h>
41#include <opie/ofiledialog.h>
42#include <opie/otabwidget.h>
43
44#include <qpe/config.h>
45#include <qpe/global.h>
46#include <qpe/qpeapplication.h>
47#include <qpe/qpemessagebox.h>
48#include <qpe/qcopenvelope_qws.h>
49#include <qpe/qpestyle.h>
50#include <qpe/lightstyle.h>
51#include <qpe/styleinterface.h>
52
53/* QT */
30#include <qbuttongroup.h> 54#include <qbuttongroup.h>
@@ -51,27 +75,2 @@
51 75
52#include <qpe/config.h>
53#include <qpe/global.h>
54#include <qpe/resource.h>
55#include <qpe/qpeapplication.h>
56#include <qpe/qpemessagebox.h>
57#include <qpe/qcopenvelope_qws.h>
58#include <qpe/qpestyle.h>
59#include <qpe/lightstyle.h>
60#include <qpe/qlibrary.h>
61#include <qpe/styleinterface.h>
62
63#include <opie/ofontselector.h>
64#include <opie/odevice.h>
65#include <opie/ofiledialog.h>
66#include <opie/otabwidget.h>
67
68#include "appearance.h"
69#include "editScheme.h"
70#include "stylelistitem.h"
71#include "decolistitem.h"
72#include "colorlistitem.h"
73#include "exceptlistitem.h"
74#include "sample.h"
75
76
77using namespace Opie; 76using namespace Opie;
@@ -83,9 +82,12 @@ public:
83 DefaultWindowDecoration() : ref(0) {} 82 DefaultWindowDecoration() : ref(0) {}
84 QString name() const { 83 QString name() const
84 {
85 return "Default"; 85 return "Default";
86 } 86 }
87QPixmap icon() const { 87 QPixmap icon() const
88 {
88 return QPixmap(); 89 return QPixmap();
89 } 90 }
90 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { 91 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
92 {
91 *iface = 0; 93 *iface = 0;
@@ -136,2 +138,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
136#endif 138#endif
139
137 { 140 {
@@ -141,3 +144,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
141 144
142 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 145 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
146 {
143 QString libstr = path; 147 QString libstr = path;
@@ -148,3 +152,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
148 152
149 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) { 153 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
154 {
150 StyleListItem *slit = new StyleListItem ( lib, iface ); 155 StyleListItem *slit = new StyleListItem ( lib, iface );
@@ -186,3 +191,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
186 191
187 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 192 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
193 {
188 QString libstr = path; 194 QString libstr = path;
@@ -193,3 +199,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
193 199
194 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) { 200 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
201 {
195 DecoListItem *dlit = new DecoListItem ( lib, iface ); 202 DecoListItem *dlit = new DecoListItem ( lib, iface );
@@ -248,3 +255,4 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
248 255
249 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 256 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
257 {
250 QString name = (*it). left ((*it). find ( ".scheme" )); 258 QString name = (*it). left ((*it). find ( ".scheme" ));
@@ -350,3 +358,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
350 QListViewItem *lvit = 0; 358 QListViewItem *lvit = 0;
351 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 359 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
360 {
352 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); 361 int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
@@ -434,5 +443,8 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
434 443
435 if (rotDirection == -1) { 444 if (rotDirection == -1)
445 {
436 rot = ODevice::inst ( )-> direction ( ); 446 rot = ODevice::inst ( )-> direction ( );
437 } else { 447 }
448 else
449 {
438 rot = (ODirection)rotDirection; 450 rot = (ODirection)rotDirection;
@@ -484,4 +496,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
484Appearance::~Appearance() 496Appearance::~Appearance()
485{ 497{}
486}
487 498
@@ -489,3 +500,4 @@ void Appearance::tabChanged ( QWidget *w )
489{ 500{
490 if ( w == m_advtab ) { 501 if ( w == m_advtab )
502 {
491 m_sample-> hide ( ); 503 m_sample-> hide ( );
@@ -505,3 +517,4 @@ void Appearance::accept ( )
505 517
506 if ( m_style_changed ) { 518 if ( m_style_changed )
519 {
507 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); 520 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
@@ -511,3 +524,4 @@ void Appearance::accept ( )
511 524
512 if ( m_deco_changed ) { 525 if ( m_deco_changed )
526 {
513 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); 527 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
@@ -517,3 +531,4 @@ void Appearance::accept ( )
517 531
518 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { 532 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
533 {
519 config. writeEntry ( "TabStyle", newtabstyle + 1 ); 534 config. writeEntry ( "TabStyle", newtabstyle + 1 );
@@ -522,3 +537,4 @@ void Appearance::accept ( )
522 537
523 if ( m_font_changed ) { 538 if ( m_font_changed )
539 {
524 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); 540 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
@@ -538,7 +554,12 @@ void Appearance::accept ( )
538 ODirection rot; 554 ODirection rot;
539 if (m_rotdir_ccw-> isChecked ( )) { 555 if (m_rotdir_ccw-> isChecked ( ))
556 {
540 rot = CCW; 557 rot = CCW;
541 } else if (m_rotdir_cw-> isChecked ( )) { 558 }
559 else if (m_rotdir_cw-> isChecked ( ))
560 {
542 rot = CW; 561 rot = CW;
543 } else { 562 }
563 else
564 {
544 rot = Flip; 565 rot = Flip;
@@ -551,3 +572,4 @@ void Appearance::accept ( )
551 QString exceptstr; 572 QString exceptstr;
552 for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { 573 for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( ))
574 {
553 int fl = 0; 575 int fl = 0;
@@ -581,3 +603,4 @@ void Appearance::styleClicked ( int index )
581 603
582 if ( m_sample && sli && sli-> style ( )) { 604 if ( m_sample && sli && sli-> style ( ))
605 {
583 int ci = m_color_list ? m_color_list-> currentItem ( ) : -1; 606 int ci = m_color_list ? m_color_list-> currentItem ( ) : -1;
@@ -594,3 +617,4 @@ void Appearance::styleSettingsClicked ( )
594 617
595 if ( item && item-> hasSettings ( )) { 618 if ( item && item-> hasSettings ( ))
619 {
596 QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); 620 QDialog *d = new QDialog ( this, "SETTINGS-DLG", true );
@@ -600,3 +624,4 @@ void Appearance::styleSettingsClicked ( )
600 624
601 if ( w ) { 625 if ( w )
626 {
602 vbox-> addWidget ( w ); 627 vbox-> addWidget ( w );
@@ -605,4 +630,3 @@ void Appearance::styleSettingsClicked ( )
605 630
606 d-> showMaximized ( ); 631 bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted );
607 bool accepted = ( d-> exec ( ) == QDialog::Accepted );
608 632
@@ -619,3 +643,4 @@ void Appearance::decoClicked ( int index )
619 643
620 if ( m_sample ) { 644 if ( m_sample )
645 {
621 if ( dli && dli-> interface ( )) 646 if ( dli && dli-> interface ( ))
@@ -654,6 +679,8 @@ void Appearance::editSchemeClicked ( )
654 679
655 for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { 680 for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
681 {
656 QColor col = item-> color ( role ); 682 QColor col = item-> color ( role );
657 683
658 if ( col. isValid ( )) { 684 if ( col. isValid ( ))
685 {
659 labels [cnt] = item-> label ( role ); 686 labels [cnt] = item-> label ( role );
@@ -666,4 +693,4 @@ void Appearance::editSchemeClicked ( )
666 EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true ); 693 EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true );
667 editdlg-> showMaximized ( ); 694 if ( QPEApplication::execDialog( editdlg ) == QDialog::Accepted )
668 if ( editdlg-> exec ( ) == QDialog::Accepted ) { 695 {
669 ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 ); 696 ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 );
@@ -671,4 +698,6 @@ void Appearance::editSchemeClicked ( )
671 698
672 for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { 699 for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
673 if ( item-> color ( role ). isValid ( )) { 700 {
701 if ( item-> color ( role ). isValid ( ))
702 {
674 citem-> setColor ( role, colors [cnt] ); 703 citem-> setColor ( role, colors [cnt] );
@@ -700,3 +729,4 @@ void Appearance::saveSchemeClicked()
700 729
701 if ( d-> exec ( ) == QDialog::Accepted ) { 730 if ( d-> exec ( ) == QDialog::Accepted )
731 {
702 QString schemename = ed-> text ( ); 732 QString schemename = ed-> text ( );
@@ -763,3 +793,4 @@ void Appearance::delExcept ( )
763{ 793{
764 if ( m_except-> selectedItem ( )) { 794 if ( m_except-> selectedItem ( ))
795 {
765 m_except-> setFocus ( ); 796 m_except-> setFocus ( );
@@ -785,3 +816,4 @@ void Appearance::downExcept ( )
785 816
786class ExEdit : public QLineEdit { 817class ExEdit : public QLineEdit
818{
787public: 819public:
@@ -824,3 +856,4 @@ public:
824 it-> listView ( )-> setFocus ( ); 856 it-> listView ( )-> setFocus ( );
825 else if ( e-> key ( ) == Key_Escape ) { 857 else if ( e-> key ( ) == Key_Escape )
858 {
826 m_out = false; 859 m_out = false;
@@ -850,3 +883,4 @@ void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c )
850 it-> setNoDeco ( !it-> noDeco ( )); 883 it-> setNoDeco ( !it-> noDeco ( ));
851 else if ( c == 3 ) { 884 else if ( c == 3 )
885 {
852 m_except-> ensureItemVisible ( it ); 886 m_except-> ensureItemVisible ( it );
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h
index caefad8..b6c72c3 100644
--- a/noncore/settings/appearance2/stylelistitem.h
+++ b/noncore/settings/appearance2/stylelistitem.h
@@ -30,4 +30,10 @@
30 30
31#include <qlistbox.h> 31/* OPIE */
32#include <qpe/styleinterface.h> 32#include <qpe/styleinterface.h>
33#include <qpe/qlibrary.h>
34#include <qpe/resource.h>
35
36/* QT */
37#include <qlistbox.h>
38#include <qfileinfo.h>
33 39
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp
index 61e1f93..217d2c9 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.cpp
+++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp
@@ -29,5 +29,8 @@
29 29
30#include <iostream> 30#include "categoryfilterimpl.h"
31using namespace std;
32 31
32/* OPIE */
33#include <qpe/qpeapplication.h>
34
35/* QT */
33#include <qgroupbox.h> 36#include <qgroupbox.h>
@@ -37,3 +40,6 @@ using namespace std;
37 40
38#include "categoryfilterimpl.h" 41/* STD */
42#include <iostream>
43using namespace std;
44
39 45
@@ -78,3 +84,4 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
78 start = end + 1; 84 start = end + 1;
79 } while ( start < (int)categories.length() ); 85 }
86 while ( start < (int)categories.length() );
80 87
@@ -82,3 +89,3 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
82 89
83 showMaximized(); 90 QPEApplication::showDialog( this );
84} 91}
@@ -86,4 +93,3 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
86CategoryFilterImpl :: ~CategoryFilterImpl() 93CategoryFilterImpl :: ~CategoryFilterImpl()
87{ 94{}
88}
89 95
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp
index 9d52013..126e3b9 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.cpp
+++ b/noncore/settings/aqpkg/instoptionsimpl.cpp
@@ -29,2 +29,7 @@
29 29
30#include "global.h"
31#include "instoptionsimpl.h"
32#include "ipkg.h"
33
34/* OPIE */
30#ifdef QWS 35#ifdef QWS
@@ -32,3 +37,5 @@
32#endif 37#endif
38#include <qpe/qpeapplication.h>
33 39
40/* QT */
34#include <qcheckbox.h> 41#include <qcheckbox.h>
@@ -39,6 +46,2 @@
39 46
40#include "global.h"
41#include "instoptionsimpl.h"
42#include "ipkg.h"
43
44InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) 47InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
@@ -97,3 +100,3 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par
97 100
98 showMaximized(); 101 QPEApplication::showDialog( this );
99 102
@@ -102,4 +105,3 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par
102InstallOptionsDlgImpl::~InstallOptionsDlgImpl() 105InstallOptionsDlgImpl::~InstallOptionsDlgImpl()
103{ 106{}
104}
105 107
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index dbe694e..6f5c712 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -29,9 +29,17 @@
29 29
30#include <linux/limits.h> 30#include "categoryfilterimpl.h"
31#include <unistd.h> 31#include "datamgr.h"
32#include "global.h"
33#include "inputdlg.h"
34#include "ipkg.h"
35#include "installdlgimpl.h"
36#include "letterpushbutton.h"
37#include "mainwin.h"
38#include "packagewin.h"
39#include "settingsimpl.h"
40#include "utils.h"
32 41
42/* OPIE */
33#include <qpe/qcopenvelope_qws.h> 43#include <qpe/qcopenvelope_qws.h>
34#include <qmenubar.h>
35#include <qpe/qpeapplication.h> 44#include <qpe/qpeapplication.h>
36#include <qtoolbar.h>
37#include <qpe/config.h> 45#include <qpe/config.h>
@@ -39,2 +47,5 @@
39 47
48/* QT */
49#include <qmenubar.h>
50#include <qtoolbar.h>
40#include <qaction.h> 51#include <qaction.h>
@@ -54,13 +65,5 @@
54 65
55#include "categoryfilterimpl.h" 66/* STD */
56#include "datamgr.h" 67#include <linux/limits.h>
57#include "global.h" 68#include <unistd.h>
58#include "inputdlg.h"
59#include "ipkg.h"
60#include "installdlgimpl.h"
61#include "letterpushbutton.h"
62#include "mainwin.h"
63#include "packagewin.h"
64#include "settingsimpl.h"
65#include "utils.h"
66 69
@@ -1183,3 +1186,4 @@ void MainWindow :: letterPushed( QString t )
1183 item = (QCheckListItem *)packagesList->firstChild(); 1186 item = (QCheckListItem *)packagesList->firstChild();
1184 } while ( item != start); 1187 }
1188 while ( item != start);
1185} 1189}
@@ -1190,3 +1194,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
1190 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) ); 1194 PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
1191 p->showMaximized(); 1195 QPEApplication::showWidget( p );
1192} 1196}
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 4887ceb..9fdf31e 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -29,6 +29,14 @@
29 29
30#include <fstream> 30#include "settingsimpl.h"
31#include <algorithm> 31#include "global.h"
32using namespace std; 32
33/* OPIE */
34#include <opie/otabwidget.h>
35#ifdef QWS
36#include <qpe/config.h>
37#include <qpe/resource.h>
38#endif
39#include <qpe/qpeapplication.h>
33 40
41/* QT */
34#include <qcheckbox.h> 42#include <qcheckbox.h>
@@ -41,12 +49,6 @@ using namespace std;
41 49
42#include <opie/otabwidget.h> 50/* STD */
43 51#include <fstream>
44#ifdef QWS 52#include <algorithm>
45#include <qpe/config.h> 53using namespace std;
46#include <qpe/resource.h>
47#endif
48
49#include "settingsimpl.h"
50
51#include "global.h"
52 54
@@ -80,3 +82,2 @@ SettingsImpl :: ~SettingsImpl()
80{ 82{
81
82} 83}
@@ -85,5 +86,3 @@ bool SettingsImpl :: showDlg()
85{ 86{
86 showMaximized(); 87 QPEApplication::execDialog( this );
87 exec();
88
89 if ( changed ) 88 if ( changed )
@@ -464,2 +463,3 @@ void SettingsImpl :: changeDestinationDetails()
464#endif 463#endif
464
465 } 465 }
@@ -478,2 +478,3 @@ void SettingsImpl :: changeDestinationDetails()
478#endif 478#endif
479
479 } 480 }
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index a00193d..977c283 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -2,8 +2,11 @@
2#include "backuprestore.h" 2#include "backuprestore.h"
3//#include "output.h"
4#include "errordialog.h" 3#include "errordialog.h"
5 4
5/* OPIE */
6#include <opie2/ostorageinfo.h>
7#include <qpe/qpeapplication.h>
8
9/* QT */
6#include <qapplication.h> 10#include <qapplication.h>
7#include <qmultilineedit.h> 11#include <qmultilineedit.h>
8
9#include <qdir.h> 12#include <qdir.h>
@@ -23,4 +26,4 @@
23#include <qtextview.h> 26#include <qtextview.h>
24#include <opie2/ostorageinfo.h>
25 27
28/* STD */
26#include <errno.h> 29#include <errno.h>
@@ -43,3 +46,2 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
43{ 46{
44 this->showMaximized();
45 backupList->header()->hide(); 47 backupList->header()->hide();
@@ -132,2 +134,3 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
132 } 134 }
135 QPEApplication::showWidget( this );
133} 136}
@@ -289,4 +292,3 @@ void BackupAndRestore::backup()
289 } 292 }
290 pErrDialog->showMaximized(); 293 QPEApplication::execDialog( pErrDialog );
291 pErrDialog->exec();
292 delete pErrDialog; 294 delete pErrDialog;
@@ -454,4 +456,3 @@ void BackupAndRestore::restore()
454 } 456 }
455 pErrDialog->showMaximized(); 457 QPEApplication::execDialog( pErrDialog );
456 pErrDialog->exec();
457 delete pErrDialog; 458 delete pErrDialog;
diff --git a/noncore/settings/networksettings/ppp/devices.cpp b/noncore/settings/networksettings/ppp/devices.cpp
index e94904b..9da090d 100644
--- a/noncore/settings/networksettings/ppp/devices.cpp
+++ b/noncore/settings/networksettings/ppp/devices.cpp
@@ -26,4 +26,14 @@
26 26
27#include "interfaceppp.h"
28#include "devices.h"
29#include "authwidget.h"
30#include "pppdata.h"
31#include "edit.h"
32#include "general.h"
33
34/* OPIE */
35#include <qpe/qpeapplication.h>
36
37/* QT */
27#include <qdir.h> 38#include <qdir.h>
28#include <stdlib.h>
29#include <qlayout.h> 39#include <qlayout.h>
@@ -33,3 +43,2 @@
33#include <qmessagebox.h> 43#include <qmessagebox.h>
34
35#include <qapplication.h> 44#include <qapplication.h>
@@ -39,8 +48,5 @@
39 48
40#include "interfaceppp.h" 49/* STD */
41#include "devices.h" 50#include <stdlib.h>
42#include "authwidget.h" 51
43#include "pppdata.h"
44#include "edit.h"
45#include "general.h"
46 52
@@ -193,4 +199,3 @@ int DevicesWidget::doTab(){
193 while (!ok){ 199 while (!ok){
194 dlg->showMaximized(); 200 result = QPEApplication::execDialog( dlg );
195 result = dlg->exec();
196 ok = true; 201 ok = true;
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index ceac90c..7d21605 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -25,4 +25,12 @@
25 25
26#include <string.h> 26#include "edit.h"
27#include <termios.h> 27#include "pppdata.h"
28#include "iplined.h"
29#include "auth.h"
30
31/* OPIE */
32#include <qpe/resource.h>
33#include <qpe/qpeapplication.h>
34
35/* QT */
28#include <qlayout.h> 36#include <qlayout.h>
@@ -36,8 +44,7 @@
36#include <qdialog.h> 44#include <qdialog.h>
37#include <qpe/resource.h>
38 45
39#include "edit.h" 46/* STD */
40#include "pppdata.h" 47
41#include "iplined.h" 48#include <string.h>
42#include "auth.h" 49#include <termios.h>
43 50
@@ -114,3 +121,4 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
114 // Set defaults if editing an existing connection 121 // Set defaults if editing an existing connection
115 if(!isnewaccount) { 122 if(!isnewaccount)
123 {
116 connectname_l->setText(_pppdata->accname()); 124 connectname_l->setText(_pppdata->accname());
@@ -121,4 +129,6 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
121 uint idx = 0; 129 uint idx = 0;
122 while(idx != n.length()) { 130 while(idx != n.length())
123 if(n[idx] == ':') { 131 {
132 if(n[idx] == ':')
133 {
124 if(tmp.length() > 0) 134 if(tmp.length() > 0)
@@ -126,3 +136,4 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
126 tmp = ""; 136 tmp = "";
127 } else 137 }
138 else
128 tmp += n[idx]; 139 tmp += n[idx];
@@ -139,8 +150,12 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
139 150
140bool DialWidget::save() { 151bool DialWidget::save()
152{
141 //first check to make sure that the account name is unique! 153 //first check to make sure that the account name is unique!
142 if(connectname_l->text().isEmpty() || 154 if(connectname_l->text().isEmpty() ||
143 !_pppdata->isUniqueAccname(connectname_l->text())) { 155 !_pppdata->isUniqueAccname(connectname_l->text()))
156 {
144 return false; 157 return false;
145 } else { 158 }
159 else
160 {
146 _pppdata->setAccname(connectname_l->text()); 161 _pppdata->setAccname(connectname_l->text());
@@ -148,3 +163,4 @@ bool DialWidget::save() {
148 QString number = ""; 163 QString number = "";
149 for(uint i = 0; i < numbers->count(); i++) { 164 for(uint i = 0; i < numbers->count(); i++)
165 {
150 if(i != 0) 166 if(i != 0)
@@ -160,3 +176,4 @@ bool DialWidget::save() {
160 176
161void DialWidget::numbersChanged() { 177void DialWidget::numbersChanged()
178{
162 int sel = numbers->currentItem(); 179 int sel = numbers->currentItem();
@@ -169,3 +186,4 @@ void DialWidget::numbersChanged() {
169 186
170void DialWidget::selectionChanged(int) { 187void DialWidget::selectionChanged(int)
188{
171 numbersChanged(); 189 numbersChanged();
@@ -174,5 +192,7 @@ void DialWidget::selectionChanged(int) {
174 192
175void DialWidget::addNumber() { 193void DialWidget::addNumber()
194{
176 PhoneNumberDialog dlg(this); 195 PhoneNumberDialog dlg(this);
177 if(dlg.exec()) { 196 if(dlg.exec())
197 {
178 numbers->insertItem(dlg.phoneNumber()); 198 numbers->insertItem(dlg.phoneNumber());
@@ -183,4 +203,6 @@ void DialWidget::addNumber() {
183 203
184void DialWidget::delNumber() { 204void DialWidget::delNumber()
185 if(numbers->currentItem() != -1) { 205{
206 if(numbers->currentItem() != -1)
207 {
186 numbers->removeItem(numbers->currentItem()); 208 numbers->removeItem(numbers->currentItem());
@@ -191,5 +213,7 @@ void DialWidget::delNumber() {
191 213
192void DialWidget::upNumber() { 214void DialWidget::upNumber()
215{
193 int idx = numbers->currentItem(); 216 int idx = numbers->currentItem();
194 if(idx != -1) { 217 if(idx != -1)
218 {
195 QString item = numbers->text(idx); 219 QString item = numbers->text(idx);
@@ -203,5 +227,7 @@ void DialWidget::upNumber() {
203 227
204void DialWidget::downNumber() { 228void DialWidget::downNumber()
229{
205 int idx = numbers->currentItem(); 230 int idx = numbers->currentItem();
206 if(idx != -1) { 231 if(idx != -1)
232 {
207 QString item = numbers->text(idx); 233 QString item = numbers->text(idx);
@@ -215,6 +241,6 @@ void DialWidget::downNumber() {
215 241
216void DialWidget::pppdargsbutton() { 242void DialWidget::pppdargsbutton()
243{
217 PPPdArguments pa(_pppdata, this); 244 PPPdArguments pa(_pppdata, this);
218 pa.showMaximized(); 245 QPEApplication::execDialog( &pa );
219 pa.exec();
220} 246}
@@ -307,3 +333,4 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch
307 // Set defaults if editing an existing connection 333 // Set defaults if editing an existing connection
308 if(!isnewaccount) { 334 if(!isnewaccount)
335 {
309 before_connect->setText(_pppdata->command_before_connect()); 336 before_connect->setText(_pppdata->command_before_connect());
@@ -316,3 +343,4 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch
316 343
317bool ExecWidget::save() { 344bool ExecWidget::save()
345{
318 _pppdata->setCommand_before_connect(before_connect->text()); 346 _pppdata->setCommand_before_connect(before_connect->text());
@@ -416,5 +444,7 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
416 //load info from gpppdata 444 //load info from gpppdata
417 if(!isnewaccount) { 445 if(!isnewaccount)
446 {
418 if(_pppdata->ipaddr() == "0.0.0.0" && 447 if(_pppdata->ipaddr() == "0.0.0.0" &&
419 _pppdata->subnetmask() == "0.0.0.0") { 448 _pppdata->subnetmask() == "0.0.0.0")
449 {
420 dynamicadd_rb->setChecked(true); 450 dynamicadd_rb->setChecked(true);
@@ -423,3 +453,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
423 } 453 }
424 else { 454 else
455 {
425 ipaddress_l->setText(_pppdata->ipaddr()); 456 ipaddress_l->setText(_pppdata->ipaddr());
@@ -430,3 +461,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
430 } 461 }
431 else { 462 else
463 {
432 dynamicadd_rb->setChecked(true); 464 dynamicadd_rb->setChecked(true);
@@ -437,3 +469,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
437 469
438void IPWidget::autoname_t(bool on) { 470void IPWidget::autoname_t(bool on)
471{
439 static bool was_warned = false; 472 static bool was_warned = false;
@@ -441,3 +474,4 @@ void IPWidget::autoname_t(bool on) {
441 // big-fat warning when selecting the auto configure hostname option 474 // big-fat warning when selecting the auto configure hostname option
442 if(on && !was_warned) { 475 if(on && !was_warned)
476 {
443 QMessageBox::information(this, 477 QMessageBox::information(this,
@@ -456,7 +490,11 @@ void IPWidget::autoname_t(bool on) {
456 490
457void IPWidget::save() { 491void IPWidget::save()
458 if(dynamicadd_rb->isChecked()) { 492{
493 if(dynamicadd_rb->isChecked())
494 {
459 _pppdata->setIpaddr("0.0.0.0"); 495 _pppdata->setIpaddr("0.0.0.0");
460 _pppdata->setSubnetmask("0.0.0.0"); 496 _pppdata->setSubnetmask("0.0.0.0");
461 } else { 497 }
498 else
499 {
462 _pppdata->setIpaddr(ipaddress_l->text()); 500 _pppdata->setIpaddr(ipaddress_l->text());
@@ -468,4 +506,6 @@ void IPWidget::save() {
468 506
469void IPWidget::hitIPSelect( int i ) { 507void IPWidget::hitIPSelect( int i )
470 if(i == 0) { 508{
509 if(i == 0)
510 {
471 ipaddress_label->setEnabled(false); 511 ipaddress_label->setEnabled(false);
@@ -475,3 +515,4 @@ void IPWidget::hitIPSelect( int i ) {
475 } 515 }
476 else { 516 else
517 {
477 ipaddress_label->setEnabled(true); 518 ipaddress_label->setEnabled(true);
@@ -599,3 +640,4 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha
599 // restore data if editing 640 // restore data if editing
600 if(!isnewaccount) { 641 if(!isnewaccount)
642 {
601 dnsservers->insertStringList(_pppdata->dns()); 643 dnsservers->insertStringList(_pppdata->dns());
@@ -611,3 +653,4 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha
611 653
612void DNSWidget::DNS_Edit_Changed(const QString &text) { 654void DNSWidget::DNS_Edit_Changed(const QString &text)
655{
613 QRegExp r("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+"); 656 QRegExp r("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+");
@@ -616,3 +659,4 @@ void DNSWidget::DNS_Edit_Changed(const QString &text) {
616 659
617void DNSWidget::DNS_Entry_Selected(int) { 660void DNSWidget::DNS_Entry_Selected(int)
661{
618 remove->setEnabled(true); 662 remove->setEnabled(true);
@@ -620,3 +664,4 @@ void DNSWidget::DNS_Entry_Selected(int) {
620 664
621void DNSWidget::DNS_Mode_Selected(int mode) { 665void DNSWidget::DNS_Mode_Selected(int mode)
666{
622 bool on = (mode == 1); 667 bool on = (mode == 1);
@@ -633,3 +678,4 @@ void DNSWidget::DNS_Mode_Selected(int mode) {
633 678
634void DNSWidget::save() { 679void DNSWidget::save()
680{
635 _pppdata->setAutoDNS(bg->id(bg->selected()) == 0); 681 _pppdata->setAutoDNS(bg->id(bg->selected()) == 0);
@@ -651,4 +697,6 @@ void DNSWidget::save() {
651 697
652void DNSWidget::adddns() { 698void DNSWidget::adddns()
653 if(dnsservers->count() < MAX_DNS_ENTRIES) { 699{
700 if(dnsservers->count() < MAX_DNS_ENTRIES)
701 {
654 dnsservers->insertItem(dnsipaddr->text()); 702 dnsservers->insertItem(dnsipaddr->text());
@@ -659,3 +707,4 @@ void DNSWidget::adddns() {
659 707
660void DNSWidget::removedns() { 708void DNSWidget::removedns()
709{
661 int i; 710 int i;
@@ -723,4 +772,6 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
723 //load info from gpppdata 772 //load info from gpppdata
724 if(!isnewaccount) { 773 if(!isnewaccount)
725 if(_pppdata->gateway() == "0.0.0.0") { 774 {
775 if(_pppdata->gateway() == "0.0.0.0")
776 {
726 defaultgateway->setChecked(true); 777 defaultgateway->setChecked(true);
@@ -728,3 +779,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
728 } 779 }
729 else { 780 else
781 {
730 gatewayaddr->setText(_pppdata->gateway()); 782 gatewayaddr->setText(_pppdata->gateway());
@@ -734,3 +786,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
734 } 786 }
735 else { 787 else
788 {
736 defaultgateway->setChecked(true); 789 defaultgateway->setChecked(true);
@@ -741,3 +794,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
741 794
742void GatewayWidget::save() { 795void GatewayWidget::save()
796{
743 _pppdata->setGateway(gatewayaddr->text()); 797 _pppdata->setGateway(gatewayaddr->text());
@@ -747,4 +801,6 @@ void GatewayWidget::save() {
747 801
748void GatewayWidget::hitGatewaySelect( int i ) { 802void GatewayWidget::hitGatewaySelect( int i )
749 if(i == 0) { 803{
804 if(i == 0)
805 {
750 gatewayaddr->setText("0.0.0.0"); 806 gatewayaddr->setText("0.0.0.0");
@@ -753,3 +809,4 @@ void GatewayWidget::hitGatewaySelect( int i ) {
753 } 809 }
754 else { 810 else
811 {
755 gatewayaddr->setEnabled(true); 812 gatewayaddr->setEnabled(true);
@@ -805,3 +862,4 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con
805 //load data from gpppdata 862 //load data from gpppdata
806 if(!isnewaccount) { 863 if(!isnewaccount)
864 {
807 QStringList &comlist = _pppdata->scriptType(); 865 QStringList &comlist = _pppdata->scriptType();
@@ -826,3 +884,4 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con
826 884
827bool ScriptWidget::check() { 885bool ScriptWidget::check()
886{
828 uint lstart = 0; 887 uint lstart = 0;
@@ -831,8 +890,12 @@ bool ScriptWidget::check() {
831 890
832 if(sl->count() > 0) { 891 if(sl->count() > 0)
833 for( uint i=0; i <= sl->count()-1; i++) { 892 {
834 if(stl->text(i) == "LoopStart") { 893 for( uint i=0; i <= sl->count()-1; i++)
894 {
895 if(stl->text(i) == "LoopStart")
896 {
835 lstart++; 897 lstart++;
836 } 898 }
837 if (stl->text(i) == "LoopEnd") { 899 if (stl->text(i) == "LoopEnd")
900 {
838 lend++; 901 lend++;
@@ -847,5 +910,7 @@ bool ScriptWidget::check() {
847 910
848void ScriptWidget::save() { 911void ScriptWidget::save()
912{
849 QStringList typelist, arglist; 913 QStringList typelist, arglist;
850 for(uint i=0; i < sl->count(); i++) { 914 for(uint i=0; i < sl->count(); i++)
915 {
851 typelist.append(stl->text(i)); 916 typelist.append(stl->text(i));
@@ -859,3 +924,4 @@ void ScriptWidget::save() {
859 924
860void ScriptWidget::adjustScrollBar() { 925void ScriptWidget::adjustScrollBar()
926{
861 if((int)sl->count() <= sl->numItemsVisible()) 927 if((int)sl->count() <= sl->numItemsVisible())
@@ -867,3 +933,4 @@ void ScriptWidget::adjustScrollBar() {
867 933
868void ScriptWidget::scrolling(int i) { 934void ScriptWidget::scrolling(int i)
935{
869 sl->setTopItem(i); 936 sl->setTopItem(i);
@@ -873,3 +940,4 @@ void ScriptWidget::scrolling(int i) {
873 940
874void ScriptWidget::slhighlighted(int i) { 941void ScriptWidget::slhighlighted(int i)
942{
875 insert->setEnabled(true); 943 insert->setEnabled(true);
@@ -880,3 +948,4 @@ void ScriptWidget::slhighlighted(int i) {
880 948
881void ScriptWidget::stlhighlighted(int i) { 949void ScriptWidget::stlhighlighted(int i)
950{
882 insert->setEnabled(true); 951 insert->setEnabled(true);
@@ -887,3 +956,4 @@ void ScriptWidget::stlhighlighted(int i) {
887 956
888void ScriptWidget::addButton() { 957void ScriptWidget::addButton()
958{
889 //don't allow more than the maximum script entries 959 //don't allow more than the maximum script entries
@@ -892,3 +962,4 @@ void ScriptWidget::addButton() {
892 962
893 switch(se->type()) { 963 switch(se->type())
964 {
894 case ScriptEdit::Expect: 965 case ScriptEdit::Expect:
@@ -982,3 +1053,4 @@ void ScriptWidget::addButton() {
982 1053
983void ScriptWidget::insertButton() { 1054void ScriptWidget::insertButton()
1055{
984 //exit if there is no highlighted item, or we've reached the 1056 //exit if there is no highlighted item, or we've reached the
@@ -988,3 +1060,4 @@ void ScriptWidget::insertButton() {
988 1060
989 switch(se->type()) { 1061 switch(se->type())
1062 {
990 case ScriptEdit::Expect: 1063 case ScriptEdit::Expect:
@@ -1072,4 +1145,6 @@ void ScriptWidget::insertButton() {
1072 1145
1073void ScriptWidget::removeButton() { 1146void ScriptWidget::removeButton()
1074 if(sl->currentItem() >= 0) { 1147{
1148 if(sl->currentItem() >= 0)
1149 {
1075 int stlc = stl->currentItem(); 1150 int stlc = stl->currentItem();
@@ -1121,3 +1196,4 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
1121 1196
1122QString PhoneNumberDialog::phoneNumber() { 1197QString PhoneNumberDialog::phoneNumber()
1198{
1123 QString s = le->text(); 1199 QString s = le->text();
@@ -1128,3 +1204,4 @@ QString PhoneNumberDialog::phoneNumber() {
1128 1204
1129void PhoneNumberDialog::textChanged(const QString &s) { 1205void PhoneNumberDialog::textChanged(const QString &s)
1206{
1130// enableButtonOK(s.length() > 0); 1207// enableButtonOK(s.length() > 0);
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index 566b179..9cb8ad2 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -21,4 +21,9 @@
21 21
22#include "modulesinfo.h"
23#include "detail.h"
24
25/* OPIE */
22#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
23 27
28/* QT */
24#include <qfile.h> 29#include <qfile.h>
@@ -29,5 +34,2 @@
29 34
30#include "modulesinfo.h"
31#include "detail.h"
32
33ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 35ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
@@ -84,4 +86,3 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
84ModulesInfo::~ModulesInfo() 86ModulesInfo::~ModulesInfo()
85{ 87{}
86}
87 88
@@ -108,3 +109,4 @@ void ModulesInfo::updateData()
108 QListViewItem *selecteditem = 0x0; 109 QListViewItem *selecteditem = 0x0;
109 while ( true ) { 110 while ( true )
111 {
110 modname[0] = '\0'; 112 modname[0] = '\0';
@@ -185,3 +187,3 @@ void ModulesInfo::viewModules( QListViewItem *modules )
185 187
186 ModulesDtl->showMaximized(); 188 QPEApplication::showWidget( ModulesDtl );
187} 189}
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index af0fe26..2a90b0f 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -19,4 +19,9 @@
19 19
20#include "processinfo.h"
21#include "detail.h"
22
23/* OPIE */
20#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
21 25
26/* QT */
22#include <qdir.h> 27#include <qdir.h>
@@ -27,2 +32,3 @@
27 32
33/* STD */
28#include <sys/types.h> 34#include <sys/types.h>
@@ -30,5 +36,2 @@
30 36
31#include "processinfo.h"
32#include "detail.h"
33
34ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) 37ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
@@ -88,4 +91,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
88ProcessInfo::~ProcessInfo() 91ProcessInfo::~ProcessInfo()
89{ 92{}
90}
91 93
@@ -198,3 +200,3 @@ void ProcessInfo::viewProcess( QListViewItem *process )
198 } 200 }
199 ProcessDtl->showMaximized(); 201 QPEApplication::showWidget( ProcessDtl );
200} 202}
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index d87a005..08de352 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -10,3 +10,9 @@
10#include "userdialog.h" 10#include "userdialog.h"
11#include "passwd.h"
12
13/* OPIE */
14#include <opie/odevice.h>
15#include <qpe/qpeapplication.h>
11 16
17/* QT */
12#include <qlayout.h> 18#include <qlayout.h>
@@ -16,2 +22,3 @@
16 22
23/* STD */
17#include <sys/types.h> 24#include <sys/types.h>
@@ -21,5 +28,3 @@
21 28
22#include "passwd.h"
23 29
24#include <opie/odevice.h>
25using namespace Opie; 30using namespace Opie;
@@ -31,3 +36,4 @@ using namespace Opie;
31 */ 36 */
32UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) { 37UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl)
38{
33 vm=viewmode; 39 vm=viewmode;
@@ -41,5 +47,7 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
41 // And also fill the listview & the combobox with all available groups. 47 // And also fill the listview & the combobox with all available groups.
42 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) { 48 for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it)
49 {
43 accounts->splitGroupEntry(*it); 50 accounts->splitGroupEntry(*it);
44 if(accounts->gr_name.find(QRegExp("^#"),0)) {// Skip commented lines. 51 if(accounts->gr_name.find(QRegExp("^#"),0))
52 {// Skip commented lines.
45 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox); 53 new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
@@ -48,3 +56,3 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
48 } 56 }
49 showMaximized(); 57 QPEApplication::showDialog( this );
50} 58}
@@ -55,4 +63,4 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
55 */ 63 */
56UserDialog::~UserDialog() { 64UserDialog::~UserDialog()
57} 65{}
58 66
@@ -62,3 +70,4 @@ UserDialog::~UserDialog() {
62 */ 70 */
63void UserDialog::setupTab1() { 71void UserDialog::setupTab1()
72{
64 QPixmap mypixmap; 73 QPixmap mypixmap;
@@ -111,3 +120,4 @@ void UserDialog::setupTab1() {
111 120
112 if(vm==VIEWMODE_NEW) { 121 if(vm==VIEWMODE_NEW)
122 {
113 // Copy /etc/skel 123 // Copy /etc/skel
@@ -138,3 +148,4 @@ void UserDialog::setupTab1() {
138 vlayout1->addWidget(groupLabel); 148 vlayout1->addWidget(groupLabel);
139 if(vm==VIEWMODE_NEW) { 149 if(vm==VIEWMODE_NEW)
150 {
140 vlayout1->addSpacing(5); 151 vlayout1->addSpacing(5);
@@ -154,3 +165,4 @@ void UserDialog::setupTab1() {
154 vlayout2->addWidget(groupComboBox); 165 vlayout2->addWidget(groupComboBox);
155 if(vm==VIEWMODE_NEW) { 166 if(vm==VIEWMODE_NEW)
167 {
156 vlayout2->addSpacing(5); 168 vlayout2->addSpacing(5);
@@ -168,3 +180,4 @@ void UserDialog::setupTab1() {
168 */ 180 */
169void UserDialog::setupTab2() { 181void UserDialog::setupTab2()
182{
170 QWidget *tabpage = new QWidget(myTabWidget,"page2"); 183 QWidget *tabpage = new QWidget(myTabWidget,"page2");
@@ -197,3 +210,4 @@ void UserDialog::setupTab2() {
197 */ 210 */
198bool UserDialog::addUser(int uid, int gid) { 211bool UserDialog::addUser(int uid, int gid)
212{
199 QCheckListItem *temp; 213 QCheckListItem *temp;
@@ -211,5 +225,7 @@ bool UserDialog::addUser(int uid, int gid) {
211 // If we're running on OZ, add new users to some default groups. 225 // If we're running on OZ, add new users to some default groups.
212 if(oz) { 226 if(oz)
227 {
213 QListViewItemIterator iter( adduserDialog->groupsListView ); 228 QListViewItemIterator iter( adduserDialog->groupsListView );
214 for ( ; iter.current(); ++iter ) { 229 for ( ; iter.current(); ++iter )
230 {
215 temp=(QCheckListItem*)iter.current(); 231 temp=(QCheckListItem*)iter.current();
@@ -226,3 +242,4 @@ bool UserDialog::addUser(int uid, int gid) {
226 if(!(adduserDialog->exec())) return false; 242 if(!(adduserDialog->exec())) return false;
227 if((adduserDialog->groupComboBox->currentItem()!=0)) { 243 if((adduserDialog->groupComboBox->currentItem()!=0))
244 {
228 accounts->findGroup(adduserDialog->groupComboBox->currentText()); 245 accounts->findGroup(adduserDialog->groupComboBox->currentText());
@@ -233,3 +250,4 @@ bool UserDialog::addUser(int uid, int gid) {
233 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), 250 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),
234 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) { 251 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText())))
252 {
235 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); 253 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user.");
@@ -240,3 +258,4 @@ bool UserDialog::addUser(int uid, int gid) {
240 QListViewItemIterator it( adduserDialog->groupsListView ); 258 QListViewItemIterator it( adduserDialog->groupsListView );
241 for ( ; it.current(); ++it ) { 259 for ( ; it.current(); ++it )
260 {
242 temp=(QCheckListItem*)it.current(); 261 temp=(QCheckListItem*)it.current();
@@ -246,5 +265,7 @@ bool UserDialog::addUser(int uid, int gid) {
246 // Copy image to pics/users/ 265 // Copy image to pics/users/
247 if(!(adduserDialog->userImage.isNull())) { 266 if(!(adduserDialog->userImage.isNull()))
267 {
248 QDir d; 268 QDir d;
249 if(!(d.exists("/opt/QtPalmtop/pics/users"))) { 269 if(!(d.exists("/opt/QtPalmtop/pics/users")))
270 {
250 d.mkdir("/opt/QtPalmtop/pics/users"); 271 d.mkdir("/opt/QtPalmtop/pics/users");
@@ -258,3 +279,4 @@ bool UserDialog::addUser(int uid, int gid) {
258 accounts->findUser(adduserDialog->loginLineEdit->text()); 279 accounts->findUser(adduserDialog->loginLineEdit->text());
259 if(adduserDialog->skelCheckBox->isChecked()) { 280 if(adduserDialog->skelCheckBox->isChecked())
281 {
260 QString command_cp; 282 QString command_cp;
@@ -282,8 +304,13 @@ bool UserDialog::addUser(int uid, int gid) {
282 */ 304 */
283bool UserDialog::delUser(const char *username) { 305bool UserDialog::delUser(const char *username)
284 if((accounts->findUser(username))) {// Does that user exist? 306{
285 if(!(accounts->delUser(username))) {// Delete the user. 307 if((accounts->findUser(username)))
308 {// Does that user exist?
309 if(!(accounts->delUser(username)))
310 {// Delete the user.
286 QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+"."); 311 QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+".");
287 } 312 }
288 } else { 313 }
314 else
315 {
289 QMessageBox::information(0,"Invalid Username","That username ("+QString(username)+")does not exist."); 316 QMessageBox::information(0,"Invalid Username","That username ("+QString(username)+")does not exist.");
@@ -303,3 +330,4 @@ bool UserDialog::delUser(const char *username) {
303 */ 330 */
304bool UserDialog::editUser(const char *username) { 331bool UserDialog::editUser(const char *username)
332{
305 int invalid_group=0; 333 int invalid_group=0;
@@ -309,3 +337,4 @@ bool UserDialog::editUser(const char *username) {
309 accounts->findUser(username);// Locate user in database and fill variables in 'accounts' object. 337 accounts->findUser(username);// Locate user in database and fill variables in 'accounts' object.
310 if(!(accounts->findGroup(accounts->pw_gid))) {// Locate the user's primary group, and fill group variables in 'accounts' object. 338 if(!(accounts->findGroup(accounts->pw_gid)))
339 {// Locate the user's primary group, and fill group variables in 'accounts' object.
311 invalid_group=1; 340 invalid_group=1;
@@ -319,3 +348,4 @@ bool UserDialog::editUser(const char *username) {
319 // If this user is not using /bin/sh,/bin/ash or /bin/false as shell, add that entry to the shell-combobox. 348 // If this user is not using /bin/sh,/bin/ash or /bin/false as shell, add that entry to the shell-combobox.
320 if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false") { 349 if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false")
350 {
321 edituserDialog->shellComboBox->insertItem(accounts->pw_shell,0); 351 edituserDialog->shellComboBox->insertItem(accounts->pw_shell,0);
@@ -324,4 +354,6 @@ bool UserDialog::editUser(const char *username) {
324 // Select the primary group for this user. 354 // Select the primary group for this user.
325 for(int i=0;i<edituserDialog->groupComboBox->count();++i) { 355 for(int i=0;i<edituserDialog->groupComboBox->count();++i)
326 if(accounts->gr_name==edituserDialog->groupComboBox->text(i)) { 356 {
357 if(accounts->gr_name==edituserDialog->groupComboBox->text(i))
358 {
327 edituserDialog->groupComboBox->setCurrentItem(i); 359 edituserDialog->groupComboBox->setCurrentItem(i);
@@ -330,3 +362,4 @@ bool UserDialog::editUser(const char *username) {
330 } 362 }
331 if(invalid_group) { 363 if(invalid_group)
364 {
332 edituserDialog->groupComboBox->insertItem("<Undefined group>",0); 365 edituserDialog->groupComboBox->insertItem("<Undefined group>",0);
@@ -340,7 +373,10 @@ bool UserDialog::editUser(const char *username) {
340 QStringList tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. 373 QStringList tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of.
341 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) {// Iterate over all of them. 374 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
375 {// Iterate over all of them.
342 qWarning(*it); 376 qWarning(*it);
343 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. 377 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups.
344 for ( ; lvit.current(); ++lvit ) { 378 for ( ; lvit.current(); ++lvit )
345 if(lvit.current()->text(0)==(*it).left((*it).find(":"))) { 379 {
380 if(lvit.current()->text(0)==(*it).left((*it).find(":")))
381 {
346 temp=(QCheckListItem*)lvit.current(); 382 temp=(QCheckListItem*)lvit.current();
@@ -352,7 +388,10 @@ bool UserDialog::editUser(const char *username) {
352 tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of. 388 tempList=accounts->groupStringList.grep(userRegExp);// Find all entries in the group database, that the user is a member of.
353 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) {// Iterate over all of them. 389 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
390 {// Iterate over all of them.
354 qWarning(*it); 391 qWarning(*it);
355 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups. 392 QListViewItemIterator lvit( edituserDialog->groupsListView );// Compare to all groups.
356 for ( ; lvit.current(); ++lvit ) { 393 for ( ; lvit.current(); ++lvit )
357 if(lvit.current()->text(0)==(*it).left((*it).find(":"))) { 394 {
395 if(lvit.current()->text(0)==(*it).left((*it).find(":")))
396 {
358 temp=(QCheckListItem*)lvit.current(); 397 temp=(QCheckListItem*)lvit.current();
@@ -372,3 +411,4 @@ bool UserDialog::editUser(const char *username) {
372 accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt(); 411 accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt();
373 if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) {// Fill all group variables in 'accounts' object. 412 if(accounts->findGroup(edituserDialog->groupComboBox->currentText()))
413 {// Fill all group variables in 'accounts' object.
374 accounts->pw_gid=accounts->gr_gid;// Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group. 414 accounts->pw_gid=accounts->gr_gid;// Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group.
@@ -381,3 +421,4 @@ bool UserDialog::editUser(const char *username) {
381 // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.) 421 // Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.)
382 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { 422 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
423 {
383 accounts->delGroupMember((*it).left((*it).find(":")),username); 424 accounts->delGroupMember((*it).left((*it).find(":")),username);
@@ -387,3 +428,4 @@ bool UserDialog::editUser(const char *username) {
387 QListViewItemIterator it( edituserDialog->groupsListView ); 428 QListViewItemIterator it( edituserDialog->groupsListView );
388 for ( ; it.current(); ++it ) { 429 for ( ; it.current(); ++it )
430 {
389 temp=(QCheckListItem*)it.current(); 431 temp=(QCheckListItem*)it.current();
@@ -394,5 +436,7 @@ bool UserDialog::editUser(const char *username) {
394 // Copy image to pics/users/ 436 // Copy image to pics/users/
395 if(!(edituserDialog->userImage.isNull())) { 437 if(!(edituserDialog->userImage.isNull()))
438 {
396 QDir d; 439 QDir d;
397 if(!(d.exists("/opt/QtPalmtop/pics/users"))) { 440 if(!(d.exists("/opt/QtPalmtop/pics/users")))
441 {
398 d.mkdir("/opt/QtPalmtop/pics/users"); 442 d.mkdir("/opt/QtPalmtop/pics/users");
@@ -410,5 +454,7 @@ bool UserDialog::editUser(const char *username) {
410 */ 454 */
411void UserDialog::accept() { 455void UserDialog::accept()
456{
412 // Add checking... valid username? username taken? 457 // Add checking... valid username? username taken?
413 if(loginLineEdit->text().isEmpty()) { 458 if(loginLineEdit->text().isEmpty())
459 {
414 QMessageBox::information(0,"Empty Login","Please enter a login."); 460 QMessageBox::information(0,"Empty Login","Please enter a login.");
@@ -423,9 +469,14 @@ void UserDialog::accept() {
423 */ 469 */
424void UserDialog::clickedPicture() { 470void UserDialog::clickedPicture()
471{
425 QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null); 472 QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null);
426 if(!(filename.isEmpty())) { 473 if(!(filename.isEmpty()))
474 {
427 userImage.reset(); 475 userImage.reset();
428 if(!(userImage.load(filename))) { 476 if(!(userImage.load(filename)))
477 {
429 QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename); 478 QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename);
430 } else { 479 }
480 else
481 {
431 // userImage=userImage.smoothScale(48,48); 482 // userImage=userImage.smoothScale(48,48);