-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,182 +1,177 @@ | |||
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 | ||
119 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 114 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
120 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); | 115 | connect( btn, SIGNAL( clicked() ), this, SLOT( newServer() ) ); |
121 | layout->addWidget( btn, 1, 0 ); | 116 | layout->addWidget( btn, 1, 0 ); |
122 | 117 | ||
123 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 118 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
124 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); | 119 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeServer() ) ); |
125 | layout->addWidget( btn, 1, 1 ); | 120 | layout->addWidget( btn, 1, 1 ); |
126 | 121 | ||
127 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); | 122 | QGroupBox *grpbox = new QGroupBox( 0, Qt::Vertical, tr( "Server" ), container ); |
128 | grpbox->layout()->setSpacing( 2 ); | 123 | grpbox->layout()->setSpacing( 2 ); |
129 | grpbox->layout()->setMargin( 4 ); | 124 | grpbox->layout()->setMargin( 4 ); |
130 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); | 125 | layout->addMultiCellWidget( grpbox, 2, 2, 0, 1 ); |
131 | 126 | ||
132 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); | 127 | QGridLayout *grplayout = new QGridLayout( grpbox->layout() ); |
133 | 128 | ||
134 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); | 129 | QLabel *label = new QLabel( tr( "Name:" ), grpbox ); |
135 | grplayout->addWidget( label, 0, 0 ); | 130 | grplayout->addWidget( label, 0, 0 ); |
136 | servername = new QLineEdit( grpbox ); | 131 | servername = new QLineEdit( grpbox ); |
137 | grplayout->addWidget( servername, 0, 1 ); | 132 | grplayout->addWidget( servername, 0, 1 ); |
138 | 133 | ||
139 | label = new QLabel( tr( "Address:" ), grpbox ); | 134 | label = new QLabel( tr( "Address:" ), grpbox ); |
140 | grplayout->addWidget( label, 1, 0 ); | 135 | grplayout->addWidget( label, 1, 0 ); |
141 | serverurl = new QLineEdit( grpbox ); | 136 | serverurl = new QLineEdit( grpbox ); |
142 | grplayout->addWidget( serverurl, 1, 1 ); | 137 | grplayout->addWidget( serverurl, 1, 1 ); |
143 | 138 | ||
144 | active = new QCheckBox( tr( "Active Server" ), grpbox ); | 139 | active = new QCheckBox( tr( "Active Server" ), grpbox ); |
145 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); | 140 | grplayout->addMultiCellWidget( active, 2, 2, 0, 1 ); |
146 | 141 | ||
147 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); | 142 | btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Update" ), grpbox ); |
148 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); | 143 | connect( btn, SIGNAL( clicked() ), this, SLOT( changeServerDetails() ) ); |
149 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); | 144 | grplayout->addMultiCellWidget( btn, 3, 3, 0, 1 ); |
150 | 145 | ||
151 | return control; | 146 | return control; |
152 | } | 147 | } |
153 | 148 | ||
154 | QWidget *SettingsImpl :: initDestinationTab() | 149 | QWidget *SettingsImpl :: initDestinationTab() |
155 | { | 150 | { |
156 | QWidget *control = new QWidget( this ); | 151 | QWidget *control = new QWidget( this ); |
157 | 152 | ||
158 | QVBoxLayout *vb = new QVBoxLayout( control ); | 153 | QVBoxLayout *vb = new QVBoxLayout( control ); |
159 | 154 | ||
160 | QScrollView *sv = new QScrollView( control ); | 155 | QScrollView *sv = new QScrollView( control ); |
161 | vb->addWidget( sv, 0, 0 ); | 156 | vb->addWidget( sv, 0, 0 ); |
162 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 157 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
163 | sv->setFrameStyle( QFrame::NoFrame ); | 158 | sv->setFrameStyle( QFrame::NoFrame ); |
164 | 159 | ||
165 | QWidget *container = new QWidget( sv->viewport() ); | 160 | QWidget *container = new QWidget( sv->viewport() ); |
166 | sv->addChild( container ); | 161 | sv->addChild( container ); |
167 | 162 | ||
168 | QGridLayout *layout = new QGridLayout( container ); | 163 | QGridLayout *layout = new QGridLayout( container ); |
169 | layout->setSpacing( 2 ); | 164 | layout->setSpacing( 2 ); |
170 | layout->setMargin( 4 ); | 165 | layout->setMargin( 4 ); |
171 | 166 | ||
172 | destinations = new QListBox( container ); | 167 | destinations = new QListBox( container ); |
173 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); | 168 | destinations->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); |
174 | connect( destinations, SIGNAL( highlighted(int) ), this, SLOT( editDestination(int) ) ); | 169 | connect( destinations, SIGNAL( highlighted(int) ), this, SLOT( editDestination(int) ) ); |
175 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); | 170 | layout->addMultiCellWidget( destinations, 0, 0, 0, 1 ); |
176 | 171 | ||
177 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); | 172 | QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); |
178 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); | 173 | connect( btn, SIGNAL( clicked() ), this, SLOT( newDestination() ) ); |
179 | layout->addWidget( btn, 1, 0 ); | 174 | layout->addWidget( btn, 1, 0 ); |
180 | 175 | ||
181 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); | 176 | btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); |
182 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); | 177 | connect( btn, SIGNAL( clicked() ), this, SLOT( removeDestination() ) ); |