-rw-r--r-- | noncore/unsupported/oipkg/TODO | 6 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/main.cpp | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 26 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/oipkg.pro | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.cpp | 7 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelist.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pksettingsbase.ui | 8 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 178 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 18 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/runwindow.ui | 4 |
12 files changed, 157 insertions, 104 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO index 714baa4..d81e873 100644 --- a/noncore/unsupported/oipkg/TODO +++ b/noncore/unsupported/oipkg/TODO | |||
@@ -1,8 +1,10 @@ | |||
1 | * search | 1 | * search |
2 | * parse "to install" and "to remove" from status | ||
3 | * Settings Class | 2 | * Settings Class |
3 | * make oipkg determine dest of "to remove" apps | ||
4 | * tr() ;) | ||
4 | * Dialog to display ipkg output live | 5 | * Dialog to display ipkg output live |
6 | * parse "to install" and "to remove" from status | ||
5 | * install local file | 7 | * install local file |
6 | * make oipkg determine dest of to remove apps | 8 | * install to dest with click on packet |
7 | * error handling | 9 | * error handling |
8 | * manage links | 10 | * manage links |
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp index 264fd55..4af59b0 100644 --- a/noncore/unsupported/oipkg/main.cpp +++ b/noncore/unsupported/oipkg/main.cpp | |||
@@ -1,19 +1,19 @@ | |||
1 | 1 | ||
2 | #include "mainwindow.h" | 2 | #include "mainwindow.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | int debugLevel; | 6 | int debugLevel; |
7 | 7 | ||
8 | int main( int argc, char ** argv ) | 8 | int main( int argc, char ** argv ) |
9 | { | 9 | { |
10 | debugLevel = 1; | 10 | debugLevel = 2; |
11 | if (argc > 2) | 11 | if (argc > 0) |
12 | { | 12 | { |
13 | debugLevel = QString ( argv[1] ).toInt(); | 13 | debugLevel = QString ( argv[1] ).toInt(); |
14 | } | 14 | } |
15 | QPEApplication a( argc, argv ); | 15 | QPEApplication a( argc, argv ); |
16 | MainWindow mw; | 16 | MainWindow mw; |
17 | a.showMainDocumentWidget( &mw ); | 17 | a.showMainDocumentWidget( &mw ); |
18 | return a.exec(); | 18 | return a.exec(); |
19 | } | 19 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index b485a03..cb2b4cd 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,264 +1,272 @@ | |||
1 | // adadpted form qpe/qipkg | 1 | // adadpted form qpe/qipkg |
2 | 2 | ||
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | 5 | ||
6 | #include <qpe/qpemenubar.h> | 6 | #include <qpe/qpemenubar.h> |
7 | #include <qpe/qpemessagebox.h> | 7 | #include <qpe/qpemessagebox.h> |
8 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
9 | #include <qpe/qpetoolbar.h> | 9 | #include <qpe/qpetoolbar.h> |
10 | #include <qaction.h> | 10 | #include <qaction.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | #include <qpopupmenu.h> | 12 | #include <qpopupmenu.h> |
13 | #include <qtoolbutton.h> | 13 | #include <qtoolbutton.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qlistview.h> | 15 | #include <qlistview.h> |
16 | #include <qtextview.h> | 16 | #include <qtextview.h> |
17 | #include <qtabwidget.h> | 17 | #include <qtabwidget.h> |
18 | #include <qcombobox.h> | 18 | #include <qcombobox.h> |
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | 20 | ||
21 | #include "pksettingsbase.h" | 21 | #include "pksettingsbase.h" |
22 | #include "packagelistitem.h" | 22 | #include "packagelistitem.h" |
23 | 23 | ||
24 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 24 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
25 | QMainWindow( parent, name, f ) | 25 | QMainWindow( parent, name, f ) |
26 | { | 26 | { |
27 | setCaption( tr("Package Manager") ); | 27 | setCaption( tr("Package Manager") ); |
28 | table = new PackageWindow( this,0,0 ); | 28 | table = new PackageWindow( this,0,0 ); |
29 | setCentralWidget( table ); | 29 | setCentralWidget( table ); |
30 | makeMenu(); | 30 | makeMenu(); |
31 | 31 | ||
32 | QFontMetrics fm = fontMetrics(); | 32 | QFontMetrics fm = fontMetrics(); |
33 | int w0 = fm.width(tr("Package"))+30; | 33 | int w0 = fm.width(tr("Package"))+30; |
34 | int w2 = fm.width("00000")+4; | 34 | int w2 = fm.width("00000")+4; |
35 | table->ListViewPackages->setColumnWidth(0,w0); | 35 | table->ListViewPackages->setColumnWidth(0,w0); |
36 | table->ListViewPackages->setColumnWidth(1,228-w2-w0); // ### screen-biased | 36 | table->ListViewPackages->setColumnWidth(1,228-w2-w0); // ### screen-biased |
37 | table->ListViewPackages->setColumnWidth(2,w2); | 37 | table->ListViewPackages->setColumnWidth(2,w2); |
38 | table->ListViewPackages->setColumnWidthMode(0,QListView::Manual); | 38 | table->ListViewPackages->setColumnWidthMode(0,QListView::Manual); |
39 | table->ListViewPackages->setColumnWidthMode(1,QListView::Manual); | 39 | table->ListViewPackages->setColumnWidthMode(1,QListView::Manual); |
40 | table->ListViewPackages->setColumnWidthMode(2,QListView::Manual); | 40 | table->ListViewPackages->setColumnWidthMode(2,QListView::Manual); |
41 | table->ListViewPackages->setSelectionMode( QListView::Multi ); | 41 | table->ListViewPackages->setSelectionMode( QListView::Multi ); |
42 | 42 | ||
43 | connect( table->section, SIGNAL( activated(int) ), | 43 | connect( table->section, SIGNAL( activated(int) ), |
44 | this, SLOT( sectionChanged() ) ); | 44 | this, SLOT( sectionChanged() ) ); |
45 | connect( table->subsection, SIGNAL(activated(int) ), | 45 | connect( table->subsection, SIGNAL(activated(int) ), |
46 | this, SLOT( subSectionChanged() ) ); | 46 | this, SLOT( subSectionChanged() ) ); |
47 | connect( table->ListViewPackages, SIGNAL( clicked( QListViewItem* ) ), | 47 | connect( table->ListViewPackages, SIGNAL( clicked( QListViewItem* ) ), |
48 | this, SLOT( setCurrent( QListViewItem* ) ) ); | 48 | this, SLOT( setCurrent( QListViewItem* ) ) ); |
49 | 49 | ||
50 | settings = new PackageManagerSettings(this,0,TRUE); | 50 | settings = new PackageManagerSettings(this,0,TRUE); |
51 | 51 | ||
52 | ipkg = new PmIpkg( settings, this ); | 52 | ipkg = new PmIpkg( settings, this ); |
53 | packageList.setSettings( settings ); | 53 | packageList.setSettings( settings ); |
54 | newList(); | 54 | getList(); |
55 | setSections(); | 55 | setSections(); |
56 | setSubSections(); | 56 | setSubSections(); |
57 | displayList(); | 57 | displayList(); |
58 | } | 58 | } |
59 | 59 | ||
60 | void MainWindow::makeMenu() | 60 | void MainWindow::makeMenu() |
61 | { | 61 | { |
62 | 62 | ||
63 | QPEToolBar *toolBar = new QPEToolBar( this ); | 63 | QPEToolBar *toolBar = new QPEToolBar( this ); |
64 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 64 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
65 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 65 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
66 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 66 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
67 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 67 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
68 | 68 | ||
69 | //#define TOOLBAR | ||
70 | #ifdef TOOLBAR | ||
71 | QPEToolBar *secBar = new QPEToolBar( this ); | ||
72 | QComboBox *sections = new QComboBox( false, this ); | ||
73 | secBar->addTo( sections ); | ||
74 | #endif | ||
75 | |||
69 | contextMenu = new QPopupMenu( this ); | 76 | contextMenu = new QPopupMenu( this ); |
70 | 77 | ||
71 | setToolBarsMovable( false ); | 78 | setToolBarsMovable( false ); |
72 | toolBar->setHorizontalStretchable( true ); | 79 | toolBar->setHorizontalStretchable( true ); |
73 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 80 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
74 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 81 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
75 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 82 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
76 | 83 | ||
77 | toolBar->setStretchableWidget (srvMenu); | 84 | toolBar->setStretchableWidget (srvMenu); |
78 | 85 | ||
79 | 86 | ||
80 | runAction = new QAction( tr( "Run" ), | 87 | runAction = new QAction( tr( "Run" ), |
81 | Resource::loadPixmap( "oipkg/install" ), | 88 | Resource::loadPixmap( "oipkg/install" ), |
82 | QString::null, 0, this, 0 ); | 89 | QString::null, 0, this, 0 ); |
83 | connect( runAction, SIGNAL( activated() ), | 90 | connect( runAction, SIGNAL( activated() ), |
84 | this, SLOT( runIpkg() ) ); | 91 | this, SLOT( runIpkg() ) ); |
85 | runAction->addTo( toolBar ); | 92 | runAction->addTo( toolBar ); |
86 | runAction->addTo( srvMenu ); | 93 | runAction->addTo( srvMenu ); |
87 | 94 | ||
88 | srvMenu->insertSeparator (); | 95 | srvMenu->insertSeparator (); |
89 | 96 | ||
90 | updateAction = new QAction( tr( "Update" ), | 97 | updateAction = new QAction( tr( "Update" ), |
91 | Resource::loadIconSet( "oipkg/repeat" ), | 98 | Resource::loadIconSet( "oipkg/repeat" ), |
92 | QString::null, 0, this, 0 ); | 99 | QString::null, 0, this, 0 ); |
93 | connect( updateAction, SIGNAL( activated() ), | 100 | connect( updateAction, SIGNAL( activated() ), |
94 | this , SLOT( updateList() ) ); | 101 | this , SLOT( updateList() ) ); |
95 | updateAction->addTo( toolBar ); | 102 | updateAction->addTo( toolBar ); |
96 | updateAction->addTo( srvMenu ); | 103 | updateAction->addTo( srvMenu ); |
97 | 104 | ||
98 | // detailsAction = new QAction( tr( "Details" ), | 105 | // detailsAction = new QAction( tr( "Details" ), |
99 | // Resource::loadIconSet( "oipkg/details" ), | 106 | // Resource::loadIconSet( "oipkg/details" ), |
100 | // QString::null, 0, this, 0 ); | 107 | // QString::null, 0, this, 0 ); |
101 | // connect( detailsAction, SIGNAL( activated() ), | 108 | // connect( detailsAction, SIGNAL( activated() ), |
102 | // this , SLOT( showDetails() ) ); | 109 | // this , SLOT( showDetails() ) ); |
103 | // detailsAction->addTo( toolBar ); | 110 | // detailsAction->addTo( toolBar ); |
104 | // detailsAction->addTo( srvMenu ); | 111 | // detailsAction->addTo( srvMenu ); |
105 | 112 | ||
106 | QAction *cfgact; | 113 | QAction *cfgact; |
107 | 114 | ||
108 | cfgact = new QAction( tr( "Setups" ), | 115 | cfgact = new QAction( tr( "Setups" ), |
109 | Resource::loadIconSet( "" ), | 116 | Resource::loadIconSet( "" ), |
110 | QString::null, 0, this, 0 ); | 117 | QString::null, 0, this, 0 ); |
111 | connect( cfgact, SIGNAL( activated() ), | 118 | connect( cfgact, SIGNAL( activated() ), |
112 | SLOT( showSettings() ) ); | 119 | SLOT( showSettings() ) ); |
113 | cfgact->addTo( cfgMenu ); | 120 | cfgact->addTo( cfgMenu ); |
114 | 121 | ||
115 | cfgact = new QAction( tr( "Servers" ), | 122 | cfgact = new QAction( tr( "Servers" ), |
116 | Resource::loadIconSet( "" ), | 123 | Resource::loadIconSet( "" ), |
117 | QString::null, 0, this, 0 ); | 124 | QString::null, 0, this, 0 ); |
118 | connect( cfgact, SIGNAL( activated() ), | 125 | connect( cfgact, SIGNAL( activated() ), |
119 | SLOT( showSettingsSrv() ) ); | 126 | SLOT( showSettingsSrv() ) ); |
120 | cfgact->addTo( cfgMenu ); | 127 | cfgact->addTo( cfgMenu ); |
121 | cfgact = new QAction( tr( "Destinations" ), | 128 | cfgact = new QAction( tr( "Destinations" ), |
122 | Resource::loadIconSet( "" ), | 129 | Resource::loadIconSet( "" ), |
123 | QString::null, 0, this, 0 ); | 130 | QString::null, 0, this, 0 ); |
124 | connect( cfgact, SIGNAL( activated() ), | 131 | connect( cfgact, SIGNAL( activated() ), |
125 | SLOT( showSettingsDst() ) ); | 132 | SLOT( showSettingsDst() ) ); |
126 | cfgact->addTo( cfgMenu ); | 133 | cfgact->addTo( cfgMenu ); |
127 | 134 | ||
128 | } | 135 | } |
129 | 136 | ||
130 | MainWindow::~MainWindow() | 137 | MainWindow::~MainWindow() |
131 | { | 138 | { |
132 | } | 139 | } |
133 | 140 | ||
134 | void MainWindow::runIpkg() | 141 | void MainWindow::runIpkg() |
135 | { | 142 | { |
136 | ipkg->commit( packageList ); | 143 | ipkg->commit( packageList ); |
137 | ipkg->runIpkg("update"); | 144 | updateList(); |
138 | packageList.update(); | ||
139 | } | 145 | } |
140 | 146 | ||
141 | void MainWindow::updateList() | 147 | void MainWindow::updateList() |
142 | { | 148 | { |
143 | ipkg->runIpkg("update"); | 149 | // todo: packageList.clear(); |
144 | packageList.update(); | 150 | ipkg->update(); |
151 | getList(); | ||
145 | } | 152 | } |
146 | 153 | ||
147 | void MainWindow::newList() | 154 | void MainWindow::getList() |
148 | { | 155 | { |
149 | packageList.update(); | 156 | packageList.update(); |
157 | displayList(); | ||
150 | } | 158 | } |
151 | 159 | ||
152 | void MainWindow::filterList() | 160 | void MainWindow::filterList() |
153 | { | 161 | { |
154 | packageList.filterPackages(); | 162 | packageList.filterPackages(); |
155 | } | 163 | } |
156 | 164 | ||
157 | void MainWindow::displayList() | 165 | void MainWindow::displayList() |
158 | { | 166 | { |
159 | table->ListViewPackages->clear(); | 167 | table->ListViewPackages->clear(); |
160 | Package *pack = packageList.first(); | 168 | Package *pack = packageList.first(); |
161 | while( pack ) | 169 | while( pack ) |
162 | { | 170 | { |
163 | if ( pack && (pack->name() != "") ) | 171 | if ( pack && (pack->name() != "") ) |
164 | { | 172 | { |
165 | table->ListViewPackages->insertItem( | 173 | table->ListViewPackages->insertItem( |
166 | new PackageListItem( table->ListViewPackages, pack ) ); | 174 | new PackageListItem( table->ListViewPackages, pack ) ); |
167 | } | 175 | } |
168 | pack = packageList.next(); | 176 | pack = packageList.next(); |
169 | } | 177 | } |
170 | } | 178 | } |
171 | 179 | ||
172 | void MainWindow::sectionChanged() | 180 | void MainWindow::sectionChanged() |
173 | { | 181 | { |
174 | disconnect( table->section, SIGNAL( activated(int) ), | 182 | disconnect( table->section, SIGNAL( activated(int) ), |
175 | this, SLOT( sectionChanged() ) ); | 183 | this, SLOT( sectionChanged() ) ); |
176 | disconnect( table->subsection, SIGNAL(activated(int) ), | 184 | disconnect( table->subsection, SIGNAL(activated(int) ), |
177 | this, SLOT( subSectionChanged() ) ); | 185 | this, SLOT( subSectionChanged() ) ); |
178 | table->subsection->clear(); | 186 | table->subsection->clear(); |
179 | packageList.setSection( table->section->currentText() ); | 187 | packageList.setSection( table->section->currentText() ); |
180 | setSubSections(); | 188 | setSubSections(); |
181 | filterList(); | 189 | filterList(); |
182 | connect( table->section, SIGNAL( activated(int) ), | 190 | connect( table->section, SIGNAL( activated(int) ), |
183 | this, SLOT( sectionChanged() ) ); | 191 | this, SLOT( sectionChanged() ) ); |
184 | connect( table->subsection, SIGNAL(activated(int) ), | 192 | connect( table->subsection, SIGNAL(activated(int) ), |
185 | this, SLOT( subSectionChanged() ) ); | 193 | this, SLOT( subSectionChanged() ) ); |
186 | displayList(); | 194 | displayList(); |
187 | } | 195 | } |
188 | 196 | ||
189 | void MainWindow::subSectionChanged() | 197 | void MainWindow::subSectionChanged() |
190 | { | 198 | { |
191 | disconnect( table->section, SIGNAL( activated(int) ), | 199 | disconnect( table->section, SIGNAL( activated(int) ), |
192 | this, SLOT( sectionChanged() ) ); | 200 | this, SLOT( sectionChanged() ) ); |
193 | disconnect( table->subsection, SIGNAL(activated(int) ), | 201 | disconnect( table->subsection, SIGNAL(activated(int) ), |
194 | this, SLOT( subSectionChanged() ) ); | 202 | this, SLOT( subSectionChanged() ) ); |
195 | packageList.setSubSection( table->subsection->currentText() ); | 203 | packageList.setSubSection( table->subsection->currentText() ); |
196 | filterList(); | 204 | filterList(); |
197 | connect( table->section, SIGNAL( activated(int) ), | 205 | connect( table->section, SIGNAL( activated(int) ), |
198 | this, SLOT( sectionChanged() ) ); | 206 | this, SLOT( sectionChanged() ) ); |
199 | connect( table->subsection, SIGNAL(activated(int) ), | 207 | connect( table->subsection, SIGNAL(activated(int) ), |
200 | this, SLOT( subSectionChanged() ) ); | 208 | this, SLOT( subSectionChanged() ) ); |
201 | displayList(); | 209 | displayList(); |
202 | } | 210 | } |
203 | 211 | ||
204 | void MainWindow::setSections() | 212 | void MainWindow::setSections() |
205 | { | 213 | { |
206 | table->section->clear(); | 214 | table->section->clear(); |
207 | table->section->insertStringList( packageList.getSections() ); | 215 | table->section->insertStringList( packageList.getSections() ); |
208 | } | 216 | } |
209 | 217 | ||
210 | void MainWindow::setSubSections() | 218 | void MainWindow::setSubSections() |
211 | { | 219 | { |
212 | table->subsection->clear(); | 220 | table->subsection->clear(); |
213 | table->subsection->insertStringList( packageList.getSubSections() ); | 221 | table->subsection->insertStringList( packageList.getSubSections() ); |
214 | } | 222 | } |
215 | 223 | ||
216 | 224 | ||
217 | void MainWindow::showSettings() | 225 | void MainWindow::showSettings() |
218 | { | 226 | { |
219 | if ( settings->showDialog( 0 ) ) | 227 | if ( settings->showDialog( 0 ) ) |
220 | newList(); | 228 | getList(); |
221 | } | 229 | } |
222 | void MainWindow::showSettingsSrv() | 230 | void MainWindow::showSettingsSrv() |
223 | { | 231 | { |
224 | if ( settings->showDialog( 1 ) ) | 232 | if ( settings->showDialog( 1 ) ) |
225 | newList(); | 233 | getList(); |
226 | } | 234 | } |
227 | void MainWindow::showSettingsDst() | 235 | void MainWindow::showSettingsDst() |
228 | { | 236 | { |
229 | if ( settings->showDialog( 2 ) ) | 237 | if ( settings->showDialog( 2 ) ) |
230 | newList(); | 238 | getList(); |
231 | } | 239 | } |
232 | 240 | ||
233 | 241 | ||
234 | void MainWindow::showDetails() | 242 | void MainWindow::showDetails() |
235 | { | 243 | { |
236 | if ( activePackage ) return; | 244 | if ( activePackage ) return; |
237 | if ( details ) | 245 | if ( details ) |
238 | { | 246 | { |
239 | details = new PackageDetails( this ); | 247 | details = new PackageDetails( this ); |
240 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 248 | connect( details->install, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
241 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); | 249 | connect( details->remove, SIGNAL(clicked()), SLOT( toggleActivePackage() ) ); |
242 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); | 250 | connect( details->ignore, SIGNAL(clicked()), details, SLOT(close())); |
243 | details->description->setTextFormat(RichText); | 251 | details->description->setTextFormat(RichText); |
244 | } | 252 | } |
245 | 253 | ||
246 | details->setCaption("Package: " + activePackage->name()); | 254 | details->setCaption("Package: " + activePackage->name()); |
247 | details->description->setText(activePackage->details() ); | 255 | details->description->setText(activePackage->details() ); |
248 | details->install->setEnabled(!activePackage->installed()); | 256 | details->install->setEnabled(!activePackage->installed()); |
249 | details->remove->setEnabled(activePackage->installed()); | 257 | details->remove->setEnabled(activePackage->installed()); |
250 | details->showMaximized(); | 258 | details->showMaximized(); |
251 | } | 259 | } |
252 | 260 | ||
253 | void MainWindow::toggleActivePackage() | 261 | void MainWindow::toggleActivePackage() |
254 | { | 262 | { |
255 | activePackage->toggleProcess(); | 263 | activePackage->toggleProcess(); |
256 | if ( details ) details->close(); | 264 | if ( details ) details->close(); |
257 | } | 265 | } |
258 | 266 | ||
259 | void MainWindow::setCurrent( QListViewItem* p ) | 267 | void MainWindow::setCurrent( QListViewItem* p ) |
260 | { | 268 | { |
261 | pvDebug(2, "MainWindow::setCurrent "); | 269 | pvDebug(2, "MainWindow::setCurrent "); |
262 | //+((Package*)p)->name()); | 270 | //+((Package*)p)->name()); |
263 | activePackage = (Package*)p; | 271 | activePackage = (Package*)p; |
264 | } | 272 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 77604fd..95dcc90 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -1,62 +1,62 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
7 | 7 | ||
8 | #include "packagelist.h" | 8 | #include "packagelist.h" |
9 | #include "pmipkg.h" | 9 | #include "pmipkg.h" |
10 | #include "pksettings.h" | 10 | #include "pksettings.h" |
11 | #include "pkdesc.h" | 11 | #include "pkdesc.h" |
12 | 12 | ||
13 | #include "pkwindow.h" | 13 | #include "pkwindow.h" |
14 | 14 | ||
15 | class MainWindow : public QMainWindow | 15 | class MainWindow : public QMainWindow |
16 | { | 16 | { |
17 | Q_OBJECT | 17 | Q_OBJECT |
18 | 18 | ||
19 | 19 | ||
20 | public: | 20 | public: |
21 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 21 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
22 | ~MainWindow(); | 22 | ~MainWindow(); |
23 | 23 | ||
24 | 24 | ||
25 | protected: | 25 | protected: |
26 | PackageWindow *table; | 26 | PackageWindow *table; |
27 | 27 | ||
28 | 28 | ||
29 | protected slots: | 29 | protected slots: |
30 | void runIpkg(); | 30 | void runIpkg(); |
31 | void newList(); | 31 | void getList(); |
32 | void updateList(); | 32 | void updateList(); |
33 | void filterList(); | 33 | void filterList(); |
34 | void displayList(); | 34 | void displayList(); |
35 | void subSectionChanged(); | 35 | void subSectionChanged(); |
36 | void sectionChanged(); | 36 | void sectionChanged(); |
37 | void showSettings(); | 37 | void showSettings(); |
38 | void showSettingsSrv(); | 38 | void showSettingsSrv(); |
39 | void showSettingsDst(); | 39 | void showSettingsDst(); |
40 | 40 | ||
41 | public slots: | 41 | public slots: |
42 | void showDetails(); | 42 | void showDetails(); |
43 | void toggleActivePackage(); | 43 | void toggleActivePackage(); |
44 | void setCurrent( QListViewItem* ); | 44 | void setCurrent( QListViewItem* ); |
45 | 45 | ||
46 | private: | 46 | private: |
47 | void makeMenu(); | 47 | void makeMenu(); |
48 | void setSections(); | 48 | void setSections(); |
49 | void setSubSections(); | 49 | void setSubSections(); |
50 | 50 | ||
51 | PmIpkg* ipkg; | 51 | PmIpkg* ipkg; |
52 | PackageManagerSettings *settings; | 52 | PackageManagerSettings *settings; |
53 | PackageDetails* details; | 53 | PackageDetails* details; |
54 | PackageList packageList; | 54 | PackageList packageList; |
55 | Package *activePackage; | 55 | Package *activePackage; |
56 | QAction *runAction; | 56 | QAction *runAction; |
57 | QAction *detailsAction; | 57 | QAction *detailsAction; |
58 | QAction *updateAction; | 58 | QAction *updateAction; |
59 | QPopupMenu *contextMenu; | 59 | QPopupMenu *contextMenu; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | #endif | 62 | #endif |
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index 04230f5..c61af0f 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro | |||
@@ -1,27 +1,27 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE= app | 2 | TEMPLATE= app |
3 | CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | #CONFIG = qt warn_on debug | 4 | CONFIG = qt warn_on debug |
5 | HEADERS = mainwindow.h \ | 5 | HEADERS = mainwindow.h \ |
6 | pksettings.h \ | 6 | pksettings.h \ |
7 | pmipkg.h \ | 7 | pmipkg.h \ |
8 | packagelistitem.h \ | 8 | packagelistitem.h \ |
9 | packagelist.h \ | 9 | packagelist.h \ |
10 | package.h | 10 | package.h |
11 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
12 | mainwindow.cpp \ | 12 | mainwindow.cpp \ |
13 | pksettings.cpp \ | 13 | pksettings.cpp \ |
14 | pmipkg.cpp \ | 14 | pmipkg.cpp \ |
15 | packagelistitem.cpp \ | 15 | packagelistitem.cpp \ |
16 | packagelist.cpp \ | 16 | packagelist.cpp \ |
17 | package.cpp | 17 | package.cpp |
18 | INCLUDEPATH += $(OPIEDIR)/include | 18 | INCLUDEPATH += $(OPIEDIR)/include |
19 | DEPENDPATH+= $(OPIEDIR)/include | 19 | DEPENDPATH+= $(OPIEDIR)/include |
20 | LIBS += -lqpe | 20 | LIBS += -lqpe |
21 | INTERFACES= pkdesc.ui \ | 21 | INTERFACES= pkdesc.ui \ |
22 | pkfind.ui \ | 22 | pkfind.ui \ |
23 | runwindow.ui \ | 23 | runwindow.ui \ |
24 | pkwindow.ui \ | 24 | pkwindow.ui \ |
25 | pksettingsbase.ui | 25 | pksettingsbase.ui |
26 | TARGET = oipkg | 26 | TARGET = oipkg |
27 | 27 | ||
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 82ea1c8..e317308 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,255 +1,255 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | 5 | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | Package::~Package() | 8 | Package::~Package() |
9 | { | 9 | { |
10 | } | 10 | } |
11 | 11 | ||
12 | Package::Package() | 12 | Package::Package() |
13 | { | 13 | { |
14 | _size = ""; | 14 | _size = ""; |
15 | _section = ""; | 15 | _section = ""; |
16 | _subsection = ""; | 16 | _subsection = ""; |
17 | _shortDesc = ""; | 17 | _shortDesc = ""; |
18 | _desc = ""; | 18 | _desc = ""; |
19 | _name = ""; | 19 | _name = ""; |
20 | _toProcess = true; | 20 | _toProcess = true; |
21 | _status = ""; | 21 | _status = ""; |
22 | } | 22 | } |
23 | 23 | ||
24 | Package::Package( QStringList pack ) | 24 | Package::Package( QStringList pack ) |
25 | { | 25 | { |
26 | Package(); | 26 | Package(); |
27 | parsePackage( pack ); | 27 | parsePackage( pack ); |
28 | _toProcess = false; | 28 | _toProcess = false; |
29 | } | 29 | } |
30 | 30 | ||
31 | Package::Package( QString n ) | 31 | Package::Package( QString n ) |
32 | { | 32 | { |
33 | Package(); | 33 | Package(); |
34 | _name = QString( n ); | 34 | _name = QString( n ); |
35 | _toProcess = false; | 35 | _toProcess = false; |
36 | } | 36 | } |
37 | 37 | ||
38 | Package::Package( Package *pi ) | 38 | Package::Package( Package *pi ) |
39 | { | 39 | { |
40 | Package(); | 40 | Package(); |
41 | copyValues( pi ); | 41 | copyValues( pi ); |
42 | _toProcess = false; | 42 | _toProcess = false; |
43 | } | 43 | } |
44 | 44 | ||
45 | 45 | ||
46 | void Package::setValue( QString n, QString t ) | 46 | void Package::setValue( QString n, QString t ) |
47 | { | 47 | { |
48 | if ( n == "Status" && installed() ) return; | 48 | if ( n == "Status" && installed() ) return; |
49 | if ( n == "Package" ) | 49 | if ( n == "Package" ) |
50 | { | 50 | { |
51 | _name = QString( t ); | 51 | _name = QString( t ); |
52 | } | 52 | } |
53 | if ( n == "Installed-Size" ) | 53 | if ( n == "Installed-Size" ) |
54 | { | 54 | { |
55 | _size = t; | 55 | _size = t; |
56 | } | 56 | } |
57 | if ( n == "Priority") | 57 | if ( n == "Priority") |
58 | { | 58 | { |
59 | 59 | ||
60 | } | 60 | } |
61 | if ( n == "Section") | 61 | if ( n == "Section") |
62 | { | 62 | { |
63 | setSection( t ); | 63 | setSection( t ); |
64 | } | 64 | } |
65 | if ( n == "Maintainer") | 65 | if ( n == "Maintainer") |
66 | { | 66 | { |
67 | 67 | ||
68 | } | 68 | } |
69 | if ( n == "Architecture") | 69 | if ( n == "Architecture") |
70 | { | 70 | { |
71 | 71 | ||
72 | } | 72 | } |
73 | if ( n == "Version") | 73 | if ( n == "Version") |
74 | { | 74 | { |
75 | 75 | ||
76 | } | 76 | } |
77 | if ( n == "Pre-Depends") | 77 | if ( n == "Pre-Depends") |
78 | { | 78 | { |
79 | 79 | ||
80 | } | 80 | } |
81 | if ( n == "Depends") | 81 | if ( n == "Depends") |
82 | { | 82 | { |
83 | 83 | ||
84 | }else if ( n == "Filename") | 84 | }else if ( n == "Filename") |
85 | { | 85 | { |
86 | 86 | ||
87 | }else if ( n == "Size") | 87 | }else if ( n == "Size") |
88 | { | 88 | { |
89 | 89 | ||
90 | }else if ( n == "MD5Sum") | 90 | }else if ( n == "MD5Sum") |
91 | { | 91 | { |
92 | 92 | ||
93 | } | 93 | } |
94 | if ( n == "Description") | 94 | if ( n == "Description") |
95 | { | 95 | { |
96 | setDesc( t ); | 96 | setDesc( t ); |
97 | } | 97 | } |
98 | if ( n == "Status") | 98 | if ( n == "Status") |
99 | { | 99 | { |
100 | if ( installed() ) return; | 100 | if ( installed() ) return; |
101 | _status = t; | 101 | _status = t; |
102 | } | 102 | } |
103 | if ( t == "Essential") | 103 | if ( t == "Essential") |
104 | { | 104 | { |
105 | 105 | ||
106 | } | 106 | } |
107 | }; | 107 | }; |
108 | 108 | ||
109 | QString Package::name() | 109 | QString Package::name() |
110 | { | 110 | { |
111 | return _name; | 111 | return _name; |
112 | } | 112 | } |
113 | 113 | ||
114 | bool Package::installed() | 114 | bool Package::installed() |
115 | { | 115 | { |
116 | return _status.contains("installed"); | 116 | return _status.contains("installed"); |
117 | } | 117 | } |
118 | 118 | ||
119 | void Package::setDesc( QString s ) | 119 | void Package::setDesc( QString s ) |
120 | { | 120 | { |
121 | _desc = s; | 121 | _desc = s; |
122 | _shortDesc = s.left( s.find("\n") ); | 122 | _shortDesc = s.left( s.find("\n") ); |
123 | } | 123 | } |
124 | 124 | ||
125 | QString Package::desc() | 125 | QString Package::desc() |
126 | { | 126 | { |
127 | return _desc; | 127 | return _desc; |
128 | } | 128 | } |
129 | 129 | ||
130 | QString Package::shortDesc() | 130 | QString Package::shortDesc() |
131 | { | 131 | { |
132 | return _shortDesc; | 132 | return _shortDesc; |
133 | } | 133 | } |
134 | 134 | ||
135 | QString Package::size() | 135 | QString Package::size() |
136 | { | 136 | { |
137 | return _size; | 137 | return _size; |
138 | } | 138 | } |
139 | 139 | ||
140 | bool Package::toProcess() | 140 | bool Package::toProcess() |
141 | { | 141 | { |
142 | return _toProcess; | 142 | return _toProcess; |
143 | } | 143 | } |
144 | 144 | ||
145 | bool Package::toRemove() | 145 | bool Package::toRemove() |
146 | { | 146 | { |
147 | if ( _toProcess && installed() ) return true; | 147 | if ( _toProcess && installed() ) return true; |
148 | else return false; | 148 | else return false; |
149 | } | 149 | } |
150 | 150 | ||
151 | bool Package::toInstall() | 151 | bool Package::toInstall() |
152 | { | 152 | { |
153 | if ( _toProcess && !installed() ) return true; | 153 | if ( _toProcess && !installed() ) return true; |
154 | else return false; | 154 | else return false; |
155 | } | 155 | } |
156 | 156 | ||
157 | void Package::toggleProcess() | 157 | void Package::toggleProcess() |
158 | { | 158 | { |
159 | _toProcess = !(_toProcess); | 159 | _toProcess = ! _toProcess; |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | 163 | ||
164 | void Package::copyValues( Package* pack ) | 164 | void Package::copyValues( Package* pack ) |
165 | { | 165 | { |
166 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); | 166 | if (_size.isEmpty() && !pack->_size.isEmpty()) _size = QString( pack->_size ); |
167 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); | 167 | if (_section.isEmpty() && !pack->_section.isEmpty()) _section = QString( pack->_section ); |
168 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); | 168 | if (_subsection.isEmpty()&& !pack->_subsection.isEmpty()) _subsection = QString( pack->_subsection ); |
169 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); | 169 | if (_shortDesc.isEmpty() && !pack->_shortDesc.isEmpty()) _shortDesc = QString( pack->_shortDesc ); |
170 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); | 170 | if (_desc.isEmpty() && !pack->_desc.isEmpty()) _desc = QString( pack->_desc ); |
171 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); | 171 | if (_name.isEmpty() && !pack->_name.isEmpty()) _name = QString( pack->_name ); |
172 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); | 172 | if (!installed() && _status.isEmpty() && !pack->_status.isEmpty()) _status = QString( pack->_status ); |
173 | } | 173 | } |
174 | 174 | ||
175 | QString Package::getSection() | 175 | QString Package::getSection() |
176 | { | 176 | { |
177 | return _section; | 177 | return _section; |
178 | } | 178 | } |
179 | 179 | ||
180 | void Package::setSection( QString s) | 180 | void Package::setSection( QString s) |
181 | { | 181 | { |
182 | int i = s.find("/"); | 182 | int i = s.find("/"); |
183 | if ( i > 0 ) | 183 | if ( i > 0 ) |
184 | { | 184 | { |
185 | _section = s.left(i); | 185 | _section = s.left(i); |
186 | _subsection = s.mid(i+1); | 186 | _subsection = s.mid(i+1); |
187 | }else{ | 187 | }else{ |
188 | _section = s; | 188 | _section = s; |
189 | _subsection = ""; | 189 | _subsection = ""; |
190 | } | 190 | } |
191 | } | 191 | } |
192 | 192 | ||
193 | QString Package::getSubSection() | 193 | QString Package::getSubSection() |
194 | { | 194 | { |
195 | return _subsection; | 195 | return _subsection; |
196 | } | 196 | } |
197 | 197 | ||
198 | void Package::parsePackage( QStringList pack ) | 198 | void Package::parsePackage( QStringList pack ) |
199 | { | 199 | { |
200 | if ( pack.isEmpty() ) return; | 200 | if ( pack.isEmpty() ) return; |
201 | int count = pack.count(); | 201 | int count = pack.count(); |
202 | for( int i = 0; i < count; i++ ) | 202 | for( int i = 0; i < count; i++ ) |
203 | { | 203 | { |
204 | QString line = pack[i]; | 204 | QString line = pack[i]; |
205 | int sep = line.find( QRegExp(":[\t ]+") ); | 205 | int sep = line.find( QRegExp(":[\t ]+") ); |
206 | if ( sep >= 0 ) | 206 | if ( sep >= 0 ) |
207 | { | 207 | { |
208 | QString tag = line.left(sep); | 208 | QString tag = line.left(sep); |
209 | QString value = line.mid(sep+2).simplifyWhiteSpace(); | 209 | QString value = line.mid(sep+2).simplifyWhiteSpace(); |
210 | setValue( tag, value ); | 210 | setValue( tag, value ); |
211 | }else{ | 211 | }else{ |
212 | } | 212 | } |
213 | } | 213 | } |
214 | return; | 214 | return; |
215 | } | 215 | } |
216 | 216 | ||
217 | QString Package::details() | 217 | QString Package::details() |
218 | { | 218 | { |
219 | QString status; | 219 | QString status; |
220 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); | 220 | Process ipkg_status(QStringList() << "ipkg" << "info" << name() ); |
221 | QString description; | 221 | QString description; |
222 | if ( ipkg_status.exec("",status) ) | 222 | if ( ipkg_status.exec("",status) ) |
223 | { | 223 | { |
224 | QStringList lines = QStringList::split('\n',status,TRUE); | 224 | QStringList lines = QStringList::split('\n',status,TRUE); |
225 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { | 225 | for (QStringList::Iterator it = lines.begin(); it!=lines.end(); ++it) { |
226 | QString line = *it; | 226 | QString line = *it; |
227 | if ( line == " ." ) | 227 | if ( line == " ." ) |
228 | { | 228 | { |
229 | description.append("<p>"); | 229 | description.append("<p>"); |
230 | } else | 230 | } else |
231 | if ( line[0] == ' ' || line[0] == '\t' ) | 231 | if ( line[0] == ' ' || line[0] == '\t' ) |
232 | { | 232 | { |
233 | // continuation | 233 | // continuation |
234 | description.append(" "); | 234 | description.append(" "); |
235 | description.append(Qtopia::escapeString(line)); | 235 | description.append(Qtopia::escapeString(line)); |
236 | } else { | 236 | } else { |
237 | int sep = line.find(QRegExp(":[\t ]+")); | 237 | int sep = line.find(QRegExp(":[\t ]+")); |
238 | if ( sep >= 0 ) | 238 | if ( sep >= 0 ) |
239 | { | 239 | { |
240 | QString tag = line.left(sep); | 240 | QString tag = line.left(sep); |
241 | description.append("<br>"); | 241 | description.append("<br>"); |
242 | description.append("<b>"); | 242 | description.append("<b>"); |
243 | description.append(Qtopia::escapeString(tag)); | 243 | description.append(Qtopia::escapeString(tag)); |
244 | description.append(":</b> "); | 244 | description.append(":</b> "); |
245 | description.append(Qtopia::escapeString(line.mid(sep+2))); | 245 | description.append(Qtopia::escapeString(line.mid(sep+2))); |
246 | } else { | 246 | } else { |
247 | description.append(" "); | 247 | description.append(" "); |
248 | description.append(Qtopia::escapeString(line)); | 248 | description.append(Qtopia::escapeString(line)); |
249 | } | 249 | } |
250 | } | 250 | } |
251 | } | 251 | } |
252 | } | 252 | } |
253 | return description; | 253 | return description; |
254 | } | 254 | } |
255 | 255 | ||
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index d72ef75..5f6934d 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -16,200 +16,201 @@ PackageList::PackageList() | |||
16 | Config cfg( "oipkg", Config::User ); | 16 | Config cfg( "oipkg", Config::User ); |
17 | cfg.setGroup( "Common" ); | 17 | cfg.setGroup( "Common" ); |
18 | statusDir = cfg.readEntry( "statusDir", "" ); | 18 | statusDir = cfg.readEntry( "statusDir", "" ); |
19 | listsDir = cfg.readEntry( "listsDir", "" ); | 19 | listsDir = cfg.readEntry( "listsDir", "" ); |
20 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | 20 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) |
21 | { | 21 | { |
22 | statusDir="/usr/lib/ipkg/"; | 22 | statusDir="/usr/lib/ipkg/"; |
23 | listsDir="/usr/lib/ipkg/lists/"; | 23 | listsDir="/usr/lib/ipkg/lists/"; |
24 | cfg.writeEntry( "statusDir", statusDir ); | 24 | cfg.writeEntry( "statusDir", statusDir ); |
25 | cfg.writeEntry( "listsDir", listsDir ); | 25 | cfg.writeEntry( "listsDir", listsDir ); |
26 | } | 26 | } |
27 | } | 27 | } |
28 | pvDebug( 5, "PackageList::PackageList statusDir "+statusDir); | 28 | pvDebug( 5, "PackageList::PackageList statusDir "+statusDir); |
29 | pvDebug( 5, "PackageList::PackageList listsDir "+listsDir); | 29 | pvDebug( 5, "PackageList::PackageList listsDir "+listsDir); |
30 | sections << "All"; | 30 | sections << "All"; |
31 | subSections.insert("All", new QStringList() ); | 31 | subSections.insert("All", new QStringList() ); |
32 | QStringList *ss = subSections["All"]; | 32 | QStringList *ss = subSections["All"]; |
33 | *ss << "All"; | 33 | *ss << "All"; |
34 | aktSection = "All"; | 34 | aktSection = "All"; |
35 | aktSubSection = "All"; | 35 | aktSubSection = "All"; |
36 | } | 36 | } |
37 | 37 | ||
38 | PackageList::PackageList( PackageManagerSettings* s) | 38 | PackageList::PackageList( PackageManagerSettings* s) |
39 | : packageIter( packageList ) | 39 | : packageIter( packageList ) |
40 | { | 40 | { |
41 | settings = s; | 41 | settings = s; |
42 | PackageList(); | 42 | PackageList(); |
43 | } | 43 | } |
44 | 44 | ||
45 | PackageList::~PackageList() | 45 | PackageList::~PackageList() |
46 | { | 46 | { |
47 | } | 47 | } |
48 | 48 | ||
49 | /** Inserts a package into the list */ | 49 | /** Inserts a package into the list */ |
50 | void PackageList::insertPackage( Package* pack ) | 50 | void PackageList::insertPackage( Package* pack ) |
51 | { | 51 | { |
52 | Package* p = packageList.find( pack->name() ); | 52 | Package* p = packageList.find( pack->name() ); |
53 | if ( p ) | 53 | if ( p ) |
54 | { | 54 | { |
55 | p->copyValues( pack ); | 55 | p->copyValues( pack ); |
56 | delete pack; | 56 | delete pack; |
57 | pack = p; | 57 | pack = p; |
58 | }else{ | 58 | }else{ |
59 | packageList.insert( pack->name(), pack ); | 59 | packageList.insert( pack->name(), pack ); |
60 | origPackageList.insert( pack->name(), pack ); | 60 | origPackageList.insert( pack->name(), pack ); |
61 | empty=false; | 61 | empty=false; |
62 | }; | 62 | }; |
63 | updateSections( pack ); | 63 | updateSections( pack ); |
64 | } | 64 | } |
65 | 65 | ||
66 | void PackageList::filterPackages() | 66 | void PackageList::filterPackages() |
67 | { | 67 | { |
68 | packageList.clear(); | 68 | packageList.clear(); |
69 | QDictIterator<Package> filterIter( origPackageList ); | 69 | QDictIterator<Package> filterIter( origPackageList ); |
70 | filterIter.toFirst(); | 70 | filterIter.toFirst(); |
71 | Package *pack= filterIter.current() ; | 71 | Package *pack= filterIter.current() ; |
72 | while ( pack ) | 72 | while ( pack ) |
73 | { | 73 | { |
74 | if ( ((aktSection=="All")||(pack->getSection()==aktSection)) && | 74 | if ( ((aktSection=="All")||(pack->getSection()==aktSection)) && |
75 | ((aktSubSection=="All")||(pack->getSubSection()==aktSubSection)) ) | 75 | ((aktSubSection=="All")||(pack->getSubSection()==aktSubSection)) ) |
76 | { | 76 | { |
77 | packageList.insert( pack->name(), pack ); | 77 | packageList.insert( pack->name(), pack ); |
78 | } | 78 | } |
79 | ++filterIter; | 79 | ++filterIter; |
80 | pack = filterIter.current(); | 80 | pack = filterIter.current(); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
84 | Package* PackageList::find( QString n ) | 84 | Package* PackageList::find( QString n ) |
85 | { | 85 | { |
86 | return packageList.find( n ); | 86 | return packageList.find( n ); |
87 | } | 87 | } |
88 | 88 | ||
89 | Package* PackageList::first() | 89 | Package* PackageList::first() |
90 | { | 90 | { |
91 | packageIter.toFirst(); | 91 | packageIter.toFirst(); |
92 | return packageIter.current(); | 92 | return packageIter.current(); |
93 | } | 93 | } |
94 | 94 | ||
95 | Package* PackageList::next() | 95 | Package* PackageList::next() |
96 | { | 96 | { |
97 | ++packageIter; | 97 | ++packageIter; |
98 | return packageIter.current(); | 98 | return packageIter.current(); |
99 | } | 99 | } |
100 | 100 | ||
101 | QStringList PackageList::getSections() | 101 | QStringList PackageList::getSections() |
102 | { | 102 | { |
103 | sections.sort(); | 103 | sections.sort(); |
104 | return sections; | 104 | return sections; |
105 | } | 105 | } |
106 | 106 | ||
107 | QStringList PackageList::getSubSections() | 107 | QStringList PackageList::getSubSections() |
108 | { | 108 | { |
109 | QStringList ss; | 109 | QStringList ss; |
110 | if ( !subSections[aktSection] ) return ss; | 110 | if ( !subSections[aktSection] ) return ss; |
111 | ss = *subSections[aktSection]; | 111 | ss = *subSections[aktSection]; |
112 | ss.sort(); | 112 | ss.sort(); |
113 | return ss; | 113 | return ss; |
114 | } | 114 | } |
115 | 115 | ||
116 | void PackageList::setSection( QString sec ) | 116 | void PackageList::setSection( QString sec ) |
117 | { | 117 | { |
118 | aktSection = sec; | 118 | aktSection = sec; |
119 | } | 119 | } |
120 | 120 | ||
121 | void PackageList::setSubSection( QString ssec ) | 121 | void PackageList::setSubSection( QString ssec ) |
122 | { | 122 | { |
123 | aktSubSection = ssec; | 123 | aktSubSection = ssec; |
124 | } | 124 | } |
125 | 125 | ||
126 | void PackageList::updateSections( Package* pack ) | 126 | void PackageList::updateSections( Package* pack ) |
127 | { | 127 | { |
128 | QString s = pack->getSection(); | 128 | QString s = pack->getSection(); |
129 | if ( s.isEmpty() || s == "") return; | 129 | if ( s.isEmpty() || s == "") return; |
130 | if ( sections.contains(s) ) return; | 130 | if ( sections.contains(s) ) return; |
131 | sections += s; | 131 | sections += s; |
132 | QString ss = pack->getSubSection(); | 132 | QString ss = pack->getSubSection(); |
133 | if ( ss.isEmpty() || ss == "" ) return; | 133 | if ( ss.isEmpty() || ss == "" ) return; |
134 | if ( !subSections[s] ) { | 134 | if ( !subSections[s] ) { |
135 | subSections.insert( s, new QStringList() ); | 135 | subSections.insert( s, new QStringList() ); |
136 | QStringList *subsecs = subSections[s]; | 136 | QStringList *subsecs = subSections[s]; |
137 | *subsecs += "All"; | 137 | *subsecs += "All"; |
138 | } | 138 | } |
139 | QStringList *subsecs = subSections[s]; | 139 | QStringList *subsecs = subSections[s]; |
140 | *subsecs += ss; | 140 | *subsecs += ss; |
141 | if ( !subSections["All"] ) subSections.insert( "All", new QStringList() ); | 141 | if ( !subSections["All"] ) subSections.insert( "All", new QStringList() ); |
142 | subsecs = subSections["All"]; | 142 | subsecs = subSections["All"]; |
143 | *subsecs += ss; | 143 | *subsecs += ss; |
144 | } | 144 | } |
145 | 145 | ||
146 | 146 | ||
147 | 147 | ||
148 | /** No descriptions */ | 148 | /** No descriptions */ |
149 | void PackageList::parseStatus() | 149 | void PackageList::parseStatus() |
150 | { | 150 | { |
151 | QStringList dests = settings->getDestinationUrls(); | 151 | QStringList dests = settings->getDestinationUrls(); |
152 | for ( QStringList::Iterator it = dests.begin(); it != dests.end(); ++it ) | 152 | for ( QStringList::Iterator it = dests.begin(); it != dests.end(); ++it ) |
153 | { | 153 | { |
154 | pvDebug( 2,"Status Dir: "+*it+statusDir+"/status"); | 154 | pvDebug( 2,"Status Dir: "+*it+statusDir+"/status"); |
155 | readFileEntries( *it+statusDir+"/status" ); | 155 | readFileEntries( *it+statusDir+"/status" ); |
156 | }; | 156 | }; |
157 | } | 157 | } |
158 | 158 | ||
159 | void PackageList::parseList() | 159 | void PackageList::parseList() |
160 | { | 160 | { |
161 | QStringList srvs = settings->getActiveServers(); | 161 | QStringList srvs = settings->getActiveServers(); |
162 | 162 | ||
163 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | 163 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) |
164 | { | 164 | { |
165 | pvDebug( 2, "List Dir: "+listsDir+"/"+*it); | 165 | pvDebug( 2, "List Dir: "+listsDir+"/"+*it); |
166 | readFileEntries( listsDir+"/"+*it ); | 166 | readFileEntries( listsDir+"/"+*it ); |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | void PackageList::readFileEntries( QString filename ) | 170 | void PackageList::readFileEntries( QString filename ) |
171 | { | 171 | { |
172 | QStringList packEntry; | 172 | QStringList packEntry; |
173 | QFile f( filename ); | 173 | QFile f( filename ); |
174 | if ( !f.open(IO_ReadOnly) ) return; | 174 | if ( !f.open(IO_ReadOnly) ) return; |
175 | QTextStream *statusStream = new QTextStream( &f ); | 175 | QTextStream *statusStream = new QTextStream( &f ); |
176 | while ( !statusStream ->eof() ) | 176 | while ( !statusStream ->eof() ) |
177 | { | 177 | { |
178 | QString line = statusStream->readLine(); | 178 | QString line = statusStream->readLine(); |
179 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) | 179 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) |
180 | { | 180 | { |
181 | //end of package | 181 | //end of package |
182 | if ( ! packEntry.isEmpty() ) | 182 | if ( ! packEntry.isEmpty() ) |
183 | { | 183 | { |
184 | Package *p = new Package( packEntry ); | 184 | Package *p = new Package( packEntry ); |
185 | if ( p ) | 185 | if ( p ) |
186 | { | 186 | { |
187 | insertPackage( p ); | 187 | insertPackage( p ); |
188 | packEntry.clear(); | 188 | packEntry.clear(); |
189 | } | 189 | } |
190 | } | 190 | } |
191 | }else{ | 191 | }else{ |
192 | packEntry << line; | 192 | packEntry << line; |
193 | }; | 193 | }; |
194 | } | 194 | } |
195 | return; | 195 | return; |
196 | } | 196 | } |
197 | 197 | ||
198 | 198 | ||
199 | void PackageList::update() | 199 | void PackageList::update() |
200 | { | 200 | { |
201 | pvDebug( 3, "parseStatus"); | 201 | pvDebug( 3, "parseStatus"); |
202 | parseStatus(); | 202 | parseStatus(); |
203 | pvDebug( 3, "parseList"); | 203 | pvDebug( 3, "parseList"); |
204 | parseList(); | 204 | parseList(); |
205 | pvDebug( 3, "finished parsing"); | 205 | pvDebug( 3, "finished parsing"); |
206 | } | 206 | } |
207 | 207 | ||
208 | |||
209 | |||
210 | /** No descriptions */ | ||
211 | void PackageList::setSettings( PackageManagerSettings *s ) | 208 | void PackageList::setSettings( PackageManagerSettings *s ) |
212 | { | 209 | { |
213 | settings = s; | 210 | settings = s; |
214 | } | 211 | } |
215 | 212 | ||
213 | Package* PackageList::getByName( QString n ) | ||
214 | { | ||
215 | origPackageList[n]; | ||
216 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h index eda8d22..68b89f0 100644 --- a/noncore/unsupported/oipkg/packagelist.h +++ b/noncore/unsupported/oipkg/packagelist.h | |||
@@ -1,63 +1,65 @@ | |||
1 | #ifndef PACKAGELIST_H | 1 | #ifndef PACKAGELIST_H |
2 | #define PACKAGELIST_H | 2 | #define PACKAGELIST_H |
3 | 3 | ||
4 | #include <qdict.h> | 4 | #include <qdict.h> |
5 | #include "package.h" | 5 | #include "package.h" |
6 | #include "pksettings.h" | 6 | #include "pksettings.h" |
7 | #include "debug.h" | 7 | #include "debug.h" |
8 | 8 | ||
9 | #define HACK | 9 | #define HACK |
10 | #ifdef HACK | 10 | #ifdef HACK |
11 | static QString listsDir="/usr/lib/ipkg/"; | 11 | static QString listsDir="/usr/lib/ipkg/"; |
12 | static QString statusDir="/usr/lib/ipkg/"; | 12 | static QString statusDir="/usr/lib/ipkg/"; |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | class PackageList { | 15 | class PackageList { |
16 | public: | 16 | public: |
17 | PackageList(); | 17 | PackageList(); |
18 | PackageList( PackageManagerSettings* ); | 18 | PackageList( PackageManagerSettings* ); |
19 | ~PackageList(); | 19 | ~PackageList(); |
20 | void insertPackage( Package* ); | 20 | void insertPackage( Package* ); |
21 | Package* find( QString ); | 21 | Package* find( QString ); |
22 | Package* next(); | 22 | Package* next(); |
23 | Package* first(); | 23 | Package* first(); |
24 | 24 | ||
25 | QStringList getSections(); | 25 | QStringList getSections(); |
26 | QStringList getSubSections(); | 26 | QStringList getSubSections(); |
27 | void setSettings( PackageManagerSettings* ); | 27 | void setSettings( PackageManagerSettings* ); |
28 | void filterPackages(); | 28 | void filterPackages(); |
29 | /** No descriptions */ | ||
30 | Package* getByName( QString ); | ||
29 | 31 | ||
30 | public slots: | 32 | public slots: |
31 | void setSection(QString); | 33 | void setSection(QString); |
32 | void setSubSection(QString); | 34 | void setSubSection(QString); |
33 | void update(); | 35 | void update(); |
34 | 36 | ||
35 | private: | 37 | private: |
36 | int currentPackage; | 38 | int currentPackage; |
37 | int packageCount; | 39 | int packageCount; |
38 | 40 | ||
39 | PackageManagerSettings *settings; | 41 | PackageManagerSettings *settings; |
40 | QDict<Package> packageList; | 42 | QDict<Package> packageList; |
41 | QDict<Package> origPackageList; | 43 | QDict<Package> origPackageList; |
42 | QDictIterator<Package> packageIter; | 44 | QDictIterator<Package> packageIter; |
43 | 45 | ||
44 | bool empty; | 46 | bool empty; |
45 | #ifndef HACK | 47 | #ifndef HACK |
46 | QString listsDir; | 48 | QString listsDir; |
47 | QString statusDir; | 49 | QString statusDir; |
48 | #endif | 50 | #endif |
49 | QString aktSection; | 51 | QString aktSection; |
50 | QString aktSubSection; | 52 | QString aktSubSection; |
51 | QStringList sections; | 53 | QStringList sections; |
52 | QDict<QStringList> subSections; | 54 | QDict<QStringList> subSections; |
53 | QDict<bool> sectionsDict; | 55 | QDict<bool> sectionsDict; |
54 | 56 | ||
55 | 57 | ||
56 | void updateSections( Package* ); | 58 | void updateSections( Package* ); |
57 | void parseStatus(); | 59 | void parseStatus(); |
58 | void parseList(); | 60 | void parseList(); |
59 | void readFileEntries( QString ); | 61 | void readFileEntries( QString ); |
60 | }; | 62 | }; |
61 | 63 | ||
62 | 64 | ||
63 | #endif | 65 | #endif |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index 2efd2f3..ea507a8 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -1,527 +1,527 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>PackageManagerSettingsBase</class> | 2 | <class>PackageManagerSettingsBase</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>Form4</cstring> | 7 | <cstring>Form4</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>357</width> | 14 | <width>353</width> |
15 | <height>454</height> | 15 | <height>454</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>Package Servers</string> | 20 | <string>Package Servers</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>3</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>3</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QTabWidget</class> | 38 | <class>QTabWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>TabWidget</cstring> | 41 | <cstring>TabWidget</cstring> |
42 | </property> | 42 | </property> |
43 | <property stdset="1"> | 43 | <property stdset="1"> |
44 | <name>enabled</name> | 44 | <name>enabled</name> |
45 | <bool>true</bool> | 45 | <bool>true</bool> |
46 | </property> | 46 | </property> |
47 | <property> | 47 | <property> |
48 | <name>layoutMargin</name> | 48 | <name>layoutMargin</name> |
49 | </property> | 49 | </property> |
50 | <property> | 50 | <property> |
51 | <name>layoutSpacing</name> | 51 | <name>layoutSpacing</name> |
52 | </property> | 52 | </property> |
53 | <widget> | 53 | <widget> |
54 | <class>QWidget</class> | 54 | <class>QWidget</class> |
55 | <property stdset="1"> | 55 | <property stdset="1"> |
56 | <name>name</name> | 56 | <name>name</name> |
57 | <cstring>tab</cstring> | 57 | <cstring>tab</cstring> |
58 | </property> | 58 | </property> |
59 | <attribute> | 59 | <attribute> |
60 | <name>title</name> | 60 | <name>title</name> |
61 | <string>Settings</string> | 61 | <string>Settings</string> |
62 | </attribute> | 62 | </attribute> |
63 | <grid> | 63 | <grid> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>margin</name> | 65 | <name>margin</name> |
66 | <number>3</number> | 66 | <number>3</number> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>spacing</name> | 69 | <name>spacing</name> |
70 | <number>3</number> | 70 | <number>3</number> |
71 | </property> | 71 | </property> |
72 | <widget row="0" column="0" > | 72 | <widget row="0" column="0" > |
73 | <class>QLayoutWidget</class> | 73 | <class>QLayoutWidget</class> |
74 | <property stdset="1"> | 74 | <property stdset="1"> |
75 | <name>name</name> | 75 | <name>name</name> |
76 | <cstring>Layout3_2</cstring> | 76 | <cstring>Layout3_2</cstring> |
77 | </property> | 77 | </property> |
78 | <hbox> | 78 | <hbox> |
79 | <property stdset="1"> | 79 | <property stdset="1"> |
80 | <name>margin</name> | 80 | <name>margin</name> |
81 | <number>0</number> | 81 | <number>0</number> |
82 | </property> | 82 | </property> |
83 | <property stdset="1"> | 83 | <property stdset="1"> |
84 | <name>spacing</name> | 84 | <name>spacing</name> |
85 | <number>6</number> | 85 | <number>6</number> |
86 | </property> | 86 | </property> |
87 | <widget> | 87 | <widget> |
88 | <class>QLabel</class> | 88 | <class>QLabel</class> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>name</name> | 90 | <name>name</name> |
91 | <cstring>Settings</cstring> | 91 | <cstring>Settings</cstring> |
92 | </property> | 92 | </property> |
93 | <property stdset="1"> | 93 | <property stdset="1"> |
94 | <name>text</name> | 94 | <name>text</name> |
95 | <string>Installation Setups</string> | 95 | <string>Installation Setups</string> |
96 | </property> | 96 | </property> |
97 | </widget> | 97 | </widget> |
98 | <spacer> | 98 | <spacer> |
99 | <property> | 99 | <property> |
100 | <name>name</name> | 100 | <name>name</name> |
101 | <cstring>Spacer2_2_2</cstring> | 101 | <cstring>Spacer2_2_2</cstring> |
102 | </property> | 102 | </property> |
103 | <property stdset="1"> | 103 | <property stdset="1"> |
104 | <name>orientation</name> | 104 | <name>orientation</name> |
105 | <enum>Horizontal</enum> | 105 | <enum>Horizontal</enum> |
106 | </property> | 106 | </property> |
107 | <property stdset="1"> | 107 | <property stdset="1"> |
108 | <name>sizeType</name> | 108 | <name>sizeType</name> |
109 | <enum>Expanding</enum> | 109 | <enum>Expanding</enum> |
110 | </property> | 110 | </property> |
111 | <property> | 111 | <property> |
112 | <name>sizeHint</name> | 112 | <name>sizeHint</name> |
113 | <size> | 113 | <size> |
114 | <width>20</width> | 114 | <width>20</width> |
115 | <height>20</height> | 115 | <height>20</height> |
116 | </size> | 116 | </size> |
117 | </property> | 117 | </property> |
118 | </spacer> | 118 | </spacer> |
119 | </hbox> | 119 | </hbox> |
120 | </widget> | 120 | </widget> |
121 | <widget row="5" column="0" > | 121 | <widget row="5" column="0" > |
122 | <class>QLayoutWidget</class> | 122 | <class>QLayoutWidget</class> |
123 | <property stdset="1"> | 123 | <property stdset="1"> |
124 | <name>name</name> | 124 | <name>name</name> |
125 | <cstring>Layout8</cstring> | 125 | <cstring>Layout8</cstring> |
126 | </property> | 126 | </property> |
127 | <hbox> | 127 | <hbox> |
128 | <property stdset="1"> | 128 | <property stdset="1"> |
129 | <name>margin</name> | 129 | <name>margin</name> |
130 | <number>0</number> | 130 | <number>0</number> |
131 | </property> | 131 | </property> |
132 | <property stdset="1"> | 132 | <property stdset="1"> |
133 | <name>spacing</name> | 133 | <name>spacing</name> |
134 | <number>6</number> | 134 | <number>6</number> |
135 | </property> | 135 | </property> |
136 | <widget> | 136 | <widget> |
137 | <class>QLabel</class> | 137 | <class>QLabel</class> |
138 | <property stdset="1"> | 138 | <property stdset="1"> |
139 | <name>name</name> | 139 | <name>name</name> |
140 | <cstring>TextLabel1</cstring> | 140 | <cstring>TextLabel1</cstring> |
141 | </property> | 141 | </property> |
142 | <property stdset="1"> | 142 | <property stdset="1"> |
143 | <name>text</name> | 143 | <name>text</name> |
144 | <string>Install destination:</string> | 144 | <string>Install destination:</string> |
145 | </property> | 145 | </property> |
146 | </widget> | 146 | </widget> |
147 | <widget> | 147 | <widget> |
148 | <class>QComboBox</class> | 148 | <class>QComboBox</class> |
149 | <property stdset="1"> | 149 | <property stdset="1"> |
150 | <name>name</name> | 150 | <name>name</name> |
151 | <cstring>activeDestination</cstring> | 151 | <cstring>activeDestination</cstring> |
152 | </property> | 152 | </property> |
153 | </widget> | 153 | </widget> |
154 | </hbox> | 154 | </hbox> |
155 | </widget> | 155 | </widget> |
156 | <widget row="6" column="0" > | 156 | <widget row="6" column="0" > |
157 | <class>QLayoutWidget</class> | 157 | <class>QLayoutWidget</class> |
158 | <property stdset="1"> | 158 | <property stdset="1"> |
159 | <name>name</name> | 159 | <name>name</name> |
160 | <cstring>Layout9</cstring> | 160 | <cstring>Layout9</cstring> |
161 | </property> | 161 | </property> |
162 | <hbox> | 162 | <hbox> |
163 | <property stdset="1"> | 163 | <property stdset="1"> |
164 | <name>margin</name> | 164 | <name>margin</name> |
165 | <number>0</number> | 165 | <number>0</number> |
166 | </property> | 166 | </property> |
167 | <property stdset="1"> | 167 | <property stdset="1"> |
168 | <name>spacing</name> | 168 | <name>spacing</name> |
169 | <number>6</number> | 169 | <number>6</number> |
170 | </property> | 170 | </property> |
171 | <widget> | 171 | <widget> |
172 | <class>QCheckBox</class> | 172 | <class>QCheckBox</class> |
173 | <property stdset="1"> | 173 | <property stdset="1"> |
174 | <name>name</name> | 174 | <name>name</name> |
175 | <cstring>CheckBoxLink</cstring> | 175 | <cstring>CheckBoxLink</cstring> |
176 | </property> | 176 | </property> |
177 | <property stdset="1"> | 177 | <property stdset="1"> |
178 | <name>text</name> | 178 | <name>text</name> |
179 | <string>Link Destination:</string> | 179 | <string>Link Destination:</string> |
180 | </property> | 180 | </property> |
181 | </widget> | 181 | </widget> |
182 | <widget> | 182 | <widget> |
183 | <class>QComboBox</class> | 183 | <class>QComboBox</class> |
184 | <property stdset="1"> | 184 | <property stdset="1"> |
185 | <name>name</name> | 185 | <name>name</name> |
186 | <cstring>activeLinkDestination</cstring> | 186 | <cstring>activeLinkDestination</cstring> |
187 | </property> | 187 | </property> |
188 | <property stdset="1"> | 188 | <property stdset="1"> |
189 | <name>enabled</name> | 189 | <name>enabled</name> |
190 | <bool>false</bool> | 190 | <bool>false</bool> |
191 | </property> | 191 | </property> |
192 | </widget> | 192 | </widget> |
193 | </hbox> | 193 | </hbox> |
194 | </widget> | 194 | </widget> |
195 | <widget row="3" column="0" > | 195 | <widget row="3" column="0" > |
196 | <class>QLayoutWidget</class> | 196 | <class>QLayoutWidget</class> |
197 | <property stdset="1"> | 197 | <property stdset="1"> |
198 | <name>name</name> | 198 | <name>name</name> |
199 | <cstring>Layout13</cstring> | 199 | <cstring>Layout13</cstring> |
200 | </property> | 200 | </property> |
201 | <hbox> | 201 | <hbox> |
202 | <property stdset="1"> | 202 | <property stdset="1"> |
203 | <name>margin</name> | 203 | <name>margin</name> |
204 | <number>0</number> | 204 | <number>0</number> |
205 | </property> | 205 | </property> |
206 | <property stdset="1"> | 206 | <property stdset="1"> |
207 | <name>spacing</name> | 207 | <name>spacing</name> |
208 | <number>6</number> | 208 | <number>6</number> |
209 | </property> | 209 | </property> |
210 | <widget> | 210 | <widget> |
211 | <class>QLabel</class> | 211 | <class>QLabel</class> |
212 | <property stdset="1"> | 212 | <property stdset="1"> |
213 | <name>name</name> | 213 | <name>name</name> |
214 | <cstring>TextLabel1_2</cstring> | 214 | <cstring>TextLabel1_2</cstring> |
215 | </property> | 215 | </property> |
216 | <property stdset="1"> | 216 | <property stdset="1"> |
217 | <name>text</name> | 217 | <name>text</name> |
218 | <string>Used servers:</string> | 218 | <string>Used servers:</string> |
219 | </property> | 219 | </property> |
220 | </widget> | 220 | </widget> |
221 | <spacer> | 221 | <spacer> |
222 | <property> | 222 | <property> |
223 | <name>name</name> | 223 | <name>name</name> |
224 | <cstring>Spacer4</cstring> | 224 | <cstring>Spacer4</cstring> |
225 | </property> | 225 | </property> |
226 | <property stdset="1"> | 226 | <property stdset="1"> |
227 | <name>orientation</name> | 227 | <name>orientation</name> |
228 | <enum>Horizontal</enum> | 228 | <enum>Horizontal</enum> |
229 | </property> | 229 | </property> |
230 | <property stdset="1"> | 230 | <property stdset="1"> |
231 | <name>sizeType</name> | 231 | <name>sizeType</name> |
232 | <enum>Expanding</enum> | 232 | <enum>Expanding</enum> |
233 | </property> | 233 | </property> |
234 | <property> | 234 | <property> |
235 | <name>sizeHint</name> | 235 | <name>sizeHint</name> |
236 | <size> | 236 | <size> |
237 | <width>20</width> | 237 | <width>20</width> |
238 | <height>20</height> | 238 | <height>20</height> |
239 | </size> | 239 | </size> |
240 | </property> | 240 | </property> |
241 | </spacer> | 241 | </spacer> |
242 | </hbox> | 242 | </hbox> |
243 | </widget> | 243 | </widget> |
244 | <widget row="4" column="0" > | 244 | <widget row="4" column="0" > |
245 | <class>QListBox</class> | 245 | <class>QListBox</class> |
246 | <property stdset="1"> | 246 | <property stdset="1"> |
247 | <name>name</name> | 247 | <name>name</name> |
248 | <cstring>activeServers</cstring> | 248 | <cstring>activeServers</cstring> |
249 | </property> | 249 | </property> |
250 | <property stdset="1"> | 250 | <property stdset="1"> |
251 | <name>enabled</name> | 251 | <name>enabled</name> |
252 | <bool>true</bool> | 252 | <bool>true</bool> |
253 | </property> | 253 | </property> |
254 | <property stdset="1"> | 254 | <property stdset="1"> |
255 | <name>selectionMode</name> | 255 | <name>selectionMode</name> |
256 | <enum>Multi</enum> | 256 | <enum>Multi</enum> |
257 | </property> | 257 | </property> |
258 | </widget> | 258 | </widget> |
259 | <widget row="1" column="0" > | 259 | <widget row="1" column="0" > |
260 | <class>QComboBox</class> | 260 | <class>QComboBox</class> |
261 | <property stdset="1"> | 261 | <property stdset="1"> |
262 | <name>name</name> | 262 | <name>name</name> |
263 | <cstring>settingName</cstring> | 263 | <cstring>settingName</cstring> |
264 | </property> | 264 | </property> |
265 | <property stdset="1"> | 265 | <property stdset="1"> |
266 | <name>enabled</name> | 266 | <name>enabled</name> |
267 | <bool>true</bool> | 267 | <bool>true</bool> |
268 | </property> | 268 | </property> |
269 | <property stdset="1"> | 269 | <property stdset="1"> |
270 | <name>focusPolicy</name> | 270 | <name>focusPolicy</name> |
271 | <enum>NoFocus</enum> | 271 | <enum>NoFocus</enum> |
272 | </property> | 272 | </property> |
273 | <property stdset="1"> | 273 | <property stdset="1"> |
274 | <name>editable</name> | 274 | <name>editable</name> |
275 | <bool>false</bool> | 275 | <bool>false</bool> |
276 | </property> | 276 | </property> |
277 | </widget> | 277 | </widget> |
278 | <widget row="2" column="0" > | 278 | <widget row="2" column="0" > |
279 | <class>QLayoutWidget</class> | 279 | <class>QLayoutWidget</class> |
280 | <property stdset="1"> | 280 | <property stdset="1"> |
281 | <name>name</name> | 281 | <name>name</name> |
282 | <cstring>Layout11</cstring> | 282 | <cstring>Layout11</cstring> |
283 | </property> | 283 | </property> |
284 | <hbox> | 284 | <hbox> |
285 | <property stdset="1"> | 285 | <property stdset="1"> |
286 | <name>margin</name> | 286 | <name>margin</name> |
287 | <number>0</number> | 287 | <number>0</number> |
288 | </property> | 288 | </property> |
289 | <property stdset="1"> | 289 | <property stdset="1"> |
290 | <name>spacing</name> | 290 | <name>spacing</name> |
291 | <number>6</number> | 291 | <number>6</number> |
292 | </property> | 292 | </property> |
293 | <widget> | 293 | <widget> |
294 | <class>QPushButton</class> | 294 | <class>QPushButton</class> |
295 | <property stdset="1"> | 295 | <property stdset="1"> |
296 | <name>name</name> | 296 | <name>name</name> |
297 | <cstring>newsetting</cstring> | 297 | <cstring>newsetting</cstring> |
298 | </property> | 298 | </property> |
299 | <property stdset="1"> | 299 | <property stdset="1"> |
300 | <name>enabled</name> | 300 | <name>enabled</name> |
301 | <bool>true</bool> | 301 | <bool>false</bool> |
302 | </property> | 302 | </property> |
303 | <property stdset="1"> | 303 | <property stdset="1"> |
304 | <name>text</name> | 304 | <name>text</name> |
305 | <string>New</string> | 305 | <string>New</string> |
306 | </property> | 306 | </property> |
307 | <property stdset="1"> | 307 | <property stdset="1"> |
308 | <name>autoDefault</name> | 308 | <name>autoDefault</name> |
309 | <bool>false</bool> | 309 | <bool>false</bool> |
310 | </property> | 310 | </property> |
311 | </widget> | 311 | </widget> |
312 | <widget> | 312 | <widget> |
313 | <class>QPushButton</class> | 313 | <class>QPushButton</class> |
314 | <property stdset="1"> | 314 | <property stdset="1"> |
315 | <name>name</name> | 315 | <name>name</name> |
316 | <cstring>renamesetting</cstring> | 316 | <cstring>renamesetting</cstring> |
317 | </property> | 317 | </property> |
318 | <property stdset="1"> | 318 | <property stdset="1"> |
319 | <name>enabled</name> | 319 | <name>enabled</name> |
320 | <bool>true</bool> | 320 | <bool>false</bool> |
321 | </property> | 321 | </property> |
322 | <property stdset="1"> | 322 | <property stdset="1"> |
323 | <name>text</name> | 323 | <name>text</name> |
324 | <string>Rename</string> | 324 | <string>Rename</string> |
325 | </property> | 325 | </property> |
326 | </widget> | 326 | </widget> |
327 | <widget> | 327 | <widget> |
328 | <class>QPushButton</class> | 328 | <class>QPushButton</class> |
329 | <property stdset="1"> | 329 | <property stdset="1"> |
330 | <name>name</name> | 330 | <name>name</name> |
331 | <cstring>removesetting</cstring> | 331 | <cstring>removesetting</cstring> |
332 | </property> | 332 | </property> |
333 | <property stdset="1"> | 333 | <property stdset="1"> |
334 | <name>enabled</name> | 334 | <name>enabled</name> |
335 | <bool>true</bool> | 335 | <bool>false</bool> |
336 | </property> | 336 | </property> |
337 | <property stdset="1"> | 337 | <property stdset="1"> |
338 | <name>text</name> | 338 | <name>text</name> |
339 | <string>Remove</string> | 339 | <string>Remove</string> |
340 | </property> | 340 | </property> |
341 | <property stdset="1"> | 341 | <property stdset="1"> |
342 | <name>autoDefault</name> | 342 | <name>autoDefault</name> |
343 | <bool>false</bool> | 343 | <bool>false</bool> |
344 | </property> | 344 | </property> |
345 | </widget> | 345 | </widget> |
346 | </hbox> | 346 | </hbox> |
347 | </widget> | 347 | </widget> |
348 | </grid> | 348 | </grid> |
349 | </widget> | 349 | </widget> |
350 | <widget> | 350 | <widget> |
351 | <class>QWidget</class> | 351 | <class>QWidget</class> |
352 | <property stdset="1"> | 352 | <property stdset="1"> |
353 | <name>name</name> | 353 | <name>name</name> |
354 | <cstring>tab</cstring> | 354 | <cstring>tab</cstring> |
355 | </property> | 355 | </property> |
356 | <attribute> | 356 | <attribute> |
357 | <name>title</name> | 357 | <name>title</name> |
358 | <string>Servers</string> | 358 | <string>Servers</string> |
359 | </attribute> | 359 | </attribute> |
360 | <grid> | 360 | <grid> |
361 | <property stdset="1"> | 361 | <property stdset="1"> |
362 | <name>margin</name> | 362 | <name>margin</name> |
363 | <number>3</number> | 363 | <number>3</number> |
364 | </property> | 364 | </property> |
365 | <property stdset="1"> | 365 | <property stdset="1"> |
366 | <name>spacing</name> | 366 | <name>spacing</name> |
367 | <number>3</number> | 367 | <number>3</number> |
368 | </property> | 368 | </property> |
369 | <widget row="3" column="0" rowspan="1" colspan="2" > | 369 | <widget row="3" column="0" rowspan="1" colspan="2" > |
370 | <class>QLayoutWidget</class> | 370 | <class>QLayoutWidget</class> |
371 | <property stdset="1"> | 371 | <property stdset="1"> |
372 | <name>name</name> | 372 | <name>name</name> |
373 | <cstring>Layout4</cstring> | 373 | <cstring>Layout4</cstring> |
374 | </property> | 374 | </property> |
375 | <grid> | 375 | <grid> |
376 | <property stdset="1"> | 376 | <property stdset="1"> |
377 | <name>margin</name> | 377 | <name>margin</name> |
378 | <number>0</number> | 378 | <number>0</number> |
379 | </property> | 379 | </property> |
380 | <property stdset="1"> | 380 | <property stdset="1"> |
381 | <name>spacing</name> | 381 | <name>spacing</name> |
382 | <number>6</number> | 382 | <number>6</number> |
383 | </property> | 383 | </property> |
384 | <widget row="0" column="1" > | 384 | <widget row="0" column="1" > |
385 | <class>QLineEdit</class> | 385 | <class>QLineEdit</class> |
386 | <property stdset="1"> | 386 | <property stdset="1"> |
387 | <name>name</name> | 387 | <name>name</name> |
388 | <cstring>servername</cstring> | 388 | <cstring>servername</cstring> |
389 | </property> | 389 | </property> |
390 | </widget> | 390 | </widget> |
391 | <widget row="0" column="0" > | 391 | <widget row="0" column="0" > |
392 | <class>QLabel</class> | 392 | <class>QLabel</class> |
393 | <property stdset="1"> | 393 | <property stdset="1"> |
394 | <name>name</name> | 394 | <name>name</name> |
395 | <cstring>TextLabel1_3</cstring> | 395 | <cstring>TextLabel1_3</cstring> |
396 | </property> | 396 | </property> |
397 | <property stdset="1"> | 397 | <property stdset="1"> |
398 | <name>text</name> | 398 | <name>text</name> |
399 | <string>Name:</string> | 399 | <string>Name:</string> |
400 | </property> | 400 | </property> |
401 | </widget> | 401 | </widget> |
402 | <widget row="1" column="1" > | 402 | <widget row="1" column="1" > |
403 | <class>QLineEdit</class> | 403 | <class>QLineEdit</class> |
404 | <property stdset="1"> | 404 | <property stdset="1"> |
405 | <name>name</name> | 405 | <name>name</name> |
406 | <cstring>serverurl</cstring> | 406 | <cstring>serverurl</cstring> |
407 | </property> | 407 | </property> |
408 | </widget> | 408 | </widget> |
409 | <widget row="1" column="0" > | 409 | <widget row="1" column="0" > |
410 | <class>QLabel</class> | 410 | <class>QLabel</class> |
411 | <property stdset="1"> | 411 | <property stdset="1"> |
412 | <name>name</name> | 412 | <name>name</name> |
413 | <cstring>TextLabel2_3</cstring> | 413 | <cstring>TextLabel2_3</cstring> |
414 | </property> | 414 | </property> |
415 | <property stdset="1"> | 415 | <property stdset="1"> |
416 | <name>text</name> | 416 | <name>text</name> |
417 | <string>URL:</string> | 417 | <string>URL:</string> |
418 | </property> | 418 | </property> |
419 | </widget> | 419 | </widget> |
420 | </grid> | 420 | </grid> |
421 | </widget> | 421 | </widget> |
422 | <widget row="0" column="0" rowspan="1" colspan="2" > | 422 | <widget row="0" column="0" rowspan="1" colspan="2" > |
423 | <class>QLayoutWidget</class> | 423 | <class>QLayoutWidget</class> |
424 | <property stdset="1"> | 424 | <property stdset="1"> |
425 | <name>name</name> | 425 | <name>name</name> |
426 | <cstring>Layout2</cstring> | 426 | <cstring>Layout2</cstring> |
427 | </property> | 427 | </property> |
428 | <hbox> | 428 | <hbox> |
429 | <property stdset="1"> | 429 | <property stdset="1"> |
430 | <name>margin</name> | 430 | <name>margin</name> |
431 | <number>0</number> | 431 | <number>0</number> |
432 | </property> | 432 | </property> |
433 | <property stdset="1"> | 433 | <property stdset="1"> |
434 | <name>spacing</name> | 434 | <name>spacing</name> |
435 | <number>6</number> | 435 | <number>6</number> |
436 | </property> | 436 | </property> |
437 | <widget> | 437 | <widget> |
438 | <class>QLabel</class> | 438 | <class>QLabel</class> |
439 | <property stdset="1"> | 439 | <property stdset="1"> |
440 | <name>name</name> | 440 | <name>name</name> |
441 | <cstring>Servers</cstring> | 441 | <cstring>Servers</cstring> |
442 | </property> | 442 | </property> |
443 | <property stdset="1"> | 443 | <property stdset="1"> |
444 | <name>text</name> | 444 | <name>text</name> |
445 | <string>Servers</string> | 445 | <string>Servers</string> |
446 | </property> | 446 | </property> |
447 | </widget> | 447 | </widget> |
448 | <spacer> | 448 | <spacer> |
449 | <property> | 449 | <property> |
450 | <name>name</name> | 450 | <name>name</name> |
451 | <cstring>Spacer2</cstring> | 451 | <cstring>Spacer2</cstring> |
452 | </property> | 452 | </property> |
453 | <property stdset="1"> | 453 | <property stdset="1"> |
454 | <name>orientation</name> | 454 | <name>orientation</name> |
455 | <enum>Horizontal</enum> | 455 | <enum>Horizontal</enum> |
456 | </property> | 456 | </property> |
457 | <property stdset="1"> | 457 | <property stdset="1"> |
458 | <name>sizeType</name> | 458 | <name>sizeType</name> |
459 | <enum>Expanding</enum> | 459 | <enum>Expanding</enum> |
460 | </property> | 460 | </property> |
461 | <property> | 461 | <property> |
462 | <name>sizeHint</name> | 462 | <name>sizeHint</name> |
463 | <size> | 463 | <size> |
464 | <width>20</width> | 464 | <width>20</width> |
465 | <height>20</height> | 465 | <height>20</height> |
466 | </size> | 466 | </size> |
467 | </property> | 467 | </property> |
468 | </spacer> | 468 | </spacer> |
469 | </hbox> | 469 | </hbox> |
470 | </widget> | 470 | </widget> |
471 | <widget row="1" column="0" rowspan="1" colspan="2" > | 471 | <widget row="1" column="0" rowspan="1" colspan="2" > |
472 | <class>QListBox</class> | 472 | <class>QListBox</class> |
473 | <property stdset="1"> | 473 | <property stdset="1"> |
474 | <name>name</name> | 474 | <name>name</name> |
475 | <cstring>servers</cstring> | 475 | <cstring>servers</cstring> |
476 | </property> | 476 | </property> |
477 | <property stdset="1"> | 477 | <property stdset="1"> |
478 | <name>selectionMode</name> | 478 | <name>selectionMode</name> |
479 | <enum>Extended</enum> | 479 | <enum>Extended</enum> |
480 | </property> | 480 | </property> |
481 | </widget> | 481 | </widget> |
482 | <widget row="2" column="1" > | 482 | <widget row="2" column="1" > |
483 | <class>QPushButton</class> | 483 | <class>QPushButton</class> |
484 | <property stdset="1"> | 484 | <property stdset="1"> |
485 | <name>name</name> | 485 | <name>name</name> |
486 | <cstring>removeserver</cstring> | 486 | <cstring>removeserver</cstring> |
487 | </property> | 487 | </property> |
488 | <property stdset="1"> | 488 | <property stdset="1"> |
489 | <name>enabled</name> | 489 | <name>enabled</name> |
490 | <bool>true</bool> | 490 | <bool>true</bool> |
491 | </property> | 491 | </property> |
492 | <property stdset="1"> | 492 | <property stdset="1"> |
493 | <name>text</name> | 493 | <name>text</name> |
494 | <string>Remove</string> | 494 | <string>Remove</string> |
495 | </property> | 495 | </property> |
496 | <property stdset="1"> | 496 | <property stdset="1"> |
497 | <name>autoDefault</name> | 497 | <name>autoDefault</name> |
498 | <bool>false</bool> | 498 | <bool>false</bool> |
499 | </property> | 499 | </property> |
500 | </widget> | 500 | </widget> |
501 | <widget row="2" column="0" > | 501 | <widget row="2" column="0" > |
502 | <class>QPushButton</class> | 502 | <class>QPushButton</class> |
503 | <property stdset="1"> | 503 | <property stdset="1"> |
504 | <name>name</name> | 504 | <name>name</name> |
505 | <cstring>newserver</cstring> | 505 | <cstring>newserver</cstring> |
506 | </property> | 506 | </property> |
507 | <property stdset="1"> | 507 | <property stdset="1"> |
508 | <name>enabled</name> | 508 | <name>enabled</name> |
509 | <bool>true</bool> | 509 | <bool>true</bool> |
510 | </property> | 510 | </property> |
511 | <property stdset="1"> | 511 | <property stdset="1"> |
512 | <name>text</name> | 512 | <name>text</name> |
513 | <string>New</string> | 513 | <string>New</string> |
514 | </property> | 514 | </property> |
515 | <property stdset="1"> | 515 | <property stdset="1"> |
516 | <name>autoDefault</name> | 516 | <name>autoDefault</name> |
517 | <bool>false</bool> | 517 | <bool>false</bool> |
518 | </property> | 518 | </property> |
519 | </widget> | 519 | </widget> |
520 | </grid> | 520 | </grid> |
521 | </widget> | 521 | </widget> |
522 | <widget> | 522 | <widget> |
523 | <class>QWidget</class> | 523 | <class>QWidget</class> |
524 | <property stdset="1"> | 524 | <property stdset="1"> |
525 | <name>name</name> | 525 | <name>name</name> |
526 | <cstring>tab</cstring> | 526 | <cstring>tab</cstring> |
527 | </property> | 527 | </property> |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 528365e..681f2d4 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,183 +1,219 @@ | |||
1 | #include "pmipkg.h" | 1 | #include "pmipkg.h" |
2 | #include "pkdesc.h" | 2 | #include "pkdesc.h" |
3 | #include "pkfind.h" | 3 | #include "pkfind.h" |
4 | #include "pksettings.h" | 4 | #include "pksettings.h" |
5 | #include "package.h" | 5 | #include "package.h" |
6 | #include "packagelistitem.h" | 6 | #include "packagelistitem.h" |
7 | 7 | ||
8 | #include <qpe/process.h> | 8 | #include <qpe/process.h> |
9 | #include <qpe/resource.h> | 9 | #include <qpe/resource.h> |
10 | #include <qpe/stringutil.h> | 10 | #include <qpe/stringutil.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qfile.h> | 13 | #include <qfile.h> |
14 | #include <qmultilineedit.h> | 14 | #include <qmultilineedit.h> |
15 | #include <qstring.h> | 15 | #include <qstring.h> |
16 | #include <qtextstream.h> | 16 | #include <qtextstream.h> |
17 | #include <qtextview.h> | 17 | #include <qtextview.h> |
18 | 18 | ||
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <unistd.h> | 20 | #include <unistd.h> |
21 | 21 | ||
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include "runwindow.h" | 23 | #include "runwindow.h" |
24 | 24 | ||
25 | 25 | ||
26 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 26 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
27 | : RunWindow ( p, name, f ) | 27 | // : RunWindow ( p, name, f ) |
28 | //: QObject ( p ) | 28 | : QObject ( p ) |
29 | { | 29 | { |
30 | settings = s; | 30 | settings = s; |
31 | 31 | runwindow = new RunWindow ( p, name, f ); | |
32 | linkDest = new QCopChannel( "QPE/MakeLinks", this ); | 32 | linkDest = new QCopChannel( "QPE/MakeLinks", this ); |
33 | connect( linkDest, SIGNAL(received(const QCString &, const QByteArray &)), | 33 | connect( linkDest, SIGNAL(received(const QCString &, const QByteArray &)), |
34 | this, SLOT(linkDestination( const QString &, const QString&)) ); | 34 | this, SLOT(linkDestination( const QString &, const QByteArray&)) ); |
35 | } | 35 | } |
36 | 36 | ||
37 | PmIpkg::~PmIpkg() | 37 | PmIpkg::~PmIpkg() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | //#define PROC | ||
42 | #define SYSTEM | ||
41 | int PmIpkg::runIpkg(const QString& args) | 43 | int PmIpkg::runIpkg(const QString& args) |
42 | { | 44 | { |
43 | pvDebug(4,"PmIpkg::runIpkg"); | 45 | pvDebug(2,"PmIpkg::runIpkg "+args); |
46 | #ifdef PROC | ||
47 | QStringList cmd = "/usr/bin/ipkg "; | ||
48 | #endif | ||
49 | #ifdef SYSTEM | ||
44 | QString cmd = "/usr/bin/ipkg "; | 50 | QString cmd = "/usr/bin/ipkg "; |
51 | #endif | ||
45 | cmd += " -dest "+settings->getDestinationName(); | 52 | cmd += " -dest "+settings->getDestinationName(); |
46 | cmd += " -force-defaults "; | 53 | cmd += " -force-defaults "; |
47 | 54 | ||
48 | outPut->setText( outPut->text()+"<br><br>Starting to "+ args+"<br>\n"); | 55 | out( "Starting to "+ args+"<br>\n"); |
49 | QString redirect = "/tmp/ipkg.pipe"; | 56 | cmd += args; |
50 | cmd += args+" | tee "+redirect+" 2>&1&"; | 57 | out( "running:<br>\n"+cmd+"<br>\n" ); |
51 | 58 | int r = 0; | |
52 | outPut->setText( outPut->text() + "running:<br>\n"+cmd+"<br>\n" ); | 59 | #ifdef PROC |
53 | pvDebug( 0, "Execute >"+cmd+"<" ); | 60 | QString o = "start"; |
54 | int r = system(cmd.latin1()); | 61 | Process ipkg( cmd ); |
62 | QString description; | ||
63 | ipkg.exec("",o); | ||
64 | out( o ); | ||
65 | #endif | ||
66 | #ifdef SYSTEM | ||
67 | QString redirect = "/tmp/oipkg.pipe"; | ||
68 | cmd += " | tee "+redirect+" 2>&1"; | ||
69 | r = system(cmd.latin1()); | ||
55 | QFile f( redirect ); | 70 | QFile f( redirect ); |
56 | if ( f.open(IO_ReadOnly) ) { | 71 | while ( ! f.open(IO_ReadOnly) ) {}; |
72 | // if ( f.open(IO_ReadOnly) ) {}; | ||
73 | { | ||
57 | QTextStream t( &f ); | 74 | QTextStream t( &f ); |
58 | QString fp; | 75 | QString fp; |
59 | while ( !t.eof() ) | 76 | while ( !t.eof() ) |
60 | { | ||
61 | outPut->setText( outPut->text() + t.readLine() +"\n<br>" ); | ||
62 | } | ||
63 | } | ||
64 | f.close(); | ||
65 | outPut->setText( outPut->text() + "\n<br><br>Finished!"); | ||
66 | outPut->setContentsPos(0,outPut->contentsHeight()); | ||
67 | |||
68 | if ( r == 0 ) | ||
69 | { | 77 | { |
70 | QString param = args.left( args.find(" ") ); | 78 | out( t.readLine() +"<br>" ); |
71 | QString file = args.right( args.length() - args.find(" ") ); | ||
72 | if ( param == "install" && settings->createLinks() ) | ||
73 | makeLinks( file); | ||
74 | } | 79 | } |
80 | } | ||
81 | f.close(); | ||
82 | out( "Finished!<br>"); | ||
83 | #endif | ||
75 | 84 | ||
76 | return r; | 85 | return r; |
77 | } | 86 | } |
78 | 87 | ||
79 | void PmIpkg::makeLinks(QString file) | 88 | void PmIpkg::makeLinks(QString file) |
80 | { | 89 | { |
81 | outPut->setText( outPut->text() + "<br>creating links<br>" ); | 90 | out( "<br>creating links<br>" ); |
82 | QString dest = settings->getDestinationUrl(); | 91 | QString dest = settings->getDestinationUrl(); |
83 | system(("ipkg -d "+dest+" files "+file+"> /tmp/oipkg.pipe").latin1()); | 92 | out("for package "+file+" in "+dest+"<br>"); |
93 | system(("ipkg -d "+dest+" files "+file+"> /tmp/oipkg.pipe 2>&1").latin1()); | ||
84 | QFile f( "/tmp/oipkg.pipe" ); | 94 | QFile f( "/tmp/oipkg.pipe" ); |
85 | if ( ! f.open(IO_ReadOnly) )return; | 95 | while ( ! f.open(IO_ReadOnly) ) {}; |
86 | QTextStream t( &f ); | 96 | QTextStream t( &f ); |
87 | QString fp; | 97 | QString fp; |
88 | while ( !t.eof() ) | 98 | while ( !t.eof() ) |
89 | { | 99 | { |
90 | processLinkDir( t.readLine(), dest ); | 100 | fp = t.readLine(); |
101 | processLinkDir( fp, dest ); | ||
91 | } | 102 | } |
92 | f.close(); | 103 | f.close(); |
93 | } | 104 | } |
94 | 105 | ||
95 | void PmIpkg::processLinkDir( QString file, QString dest ) | 106 | void PmIpkg::processLinkDir( QString file, QString dest ) |
96 | { | 107 | { |
97 | QString destFile = file.right( file.length() - dest.length() ); | 108 | QString destFile = file.right( file.length() - dest.length() ); |
98 | QFileInfo fileInfo( file ); | 109 | QFileInfo fileInfo( file ); |
99 | if ( fileInfo.isFile() ) | ||
100 | { | ||
101 | const char *instFile = strdup( (file).ascii() ); | ||
102 | const char *linkFile = strdup( (destFile).ascii()); | ||
103 | outPut->setText( outPut->text() + "linking: "+file+" -> "+destFile ); | ||
104 | symlink( instFile, linkFile ); | ||
105 | } | ||
106 | if ( fileInfo.isDir() ) | 110 | if ( fileInfo.isDir() ) |
111 | { | ||
112 | QDir destDir( destFile ); | ||
113 | destDir.mkdir( destFile, true ); | ||
114 | QDir d( file ); | ||
115 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | ||
116 | const QFileInfoList *list = d.entryInfoList(); | ||
117 | QFileInfoListIterator it( *list ); | ||
118 | QFileInfo *fi; | ||
119 | while ( (fi=it.current()) ) | ||
107 | { | 120 | { |
108 | QDir destDir( destFile ); | 121 | out( "<b>"+fi->absFilePath()+"</b>" ); |
109 | destDir.mkdir( destFile, true ); | 122 | processLinkDir( fi->absFilePath(), dest ); |
110 | QDir d( file ); | 123 | ++it; |
111 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | ||
112 | |||
113 | const QFileInfoList *list = d.entryInfoList(); | ||
114 | QFileInfoListIterator it( *list ); | ||
115 | QFileInfo *fi; | ||
116 | while ( (fi=it.current()) ) { | ||
117 | processLinkDir( fi->absFilePath(), dest ); | ||
118 | ++it; | ||
119 | } | ||
120 | } | 124 | } |
125 | } else | ||
126 | if ( fileInfo.isFile() ) | ||
127 | { | ||
128 | const char *instFile = strdup( (file).ascii() ); | ||
129 | const char *linkFile = strdup( (destFile).ascii()); | ||
130 | out( "linking: "+file+" -> "+destFile ); | ||
131 | qDebug( "linking: %s -> %s", instFile, linkFile ); | ||
132 | symlink( instFile, linkFile ); | ||
133 | } | ||
121 | } | 134 | } |
122 | 135 | ||
123 | void PmIpkg::commit( PackageList pl ) | 136 | void PmIpkg::commit( PackageList pl ) |
124 | { | 137 | { |
125 | showMaximized(); | 138 | runwindow->showMaximized(); |
126 | exec(); | 139 | // exec(); |
127 | outPut->setText( "<b>Starting...</b><br>\n"); | 140 | runwindow->outPut->setText(""); |
141 | out( "<h1>Starting...</h1><br>\n"); | ||
128 | QStringList to_remove, to_install; | 142 | QStringList to_remove, to_install; |
129 | 143 | ||
130 | QString rem="To remove:<br>\n"; | 144 | QString rem="<b>To remove:</b><br>\n"; |
131 | QString inst="To install:<br>\n";; | 145 | QString inst="<b>To install:</b><br>\n";; |
132 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 146 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
133 | { | 147 | { |
134 | if ( pack && (pack->name() != "") && pack) | 148 | if ( pack && (pack->name() != "") && pack) |
135 | { | 149 | { |
136 | if ( pack->toInstall() ) | 150 | if ( pack->toInstall() ) |
137 | { | 151 | { |
138 | to_install.append( pack->name() ); | 152 | to_install.append( pack->name() ); |
139 | inst += pack->name()+"\n"; | 153 | inst += pack->name()+"<br>"; |
140 | } | 154 | } |
141 | if ( pack->toRemove() ) | 155 | if ( pack->toRemove() ) |
142 | { | 156 | { |
143 | to_remove.append( pack->name() ); | 157 | to_remove.append( pack->name() ); |
144 | rem += pack->name()+"\n"; | 158 | rem += pack->name()+"<br>"; |
145 | } | 159 | } |
146 | } | 160 | } |
147 | } | 161 | } |
148 | 162 | ||
149 | outPut->setText( outPut->text()+inst+rem); | 163 | out("<p>"+inst+"</p>"+"<p>"+rem+"</p>"); |
150 | bool ok=TRUE; | 164 | bool ok=TRUE; |
151 | 165 | ||
152 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); | 166 | qDebug("to remove=%i; to install=%i",to_remove.count(),to_install.count()); |
153 | 167 | ||
154 | int jobs = to_remove.count()+to_install.count(); | 168 | int jobs = to_remove.count()+to_install.count(); |
155 | if ( jobs < 1 ) return; | 169 | if ( jobs < 1 ) return; |
156 | 170 | ||
157 | if ( to_remove.count() ) | 171 | if ( to_remove.count() ) |
158 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) | 172 | for (QStringList::ConstIterator it=to_remove.begin(); it!=to_remove.end(); ++it) |
159 | if ( runIpkg("remove " + *it) != 0 ) ok = false; | 173 | if ( runIpkg("remove " + *it) != 0 ) ok = false; |
160 | if ( to_install.count() ) | 174 | if ( to_install.count() ) |
161 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) | 175 | for (QStringList::ConstIterator it=to_install.begin(); it!=to_install.end(); ++it) |
162 | if ( runIpkg("install " + *it) != 0 ) ok = false; | 176 | { |
177 | if ( runIpkg("install " + *it) == 0 ) | ||
178 | { | ||
179 | if ( settings->createLinks() ) | ||
180 | makeLinks( *it ); | ||
181 | }else{ | ||
182 | ok = false; | ||
183 | } | ||
184 | } | ||
163 | 185 | ||
164 | // ##### If we looked in the list of files, we could send out accurate | 186 | // ##### If we looked in the list of files, we could send out accurate |
165 | // ##### messages. But we don't bother yet, and just do an "all". | 187 | // ##### messages. But we don't bother yet, and just do an "all". |
166 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 188 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
167 | QString lf = QString::null; | 189 | QString lf = QString::null; |
168 | e << lf; | 190 | e << lf; |
169 | } | 191 | } |
170 | 192 | ||
171 | void PmIpkg::linkDestination( QString src, QString dest ) | 193 | void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) |
194 | // add 3rd package parameter | ||
172 | { | 195 | { |
173 | QDir d( src ); | 196 | qDebug("msg="+msg+" -- "+QString(dest) ); |
174 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 197 | // QDir d( src ); |
175 | if (! d.exists() ) return; | 198 | // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
176 | const QFileInfoList *list = d.entryInfoList(); | 199 | //// if (! d.exists() ) return; |
177 | QFileInfoListIterator it( *list ); | 200 | // const QFileInfoList *list = d.entryInfoList(); |
178 | QFileInfo *fi; | 201 | // QFileInfoListIterator it( *list ); |
179 | while ( (fi=it.current()) ) { | 202 | // QFileInfo *fi; |
180 | processLinkDir( fi->absFilePath(), dest ); | 203 | // while ( (fi=it.current()) ) { |
181 | ++it; | 204 | // processLinkDir( fi->absFilePath(), dest ); |
182 | } | 205 | // ++it; |
206 | // } | ||
207 | } | ||
208 | |||
209 | void PmIpkg::update() | ||
210 | { | ||
211 | runwindow->showMaximized(); | ||
212 | runIpkg( "update" ); | ||
213 | } | ||
214 | |||
215 | void PmIpkg::out( QString o ) | ||
216 | { | ||
217 | runwindow->outPut->setText( runwindow->outPut->text()+o ); | ||
218 | runwindow->outPut->setContentsPos(0,runwindow->outPut->contentsHeight()); | ||
183 | } | 219 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 98efaa6..e6486ff 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,42 +1,46 @@ | |||
1 | #ifndef PMIPKG_H | 1 | #ifndef PMIPKG_H |
2 | #define PMIPKG_H | 2 | #define PMIPKG_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qwidget.h> | 7 | #include <qwidget.h> |
8 | #include "pksettings.h" | 8 | #include "pksettings.h" |
9 | #include "runwindow.h" | 9 | #include "runwindow.h" |
10 | #include "packagelist.h" | 10 | #include "packagelist.h" |
11 | #include "debug.h" | 11 | #include "debug.h" |
12 | 12 | ||
13 | //#define DIA | ||
13 | 14 | ||
14 | #include <qpe/qcopenvelope_qws.h> | 15 | #include <qpe/qcopenvelope_qws.h> |
15 | 16 | ||
16 | class PmIpkg : public RunWindow | 17 | |
17 | //class PmIpkg : public QObject | 18 | //class PmIpkg : public RunWindow |
19 | class PmIpkg : public QObject | ||
18 | { | 20 | { |
19 | Q_OBJECT | 21 | Q_OBJECT |
20 | public: | 22 | public: |
21 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 23 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
22 | //PmIpkg( QObject*, PackageManagerSettings* ); | 24 | //PmIpkg( QObject*, PackageManagerSettings* ); |
23 | ~PmIpkg(); | 25 | ~PmIpkg(); |
24 | 26 | ||
27 | void commit( PackageList ); | ||
28 | void update(); | ||
25 | PackageList* getPackageList(); | 29 | PackageList* getPackageList(); |
26 | 30 | ||
27 | private: | 31 | private: |
28 | PackageManagerSettings* settings; | 32 | PackageManagerSettings* settings; |
33 | RunWindow *runwindow; | ||
29 | QCopChannel *linkDest; | 34 | QCopChannel *linkDest; |
30 | void processLinkDir( QString, QString ); | ||
31 | |||
32 | 35 | ||
33 | public: | ||
34 | void makeLinks(QString); | 36 | void makeLinks(QString); |
37 | void processLinkDir( QString, QString ); | ||
38 | |||
35 | int runIpkg(const QString& args); | 39 | int runIpkg(const QString& args); |
36 | void commit( PackageList ); | 40 | void out( QString ); |
37 | 41 | ||
38 | public slots: | 42 | public slots: |
39 | void linkDestination( QString, QString ); | 43 | void linkDestination( const QString, const QByteArray ); |
40 | }; | 44 | }; |
41 | 45 | ||
42 | #endif | 46 | #endif |
diff --git a/noncore/unsupported/oipkg/runwindow.ui b/noncore/unsupported/oipkg/runwindow.ui index 23f58cf..9113f2d 100644 --- a/noncore/unsupported/oipkg/runwindow.ui +++ b/noncore/unsupported/oipkg/runwindow.ui | |||
@@ -1,63 +1,63 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>RunWindow</class> | 2 | <class>RunWindow</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>RunWindow</cstring> | 7 | <cstring>RunWindow</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>201</width> | 14 | <width>197</width> |
15 | <height>291</height> | 15 | <height>291</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>running...</string> | 20 | <string>running...</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <grid> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>5</number> | 31 | <number>5</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>2</number> | 35 | <number>2</number> |
36 | </property> | 36 | </property> |
37 | <widget row="0" column="0" > | 37 | <widget row="0" column="0" > |
38 | <class>QProgressBar</class> | 38 | <class>QProgressBar</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>progress</cstring> | 41 | <cstring>progress</cstring> |
42 | </property> | 42 | </property> |
43 | <property stdset="1"> | 43 | <property stdset="1"> |
44 | <name>progress</name> | 44 | <name>progress</name> |
45 | <number>0</number> | 45 | <number>42</number> |
46 | </property> | 46 | </property> |
47 | </widget> | 47 | </widget> |
48 | <widget row="1" column="0" > | 48 | <widget row="1" column="0" > |
49 | <class>QTextView</class> | 49 | <class>QTextView</class> |
50 | <property stdset="1"> | 50 | <property stdset="1"> |
51 | <name>name</name> | 51 | <name>name</name> |
52 | <cstring>outPut</cstring> | 52 | <cstring>outPut</cstring> |
53 | </property> | 53 | </property> |
54 | <property stdset="1"> | 54 | <property stdset="1"> |
55 | <name>font</name> | 55 | <name>font</name> |
56 | <font> | 56 | <font> |
57 | <pointsize>6</pointsize> | 57 | <pointsize>6</pointsize> |
58 | </font> | 58 | </font> |
59 | </property> | 59 | </property> |
60 | </widget> | 60 | </widget> |
61 | </grid> | 61 | </grid> |
62 | </widget> | 62 | </widget> |
63 | </UI> | 63 | </UI> |