-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/settingsimpl.cpp | 5 |
2 files changed, 1 insertions, 6 deletions
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index a74b861..d76ae39 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro | |||
@@ -1,40 +1,40 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = global.h \ | 2 | HEADERS = global.h \ |
3 | mainwin.h \ | 3 | mainwin.h \ |
4 | datamgr.h \ | 4 | datamgr.h \ |
5 | settingsimpl.h \ | 5 | settingsimpl.h \ |
6 | ipkg.h \ | 6 | ipkg.h \ |
7 | packagewin.h \ | 7 | packagewin.h \ |
8 | package.h \ | 8 | package.h \ |
9 | installdlgimpl.h \ | 9 | installdlgimpl.h \ |
10 | instoptionsimpl.h \ | 10 | instoptionsimpl.h \ |
11 | destination.h \ | 11 | destination.h \ |
12 | utils.h \ | 12 | utils.h \ |
13 | server.h \ | 13 | server.h \ |
14 | letterpushbutton.h \ | 14 | letterpushbutton.h \ |
15 | inputdlg.h \ | 15 | inputdlg.h \ |
16 | categoryfilterimpl.h | 16 | categoryfilterimpl.h |
17 | SOURCES = mainwin.cpp \ | 17 | SOURCES = mainwin.cpp \ |
18 | datamgr.cpp \ | 18 | datamgr.cpp \ |
19 | mem.cpp \ | 19 | mem.cpp \ |
20 | settingsimpl.cpp \ | 20 | settingsimpl.cpp \ |
21 | ipkg.cpp \ | 21 | ipkg.cpp \ |
22 | main.cpp \ | 22 | main.cpp \ |
23 | packagewin.cpp \ | 23 | packagewin.cpp \ |
24 | package.cpp \ | 24 | package.cpp \ |
25 | installdlgimpl.cpp \ | 25 | installdlgimpl.cpp \ |
26 | instoptionsimpl.cpp \ | 26 | instoptionsimpl.cpp \ |
27 | destination.cpp \ | 27 | destination.cpp \ |
28 | utils.cpp \ | 28 | utils.cpp \ |
29 | server.cpp \ | 29 | server.cpp \ |
30 | letterpushbutton.cpp \ | 30 | letterpushbutton.cpp \ |
31 | inputdlg.cpp \ | 31 | inputdlg.cpp \ |
32 | version.cpp \ | 32 | version.cpp \ |
33 | categoryfilterimpl.cpp | 33 | categoryfilterimpl.cpp |
34 | TARGET = aqpkg | 34 | TARGET = aqpkg |
35 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
36 | DEPENDPATH += $(OPIEDIR)/include | 36 | DEPENDPATH += $(OPIEDIR)/include |
37 | LIBS += -lqpe -lopiecore2 -lopieui2 -lstdc++ | 37 | LIBS += -lqpe -lopiecore2 -lopieui2 |
38 | 38 | ||
39 | include ( $(OPIEDIR)/include.pro ) | 39 | include ( $(OPIEDIR)/include.pro ) |
40 | 40 | ||
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp index 2f35617..9c8ec7a 100644 --- a/noncore/settings/aqpkg/settingsimpl.cpp +++ b/noncore/settings/aqpkg/settingsimpl.cpp | |||
@@ -1,118 +1,113 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | 3 | ||
4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> | 4 | =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> |
5 | .=l. Dan Williams <drw@handhelds.org> | 5 | .=l. Dan Williams <drw@handhelds.org> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "settingsimpl.h" | 30 | #include "settingsimpl.h" |
31 | #include "global.h" | 31 | #include "global.h" |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/otabwidget.h> | 34 | #include <opie2/otabwidget.h> |
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
38 | #endif | 38 | #endif |
39 | #include <qpe/qpeapplication.h> | 39 | #include <qpe/qpeapplication.h> |
40 | 40 | ||
41 | /* QT */ | 41 | /* QT */ |
42 | #include <qcheckbox.h> | 42 | #include <qcheckbox.h> |
43 | #include <qgroupbox.h> | 43 | #include <qgroupbox.h> |
44 | #include <qlabel.h> | 44 | #include <qlabel.h> |
45 | #include <qlayout.h> | 45 | #include <qlayout.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qlistbox.h> | 47 | #include <qlistbox.h> |
48 | #include <qpushbutton.h> | 48 | #include <qpushbutton.h> |
49 | 49 | ||
50 | /* STD */ | ||
51 | #include <fstream> | ||
52 | #include <algorithm> | ||
53 | using namespace std; | ||
54 | |||
55 | using namespace Opie::Ui; | 50 | using namespace Opie::Ui; |
56 | using namespace Opie::Ui; | 51 | using namespace Opie::Ui; |
57 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 52 | SettingsImpl :: SettingsImpl( DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
58 | : QDialog( parent, name, modal, fl ) | 53 | : QDialog( parent, name, modal, fl ) |
59 | { | 54 | { |
60 | setCaption( tr( "Configuration" ) ); | 55 | setCaption( tr( "Configuration" ) ); |
61 | 56 | ||
62 | // Setup layout to make everything pretty | 57 | // Setup layout to make everything pretty |
63 | QVBoxLayout *layout = new QVBoxLayout( this ); | 58 | QVBoxLayout *layout = new QVBoxLayout( this ); |
64 | layout->setMargin( 2 ); | 59 | layout->setMargin( 2 ); |
65 | layout->setSpacing( 4 ); | 60 | layout->setSpacing( 4 ); |
66 | 61 | ||
67 | // Setup tabs for all info | 62 | // Setup tabs for all info |
68 | OTabWidget *tabwidget = new OTabWidget( this ); | 63 | OTabWidget *tabwidget = new OTabWidget( this ); |
69 | layout->addWidget( tabwidget ); | 64 | layout->addWidget( tabwidget ); |
70 | 65 | ||
71 | tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); | 66 | tabwidget->addTab( initServerTab(), "aqpkg/servertab", tr( "Servers" ) ); |
72 | tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); | 67 | tabwidget->addTab( initDestinationTab(), "aqpkg/desttab", tr( "Destinations" ) ); |
73 | tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); | 68 | tabwidget->addTab( initProxyTab(), "aqpkg/proxytab", tr( "Proxies" ) ); |
74 | tabwidget->setCurrentTab( tr( "Servers" ) ); | 69 | tabwidget->setCurrentTab( tr( "Servers" ) ); |
75 | 70 | ||
76 | dataMgr = dataManager; | 71 | dataMgr = dataManager; |
77 | setupData(); | 72 | setupData(); |
78 | changed = false; | 73 | changed = false; |
79 | newserver = false; | 74 | newserver = false; |
80 | newdestination = false; | 75 | newdestination = false; |
81 | } | 76 | } |
82 | 77 | ||
83 | SettingsImpl :: ~SettingsImpl() | 78 | SettingsImpl :: ~SettingsImpl() |
84 | { | 79 | { |
85 | } | 80 | } |
86 | 81 | ||
87 | bool SettingsImpl :: showDlg() | 82 | bool SettingsImpl :: showDlg() |
88 | { | 83 | { |
89 | QPEApplication::execDialog( this ); | 84 | QPEApplication::execDialog( this ); |
90 | if ( changed ) | 85 | if ( changed ) |
91 | dataMgr->writeOutIpkgConf(); | 86 | dataMgr->writeOutIpkgConf(); |
92 | 87 | ||
93 | return changed; | 88 | return changed; |
94 | } | 89 | } |
95 | 90 | ||
96 | QWidget *SettingsImpl :: initServerTab() | 91 | QWidget *SettingsImpl :: initServerTab() |
97 | { | 92 | { |
98 | QWidget *control = new QWidget( this ); | 93 | QWidget *control = new QWidget( this ); |
99 | 94 | ||
100 | QVBoxLayout *vb = new QVBoxLayout( control ); | 95 | QVBoxLayout *vb = new QVBoxLayout( control ); |
101 | 96 | ||
102 | QScrollView *sv = new QScrollView( control ); | 97 | QScrollView *sv = new QScrollView( control ); |
103 | vb->addWidget( sv, 0, 0 ); | 98 | vb->addWidget( sv, 0, 0 ); |
104 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 99 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
105 | sv->setFrameStyle( QFrame::NoFrame ); | 100 | sv->setFrameStyle( QFrame::NoFrame ); |
106 | 101 | ||
107 | QWidget *container = new QWidget( sv->viewport() ); | 102 | QWidget *container = new QWidget( sv->viewport() ); |
108 | sv->addChild( container ); | 103 | sv->addChild( container ); |
109 | 104 | ||
110 | QGridLayout *layout = new QGridLayout( container ); | 105 | QGridLayout *layout = new QGridLayout( container ); |
111 | layout->setSpacing( 2 ); | 106 | layout->setSpacing( 2 ); |
112 | layout->setMargin( 4 ); | 107 | layout->setMargin( 4 ); |
113 | 108 | ||
114 | servers = new QListBox( container ); | 109 | servers = new QListBox( container ); |
115 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 110 | servers->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
116 | connect( servers, SIGNAL( highlighted(int) ), this, SLOT( editServer(int) ) ); | 111 | connect( servers, SIGNAL( highlighted(int) ), this, SLOT( editServer(int) ) ); |
117 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); | 112 | layout->addMultiCellWidget( servers, 0, 0, 0, 1 ); |
118 | 113 | ||