-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 162 | ||||
-rw-r--r-- | noncore/settings/appearance2/stylelistitem.h | 8 | ||||
-rw-r--r-- | noncore/settings/aqpkg/categoryfilterimpl.cpp | 20 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.cpp | 16 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 38 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 35 | ||||
-rw-r--r-- | noncore/settings/backup/backuprestore.cpp | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/devices.cpp | 25 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/edit.cpp | 233 | ||||
-rw-r--r-- | noncore/settings/sysinfo/modulesinfo.cpp | 16 | ||||
-rw-r--r-- | noncore/settings/sysinfo/processinfo.cpp | 14 | ||||
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 149 |
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 | |||
@@ -28,4 +28,28 @@ | |||
28 | */ | 28 | */ |
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> |
31 | #include <qcheckbox.h> | 55 | #include <qcheckbox.h> |
@@ -50,29 +74,4 @@ | |||
50 | #include <qwhatsthis.h> | 74 | #include <qwhatsthis.h> |
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 | |||
77 | using namespace Opie; | 76 | using namespace Opie; |
78 | 77 | ||
@@ -82,11 +81,14 @@ class DefaultWindowDecoration : public WindowDecorationInterface | |||
82 | public: | 81 | 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 | } |
87 | QPixmap 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; |
92 | if ( uuid == IID_QUnknown ) | 94 | if ( uuid == IID_QUnknown ) |
@@ -135,4 +137,5 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
135 | m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); | 137 | m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); |
136 | #endif | 138 | #endif |
139 | |||
137 | { | 140 | { |
138 | QString path = QPEApplication::qpeDir ( ); | 141 | QString path = QPEApplication::qpeDir ( ); |
@@ -140,5 +143,6 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
140 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 143 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
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; |
144 | libstr.append( "/" ); | 148 | libstr.append( "/" ); |
@@ -147,5 +151,6 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
147 | StyleInterface *iface; | 151 | StyleInterface *iface; |
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 ); |
151 | m_style_list-> insertItem ( slit ); | 156 | m_style_list-> insertItem ( slit ); |
@@ -185,5 +190,6 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
185 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 190 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
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; |
189 | libstr.append( "/" ); | 195 | libstr.append( "/" ); |
@@ -192,5 +198,6 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
192 | WindowDecorationInterface *iface; | 198 | WindowDecorationInterface *iface; |
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 ); |
196 | m_deco_list-> insertItem ( dlit ); | 203 | m_deco_list-> insertItem ( dlit ); |
@@ -247,5 +254,6 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
247 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); | 254 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); |
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" )); |
251 | QString pathstr = path; | 259 | QString pathstr = path; |
@@ -349,5 +357,6 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
349 | QStringList sl = cfg. readListEntry ( "NoStyle", ';' ); | 357 | QStringList sl = cfg. readListEntry ( "NoStyle", ';' ); |
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 ); |
353 | 362 | ||
@@ -433,7 +442,10 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
433 | ODirection rot = CW; | 442 | ODirection rot = CW; |
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; |
439 | } | 451 | } |
@@ -483,10 +495,10 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | |||
483 | 495 | ||
484 | Appearance::~Appearance() | 496 | Appearance::~Appearance() |
485 | { | 497 | {} |
486 | } | ||
487 | 498 | ||
488 | void Appearance::tabChanged ( QWidget *w ) | 499 | 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 ( ); |
492 | updateGeometry ( ); // shouldn't be necessary ... | 504 | updateGeometry ( ); // shouldn't be necessary ... |
@@ -504,5 +516,6 @@ void Appearance::accept ( ) | |||
504 | config. setGroup ( "Appearance" ); | 516 | config. setGroup ( "Appearance" ); |
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 ( )); |
508 | if ( item ) | 521 | if ( item ) |
@@ -510,5 +523,6 @@ void Appearance::accept ( ) | |||
510 | } | 523 | } |
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 ( )); |
514 | if ( item ) | 528 | if ( item ) |
@@ -516,10 +530,12 @@ void Appearance::accept ( ) | |||
516 | } | 530 | } |
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 ); |
520 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); | 535 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); |
521 | } | 536 | } |
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 ( )); |
525 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); | 541 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); |
@@ -537,9 +553,14 @@ void Appearance::accept ( ) | |||
537 | 553 | ||
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; |
545 | } | 566 | } |
@@ -550,5 +571,6 @@ void Appearance::accept ( ) | |||
550 | QStringList sl; | 571 | QStringList sl; |
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; |
554 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); | 576 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); |
@@ -580,5 +602,6 @@ void Appearance::styleClicked ( int index ) | |||
580 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); | 602 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); |
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; |
584 | 607 | ||
@@ -593,5 +616,6 @@ void Appearance::styleSettingsClicked ( ) | |||
593 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 616 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
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 ); |
597 | QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 ); | 621 | QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 ); |
@@ -599,11 +623,11 @@ void Appearance::styleSettingsClicked ( ) | |||
599 | QWidget *w = item-> settings ( d ); | 623 | QWidget *w = item-> settings ( d ); |
600 | 624 | ||
601 | if ( w ) { | 625 | if ( w ) |
626 | { | ||
602 | vbox-> addWidget ( w ); | 627 | vbox-> addWidget ( w ); |
603 | 628 | ||
604 | d-> setCaption ( w-> caption ( )); | 629 | d-> setCaption ( w-> caption ( )); |
605 | 630 | ||
606 | d-> showMaximized ( ); | 631 | bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted ); |
607 | bool accepted = ( d-> exec ( ) == QDialog::Accepted ); | ||
608 | 632 | ||
609 | if ( item-> setSettings ( accepted )) | 633 | if ( item-> setSettings ( accepted )) |
@@ -618,5 +642,6 @@ void Appearance::decoClicked ( int index ) | |||
618 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); | 642 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); |
619 | 643 | ||
620 | if ( m_sample ) { | 644 | if ( m_sample ) |
645 | { | ||
621 | if ( dli && dli-> interface ( )) | 646 | if ( dli && dli-> interface ( )) |
622 | m_sample-> setDecoration ( dli-> interface ( )); | 647 | m_sample-> setDecoration ( dli-> interface ( )); |
@@ -653,8 +678,10 @@ void Appearance::editSchemeClicked ( ) | |||
653 | QColor colors [QColorGroup::NColorRoles]; | 678 | QColor colors [QColorGroup::NColorRoles]; |
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 ); |
660 | colors [cnt] = col; | 687 | colors [cnt] = col; |
@@ -665,11 +692,13 @@ void Appearance::editSchemeClicked ( ) | |||
665 | 692 | ||
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 ); |
670 | cnt = 0; | 697 | cnt = 0; |
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] ); |
675 | cnt++; | 704 | cnt++; |
@@ -699,5 +728,6 @@ void Appearance::saveSchemeClicked() | |||
699 | ed-> setFocus ( ); | 728 | ed-> setFocus ( ); |
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 ( ); |
703 | QString filestr = QPEApplication::qpeDir(); | 733 | QString filestr = QPEApplication::qpeDir(); |
@@ -762,5 +792,6 @@ void Appearance::addExcept ( ) | |||
762 | void Appearance::delExcept ( ) | 792 | void Appearance::delExcept ( ) |
763 | { | 793 | { |
764 | if ( m_except-> selectedItem ( )) { | 794 | if ( m_except-> selectedItem ( )) |
795 | { | ||
765 | m_except-> setFocus ( ); | 796 | m_except-> setFocus ( ); |
766 | delete m_except-> selectedItem ( ); | 797 | delete m_except-> selectedItem ( ); |
@@ -784,5 +815,6 @@ void Appearance::downExcept ( ) | |||
784 | } | 815 | } |
785 | 816 | ||
786 | class ExEdit : public QLineEdit { | 817 | class ExEdit : public QLineEdit |
818 | { | ||
787 | public: | 819 | public: |
788 | ExEdit ( ExceptListItem *item ) | 820 | ExEdit ( ExceptListItem *item ) |
@@ -823,5 +855,6 @@ public: | |||
823 | if ( e-> key ( ) == Key_Return ) | 855 | if ( e-> key ( ) == Key_Return ) |
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; |
827 | it-> listView ( )-> setFocus ( ); | 860 | it-> listView ( )-> setFocus ( ); |
@@ -849,5 +882,6 @@ void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c ) | |||
849 | else if ( c == 2 ) | 882 | else if ( c == 2 ) |
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 ); |
853 | new ExEdit ( it ); | 887 | new ExEdit ( 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 | |||
@@ -29,6 +29,12 @@ | |||
29 | #define STYLELISTITEM_H | 29 | #define STYLELISTITEM_H |
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 | ||
34 | #include <stdio.h> | 40 | #include <stdio.h> |
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 | |||
@@ -28,7 +28,10 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <iostream> | 30 | #include "categoryfilterimpl.h" |
31 | using namespace std; | ||
32 | 31 | ||
32 | /* OPIE */ | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | |||
35 | /* QT */ | ||
33 | #include <qgroupbox.h> | 36 | #include <qgroupbox.h> |
34 | #include <qlayout.h> | 37 | #include <qlayout.h> |
@@ -36,5 +39,8 @@ using namespace std; | |||
36 | #include <qstring.h> | 39 | #include <qstring.h> |
37 | 40 | ||
38 | #include "categoryfilterimpl.h" | 41 | /* STD */ |
42 | #include <iostream> | ||
43 | using namespace std; | ||
44 | |||
39 | 45 | ||
40 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) | 46 | CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QString &selectedCategories, QWidget *parent, const char *name ) |
@@ -77,14 +83,14 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin | |||
77 | 83 | ||
78 | start = end + 1; | 84 | start = end + 1; |
79 | } while ( start < (int)categories.length() ); | 85 | } |
86 | while ( start < (int)categories.length() ); | ||
80 | 87 | ||
81 | lstCategories->sort( true ); | 88 | lstCategories->sort( true ); |
82 | 89 | ||
83 | showMaximized(); | 90 | QPEApplication::showDialog( this ); |
84 | } | 91 | } |
85 | 92 | ||
86 | CategoryFilterImpl :: ~CategoryFilterImpl() | 93 | CategoryFilterImpl :: ~CategoryFilterImpl() |
87 | { | 94 | {} |
88 | } | ||
89 | 95 | ||
90 | QString CategoryFilterImpl :: getSelectedFilter() | 96 | QString CategoryFilterImpl :: getSelectedFilter() |
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 | |||
@@ -28,8 +28,15 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "global.h" | ||
31 | #include "instoptionsimpl.h" | ||
32 | #include "ipkg.h" | ||
33 | |||
34 | /* OPIE */ | ||
30 | #ifdef QWS | 35 | #ifdef QWS |
31 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
32 | #endif | 37 | #endif |
38 | #include <qpe/qpeapplication.h> | ||
33 | 39 | ||
40 | /* QT */ | ||
34 | #include <qcheckbox.h> | 41 | #include <qcheckbox.h> |
35 | #include <qcombobox.h> | 42 | #include <qcombobox.h> |
@@ -38,8 +45,4 @@ | |||
38 | #include <qlayout.h> | 45 | #include <qlayout.h> |
39 | 46 | ||
40 | #include "global.h" | ||
41 | #include "instoptionsimpl.h" | ||
42 | #include "ipkg.h" | ||
43 | |||
44 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) | 47 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl ) |
45 | : QDialog( parent, name, modal, fl ) | 48 | : QDialog( parent, name, modal, fl ) |
@@ -96,11 +99,10 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par | |||
96 | // makeLinks->setChecked( true ); | 99 | // makeLinks->setChecked( true ); |
97 | 100 | ||
98 | showMaximized(); | 101 | QPEApplication::showDialog( this ); |
99 | 102 | ||
100 | } | 103 | } |
101 | 104 | ||
102 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() | 105 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() |
103 | { | 106 | {} |
104 | } | ||
105 | 107 | ||
106 | 108 | ||
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 | |||
@@ -28,14 +28,25 @@ | |||
28 | */ | 28 | */ |
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> |
38 | #include <qpe/resource.h> | 46 | #include <qpe/resource.h> |
39 | 47 | ||
48 | /* QT */ | ||
49 | #include <qmenubar.h> | ||
50 | #include <qtoolbar.h> | ||
40 | #include <qaction.h> | 51 | #include <qaction.h> |
41 | #include <qcombobox.h> | 52 | #include <qcombobox.h> |
@@ -53,15 +64,7 @@ | |||
53 | #include <qwidgetstack.h> | 64 | #include <qwidgetstack.h> |
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 | ||
67 | extern int compareVersions( const char *v1, const char *v2 ); | 70 | extern int compareVersions( const char *v1, const char *v2 ); |
@@ -1182,5 +1185,6 @@ void MainWindow :: letterPushed( QString t ) | |||
1182 | if ( !item ) | 1185 | if ( !item ) |
1183 | item = (QCheckListItem *)packagesList->firstChild(); | 1186 | item = (QCheckListItem *)packagesList->firstChild(); |
1184 | } while ( item != start); | 1187 | } |
1188 | while ( item != start); | ||
1185 | } | 1189 | } |
1186 | 1190 | ||
@@ -1189,5 +1193,5 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item ) | |||
1189 | QString itemstr( ((QCheckListItem*)item)->text() ); | 1193 | QString itemstr( ((QCheckListItem*)item)->text() ); |
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 | } |
1193 | 1197 | ||
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 | |||
@@ -28,8 +28,16 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <fstream> | 30 | #include "settingsimpl.h" |
31 | #include <algorithm> | 31 | #include "global.h" |
32 | using 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> |
35 | #include <qgroupbox.h> | 43 | #include <qgroupbox.h> |
@@ -40,14 +48,8 @@ using namespace std; | |||
40 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
41 | 49 | ||
42 | #include <opie/otabwidget.h> | 50 | /* STD */ |
43 | 51 | #include <fstream> | |
44 | #ifdef QWS | 52 | #include <algorithm> |
45 | #include <qpe/config.h> | 53 | using namespace std; |
46 | #include <qpe/resource.h> | ||
47 | #endif | ||
48 | |||
49 | #include "settingsimpl.h" | ||
50 | |||
51 | #include "global.h" | ||
52 | 54 | ||
53 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 55 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
@@ -79,12 +81,9 @@ SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const | |||
79 | SettingsImpl :: ~SettingsImpl() | 81 | SettingsImpl :: ~SettingsImpl() |
80 | { | 82 | { |
81 | |||
82 | } | 83 | } |
83 | 84 | ||
84 | bool SettingsImpl :: showDlg() | 85 | bool SettingsImpl :: showDlg() |
85 | { | 86 | { |
86 | showMaximized(); | 87 | QPEApplication::execDialog( this ); |
87 | exec(); | ||
88 | |||
89 | if ( changed ) | 88 | if ( changed ) |
90 | dataMgr->writeOutIpkgConf(); | 89 | dataMgr->writeOutIpkgConf(); |
@@ -463,4 +462,5 @@ void SettingsImpl :: changeDestinationDetails() | |||
463 | cfg.writeEntry( key, val ); | 462 | cfg.writeEntry( key, val ); |
464 | #endif | 463 | #endif |
464 | |||
465 | } | 465 | } |
466 | } | 466 | } |
@@ -477,4 +477,5 @@ void SettingsImpl :: changeDestinationDetails() | |||
477 | cfg.writeEntry( key, true ); | 477 | cfg.writeEntry( key, true ); |
478 | #endif | 478 | #endif |
479 | |||
479 | } | 480 | } |
480 | } | 481 | } |
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 | |||
@@ -1,10 +1,13 @@ | |||
1 | 1 | ||
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> |
10 | #include <qfile.h> | 13 | #include <qfile.h> |
@@ -22,6 +25,6 @@ | |||
22 | #include <qtextstream.h> | 25 | #include <qtextstream.h> |
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> |
27 | #include <stdlib.h> | 30 | #include <stdlib.h> |
@@ -42,5 +45,4 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f | |||
42 | : BackupAndRestoreBase(parent, name, fl) | 45 | : BackupAndRestoreBase(parent, name, fl) |
43 | { | 46 | { |
44 | this->showMaximized(); | ||
45 | backupList->header()->hide(); | 47 | backupList->header()->hide(); |
46 | restoreList->header()->hide(); | 48 | restoreList->header()->hide(); |
@@ -131,4 +133,5 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f | |||
131 | } | 133 | } |
132 | } | 134 | } |
135 | QPEApplication::showWidget( this ); | ||
133 | } | 136 | } |
134 | 137 | ||
@@ -288,6 +291,5 @@ void BackupAndRestore::backup() | |||
288 | pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" ); | 291 | pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" ); |
289 | } | 292 | } |
290 | pErrDialog->showMaximized(); | 293 | QPEApplication::execDialog( pErrDialog ); |
291 | pErrDialog->exec(); | ||
292 | delete pErrDialog; | 294 | delete pErrDialog; |
293 | break; | 295 | break; |
@@ -453,6 +455,5 @@ void BackupAndRestore::restore() | |||
453 | pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) ); | 455 | pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) ); |
454 | } | 456 | } |
455 | pErrDialog->showMaximized(); | 457 | QPEApplication::execDialog( pErrDialog ); |
456 | pErrDialog->exec(); | ||
457 | delete pErrDialog; | 458 | delete pErrDialog; |
458 | 459 | ||
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 | |||
@@ -25,6 +25,16 @@ | |||
25 | */ | 25 | */ |
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> |
30 | #include <qtabwidget.h> | 40 | #include <qtabwidget.h> |
@@ -32,5 +42,4 @@ | |||
32 | #include <qwhatsthis.h> | 42 | #include <qwhatsthis.h> |
33 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
34 | |||
35 | #include <qapplication.h> | 44 | #include <qapplication.h> |
36 | #include <qbuttongroup.h> | 45 | #include <qbuttongroup.h> |
@@ -38,10 +47,7 @@ | |||
38 | #include <qvgroupbox.h> | 47 | #include <qvgroupbox.h> |
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 | ||
47 | void parseargs(char* buf, char** args); | 53 | void parseargs(char* buf, char** args); |
@@ -192,6 +198,5 @@ int DevicesWidget::doTab(){ | |||
192 | 198 | ||
193 | while (!ok){ | 199 | while (!ok){ |
194 | dlg->showMaximized(); | 200 | result = QPEApplication::execDialog( dlg ); |
195 | result = dlg->exec(); | ||
196 | ok = true; | 201 | ok = true; |
197 | 202 | ||
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 | |||
@@ -24,6 +24,14 @@ | |||
24 | */ | 24 | */ |
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> |
29 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
@@ -35,10 +43,9 @@ | |||
35 | #include <qhbox.h> | 43 | #include <qhbox.h> |
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 | ||
44 | DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount | 51 | DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount |
@@ -113,5 +120,6 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount | |||
113 | 120 | ||
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()); |
117 | 125 | ||
@@ -120,10 +128,13 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount | |||
120 | QString tmp = ""; | 128 | QString tmp = ""; |
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) |
125 | numbers->insertItem(tmp); | 135 | numbers->insertItem(tmp); |
126 | tmp = ""; | 136 | tmp = ""; |
127 | } else | 137 | } |
138 | else | ||
128 | tmp += n[idx]; | 139 | tmp += n[idx]; |
129 | idx++; | 140 | idx++; |
@@ -138,14 +149,19 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount | |||
138 | } | 149 | } |
139 | 150 | ||
140 | bool DialWidget::save() { | 151 | bool 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()); |
147 | 162 | ||
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) |
151 | number += ":"; | 167 | number += ":"; |
@@ -159,5 +175,6 @@ bool DialWidget::save() { | |||
159 | 175 | ||
160 | 176 | ||
161 | void DialWidget::numbersChanged() { | 177 | void DialWidget::numbersChanged() |
178 | { | ||
162 | int sel = numbers->currentItem(); | 179 | int sel = numbers->currentItem(); |
163 | 180 | ||
@@ -168,12 +185,15 @@ void DialWidget::numbersChanged() { | |||
168 | 185 | ||
169 | 186 | ||
170 | void DialWidget::selectionChanged(int) { | 187 | void DialWidget::selectionChanged(int) |
188 | { | ||
171 | numbersChanged(); | 189 | numbersChanged(); |
172 | } | 190 | } |
173 | 191 | ||
174 | 192 | ||
175 | void DialWidget::addNumber() { | 193 | void 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()); |
179 | numbersChanged(); | 199 | numbersChanged(); |
@@ -182,6 +202,8 @@ void DialWidget::addNumber() { | |||
182 | 202 | ||
183 | 203 | ||
184 | void DialWidget::delNumber() { | 204 | void DialWidget::delNumber() |
185 | if(numbers->currentItem() != -1) { | 205 | { |
206 | if(numbers->currentItem() != -1) | ||
207 | { | ||
186 | numbers->removeItem(numbers->currentItem()); | 208 | numbers->removeItem(numbers->currentItem()); |
187 | numbersChanged(); | 209 | numbersChanged(); |
@@ -190,7 +212,9 @@ void DialWidget::delNumber() { | |||
190 | 212 | ||
191 | 213 | ||
192 | void DialWidget::upNumber() { | 214 | void 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); |
196 | numbers->removeItem(idx); | 220 | numbers->removeItem(idx); |
@@ -202,7 +226,9 @@ void DialWidget::upNumber() { | |||
202 | 226 | ||
203 | 227 | ||
204 | void DialWidget::downNumber() { | 228 | void 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); |
208 | numbers->removeItem(idx); | 234 | numbers->removeItem(idx); |
@@ -214,8 +240,8 @@ void DialWidget::downNumber() { | |||
214 | 240 | ||
215 | 241 | ||
216 | void DialWidget::pppdargsbutton() { | 242 | void 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 | } |
221 | 247 | ||
@@ -306,5 +332,6 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch | |||
306 | 332 | ||
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()); |
310 | command->setText(_pppdata->command_on_connect()); | 337 | command->setText(_pppdata->command_on_connect()); |
@@ -315,5 +342,6 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch | |||
315 | 342 | ||
316 | 343 | ||
317 | bool ExecWidget::save() { | 344 | bool ExecWidget::save() |
345 | { | ||
318 | _pppdata->setCommand_before_connect(before_connect->text()); | 346 | _pppdata->setCommand_before_connect(before_connect->text()); |
319 | _pppdata->setCommand_on_connect(command->text()); | 347 | _pppdata->setCommand_on_connect(command->text()); |
@@ -415,12 +443,15 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char | |||
415 | 443 | ||
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); |
421 | hitIPSelect(0); | 451 | hitIPSelect(0); |
422 | autoname->setChecked(_pppdata->autoname()); | 452 | autoname->setChecked(_pppdata->autoname()); |
423 | } | 453 | } |
424 | else { | 454 | else |
455 | { | ||
425 | ipaddress_l->setText(_pppdata->ipaddr()); | 456 | ipaddress_l->setText(_pppdata->ipaddr()); |
426 | subnetmask_l->setText(_pppdata->subnetmask()); | 457 | subnetmask_l->setText(_pppdata->subnetmask()); |
@@ -429,5 +460,6 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char | |||
429 | } | 460 | } |
430 | } | 461 | } |
431 | else { | 462 | else |
463 | { | ||
432 | dynamicadd_rb->setChecked(true); | 464 | dynamicadd_rb->setChecked(true); |
433 | hitIPSelect(0); | 465 | hitIPSelect(0); |
@@ -436,9 +468,11 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char | |||
436 | } | 468 | } |
437 | 469 | ||
438 | void IPWidget::autoname_t(bool on) { | 470 | void IPWidget::autoname_t(bool on) |
471 | { | ||
439 | static bool was_warned = false; | 472 | static bool was_warned = false; |
440 | 473 | ||
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, |
444 | tr("Selecting this option might cause some weird " | 478 | tr("Selecting this option might cause some weird " |
@@ -455,9 +489,13 @@ void IPWidget::autoname_t(bool on) { | |||
455 | 489 | ||
456 | 490 | ||
457 | void IPWidget::save() { | 491 | void 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()); |
463 | _pppdata->setSubnetmask(subnetmask_l->text()); | 501 | _pppdata->setSubnetmask(subnetmask_l->text()); |
@@ -467,6 +505,8 @@ void IPWidget::save() { | |||
467 | 505 | ||
468 | 506 | ||
469 | void IPWidget::hitIPSelect( int i ) { | 507 | void IPWidget::hitIPSelect( int i ) |
470 | if(i == 0) { | 508 | { |
509 | if(i == 0) | ||
510 | { | ||
471 | ipaddress_label->setEnabled(false); | 511 | ipaddress_label->setEnabled(false); |
472 | sub_label->setEnabled(false); | 512 | sub_label->setEnabled(false); |
@@ -474,5 +514,6 @@ void IPWidget::hitIPSelect( int i ) { | |||
474 | subnetmask_l->setEnabled(false); | 514 | subnetmask_l->setEnabled(false); |
475 | } | 515 | } |
476 | else { | 516 | else |
517 | { | ||
477 | ipaddress_label->setEnabled(true); | 518 | ipaddress_label->setEnabled(true); |
478 | sub_label->setEnabled(true); | 519 | sub_label->setEnabled(true); |
@@ -598,5 +639,6 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha | |||
598 | 639 | ||
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()); |
602 | dnsdomain->setText(_pppdata->domain()); | 644 | dnsdomain->setText(_pppdata->domain()); |
@@ -610,14 +652,17 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha | |||
610 | } | 652 | } |
611 | 653 | ||
612 | void DNSWidget::DNS_Edit_Changed(const QString &text) { | 654 | void 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]+"); |
614 | add->setEnabled(text.find(r) != -1); | 657 | add->setEnabled(text.find(r) != -1); |
615 | } | 658 | } |
616 | 659 | ||
617 | void DNSWidget::DNS_Entry_Selected(int) { | 660 | void DNSWidget::DNS_Entry_Selected(int) |
661 | { | ||
618 | remove->setEnabled(true); | 662 | remove->setEnabled(true); |
619 | } | 663 | } |
620 | 664 | ||
621 | void DNSWidget::DNS_Mode_Selected(int mode) { | 665 | void DNSWidget::DNS_Mode_Selected(int mode) |
666 | { | ||
622 | bool on = (mode == 1); | 667 | bool on = (mode == 1); |
623 | dns_label->setEnabled(on); | 668 | dns_label->setEnabled(on); |
@@ -632,5 +677,6 @@ void DNSWidget::DNS_Mode_Selected(int mode) { | |||
632 | } | 677 | } |
633 | 678 | ||
634 | void DNSWidget::save() { | 679 | void DNSWidget::save() |
680 | { | ||
635 | _pppdata->setAutoDNS(bg->id(bg->selected()) == 0); | 681 | _pppdata->setAutoDNS(bg->id(bg->selected()) == 0); |
636 | QStringList serverlist; | 682 | QStringList serverlist; |
@@ -650,6 +696,8 @@ void DNSWidget::save() { | |||
650 | 696 | ||
651 | 697 | ||
652 | void DNSWidget::adddns() { | 698 | void 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()); |
655 | dnsipaddr->setText(""); | 703 | dnsipaddr->setText(""); |
@@ -658,5 +706,6 @@ void DNSWidget::adddns() { | |||
658 | 706 | ||
659 | 707 | ||
660 | void DNSWidget::removedns() { | 708 | void DNSWidget::removedns() |
709 | { | ||
661 | int i; | 710 | int i; |
662 | i = dnsservers->currentItem(); | 711 | i = dnsservers->currentItem(); |
@@ -722,10 +771,13 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c | |||
722 | 771 | ||
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); |
727 | hitGatewaySelect(0); | 778 | hitGatewaySelect(0); |
728 | } | 779 | } |
729 | else { | 780 | else |
781 | { | ||
730 | gatewayaddr->setText(_pppdata->gateway()); | 782 | gatewayaddr->setText(_pppdata->gateway()); |
731 | staticgateway->setChecked(true); | 783 | staticgateway->setChecked(true); |
@@ -733,5 +785,6 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c | |||
733 | defaultroute->setChecked(_pppdata->defaultroute()); | 785 | defaultroute->setChecked(_pppdata->defaultroute()); |
734 | } | 786 | } |
735 | else { | 787 | else |
788 | { | ||
736 | defaultgateway->setChecked(true); | 789 | defaultgateway->setChecked(true); |
737 | hitGatewaySelect(0); | 790 | hitGatewaySelect(0); |
@@ -740,5 +793,6 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c | |||
740 | } | 793 | } |
741 | 794 | ||
742 | void GatewayWidget::save() { | 795 | void GatewayWidget::save() |
796 | { | ||
743 | _pppdata->setGateway(gatewayaddr->text()); | 797 | _pppdata->setGateway(gatewayaddr->text()); |
744 | _pppdata->setDefaultroute(defaultroute->isChecked()); | 798 | _pppdata->setDefaultroute(defaultroute->isChecked()); |
@@ -746,11 +800,14 @@ void GatewayWidget::save() { | |||
746 | 800 | ||
747 | 801 | ||
748 | void GatewayWidget::hitGatewaySelect( int i ) { | 802 | void 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"); |
751 | gatewayaddr->setEnabled(false); | 807 | gatewayaddr->setEnabled(false); |
752 | gate_label->setEnabled(false); | 808 | gate_label->setEnabled(false); |
753 | } | 809 | } |
754 | else { | 810 | else |
811 | { | ||
755 | gatewayaddr->setEnabled(true); | 812 | gatewayaddr->setEnabled(true); |
756 | gatewayaddr->setText(""); | 813 | gatewayaddr->setText(""); |
@@ -804,5 +861,6 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con | |||
804 | 861 | ||
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(); |
808 | QStringList &arglist = _pppdata->script(); | 866 | QStringList &arglist = _pppdata->script(); |
@@ -825,15 +883,20 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con | |||
825 | } | 883 | } |
826 | 884 | ||
827 | bool ScriptWidget::check() { | 885 | bool ScriptWidget::check() |
886 | { | ||
828 | uint lstart = 0; | 887 | uint lstart = 0; |
829 | uint lend = 0; | 888 | uint lend = 0; |
830 | uint errcnt = 0; | 889 | uint errcnt = 0; |
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++; |
839 | } | 902 | } |
@@ -846,7 +909,9 @@ bool ScriptWidget::check() { | |||
846 | 909 | ||
847 | 910 | ||
848 | void ScriptWidget::save() { | 911 | void 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)); |
852 | arglist.append(sl->text(i)); | 917 | arglist.append(sl->text(i)); |
@@ -858,5 +923,6 @@ void ScriptWidget::save() { | |||
858 | 923 | ||
859 | 924 | ||
860 | void ScriptWidget::adjustScrollBar() { | 925 | void ScriptWidget::adjustScrollBar() |
926 | { | ||
861 | if((int)sl->count() <= sl->numItemsVisible()) | 927 | if((int)sl->count() <= sl->numItemsVisible()) |
862 | slb->setRange(0, 0); | 928 | slb->setRange(0, 0); |
@@ -866,5 +932,6 @@ void ScriptWidget::adjustScrollBar() { | |||
866 | 932 | ||
867 | 933 | ||
868 | void ScriptWidget::scrolling(int i) { | 934 | void ScriptWidget::scrolling(int i) |
935 | { | ||
869 | sl->setTopItem(i); | 936 | sl->setTopItem(i); |
870 | stl->setTopItem(i); | 937 | stl->setTopItem(i); |
@@ -872,5 +939,6 @@ void ScriptWidget::scrolling(int i) { | |||
872 | 939 | ||
873 | 940 | ||
874 | void ScriptWidget::slhighlighted(int i) { | 941 | void ScriptWidget::slhighlighted(int i) |
942 | { | ||
875 | insert->setEnabled(true); | 943 | insert->setEnabled(true); |
876 | remove->setEnabled(true); | 944 | remove->setEnabled(true); |
@@ -879,5 +947,6 @@ void ScriptWidget::slhighlighted(int i) { | |||
879 | 947 | ||
880 | 948 | ||
881 | void ScriptWidget::stlhighlighted(int i) { | 949 | void ScriptWidget::stlhighlighted(int i) |
950 | { | ||
882 | insert->setEnabled(true); | 951 | insert->setEnabled(true); |
883 | remove->setEnabled(true); | 952 | remove->setEnabled(true); |
@@ -886,10 +955,12 @@ void ScriptWidget::stlhighlighted(int i) { | |||
886 | 955 | ||
887 | 956 | ||
888 | void ScriptWidget::addButton() { | 957 | void ScriptWidget::addButton() |
958 | { | ||
889 | //don't allow more than the maximum script entries | 959 | //don't allow more than the maximum script entries |
890 | if(sl->count() == MAX_SCRIPT_ENTRIES-1) | 960 | if(sl->count() == MAX_SCRIPT_ENTRIES-1) |
891 | return; | 961 | return; |
892 | 962 | ||
893 | switch(se->type()) { | 963 | switch(se->type()) |
964 | { | ||
894 | case ScriptEdit::Expect: | 965 | case ScriptEdit::Expect: |
895 | stl->insertItem("Expect"); | 966 | stl->insertItem("Expect"); |
@@ -981,5 +1052,6 @@ void ScriptWidget::addButton() { | |||
981 | 1052 | ||
982 | 1053 | ||
983 | void ScriptWidget::insertButton() { | 1054 | void 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 |
985 | //maximum entries in the script list | 1057 | //maximum entries in the script list |
@@ -987,5 +1059,6 @@ void ScriptWidget::insertButton() { | |||
987 | return; | 1059 | return; |
988 | 1060 | ||
989 | switch(se->type()) { | 1061 | switch(se->type()) |
1062 | { | ||
990 | case ScriptEdit::Expect: | 1063 | case ScriptEdit::Expect: |
991 | stl->insertItem("Expect", stl->currentItem()); | 1064 | stl->insertItem("Expect", stl->currentItem()); |
@@ -1071,6 +1144,8 @@ void ScriptWidget::insertButton() { | |||
1071 | 1144 | ||
1072 | 1145 | ||
1073 | void ScriptWidget::removeButton() { | 1146 | void ScriptWidget::removeButton() |
1074 | if(sl->currentItem() >= 0) { | 1147 | { |
1148 | if(sl->currentItem() >= 0) | ||
1149 | { | ||
1075 | int stlc = stl->currentItem(); | 1150 | int stlc = stl->currentItem(); |
1076 | sl->removeItem(sl->currentItem()); | 1151 | sl->removeItem(sl->currentItem()); |
@@ -1120,5 +1195,6 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | |||
1120 | 1195 | ||
1121 | 1196 | ||
1122 | QString PhoneNumberDialog::phoneNumber() { | 1197 | QString PhoneNumberDialog::phoneNumber() |
1198 | { | ||
1123 | QString s = le->text(); | 1199 | QString s = le->text(); |
1124 | 1200 | ||
@@ -1127,5 +1203,6 @@ QString PhoneNumberDialog::phoneNumber() { | |||
1127 | 1203 | ||
1128 | 1204 | ||
1129 | void PhoneNumberDialog::textChanged(const QString &s) { | 1205 | void PhoneNumberDialog::textChanged(const QString &s) |
1206 | { | ||
1130 | // enableButtonOK(s.length() > 0); | 1207 | // enableButtonOK(s.length() > 0); |
1131 | } | 1208 | } |
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 | |||
@@ -20,6 +20,11 @@ | |||
20 | **********************************************************************/ | 20 | **********************************************************************/ |
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> |
25 | #include <qlayout.h> | 30 | #include <qlayout.h> |
@@ -28,7 +33,4 @@ | |||
28 | #include <qwhatsthis.h> | 33 | #include <qwhatsthis.h> |
29 | 34 | ||
30 | #include "modulesinfo.h" | ||
31 | #include "detail.h" | ||
32 | |||
33 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | 35 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) |
34 | : QWidget( parent, name, fl ) | 36 | : QWidget( parent, name, fl ) |
@@ -83,6 +85,5 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | |||
83 | 85 | ||
84 | ModulesInfo::~ModulesInfo() | 86 | ModulesInfo::~ModulesInfo() |
85 | { | 87 | {} |
86 | } | ||
87 | 88 | ||
88 | void ModulesInfo::updateData() | 89 | void ModulesInfo::updateData() |
@@ -107,5 +108,6 @@ void ModulesInfo::updateData() | |||
107 | QListViewItem *newitem; | 108 | QListViewItem *newitem; |
108 | QListViewItem *selecteditem = 0x0; | 109 | QListViewItem *selecteditem = 0x0; |
109 | while ( true ) { | 110 | while ( true ) |
111 | { | ||
110 | modname[0] = '\0'; | 112 | modname[0] = '\0'; |
111 | usage[0] = '\0'; | 113 | usage[0] = '\0'; |
@@ -184,5 +186,5 @@ void ModulesInfo::viewModules( QListViewItem *modules ) | |||
184 | } | 186 | } |
185 | 187 | ||
186 | ModulesDtl->showMaximized(); | 188 | QPEApplication::showWidget( ModulesDtl ); |
187 | } | 189 | } |
188 | 190 | ||
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 | |||
@@ -18,6 +18,11 @@ | |||
18 | **********************************************************************/ | 18 | **********************************************************************/ |
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> |
23 | #include <qlayout.h> | 28 | #include <qlayout.h> |
@@ -26,10 +31,8 @@ | |||
26 | #include <qwhatsthis.h> | 31 | #include <qwhatsthis.h> |
27 | 32 | ||
33 | /* STD */ | ||
28 | #include <sys/types.h> | 34 | #include <sys/types.h> |
29 | #include <signal.h> | 35 | #include <signal.h> |
30 | 36 | ||
31 | #include "processinfo.h" | ||
32 | #include "detail.h" | ||
33 | |||
34 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | 37 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) |
35 | : QWidget( parent, name, fl ) | 38 | : QWidget( parent, name, fl ) |
@@ -87,6 +90,5 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | |||
87 | 90 | ||
88 | ProcessInfo::~ProcessInfo() | 91 | ProcessInfo::~ProcessInfo() |
89 | { | 92 | {} |
90 | } | ||
91 | 93 | ||
92 | void ProcessInfo::updateData() | 94 | void ProcessInfo::updateData() |
@@ -197,4 +199,4 @@ void ProcessInfo::viewProcess( QListViewItem *process ) | |||
197 | fclose( statfile ); | 199 | fclose( statfile ); |
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 | |||
@@ -9,5 +9,11 @@ | |||
9 | 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> |
13 | #include <qlabel.h> | 19 | #include <qlabel.h> |
@@ -15,4 +21,5 @@ | |||
15 | #include <qfile.h> | 21 | #include <qfile.h> |
16 | 22 | ||
23 | /* STD */ | ||
17 | #include <sys/types.h> | 24 | #include <sys/types.h> |
18 | #include <sys/wait.h> | 25 | #include <sys/wait.h> |
@@ -20,7 +27,5 @@ | |||
20 | #include <signal.h> | 27 | #include <signal.h> |
21 | 28 | ||
22 | #include "passwd.h" | ||
23 | 29 | ||
24 | #include <opie/odevice.h> | ||
25 | using namespace Opie; | 30 | using namespace Opie; |
26 | 31 | ||
@@ -30,5 +35,6 @@ using namespace Opie; | |||
30 | * | 35 | * |
31 | */ | 36 | */ |
32 | UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) { | 37 | UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) |
38 | { | ||
33 | vm=viewmode; | 39 | vm=viewmode; |
34 | QVBoxLayout *layout = new QVBoxLayout(this); | 40 | QVBoxLayout *layout = new QVBoxLayout(this); |
@@ -40,12 +46,14 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod | |||
40 | accounts->groupStringList.sort(); | 46 | accounts->groupStringList.sort(); |
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); |
46 | groupComboBox->insertItem(accounts->gr_name); | 54 | groupComboBox->insertItem(accounts->gr_name); |
47 | } | 55 | } |
48 | } | 56 | } |
49 | showMaximized(); | 57 | QPEApplication::showDialog( this ); |
50 | } | 58 | } |
51 | 59 | ||
@@ -54,6 +62,6 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod | |||
54 | * | 62 | * |
55 | */ | 63 | */ |
56 | UserDialog::~UserDialog() { | 64 | UserDialog::~UserDialog() |
57 | } | 65 | {} |
58 | 66 | ||
59 | /** | 67 | /** |
@@ -61,5 +69,6 @@ UserDialog::~UserDialog() { | |||
61 | * | 69 | * |
62 | */ | 70 | */ |
63 | void UserDialog::setupTab1() { | 71 | void UserDialog::setupTab1() |
72 | { | ||
64 | QPixmap mypixmap; | 73 | QPixmap mypixmap; |
65 | QWidget *tabpage = new QWidget(myTabWidget,"page1"); | 74 | QWidget *tabpage = new QWidget(myTabWidget,"page1"); |
@@ -110,5 +119,6 @@ void UserDialog::setupTab1() { | |||
110 | groupComboBox=new QComboBox(tabpage,"PrimaryGroup"); | 119 | groupComboBox=new QComboBox(tabpage,"PrimaryGroup"); |
111 | 120 | ||
112 | if(vm==VIEWMODE_NEW) { | 121 | if(vm==VIEWMODE_NEW) |
122 | { | ||
113 | // Copy /etc/skel | 123 | // Copy /etc/skel |
114 | skelLabel=new QLabel(tabpage,"skel"); | 124 | skelLabel=new QLabel(tabpage,"skel"); |
@@ -137,5 +147,6 @@ void UserDialog::setupTab1() { | |||
137 | vlayout1->addSpacing(5); | 147 | vlayout1->addSpacing(5); |
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); |
141 | vlayout1->addWidget(skelLabel); | 152 | vlayout1->addWidget(skelLabel); |
@@ -153,5 +164,6 @@ void UserDialog::setupTab1() { | |||
153 | vlayout2->addSpacing(5); | 164 | vlayout2->addSpacing(5); |
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); |
157 | vlayout2->addWidget(skelCheckBox); | 169 | vlayout2->addWidget(skelCheckBox); |
@@ -167,5 +179,6 @@ void UserDialog::setupTab1() { | |||
167 | * | 179 | * |
168 | */ | 180 | */ |
169 | void UserDialog::setupTab2() { | 181 | void UserDialog::setupTab2() |
182 | { | ||
170 | QWidget *tabpage = new QWidget(myTabWidget,"page2"); | 183 | QWidget *tabpage = new QWidget(myTabWidget,"page2"); |
171 | QVBoxLayout *layout = new QVBoxLayout(tabpage); | 184 | QVBoxLayout *layout = new QVBoxLayout(tabpage); |
@@ -196,5 +209,6 @@ void UserDialog::setupTab2() { | |||
196 | * | 209 | * |
197 | */ | 210 | */ |
198 | bool UserDialog::addUser(int uid, int gid) { | 211 | bool UserDialog::addUser(int uid, int gid) |
212 | { | ||
199 | QCheckListItem *temp; | 213 | QCheckListItem *temp; |
200 | QFile ozTest; | 214 | QFile ozTest; |
@@ -210,7 +224,9 @@ bool UserDialog::addUser(int uid, int gid) { | |||
210 | adduserDialog->uidLineEdit->setText(QString::number(uid)); | 224 | adduserDialog->uidLineEdit->setText(QString::number(uid)); |
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(); |
216 | if (temp->text()=="video") temp->setOn(true); | 232 | if (temp->text()=="video") temp->setOn(true); |
@@ -225,5 +241,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
225 | // Show the dialog! | 241 | // Show the dialog! |
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()); |
229 | adduserDialog->groupID=accounts->gr_gid; | 246 | adduserDialog->groupID=accounts->gr_gid; |
@@ -232,5 +249,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
232 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), | 249 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), |
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."); |
236 | return false; | 254 | return false; |
@@ -239,5 +257,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
239 | // Add User to additional groups. | 257 | // Add User to additional groups. |
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(); |
243 | if (temp->isOn() ) | 262 | if (temp->isOn() ) |
@@ -245,7 +264,9 @@ bool UserDialog::addUser(int uid, int gid) { | |||
245 | } | 264 | } |
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"); |
251 | } | 272 | } |
@@ -257,5 +278,6 @@ bool UserDialog::addUser(int uid, int gid) { | |||
257 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? | 278 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? |
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; |
261 | QString command_chown; | 283 | QString command_chown; |
@@ -281,10 +303,15 @@ bool UserDialog::addUser(int uid, int gid) { | |||
281 | * | 303 | * |
282 | */ | 304 | */ |
283 | bool UserDialog::delUser(const char *username) { | 305 | bool 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."); |
290 | return false; | 317 | return false; |
@@ -302,5 +329,6 @@ bool UserDialog::delUser(const char *username) { | |||
302 | * | 329 | * |
303 | */ | 330 | */ |
304 | bool UserDialog::editUser(const char *username) { | 331 | bool UserDialog::editUser(const char *username) |
332 | { | ||
305 | int invalid_group=0; | 333 | int invalid_group=0; |
306 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here. | 334 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating edituserDialog's widgets here. |
@@ -308,5 +336,6 @@ bool UserDialog::editUser(const char *username) { | |||
308 | edituserDialog->setCaption(tr("Edit User")); | 336 | edituserDialog->setCaption(tr("Edit User")); |
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; |
312 | } | 341 | } |
@@ -318,16 +347,20 @@ bool UserDialog::editUser(const char *username) { | |||
318 | edituserDialog->passwordLineEdit->setText("........"); | 347 | edituserDialog->passwordLineEdit->setText("........"); |
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); |
322 | edituserDialog->shellComboBox->setCurrentItem(0); | 352 | edituserDialog->shellComboBox->setCurrentItem(0); |
323 | } | 353 | } |
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); |
328 | break; | 360 | break; |
329 | } | 361 | } |
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); |
333 | edituserDialog->groupComboBox->setCurrentItem(0); | 366 | edituserDialog->groupComboBox->setCurrentItem(0); |
@@ -339,9 +372,12 @@ bool UserDialog::editUser(const char *username) { | |||
339 | QRegExp userRegExp(QString("[:,]%1$").arg(username));// The end of line variant. | 372 | QRegExp userRegExp(QString("[:,]%1$").arg(username));// The end of line variant. |
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(); |
347 | temp->setOn(true);// If we find a line with that groupname, select it.; | 383 | temp->setOn(true);// If we find a line with that groupname, select it.; |
@@ -351,9 +387,12 @@ bool UserDialog::editUser(const char *username) { | |||
351 | userRegExp=QRegExp(QString("[:,]%1,").arg(username));// And the other one. (not end of line.) | 387 | userRegExp=QRegExp(QString("[:,]%1,").arg(username));// And the other one. (not end of line.) |
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(); |
359 | temp->setOn(true);// If we find a line with that groupname, select it.; | 398 | temp->setOn(true);// If we find a line with that groupname, select it.; |
@@ -371,5 +410,6 @@ bool UserDialog::editUser(const char *username) { | |||
371 | // Set all variables in accounts object, that will be used when calling 'updateUser()' | 410 | // Set all variables in accounts object, that will be used when calling 'updateUser()' |
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. |
375 | } | 415 | } |
@@ -380,5 +420,6 @@ bool UserDialog::editUser(const char *username) { | |||
380 | 420 | ||
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); |
384 | } | 425 | } |
@@ -386,5 +427,6 @@ bool UserDialog::editUser(const char *username) { | |||
386 | // Add User to additional groups that he/she is a member of. | 427 | // Add User to additional groups that he/she is a member of. |
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(); |
390 | if ( temp->isOn() ) | 432 | if ( temp->isOn() ) |
@@ -393,7 +435,9 @@ bool UserDialog::editUser(const char *username) { | |||
393 | 435 | ||
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"); |
399 | } | 443 | } |
@@ -409,7 +453,9 @@ bool UserDialog::editUser(const char *username) { | |||
409 | * | 453 | * |
410 | */ | 454 | */ |
411 | void UserDialog::accept() { | 455 | void 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."); |
415 | return; | 461 | return; |
@@ -422,11 +468,16 @@ void UserDialog::accept() { | |||
422 | * | 468 | * |
423 | */ | 469 | */ |
424 | void UserDialog::clickedPicture() { | 470 | void 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); |
432 | QPixmap *picture; | 483 | QPixmap *picture; |