author | andyq <andyq> | 2002-11-22 16:11:49 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-22 16:11:49 (UTC) |
commit | 34ca473739286557b3d0c73525740f0b8b01fd4b (patch) (unidiff) | |
tree | 727fa7f17d0bafa7b2e4ae30eed2c80f80b770d9 | |
parent | 8366956992e07a9fc77b9e126bb429b32fd4ad9a (diff) | |
download | opie-34ca473739286557b3d0c73525740f0b8b01fd4b.zip opie-34ca473739286557b3d0c73525740f0b8b01fd4b.tar.gz opie-34ca473739286557b3d0c73525740f0b8b01fd4b.tar.bz2 |
Added verbose_wget flags (doesn't yet work properly though coz ipkg is sending crap)
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 55 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptions.ui | 218 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.cpp | 21 | ||||
-rw-r--r-- | noncore/settings/aqpkg/instoptionsimpl.h | 1 |
4 files changed, 163 insertions, 132 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index db9a259..485fe3d 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp | |||
@@ -1,242 +1,239 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | installdlgimpl.cpp - description | 2 | installdlgimpl.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 2002 | 4 | begin : Mon Aug 26 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #include <qpe/qpeapplication.h> | ||
20 | #endif | 21 | #endif |
21 | 22 | ||
22 | #include <qmultilineedit.h> | 23 | #include <qmultilineedit.h> |
23 | #include <qdialog.h> | 24 | #include <qdialog.h> |
24 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
25 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
26 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
27 | 28 | ||
28 | 29 | ||
29 | #include "datamgr.h" | 30 | #include "datamgr.h" |
30 | #include "instoptionsimpl.h" | 31 | #include "instoptionsimpl.h" |
31 | #include "destination.h" | 32 | #include "destination.h" |
32 | #include "installdlgimpl.h" | 33 | #include "installdlgimpl.h" |
33 | #include "global.h" | 34 | #include "global.h" |
34 | 35 | ||
35 | InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) | 36 | InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent, const char* name, bool modal, WFlags fl ) |
36 | : InstallDlg( parent, name, modal, fl ) | 37 | : InstallDlg( parent, name, modal, fl ) |
37 | { | 38 | { |
38 | pIpkg = 0; | 39 | pIpkg = 0; |
39 | upgradePackages = false; | 40 | upgradePackages = false; |
40 | dataMgr = dataManager; | 41 | dataMgr = dataManager; |
41 | vector<Destination>::iterator dit; | 42 | vector<Destination>::iterator dit; |
42 | 43 | ||
43 | QString defaultDest = "root"; | 44 | QString defaultDest = "root"; |
44 | #ifdef QWS | 45 | #ifdef QWS |
45 | Config cfg( "aqpkg" ); | 46 | Config cfg( "aqpkg" ); |
46 | cfg.setGroup( "settings" ); | 47 | cfg.setGroup( "settings" ); |
47 | defaultDest = cfg.readEntry( "dest", "root" ); | 48 | defaultDest = cfg.readEntry( "dest", "root" ); |
48 | 49 | ||
49 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) | 50 | // Grab flags - Turn MAKE_LINKS on by default (if no flags found) |
50 | flags = cfg.readNumEntry( "installFlags", 0 ); | 51 | flags = cfg.readNumEntry( "installFlags", 0 ); |
51 | #else | 52 | #else |
52 | flags = 0; | 53 | flags = 0; |
53 | #endif | 54 | #endif |
54 | 55 | ||
55 | // Output text is read only | 56 | // Output text is read only |
56 | output->setReadOnly( true ); | 57 | output->setReadOnly( true ); |
57 | QFont f( "helvetica" ); | 58 | QFont f( "helvetica" ); |
58 | f.setPointSize( 10 ); | 59 | f.setPointSize( 10 ); |
59 | output->setFont( f ); | 60 | output->setFont( f ); |
60 | 61 | ||
61 | 62 | ||
62 | // setup destination data | 63 | // setup destination data |
63 | int defIndex = 0; | 64 | int defIndex = 0; |
64 | int i; | 65 | int i; |
65 | for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i ) | 66 | for ( i = 0 , dit = dataMgr->getDestinationList().begin() ; dit != dataMgr->getDestinationList().end() ; ++dit, ++i ) |
66 | { | 67 | { |
67 | destination->insertItem( dit->getDestinationName() ); | 68 | destination->insertItem( dit->getDestinationName() ); |
68 | if ( dit->getDestinationName() == defaultDest ) | 69 | if ( dit->getDestinationName() == defaultDest ) |
69 | defIndex = i; | 70 | defIndex = i; |
70 | } | 71 | } |
71 | 72 | ||
72 | destination->setCurrentItem( defIndex ); | 73 | destination->setCurrentItem( defIndex ); |
73 | 74 | ||
74 | vector<InstallData>::iterator it; | 75 | vector<InstallData>::iterator it; |
75 | // setup package data | 76 | // setup package data |
76 | QString remove = "Remove\n"; | 77 | QString remove = "Remove\n"; |
77 | QString install = "\nInstall\n"; | 78 | QString install = "\nInstall\n"; |
78 | QString upgrade = "\nUpgrade\n"; | 79 | QString upgrade = "\nUpgrade\n"; |
79 | for ( it = packageList.begin() ; it != packageList.end() ; ++it ) | 80 | for ( it = packageList.begin() ; it != packageList.end() ; ++it ) |
80 | { | 81 | { |
81 | InstallData item = *it; | 82 | InstallData item = *it; |
82 | if ( item.option == "I" ) | 83 | if ( item.option == "I" ) |
83 | { | 84 | { |
84 | installList.push_back( item ); | 85 | installList.push_back( item ); |
85 | install += " " + item.packageName + "\n"; | 86 | install += " " + item.packageName + "\n"; |
86 | } | 87 | } |
87 | else if ( item.option == "D" ) | 88 | else if ( item.option == "D" ) |
88 | { | 89 | { |
89 | removeList.push_back( item ); | 90 | removeList.push_back( item ); |
90 | remove += " " + item.packageName + "\n"; | 91 | remove += " " + item.packageName + "\n"; |
91 | } | 92 | } |
92 | else if ( item.option == "U" || item.option == "R" ) | 93 | else if ( item.option == "U" || item.option == "R" ) |
93 | { | 94 | { |
94 | updateList.push_back( item ); | 95 | updateList.push_back( item ); |
95 | QString type = " (Upgrade)"; | 96 | QString type = " (Upgrade)"; |
96 | if ( item.option == "R" ) | 97 | if ( item.option == "R" ) |
97 | type = " (ReInstall)"; | 98 | type = " (ReInstall)"; |
98 | upgrade += " " + item.packageName + type + "\n"; | 99 | upgrade += " " + item.packageName + type + "\n"; |
99 | } | 100 | } |
100 | } | 101 | } |
101 | 102 | ||
102 | output->setText( remove + install + upgrade ); | 103 | output->setText( remove + install + upgrade ); |
103 | } | 104 | } |
104 | 105 | ||
105 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) | 106 | InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl ) |
106 | : InstallDlg( parent, name, modal, fl ) | 107 | : InstallDlg( parent, name, modal, fl ) |
107 | { | 108 | { |
108 | pIpkg = ipkg; | 109 | pIpkg = ipkg; |
109 | output->setText( initialText ); | 110 | output->setText( initialText ); |
110 | } | 111 | } |
111 | 112 | ||
112 | 113 | ||
113 | InstallDlgImpl::~InstallDlgImpl() | 114 | InstallDlgImpl::~InstallDlgImpl() |
114 | { | 115 | { |
115 | } | 116 | } |
116 | 117 | ||
117 | bool InstallDlgImpl :: showDlg() | 118 | bool InstallDlgImpl :: showDlg() |
118 | { | 119 | { |
119 | showMaximized(); | 120 | showMaximized(); |
120 | bool ret = exec(); | 121 | bool ret = exec(); |
121 | 122 | ||
122 | return ret; | 123 | return ret; |
123 | } | 124 | } |
124 | 125 | ||
125 | void InstallDlgImpl :: optionsSelected() | 126 | void InstallDlgImpl :: optionsSelected() |
126 | { | 127 | { |
127 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); | 128 | InstallOptionsDlgImpl opt( flags, this, "Option", true ); |
128 | opt.exec(); | 129 | opt.exec(); |
129 | 130 | ||
130 | // set options selected from dialog | 131 | // set options selected from dialog |
131 | flags = 0; | 132 | flags = opt.getFlags(); |
132 | if ( opt.forceDepends->isChecked() ) | ||
133 | flags |= FORCE_DEPENDS; | ||
134 | if ( opt.forceReinstall->isChecked() ) | ||
135 | flags |= FORCE_REINSTALL; | ||
136 | if ( opt.forceRemove->isChecked() ) | ||
137 | flags |= FORCE_REMOVE; | ||
138 | if ( opt.forceOverwrite->isChecked() ) | ||
139 | flags |= FORCE_OVERWRITE; | ||
140 | 133 | ||
141 | #ifdef QWS | 134 | #ifdef QWS |
142 | Config cfg( "aqpkg" ); | 135 | Config cfg( "aqpkg" ); |
143 | cfg.setGroup( "settings" ); | 136 | cfg.setGroup( "settings" ); |
144 | cfg.writeEntry( "installFlags", flags ); | 137 | cfg.writeEntry( "installFlags", flags ); |
145 | #endif | 138 | #endif |
146 | } | 139 | } |
147 | 140 | ||
148 | void InstallDlgImpl :: installSelected() | 141 | void InstallDlgImpl :: installSelected() |
149 | { | 142 | { |
150 | if ( btnInstall->text() == "Close" ) | 143 | |
151 | { | 144 | if ( btnInstall->text() == "Close" ) |
152 | done( 1 ); | 145 | { |
153 | return; | 146 | done( 1 ); |
154 | } | 147 | return; |
148 | } | ||
155 | 149 | ||
156 | btnInstall->setEnabled( false ); | 150 | // Disable buttons |
151 | btnOptions->setEnabled( false ); | ||
152 | btnInstall->setEnabled( false ); | ||
157 | 153 | ||
158 | if ( pIpkg ) | 154 | if ( pIpkg ) |
159 | { | 155 | { |
160 | output->setText( "" ); | 156 | output->setText( "" ); |
161 | 157 | ||
162 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); | 158 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); |
163 | pIpkg->runIpkg(); | 159 | pIpkg->runIpkg(); |
164 | } | 160 | } |
165 | else | 161 | else |
166 | { | 162 | { |
167 | output->setText( "" ); | 163 | output->setText( "" ); |
168 | vector<Destination>::iterator d = dataMgr->getDestination( destination->currentText() ); | 164 | vector<Destination>::iterator d = dataMgr->getDestination( destination->currentText() ); |
169 | QString dest = d->getDestinationName(); | 165 | QString dest = d->getDestinationName(); |
170 | QString destDir = d->getDestinationPath(); | 166 | QString destDir = d->getDestinationPath(); |
171 | int instFlags = flags; | 167 | int instFlags = flags; |
172 | if ( d->linkToRoot() ) | 168 | if ( d->linkToRoot() ) |
173 | instFlags |= MAKE_LINKS; | 169 | instFlags |= MAKE_LINKS; |
174 | 170 | ||
175 | #ifdef QWS | 171 | #ifdef QWS |
176 | // Save settings | 172 | // Save settings |
177 | Config cfg( "aqpkg" ); | 173 | Config cfg( "aqpkg" ); |
178 | cfg.setGroup( "settings" ); | 174 | cfg.setGroup( "settings" ); |
179 | cfg.writeEntry( "dest", dest ); | 175 | cfg.writeEntry( "dest", dest ); |
180 | #endif | 176 | #endif |
181 | 177 | ||
182 | pIpkg = new Ipkg; | 178 | pIpkg = new Ipkg; |
183 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); | 179 | connect( pIpkg, SIGNAL(outputText(const QString &)), this, SLOT(displayText(const QString &))); |
184 | 180 | ||
185 | // First run through the remove list, then the install list then the upgrade list | 181 | // First run through the remove list, then the install list then the upgrade list |
186 | vector<InstallData>::iterator it; | 182 | vector<InstallData>::iterator it; |
187 | pIpkg->setOption( "remove" ); | 183 | pIpkg->setOption( "remove" ); |
188 | for ( it = removeList.begin() ; it != removeList.end() ; ++it ) | 184 | for ( it = removeList.begin() ; it != removeList.end() ; ++it ) |
189 | { | 185 | { |
190 | pIpkg->setDestination( it->destination->getDestinationName() ); | 186 | pIpkg->setDestination( it->destination->getDestinationName() ); |
191 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); | 187 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); |
192 | pIpkg->setPackage( it->packageName ); | 188 | pIpkg->setPackage( it->packageName ); |
193 | 189 | ||
194 | int tmpFlags = flags; | 190 | int tmpFlags = flags; |
195 | if ( it->destination->linkToRoot() ) | 191 | if ( it->destination->linkToRoot() ) |
196 | tmpFlags |= MAKE_LINKS; | 192 | tmpFlags |= MAKE_LINKS; |
197 | 193 | ||
198 | pIpkg->setFlags( tmpFlags ); | 194 | pIpkg->setFlags( tmpFlags ); |
199 | pIpkg->runIpkg(); | 195 | pIpkg->runIpkg(); |
200 | } | 196 | } |
201 | 197 | ||
202 | pIpkg->setOption( "install" ); | 198 | pIpkg->setOption( "install" ); |
203 | pIpkg->setDestination( dest ); | 199 | pIpkg->setDestination( dest ); |
204 | pIpkg->setDestinationDir( destDir ); | 200 | pIpkg->setDestinationDir( destDir ); |
205 | pIpkg->setFlags( instFlags ); | 201 | pIpkg->setFlags( instFlags ); |
206 | for ( it = installList.begin() ; it != installList.end() ; ++it ) | 202 | for ( it = installList.begin() ; it != installList.end() ; ++it ) |
207 | { | 203 | { |
208 | pIpkg->setPackage( it->packageName ); | 204 | pIpkg->setPackage( it->packageName ); |
209 | pIpkg->runIpkg(); | 205 | pIpkg->runIpkg(); |
210 | } | 206 | } |
211 | 207 | ||
212 | flags |= FORCE_REINSTALL; | 208 | flags |= FORCE_REINSTALL; |
213 | for ( it = updateList.begin() ; it != updateList.end() ; ++it ) | 209 | for ( it = updateList.begin() ; it != updateList.end() ; ++it ) |
214 | { | 210 | { |
215 | if ( it->option == "R" ) | 211 | if ( it->option == "R" ) |
216 | pIpkg->setOption( "reinstall" ); | 212 | pIpkg->setOption( "reinstall" ); |
217 | else | 213 | else |
218 | pIpkg->setOption( "upgrade" ); | 214 | pIpkg->setOption( "upgrade" ); |
219 | pIpkg->setDestination( it->destination->getDestinationName() ); | 215 | pIpkg->setDestination( it->destination->getDestinationName() ); |
220 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); | 216 | pIpkg->setDestinationDir( it->destination->getDestinationPath() ); |
221 | pIpkg->setPackage( it->packageName ); | 217 | pIpkg->setPackage( it->packageName ); |
222 | 218 | ||
223 | int tmpFlags = flags; | 219 | int tmpFlags = flags; |
224 | if ( it->destination->linkToRoot() && it->recreateLinks ) | 220 | if ( it->destination->linkToRoot() && it->recreateLinks ) |
225 | tmpFlags |= MAKE_LINKS; | 221 | tmpFlags |= MAKE_LINKS; |
226 | pIpkg->setFlags( tmpFlags ); | 222 | pIpkg->setFlags( tmpFlags ); |
227 | pIpkg->runIpkg(); | 223 | pIpkg->runIpkg(); |
228 | } | 224 | } |
229 | 225 | ||
230 | delete pIpkg; | 226 | delete pIpkg; |
231 | } | 227 | } |
232 | 228 | ||
233 | btnInstall->setEnabled( true ); | 229 | btnOptions->setEnabled( true ); |
230 | btnInstall->setEnabled( true ); | ||
234 | btnInstall->setText( tr( "Close" ) ); | 231 | btnInstall->setText( tr( "Close" ) ); |
235 | } | 232 | } |
236 | 233 | ||
237 | void InstallDlgImpl :: displayText(const QString &text ) | 234 | void InstallDlgImpl :: displayText(const QString &text ) |
238 | { | 235 | { |
239 | QString t = output->text() + "\n" + text; | 236 | QString t = output->text() + "\n" + text; |
240 | output->setText( t ); | 237 | output->setText( t ); |
241 | output->setCursorPosition( output->numLines(), 0 ); | 238 | output->setCursorPosition( output->numLines(), 0 ); |
242 | } | 239 | } |
diff --git a/noncore/settings/aqpkg/instoptions.ui b/noncore/settings/aqpkg/instoptions.ui index 52897dd..00eab1e 100644 --- a/noncore/settings/aqpkg/instoptions.ui +++ b/noncore/settings/aqpkg/instoptions.ui | |||
@@ -1,155 +1,167 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>InstallOptionsDlg</class> | 2 | <class>InstallOptionsDlg</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>InstallOptionsDlg</cstring> | 7 | <cstring>InstallOptionsDlg</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>154</width> | 14 | <width>283</width> |
15 | <height>205</height> | 15 | <height>274</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Options</string> | 20 | <string>Options</string> |
21 | </property> | 21 | </property> |
22 | <property stdset="1"> | 22 | <property stdset="1"> |
23 | <name>sizeGripEnabled</name> | 23 | <name>sizeGripEnabled</name> |
24 | <bool>false</bool> | 24 | <bool>false</bool> |
25 | </property> | 25 | </property> |
26 | <widget> | 26 | <vbox> |
27 | <class>QGroupBox</class> | ||
28 | <property stdset="1"> | 27 | <property stdset="1"> |
29 | <name>name</name> | 28 | <name>margin</name> |
30 | <cstring>GroupBox1</cstring> | 29 | <number>11</number> |
31 | </property> | 30 | </property> |
32 | <property stdset="1"> | 31 | <property stdset="1"> |
33 | <name>geometry</name> | 32 | <name>spacing</name> |
34 | <rect> | 33 | <number>6</number> |
35 | <x>11</x> | ||
36 | <y>11</y> | ||
37 | <width>136</width> | ||
38 | <height>120</height> | ||
39 | </rect> | ||
40 | </property> | ||
41 | <property stdset="1"> | ||
42 | <name>title</name> | ||
43 | <string>Options</string> | ||
44 | </property> | 34 | </property> |
45 | <widget> | 35 | <widget> |
46 | <class>QCheckBox</class> | 36 | <class>QGroupBox</class> |
47 | <property stdset="1"> | 37 | <property stdset="1"> |
48 | <name>name</name> | 38 | <name>name</name> |
49 | <cstring>forceDepends</cstring> | 39 | <cstring>GroupBox1</cstring> |
50 | </property> | 40 | </property> |
51 | <property stdset="1"> | 41 | <property stdset="1"> |
52 | <name>geometry</name> | 42 | <name>title</name> |
53 | <rect> | 43 | <string>Options</string> |
54 | <x>11</x> | ||
55 | <y>19</y> | ||
56 | <width>114</width> | ||
57 | <height>19</height> | ||
58 | </rect> | ||
59 | </property> | ||
60 | <property stdset="1"> | ||
61 | <name>text</name> | ||
62 | <string>Force Depends</string> | ||
63 | </property> | 44 | </property> |
45 | <widget> | ||
46 | <class>QCheckBox</class> | ||
47 | <property stdset="1"> | ||
48 | <name>name</name> | ||
49 | <cstring>forceDepends</cstring> | ||
50 | </property> | ||
51 | <property stdset="1"> | ||
52 | <name>geometry</name> | ||
53 | <rect> | ||
54 | <x>12</x> | ||
55 | <y>20</y> | ||
56 | <width>110</width> | ||
57 | <height>19</height> | ||
58 | </rect> | ||
59 | </property> | ||
60 | <property stdset="1"> | ||
61 | <name>text</name> | ||
62 | <string>Force Depends</string> | ||
63 | </property> | ||
64 | </widget> | ||
65 | <widget> | ||
66 | <class>QCheckBox</class> | ||
67 | <property stdset="1"> | ||
68 | <name>name</name> | ||
69 | <cstring>forceReinstall</cstring> | ||
70 | </property> | ||
71 | <property stdset="1"> | ||
72 | <name>geometry</name> | ||
73 | <rect> | ||
74 | <x>12</x> | ||
75 | <y>45</y> | ||
76 | <width>107</width> | ||
77 | <height>19</height> | ||
78 | </rect> | ||
79 | </property> | ||
80 | <property stdset="1"> | ||
81 | <name>text</name> | ||
82 | <string>Force Reinstall</string> | ||
83 | </property> | ||
84 | </widget> | ||
85 | <widget> | ||
86 | <class>QCheckBox</class> | ||
87 | <property stdset="1"> | ||
88 | <name>name</name> | ||
89 | <cstring>forceRemove</cstring> | ||
90 | </property> | ||
91 | <property stdset="1"> | ||
92 | <name>geometry</name> | ||
93 | <rect> | ||
94 | <x>12</x> | ||
95 | <y>70</y> | ||
96 | <width>105</width> | ||
97 | <height>19</height> | ||
98 | </rect> | ||
99 | </property> | ||
100 | <property stdset="1"> | ||
101 | <name>text</name> | ||
102 | <string>Force Remove</string> | ||
103 | </property> | ||
104 | </widget> | ||
105 | <widget> | ||
106 | <class>QCheckBox</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>forceOverwrite</cstring> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>geometry</name> | ||
113 | <rect> | ||
114 | <x>12</x> | ||
115 | <y>95</y> | ||
116 | <width>114</width> | ||
117 | <height>19</height> | ||
118 | </rect> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>text</name> | ||
122 | <string>Force Overwrite</string> | ||
123 | </property> | ||
124 | </widget> | ||
125 | <widget> | ||
126 | <class>QCheckBox</class> | ||
127 | <property stdset="1"> | ||
128 | <name>name</name> | ||
129 | <cstring>verboseWget</cstring> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>geometry</name> | ||
133 | <rect> | ||
134 | <x>12</x> | ||
135 | <y>120</y> | ||
136 | <width>104</width> | ||
137 | <height>19</height> | ||
138 | </rect> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>text</name> | ||
142 | <string>Verbose WGet</string> | ||
143 | </property> | ||
144 | </widget> | ||
64 | </widget> | 145 | </widget> |
65 | <widget> | 146 | <widget> |
66 | <class>QCheckBox</class> | 147 | <class>QPushButton</class> |
67 | <property stdset="1"> | 148 | <property stdset="1"> |
68 | <name>name</name> | 149 | <name>name</name> |
69 | <cstring>forceReinstall</cstring> | 150 | <cstring>btnOK</cstring> |
70 | </property> | ||
71 | <property stdset="1"> | ||
72 | <name>geometry</name> | ||
73 | <rect> | ||
74 | <x>11</x> | ||
75 | <y>44</y> | ||
76 | <width>114</width> | ||
77 | <height>19</height> | ||
78 | </rect> | ||
79 | </property> | ||
80 | <property stdset="1"> | ||
81 | <name>text</name> | ||
82 | <string>Force Reinstall</string> | ||
83 | </property> | ||
84 | </widget> | ||
85 | <widget> | ||
86 | <class>QCheckBox</class> | ||
87 | <property stdset="1"> | ||
88 | <name>name</name> | ||
89 | <cstring>forceOverwrite</cstring> | ||
90 | </property> | ||
91 | <property stdset="1"> | ||
92 | <name>geometry</name> | ||
93 | <rect> | ||
94 | <x>11</x> | ||
95 | <y>94</y> | ||
96 | <width>114</width> | ||
97 | <height>19</height> | ||
98 | </rect> | ||
99 | </property> | 151 | </property> |
100 | <property stdset="1"> | 152 | <property stdset="1"> |
101 | <name>text</name> | 153 | <name>text</name> |
102 | <string>Force Overwrite</string> | 154 | <string>OK</string> |
103 | </property> | 155 | </property> |
104 | </widget> | 156 | </widget> |
105 | <widget> | 157 | </vbox> |
106 | <class>QCheckBox</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>forceRemove</cstring> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>geometry</name> | ||
113 | <rect> | ||
114 | <x>11</x> | ||
115 | <y>69</y> | ||
116 | <width>114</width> | ||
117 | <height>19</height> | ||
118 | </rect> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>text</name> | ||
122 | <string>Force Remove</string> | ||
123 | </property> | ||
124 | </widget> | ||
125 | </widget> | ||
126 | <widget> | ||
127 | <class>QPushButton</class> | ||
128 | <property stdset="1"> | ||
129 | <name>name</name> | ||
130 | <cstring>btnOK</cstring> | ||
131 | </property> | ||
132 | <property stdset="1"> | ||
133 | <name>geometry</name> | ||
134 | <rect> | ||
135 | <x>11</x> | ||
136 | <y>166</y> | ||
137 | <width>136</width> | ||
138 | <height>28</height> | ||
139 | </rect> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>text</name> | ||
143 | <string>OK</string> | ||
144 | </property> | ||
145 | </widget> | ||
146 | </widget> | 158 | </widget> |
147 | <connections> | 159 | <connections> |
148 | <connection> | 160 | <connection> |
149 | <sender>btnOK</sender> | 161 | <sender>btnOK</sender> |
150 | <signal>clicked()</signal> | 162 | <signal>clicked()</signal> |
151 | <receiver>InstallOptionsDlg</receiver> | 163 | <receiver>InstallOptionsDlg</receiver> |
152 | <slot>accept()</slot> | 164 | <slot>accept()</slot> |
153 | </connection> | 165 | </connection> |
154 | </connections> | 166 | </connections> |
155 | </UI> | 167 | </UI> |
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp index dd996e0..3a37eec 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.cpp +++ b/noncore/settings/aqpkg/instoptionsimpl.cpp | |||
@@ -1,49 +1,70 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | instoptionsimpl.cpp - description | 2 | instoptionsimpl.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 2002 | 4 | begin : Mon Aug 26 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <qpe/config.h> | 19 | #include <qpe/config.h> |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #include <qdialog.h> | 22 | #include <qdialog.h> |
23 | #include <qcheckbox.h> | 23 | #include <qcheckbox.h> |
24 | 24 | ||
25 | #include "instoptionsimpl.h" | 25 | #include "instoptionsimpl.h" |
26 | #include "ipkg.h" | 26 | #include "ipkg.h" |
27 | #include "global.h" | 27 | #include "global.h" |
28 | 28 | ||
29 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl ) | 29 | InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, QWidget * parent, const char* name, bool modal, WFlags fl ) |
30 | : InstallOptionsDlg( parent, name, modal, fl ) | 30 | : InstallOptionsDlg( parent, name, modal, fl ) |
31 | { | 31 | { |
32 | if ( flags & FORCE_DEPENDS ) | 32 | if ( flags & FORCE_DEPENDS ) |
33 | forceDepends->setChecked( true ); | 33 | forceDepends->setChecked( true ); |
34 | if ( flags & FORCE_REINSTALL ) | 34 | if ( flags & FORCE_REINSTALL ) |
35 | forceReinstall->setChecked( true ); | 35 | forceReinstall->setChecked( true ); |
36 | if ( flags & FORCE_REMOVE ) | 36 | if ( flags & FORCE_REMOVE ) |
37 | forceRemove->setChecked( true ); | 37 | forceRemove->setChecked( true ); |
38 | if ( flags & FORCE_OVERWRITE ) | 38 | if ( flags & FORCE_OVERWRITE ) |
39 | forceOverwrite->setChecked( true ); | 39 | forceOverwrite->setChecked( true ); |
40 | if ( flags & VERBOSE_WGET ) | ||
41 | verboseWget->setChecked( true ); | ||
40 | // if ( flags & MAKE_LINKS ) | 42 | // if ( flags & MAKE_LINKS ) |
41 | // makeLinks->setChecked( true ); | 43 | // makeLinks->setChecked( true ); |
42 | 44 | ||
43 | showMaximized(); | 45 | showMaximized(); |
44 | 46 | ||
45 | } | 47 | } |
46 | 48 | ||
47 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() | 49 | InstallOptionsDlgImpl::~InstallOptionsDlgImpl() |
48 | { | 50 | { |
49 | } | 51 | } |
52 | |||
53 | |||
54 | int InstallOptionsDlgImpl :: getFlags() | ||
55 | { | ||
56 | int flags = 0; | ||
57 | |||
58 | if ( forceDepends->isChecked() ) | ||
59 | flags |= FORCE_DEPENDS; | ||
60 | if ( forceReinstall->isChecked() ) | ||
61 | flags |= FORCE_REINSTALL; | ||
62 | if ( forceRemove->isChecked() ) | ||
63 | flags |= FORCE_REMOVE; | ||
64 | if ( forceOverwrite->isChecked() ) | ||
65 | flags |= FORCE_OVERWRITE; | ||
66 | if ( verboseWget->isChecked() ) | ||
67 | flags |= VERBOSE_WGET; | ||
68 | |||
69 | return flags; | ||
70 | } \ No newline at end of file | ||
diff --git a/noncore/settings/aqpkg/instoptionsimpl.h b/noncore/settings/aqpkg/instoptionsimpl.h index 08ec616..893f9bb 100644 --- a/noncore/settings/aqpkg/instoptionsimpl.h +++ b/noncore/settings/aqpkg/instoptionsimpl.h | |||
@@ -1,33 +1,34 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | installoptionsimpl.h - description | 2 | installoptionsimpl.h - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 2002 | 4 | begin : Mon Aug 26 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | #ifndef INSTALLOPTIONSIMPL_H | 17 | #ifndef INSTALLOPTIONSIMPL_H |
18 | #define INSTALLOPTIONSIMPL_H | 18 | #define INSTALLOPTIONSIMPL_H |
19 | 19 | ||
20 | #include "instoptions.h" | 20 | #include "instoptions.h" |
21 | 21 | ||
22 | class InstallOptionsDlgImpl : public InstallOptionsDlg | 22 | class InstallOptionsDlgImpl : public InstallOptionsDlg |
23 | { | 23 | { |
24 | public: | 24 | public: |
25 | InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); | 25 | InstallOptionsDlgImpl( int flags, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 ); |
26 | ~InstallOptionsDlgImpl(); | 26 | ~InstallOptionsDlgImpl(); |
27 | int getFlags(); | ||
27 | 28 | ||
28 | protected: | 29 | protected: |
29 | 30 | ||
30 | private: | 31 | private: |
31 | }; | 32 | }; |
32 | 33 | ||
33 | #endif | 34 | #endif |