author | tille <tille> | 2002-05-01 14:00:09 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-01 14:00:09 (UTC) |
commit | e729a9bdd9f37f4bd610d10122f002a0540c93ed (patch) (unidiff) | |
tree | a23696d8742a36b57256281dc7e2f7848407be61 | |
parent | 7e5615473c1d103db66f42ae60bf9ed57d52566c (diff) | |
download | opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.zip opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.gz opie-e729a9bdd9f37f4bd610d10122f002a0540c93ed.tar.bz2 |
added ipkgfind remote query
24 files changed, 552 insertions, 234 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO index 790766c..fc2e8a4 100644 --- a/noncore/unsupported/oipkg/TODO +++ b/noncore/unsupported/oipkg/TODO | |||
@@ -9 +9,6 @@ | |||
9 | * dependency checking | 9 | * dependency checking |
10 | * create dest if it does not exist | ||
11 | * allow reinstalling | ||
12 | * handle different versions | ||
13 | * different types of filters and searches | ||
14 | i.e. name, desc, files etc \ No newline at end of file | ||
diff --git a/noncore/unsupported/oipkg/debug.h b/noncore/unsupported/oipkg/debug.h index 206dea5..d20a5eb 100644 --- a/noncore/unsupported/oipkg/debug.h +++ b/noncore/unsupported/oipkg/debug.h | |||
@@ -8,3 +8,3 @@ extern int debugLevel; | |||
8 | #define HACK | 8 | #define HACK |
9 | 9 | #define PACKAGELISTLOCAL | |
10 | #define NEWLAYOUT | 10 | #define NEWLAYOUT |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index ca1e5e8..06828e0 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -25,2 +25,3 @@ | |||
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qpushbutton.h> | ||
26 | #include <qlayout.h> | 27 | #include <qlayout.h> |
@@ -44,3 +45,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
44 | ipkg = new PmIpkg( settings, this ); | 45 | ipkg = new PmIpkg( settings, this ); |
46 | // settings->setIpkg( ipkg ); | ||
45 | packageList.setSettings( settings ); | 47 | packageList.setSettings( settings ); |
48 | packageListSearch.setSettings( settings ); | ||
46 | packageList.update(); | 49 | packageList.update(); |
@@ -56,2 +59,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | |||
56 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 59 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
60 | |||
61 | connect( settings->removeLinksButton, SIGNAL( clicked()), | ||
62 | SLOT(removeLinks()) ); | ||
63 | connect( settings->createLinksButton, SIGNAL( clicked()), | ||
64 | SLOT(createLinks()) ); | ||
65 | |||
66 | //rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
67 | //rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
57 | displayList(); | 68 | displayList(); |
@@ -99,10 +110,2 @@ void MainWindow::makeMenu() | |||
99 | 110 | ||
100 | // could we use for find | ||
101 | // detailsAction = new QAction( tr( "Find" ), | ||
102 | // Resource::loadIconSet( "find" ), | ||
103 | // QString::null, 0, this, 0 ); | ||
104 | // connect( detailsAction, SIGNAL( activated() ), | ||
105 | // this , SLOT( showFind() ) ); | ||
106 | // detailsAction->addTo( toolBar ); | ||
107 | |||
108 | QAction *cfgact; | 111 | QAction *cfgact; |
@@ -128,2 +131,3 @@ void MainWindow::makeMenu() | |||
128 | 131 | ||
132 | // SECTIONS | ||
129 | sectionBar = new QPEToolBar( this ); | 133 | sectionBar = new QPEToolBar( this ); |
@@ -141,6 +145,4 @@ void MainWindow::makeMenu() | |||
141 | a->addTo( sectionBar ); | 145 | a->addTo( sectionBar ); |
142 | |||
143 | setSections(); | 146 | setSections(); |
144 | setSubSections(); | 147 | setSubSections(); |
145 | |||
146 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 148 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
@@ -150,4 +152,5 @@ void MainWindow::makeMenu() | |||
150 | 152 | ||
153 | //FIND | ||
151 | findBar = new QPEToolBar(this); | 154 | findBar = new QPEToolBar(this); |
152 | addToolBar( findBar, "Search", QMainWindow::Top, TRUE ); | 155 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
153 | label = new QLabel( tr("Filter: "), findBar ); | 156 | label = new QLabel( tr("Filter: "), findBar ); |
@@ -159,3 +162,2 @@ void MainWindow::makeMenu() | |||
159 | this, SLOT( displayList() ) ); | 162 | this, SLOT( displayList() ) ); |
160 | |||
161 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 163 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
@@ -166,3 +168,3 @@ void MainWindow::makeMenu() | |||
166 | a->addTo( findBar ); | 168 | a->addTo( findBar ); |
167 | findAction = new QAction( tr( "Find" ), QString::null, 0, this, 0 ); | 169 | findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); |
168 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); | 170 | connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); |
@@ -171,2 +173,27 @@ void MainWindow::makeMenu() | |||
171 | 173 | ||
174 | //SEARCH | ||
175 | searchBar = new QPEToolBar(this); | ||
176 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | ||
177 | label = new QLabel( tr("ipkgfind: "), searchBar ); | ||
178 | label->setBackgroundColor( searchBar->backgroundColor() ); | ||
179 | searchBar->setHorizontalStretchable( TRUE ); | ||
180 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | ||
181 | searchBar->setStretchableWidget( searchEdit ); | ||
182 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | ||
183 | // this, SLOT( displayList() ) ); | ||
184 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | ||
185 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | ||
186 | a->addTo( searchBar ); | ||
187 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | ||
188 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | ||
189 | searchCommit->addTo( searchBar ); | ||
190 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | ||
191 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | ||
192 | a->addTo( searchBar ); | ||
193 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | ||
194 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | ||
195 | searchAction->setToggleAction( true ); | ||
196 | searchAction->addTo( viewMenu ); | ||
197 | |||
198 | //DEST | ||
172 | destBar = new QPEToolBar(this); | 199 | destBar = new QPEToolBar(this); |
@@ -179,4 +206,4 @@ void MainWindow::makeMenu() | |||
179 | setComboName(destination,settings->getDestinationName()); | 206 | setComboName(destination,settings->getDestinationName()); |
180 | // connect( destination, SIGNAL(activated(int)), | 207 | connect( destination, SIGNAL(activated(int)), |
181 | // SLOT(activeDestinationChange(int)) ); | 208 | settings, SLOT(activeDestinationChange(int)) ); |
182 | spacer = new QLabel( " ", destBar ); | 209 | spacer = new QLabel( " ", destBar ); |
@@ -186,4 +213,4 @@ void MainWindow::makeMenu() | |||
186 | CheckBoxLink->setChecked( settings->createLinks() ); | 213 | CheckBoxLink->setChecked( settings->createLinks() ); |
187 | // connect( CheckBoxLink, SIGNAL(toggled(bool)), | 214 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
188 | // settings, SLOT(linkEnabled(bool)) ); | 215 | settings, SLOT(linkEnabled(bool)) ); |
189 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 216 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
@@ -202,2 +229,3 @@ void MainWindow::makeMenu() | |||
202 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 229 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
230 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | ||
203 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 231 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
@@ -211,2 +239,3 @@ MainWindow::~MainWindow() | |||
211 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 239 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
240 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | ||
212 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 241 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
@@ -219,2 +248,3 @@ void MainWindow::runIpkg() | |||
219 | packageList.allPackages(); | 248 | packageList.allPackages(); |
249 | ipkg->loadList( packageListSearch ); | ||
220 | ipkg->commit( packageList ); | 250 | ipkg->commit( packageList ); |
@@ -256,8 +286,17 @@ void MainWindow::displayList() | |||
256 | Package *pack = packageList.first(); | 286 | Package *pack = packageList.first(); |
287 | PackageListItem *item; | ||
288 | |||
289 | QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
290 | QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
257 | while( pack ) | 291 | while( pack ) |
258 | { | 292 | { |
259 | if ( pack && (pack->name() != "") ) | 293 | item = new PackageListItem( rootLocal, pack, settings ); |
260 | listViewPackages->insertItem( new PackageListItem( listViewPackages, pack, settings ) ); | ||
261 | pack = packageList.next(); | 294 | pack = packageList.next(); |
262 | } | 295 | } |
296 | pack = packageListSearch.first(); | ||
297 | while( pack ) | ||
298 | { | ||
299 | item = new PackageListItem( rootSearch, pack, settings ); | ||
300 | pack = packageListSearch.next(); | ||
301 | } | ||
263 | } | 302 | } |
@@ -347,2 +386,15 @@ void MainWindow::findClose() | |||
347 | 386 | ||
387 | void MainWindow::searchShow(bool b) | ||
388 | { | ||
389 | if (b) searchBar->show(); | ||
390 | else searchBar->hide(); | ||
391 | searchAction->setOn( b ); | ||
392 | } | ||
393 | |||
394 | void MainWindow::searchClose() | ||
395 | { | ||
396 | searchAction->setOn( false ); | ||
397 | } | ||
398 | |||
399 | |||
348 | void MainWindow::destShow(bool b) | 400 | void MainWindow::destShow(bool b) |
@@ -422 +474,20 @@ void MainWindow::receive(const QCString &msg, const QByteArray &arg) | |||
422 | } | 474 | } |
475 | |||
476 | |||
477 | void MainWindow::createLinks() | ||
478 | { | ||
479 | pvDebug(2,"creating links..."); | ||
480 | ipkg->createLinks( settings->destinationurl->text() ); | ||
481 | } | ||
482 | |||
483 | void MainWindow::removeLinks() | ||
484 | { | ||
485 | pvDebug(2,"removing links..."); | ||
486 | ipkg->removeLinks( settings->destinationurl->text() ); | ||
487 | } | ||
488 | |||
489 | void MainWindow::remotePackageQuery() | ||
490 | { | ||
491 | packageListSearch.query( searchEdit->text() ); | ||
492 | displayList(); | ||
493 | } | ||
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 7615b09..4a73b78 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -9,2 +9,4 @@ | |||
9 | #include "packagelist.h" | 9 | #include "packagelist.h" |
10 | #include "packagelistremote.h" | ||
11 | #include "packagelistlocal.h" | ||
10 | #include "pmipkg.h" | 12 | #include "pmipkg.h" |
@@ -48,2 +50,4 @@ public slots: | |||
48 | void findShow(bool); | 50 | void findShow(bool); |
51 | void searchClose(); | ||
52 | void searchShow(bool); | ||
49 | void destClose(); | 53 | void destClose(); |
@@ -51,4 +55,7 @@ public slots: | |||
51 | void filterList(); | 55 | void filterList(); |
56 | void createLinks(); | ||
57 | void removeLinks(); | ||
52 | void receive (const QCString &, const QByteArray &); | 58 | void receive (const QCString &, const QByteArray &); |
53 | void setDocument (const QString &); | 59 | void setDocument (const QString &); |
60 | void remotePackageQuery(); | ||
54 | 61 | ||
@@ -63,3 +70,7 @@ private: | |||
63 | PackageManagerSettings *settings; | 70 | PackageManagerSettings *settings; |
64 | PackageList packageList; | 71 | PackageListLocal packageList; |
72 | PackageListRemote packageListSearch; | ||
73 | PackageListView *listViewPackages; | ||
74 | // QCheckListItem* rootSearch; | ||
75 | // QCheckListItem* rootLocal; | ||
65 | QAction *runAction; | 76 | QAction *runAction; |
@@ -67,7 +78,9 @@ private: | |||
67 | QAction *findAction; | 78 | QAction *findAction; |
68 | QAction *sectionAction; | ||
69 | QAction *destAction; | ||
70 | PackageListView *listViewPackages; | ||
71 | QPEToolBar *findBar; | 79 | QPEToolBar *findBar; |
72 | QLineEdit *findEdit; | 80 | QLineEdit *findEdit; |
81 | QAction *searchAction; | ||
82 | QAction *searchCommit; | ||
83 | QPEToolBar *searchBar; | ||
84 | QLineEdit *searchEdit; | ||
85 | QAction *sectionAction; | ||
73 | QPEToolBar *sectionBar; | 86 | QPEToolBar *sectionBar; |
@@ -75,2 +88,3 @@ private: | |||
75 | QComboBox *subsection; | 88 | QComboBox *subsection; |
89 | QAction *destAction; | ||
76 | QPEToolBar *destBar; | 90 | QPEToolBar *destBar; |
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index c5d3b3d..98f92c8 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro | |||
@@ -9,3 +9,5 @@ HEADERS = mainwindow.h \ | |||
9 | packagelistitem.h \ | 9 | packagelistitem.h \ |
10 | packagelistremote.h \ | ||
10 | packagelist.h \ | 11 | packagelist.h \ |
12 | packagelistlocal.h \ | ||
11 | packagelistview.h \ | 13 | packagelistview.h \ |
@@ -16,2 +18,4 @@ SOURCES = main.cpp \ | |||
16 | packagelistview.cpp \ | 18 | packagelistview.cpp \ |
19 | packagelistremote.cpp \ | ||
20 | packagelistlocal.cpp \ | ||
17 | pksettings.cpp \ | 21 | pksettings.cpp \ |
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 0499e19..6bb53a9 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -30,2 +30,3 @@ void Package::init( PackageManagerSettings *s ) | |||
30 | _toProcess = false; | 30 | _toProcess = false; |
31 | _useFileName = false; | ||
31 | _status = ""; | 32 | _status = ""; |
@@ -50,3 +51,4 @@ Package::Package( QString n, PackageManagerSettings *s ) | |||
50 | _toProcess = true; | 51 | _toProcess = true; |
51 | _packageName = QString( n ); | 52 | _useFileName = true; |
53 | _fileName = QString( n ); | ||
52 | } | 54 | } |
@@ -92,3 +94,3 @@ void Package::setValue( QString n, QString t ) | |||
92 | { | 94 | { |
93 | 95 | _fileName = t; | |
94 | }else if ( n == "Size") | 96 | }else if ( n == "Size") |
@@ -120,2 +122,9 @@ QString Package::name() | |||
120 | 122 | ||
123 | |||
124 | QString Package::installName() | ||
125 | { | ||
126 | if (_useFileName) return _fileName; | ||
127 | else return _name; | ||
128 | } | ||
129 | |||
121 | bool Package::installed() | 130 | bool Package::installed() |
@@ -333,6 +342,11 @@ void Package::parseIpkgFile( QString file) | |||
333 | 342 | ||
334 | QString Package::getPackageName() | 343 | //QString Package::getPackageName() |
344 | //{ | ||
345 | //if ( _packageName.isEmpty() ) return _name; | ||
346 | //else return _packageName; | ||
347 | //} | ||
348 | |||
349 | void Package::instalFromFile(bool iff) | ||
335 | { | 350 | { |
336 | if ( _packageName.isEmpty() ) return _name; | 351 | _useFileName = iff; |
337 | else return _packageName; | ||
338 | } | 352 | } |
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index 49bb3bf..4618c3a 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h | |||
@@ -26,2 +26,3 @@ class Package //: public QObject | |||
26 | QString name() ; | 26 | QString name() ; |
27 | QString installName() ; | ||
27 | bool installed(); | 28 | bool installed(); |
@@ -46,5 +47,6 @@ class Package //: public QObject | |||
46 | void setLink(bool); | 47 | void setLink(bool); |
47 | void parseIpkgFile( QString );; | 48 | void parseIpkgFile( QString ); |
49 | void instalFromFile(bool iff=true); | ||
48 | public slots: | 50 | public slots: |
49 | QString getPackageName(); | 51 | // QString getPackageName(); |
50 | void toggleProcess(); | 52 | void toggleProcess(); |
@@ -53,4 +55,5 @@ private: | |||
53 | PackageManagerSettings *settings; | 55 | PackageManagerSettings *settings; |
54 | QString _packageName; | 56 | // QString _packageName; |
55 | QString _name; | 57 | QString _name; |
58 | QString _fileName; | ||
56 | bool _toProcess; | 59 | bool _toProcess; |
@@ -64,2 +67,3 @@ private: | |||
64 | QString _dest; | 67 | QString _dest; |
68 | bool _useFileName; | ||
65 | void parsePackage( QStringList ); | 69 | void parsePackage( QStringList ); |
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 035ec81..b892b30 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -6,3 +6,2 @@ | |||
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <qpe/config.h> | ||
8 | 7 | ||
@@ -14,15 +13,2 @@ PackageList::PackageList() | |||
14 | empty=true; | 13 | empty=true; |
15 | { | ||
16 | Config cfg( "oipkg", Config::User ); | ||
17 | cfg.setGroup( "Common" ); | ||
18 | statusDir = cfg.readEntry( "statusDir", "" ); | ||
19 | listsDir = cfg.readEntry( "listsDir", "" ); | ||
20 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | ||
21 | { | ||
22 | statusDir="/usr/lib/ipkg/"; | ||
23 | listsDir="/usr/lib/ipkg/lists/"; | ||
24 | cfg.writeEntry( "statusDir", statusDir ); | ||
25 | cfg.writeEntry( "listsDir", listsDir ); | ||
26 | } | ||
27 | } | ||
28 | sections << "All"; | 14 | sections << "All"; |
@@ -147,30 +133,5 @@ void PackageList::updateSections( Package* pack ) | |||
147 | 133 | ||
148 | |||
149 | /** No descriptions */ | ||
150 | void PackageList::parseStatus() | ||
151 | { | ||
152 | QStringList dests = settings->getDestinationUrls(); | ||
153 | QStringList destnames = settings->getDestinationNames(); | ||
154 | QStringList::Iterator name = destnames.begin(); | ||
155 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | ||
156 | { | ||
157 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | ||
158 | readFileEntries( *dir+statusDir+"/status", *name ); | ||
159 | ++name; | ||
160 | }; | ||
161 | } | ||
162 | |||
163 | void PackageList::parseList() | ||
164 | { | ||
165 | QStringList srvs = settings->getActiveServers(); | ||
166 | |||
167 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | ||
168 | { | ||
169 | pvDebug( 2, "List: "+listsDir+"/"+*it); | ||
170 | readFileEntries( listsDir+"/"+*it, "" ); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | void PackageList::readFileEntries( QString filename, QString dest ) | 134 | void PackageList::readFileEntries( QString filename, QString dest ) |
175 | { | 135 | { |
136 | pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); | ||
176 | QStringList packEntry; | 137 | QStringList packEntry; |
@@ -180,20 +141,20 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
180 | while ( !statusStream ->eof() ) | 141 | while ( !statusStream ->eof() ) |
181 | { | 142 | { |
182 | QString line = statusStream->readLine(); | 143 | QString line = statusStream->readLine(); |
183 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) | 144 | if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) |
184 | { | 145 | { |
185 | //end of package | 146 | //end of package |
186 | if ( ! packEntry.isEmpty() ) | 147 | if ( ! packEntry.isEmpty() ) |
187 | { | 148 | { |
188 | Package *p = new Package( packEntry, settings ); | 149 | Package *p = new Package( packEntry, settings ); |
189 | p->setDest( dest ); | 150 | p->setDest( dest ); |
190 | if ( p ) | 151 | if ( p ) |
191 | { | 152 | { |
192 | insertPackage( p ); | 153 | insertPackage( p ); |
193 | packEntry.clear(); | 154 | packEntry.clear(); |
194 | } | 155 | } |
195 | } | 156 | } |
196 | }else{ | 157 | }else{ |
197 | packEntry << line; | 158 | packEntry << line; |
198 | }; | 159 | }; |
199 | } | 160 | } |
@@ -202,12 +163,2 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
202 | 163 | ||
203 | |||
204 | void PackageList::update() | ||
205 | { | ||
206 | pvDebug( 2, "parseStatus"); | ||
207 | parseStatus(); | ||
208 | pvDebug( 2, "parseList"); | ||
209 | parseList(); | ||
210 | pvDebug( 2, "finished parsing"); | ||
211 | } | ||
212 | |||
213 | void PackageList::setSettings( PackageManagerSettings *s ) | 164 | void PackageList::setSettings( PackageManagerSettings *s ) |
diff --git a/noncore/unsupported/oipkg/packagelist.h b/noncore/unsupported/oipkg/packagelist.h index 7c326ca..acea3b9 100644 --- a/noncore/unsupported/oipkg/packagelist.h +++ b/noncore/unsupported/oipkg/packagelist.h | |||
@@ -8,8 +8,2 @@ | |||
8 | 8 | ||
9 | #define HACK | ||
10 | #ifdef HACK | ||
11 | static QString listsDir="/usr/lib/ipkg/"; | ||
12 | static QString statusDir="/usr/lib/ipkg/"; | ||
13 | #endif | ||
14 | |||
15 | class PackageList //:QObject | 9 | class PackageList //:QObject |
@@ -22,3 +16,3 @@ public: | |||
22 | PackageList( PackageManagerSettings* ); | 16 | PackageList( PackageManagerSettings* ); |
23 | ~PackageList(); | 17 | virtual ~PackageList(); |
24 | void insertPackage( Package* ); | 18 | void insertPackage( Package* ); |
@@ -39,5 +33,5 @@ public slots: | |||
39 | void setSubSection(QString); | 33 | void setSubSection(QString); |
40 | void update(); | 34 | // virtual void update(); |
41 | 35 | ||
42 | private: | 36 | protected: |
43 | int currentPackage; | 37 | int currentPackage; |
@@ -51,6 +45,2 @@ private: | |||
51 | bool empty; | 45 | bool empty; |
52 | #ifndef HACK | ||
53 | QString listsDir; | ||
54 | QString statusDir; | ||
55 | #endif | ||
56 | QString aktSection; | 46 | QString aktSection; |
@@ -63,5 +53,3 @@ private: | |||
63 | void updateSections( Package* ); | 53 | void updateSections( Package* ); |
64 | void parseStatus(); | 54 | void readFileEntries( QString file, QString dest="" ); |
65 | void parseList(); | ||
66 | void readFileEntries( QString file, QString dest ); | ||
67 | }; | 55 | }; |
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 0c7c928..b7af9a6 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -15,2 +15,13 @@ PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSetti | |||
15 | { | 15 | { |
16 | init(pi,s); | ||
17 | } | ||
18 | |||
19 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) | ||
20 | :QCheckListItem(lvi,pi->name(),CheckBox) | ||
21 | { | ||
22 | init(pi,s); | ||
23 | } | ||
24 | |||
25 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | ||
26 | { | ||
16 | package = pi; | 27 | package = pi; |
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h index 54d9f9e..b128f0d 100644 --- a/noncore/unsupported/oipkg/packagelistitem.h +++ b/noncore/unsupported/oipkg/packagelistitem.h | |||
@@ -17,2 +17,3 @@ class PackageListItem | |||
17 | public: | 17 | public: |
18 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); | ||
18 | PackageListItem(QListView*, Package*, PackageManagerSettings*); | 19 | PackageListItem(QListView*, Package*, PackageManagerSettings*); |
@@ -29,2 +30,3 @@ public: | |||
29 | private: | 30 | private: |
31 | void init(Package*, PackageManagerSettings*); | ||
30 | QCheckListItem *nameItem; | 32 | QCheckListItem *nameItem; |
diff --git a/noncore/unsupported/oipkg/packagelistlocal.cpp b/noncore/unsupported/oipkg/packagelistlocal.cpp new file mode 100644 index 0000000..6d931c8 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistlocal.cpp | |||
@@ -0,0 +1,66 @@ | |||
1 | #include <qpe/config.h> | ||
2 | #include <qfile.h> | ||
3 | #include <qfileinfo.h> | ||
4 | #include <qtextstream.h> | ||
5 | #include <qstringlist.h> | ||
6 | #include "packagelistlocal.h" | ||
7 | |||
8 | PackageListLocal::PackageListLocal() | ||
9 | : PackageList() | ||
10 | { | ||
11 | Config cfg( "oipkg", Config::User ); | ||
12 | cfg.setGroup( "Common" ); | ||
13 | statusDir = cfg.readEntry( "statusDir", "" ); | ||
14 | listsDir = cfg.readEntry( "listsDir", "" ); | ||
15 | if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) | ||
16 | { | ||
17 | statusDir="/usr/lib/ipkg/"; | ||
18 | listsDir="/usr/lib/ipkg/lists/"; | ||
19 | cfg.writeEntry( "statusDir", statusDir ); | ||
20 | cfg.writeEntry( "listsDir", listsDir ); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | PackageListLocal::PackageListLocal(PackageManagerSettings* s) | ||
25 | : PackageList(s) | ||
26 | { | ||
27 | PackageListLocal(); | ||
28 | } | ||
29 | |||
30 | PackageListLocal::~PackageListLocal() | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void PackageListLocal::parseStatus() | ||
35 | { | ||
36 | QStringList dests = settings->getDestinationUrls(); | ||
37 | QStringList destnames = settings->getDestinationNames(); | ||
38 | QStringList::Iterator name = destnames.begin(); | ||
39 | for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) | ||
40 | { | ||
41 | pvDebug( 2,"Status: "+*dir+statusDir+"/status"); | ||
42 | readFileEntries( *dir+statusDir+"/status", *name ); | ||
43 | ++name; | ||
44 | }; | ||
45 | } | ||
46 | |||
47 | void PackageListLocal::parseList() | ||
48 | { | ||
49 | QStringList srvs = settings->getActiveServers(); | ||
50 | |||
51 | for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) | ||
52 | { | ||
53 | pvDebug( 2, "List: "+listsDir+"/"+*it); | ||
54 | readFileEntries( listsDir+"/"+*it ); | ||
55 | } | ||
56 | } | ||
57 | |||
58 | |||
59 | void PackageListLocal::update() | ||
60 | { | ||
61 | pvDebug( 2, "parseStatus"); | ||
62 | parseStatus(); | ||
63 | pvDebug( 2, "parseList"); | ||
64 | parseList(); | ||
65 | pvDebug( 2, "finished parsing"); | ||
66 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistlocal.h b/noncore/unsupported/oipkg/packagelistlocal.h new file mode 100644 index 0000000..887126b --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistlocal.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef PACKAGELISTLOCAL_H | ||
2 | #define PACKAGELISTLOCAL_H | ||
3 | |||
4 | #include "packagelist.h" | ||
5 | |||
6 | |||
7 | #define HACK | ||
8 | #ifdef HACK | ||
9 | static QString listsDir="/usr/lib/ipkg/"; | ||
10 | static QString statusDir="/usr/lib/ipkg/"; | ||
11 | #endif | ||
12 | |||
13 | class PackageListLocal : public PackageList { | ||
14 | public: | ||
15 | PackageListLocal(); | ||
16 | PackageListLocal( PackageManagerSettings* ); | ||
17 | virtual ~PackageListLocal(); | ||
18 | |||
19 | public slots: | ||
20 | void update(); | ||
21 | private: | ||
22 | #ifndef HACK | ||
23 | QString listsDir; | ||
24 | QString statusDir; | ||
25 | #endif | ||
26 | void parseStatus(); | ||
27 | void parseList(); | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp new file mode 100644 index 0000000..721d4a6 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -0,0 +1,47 @@ | |||
1 | |||
2 | #include "packagelistremote.h" | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <stdlib.h> | ||
6 | #include <unistd.h> | ||
7 | |||
8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | ||
9 | : PackageList(s) | ||
10 | { | ||
11 | PackageListRemote(); | ||
12 | } | ||
13 | |||
14 | PackageListRemote::PackageListRemote() | ||
15 | : PackageList() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | PackageListRemote::~PackageListRemote() | ||
20 | { | ||
21 | } | ||
22 | |||
23 | void PackageListRemote::query(QString s) | ||
24 | { | ||
25 | int r=0; | ||
26 | QString cmd = "wget"; | ||
27 | QString redirect = "/tmp/oipkg.query"; | ||
28 | |||
29 | // use file for output | ||
30 | cmd += " --output-document="+redirect; | ||
31 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | ||
32 | QString server="http://ipkgfind.handhelds.org/"; | ||
33 | cmd += " \""+server+"/packages.phtml"; | ||
34 | cmd += "?format=pda&searchtype=package§ion="; | ||
35 | cmd += "&query="+s; | ||
36 | cmd += "\""; | ||
37 | |||
38 | pvDebug(2,"search :"+cmd); | ||
39 | r = system(cmd.latin1()); | ||
40 | readFileEntries( redirect ); | ||
41 | |||
42 | } | ||
43 | |||
44 | void PackageListRemote::update() | ||
45 | { | ||
46 | pvDebug(2,"PackageListRemote::update\ndoing nothing "); | ||
47 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistremote.h b/noncore/unsupported/oipkg/packagelistremote.h new file mode 100644 index 0000000..147da1e --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistremote.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef PACKAGELISTREMOTE_H | ||
2 | #define PACKAGELISTREMOTE_H | ||
3 | |||
4 | #include "packagelist.h" | ||
5 | #include "package.h" | ||
6 | #include "pksettings.h" | ||
7 | #include "debug.h" | ||
8 | |||
9 | class PackageListRemote : public PackageList { | ||
10 | public: | ||
11 | PackageListRemote(); | ||
12 | PackageListRemote( PackageManagerSettings* s); | ||
13 | virtual ~PackageListRemote(); | ||
14 | void query(QString); | ||
15 | public slots: | ||
16 | void update(); | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 2915ac6..610a0e1 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -1,18 +1 @@ | |||
1 | /*************************************************************************** | ||
2 | packagelistview.cpp - description | ||
3 | ------------------- | ||
4 | begin : Sat Apr 27 2002 | ||
5 | copyright : (C) 2002 by tille | ||
6 | email : tille@handhelds.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #include "packagelistview.h" | #include "packagelistview.h" | |
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h index a3db0d0..d371a34 100644 --- a/noncore/unsupported/oipkg/packagelistview.h +++ b/noncore/unsupported/oipkg/packagelistview.h | |||
@@ -50,3 +50,2 @@ public slots: | |||
50 | void stopTimer( QListViewItem* ); | 50 | void stopTimer( QListViewItem* ); |
51 | /** No descriptions */ | ||
52 | void toggleProcess(); | 51 | void toggleProcess(); |
diff --git a/noncore/unsupported/oipkg/pkfind.ui b/noncore/unsupported/oipkg/pkfind.ui deleted file mode 100644 index 7a24c00..0000000 --- a/noncore/unsupported/oipkg/pkfind.ui +++ b/dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>Search</class> | ||
3 | <widget> | ||
4 | <class>QDialog</class> | ||
5 | <property stdset="1"> | ||
6 | <name>name</name> | ||
7 | <cstring>Form5</cstring> | ||
8 | </property> | ||
9 | <property stdset="1"> | ||
10 | <name>geometry</name> | ||
11 | <rect> | ||
12 | <x>0</x> | ||
13 | <y>0</y> | ||
14 | <width>196</width> | ||
15 | <height>55</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Search Packages</string> | ||
21 | </property> | ||
22 | <hbox> | ||
23 | <property stdset="1"> | ||
24 | <name>margin</name> | ||
25 | <number>11</number> | ||
26 | </property> | ||
27 | <property stdset="1"> | ||
28 | <name>spacing</name> | ||
29 | <number>6</number> | ||
30 | </property> | ||
31 | <widget> | ||
32 | <class>QLabel</class> | ||
33 | <property stdset="1"> | ||
34 | <name>name</name> | ||
35 | <cstring>TextLabel4</cstring> | ||
36 | </property> | ||
37 | <property stdset="1"> | ||
38 | <name>text</name> | ||
39 | <string>Find:</string> | ||
40 | </property> | ||
41 | </widget> | ||
42 | <widget> | ||
43 | <class>QLineEdit</class> | ||
44 | <property stdset="1"> | ||
45 | <name>name</name> | ||
46 | <cstring>pattern</cstring> | ||
47 | </property> | ||
48 | </widget> | ||
49 | </hbox> | ||
50 | </widget> | ||
51 | </UI> | ||
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp index 6c8dc2a..7e2ef10 100644 --- a/noncore/unsupported/oipkg/pksettings.cpp +++ b/noncore/unsupported/oipkg/pksettings.cpp | |||
@@ -136,2 +136,4 @@ void PackageManagerSettings::editDestination(int i) | |||
136 | destinationurl->setEnabled(TRUE); | 136 | destinationurl->setEnabled(TRUE); |
137 | createLinksButton->setEnabled(TRUE); | ||
138 | removeLinksButton->setEnabled(TRUE); | ||
137 | } | 139 | } |
@@ -530,2 +532,3 @@ void PackageManagerSettings::linkEnabled( bool b ) | |||
530 | { | 532 | { |
533 | pvDebug(2,"PackageManagerSettings::linkEnabled "+QString(b?"yes":"no")); | ||
531 | activeLinkDestination->setEnabled( b ); | 534 | activeLinkDestination->setEnabled( b ); |
@@ -542 +545,20 @@ QComboBox* PackageManagerSettings::getDestCombo() | |||
542 | } | 545 | } |
546 | |||
547 | void PackageManagerSettings::createLinksToDest() | ||
548 | { | ||
549 | pvDebug(2,"creating links..."); | ||
550 | // emit doCreateLinks( destinationurl->text() ); | ||
551 | //ipkg->createLinks( destinationurl ); | ||
552 | } | ||
553 | |||
554 | void PackageManagerSettings::removeLinksToDest() | ||
555 | { | ||
556 | pvDebug(2,"removing links..."); | ||
557 | // emit doRemoveLinks( destinationurl->text() ); | ||
558 | //ipkg->removeLinks( destinationurl ); | ||
559 | } | ||
560 | |||
561 | //void PackageManagerSettings::setIpkg( PmIpkg* i ) | ||
562 | //{ | ||
563 | //ipkg = i; | ||
564 | //} | ||
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h index fbb3b99..1632d4a 100644 --- a/noncore/unsupported/oipkg/pksettings.h +++ b/noncore/unsupported/oipkg/pksettings.h | |||
@@ -4,6 +4,8 @@ | |||
4 | #include "pksettingsbase.h" | 4 | #include "pksettingsbase.h" |
5 | //#include "pmipkg.h" | ||
5 | #include <qintdict.h> | 6 | #include <qintdict.h> |
7 | #include <qobject.h> | ||
6 | 8 | ||
7 | 9 | ||
8 | class PackageManagerSettings : private PackageManagerSettingsBase | 10 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | { | 11 | { |
@@ -24,19 +26,4 @@ public: | |||
24 | QString getDestinationUrlByName(QString); | 26 | QString getDestinationUrlByName(QString); |
25 | /** No descriptions */ | ||
26 | QComboBox* getDestCombo(); | 27 | QComboBox* getDestCombo(); |
27 | 28 | // void setIpkg( PmIpkg* ); | |
28 | private: | ||
29 | QIntDict<QString> serverurlDic; | ||
30 | QIntDict<QString> destinationurlDic; | ||
31 | int ipkg_old; | ||
32 | int editedserver; | ||
33 | int editeddestination; | ||
34 | int currentSetting; | ||
35 | int installationSettingsCount; | ||
36 | bool changed; | ||
37 | |||
38 | bool readIpkgConfig(const QString&); | ||
39 | void writeIpkgConfig(const QString&); | ||
40 | void writeSettings(); | ||
41 | void readSettings(); | ||
42 | 29 | ||
@@ -48,3 +35,4 @@ public slots: | |||
48 | void installationSettingSetName(const QString &); | 35 | void installationSettingSetName(const QString &); |
49 | 36 | void removeLinksToDest(); | |
37 | void createLinksToDest(); | ||
50 | void newServer(); | 38 | void newServer(); |
@@ -65,2 +53,20 @@ public slots: | |||
65 | void activeServerChanged(); | 53 | void activeServerChanged(); |
54 | signals: | ||
55 | // void doCreateLinks( QString dest ); | ||
56 | // void doRemoveLinks( QString dest ); | ||
57 | |||
58 | private: | ||
59 | QIntDict<QString> serverurlDic; | ||
60 | QIntDict<QString> destinationurlDic; | ||
61 | int ipkg_old; | ||
62 | int editedserver; | ||
63 | int editeddestination; | ||
64 | int currentSetting; | ||
65 | int installationSettingsCount; | ||
66 | bool changed; | ||
67 | |||
68 | bool readIpkgConfig(const QString&); | ||
69 | void writeIpkgConfig(const QString&); | ||
70 | void writeSettings(); | ||
71 | void readSettings(); | ||
66 | }; | 72 | }; |
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui index fd6d208..5b83248 100644 --- a/noncore/unsupported/oipkg/pksettingsbase.ui +++ b/noncore/unsupported/oipkg/pksettingsbase.ui | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>345</width> | 14 | <width>337</width> |
15 | <height>454</height> | 15 | <height>454</height> |
@@ -534,3 +534,3 @@ | |||
534 | <name>margin</name> | 534 | <name>margin</name> |
535 | <number>3</number> | 535 | <number>2</number> |
536 | </property> | 536 | </property> |
@@ -538,3 +538,3 @@ | |||
538 | <name>spacing</name> | 538 | <name>spacing</name> |
539 | <number>3</number> | 539 | <number>2</number> |
540 | </property> | 540 | </property> |
@@ -714,2 +714,117 @@ | |||
714 | </widget> | 714 | </widget> |
715 | <widget row="4" column="0" > | ||
716 | <class>QLayoutWidget</class> | ||
717 | <property stdset="1"> | ||
718 | <name>name</name> | ||
719 | <cstring>Layout11</cstring> | ||
720 | </property> | ||
721 | <hbox> | ||
722 | <property stdset="1"> | ||
723 | <name>margin</name> | ||
724 | <number>0</number> | ||
725 | </property> | ||
726 | <property stdset="1"> | ||
727 | <name>spacing</name> | ||
728 | <number>6</number> | ||
729 | </property> | ||
730 | <widget> | ||
731 | <class>QPushButton</class> | ||
732 | <property stdset="1"> | ||
733 | <name>name</name> | ||
734 | <cstring>createLinksButton</cstring> | ||
735 | </property> | ||
736 | <property stdset="1"> | ||
737 | <name>enabled</name> | ||
738 | <bool>false</bool> | ||
739 | </property> | ||
740 | <property stdset="1"> | ||
741 | <name>text</name> | ||
742 | <string>link to /</string> | ||
743 | </property> | ||
744 | </widget> | ||
745 | <widget> | ||
746 | <class>QPushButton</class> | ||
747 | <property stdset="1"> | ||
748 | <name>name</name> | ||
749 | <cstring>removeLinksButton</cstring> | ||
750 | </property> | ||
751 | <property stdset="1"> | ||
752 | <name>enabled</name> | ||
753 | <bool>false</bool> | ||
754 | </property> | ||
755 | <property stdset="1"> | ||
756 | <name>text</name> | ||
757 | <string>Remove links</string> | ||
758 | </property> | ||
759 | </widget> | ||
760 | </hbox> | ||
761 | </widget> | ||
762 | <widget row="5" column="0" > | ||
763 | <class>QGroupBox</class> | ||
764 | <property stdset="1"> | ||
765 | <name>name</name> | ||
766 | <cstring>GroupBox1</cstring> | ||
767 | </property> | ||
768 | <property stdset="1"> | ||
769 | <name>title</name> | ||
770 | <string></string> | ||
771 | </property> | ||
772 | <grid> | ||
773 | <property stdset="1"> | ||
774 | <name>margin</name> | ||
775 | <number>11</number> | ||
776 | </property> | ||
777 | <property stdset="1"> | ||
778 | <name>spacing</name> | ||
779 | <number>6</number> | ||
780 | </property> | ||
781 | <widget row="0" column="0" > | ||
782 | <class>QLayoutWidget</class> | ||
783 | <property stdset="1"> | ||
784 | <name>name</name> | ||
785 | <cstring>Layout12</cstring> | ||
786 | </property> | ||
787 | <hbox> | ||
788 | <property stdset="1"> | ||
789 | <name>margin</name> | ||
790 | <number>0</number> | ||
791 | </property> | ||
792 | <property stdset="1"> | ||
793 | <name>spacing</name> | ||
794 | <number>6</number> | ||
795 | </property> | ||
796 | <widget> | ||
797 | <class>QCheckBox</class> | ||
798 | <property stdset="1"> | ||
799 | <name>name</name> | ||
800 | <cstring>CheckBoxvolatile</cstring> | ||
801 | </property> | ||
802 | <property stdset="1"> | ||
803 | <name>enabled</name> | ||
804 | <bool>false</bool> | ||
805 | </property> | ||
806 | <property stdset="1"> | ||
807 | <name>text</name> | ||
808 | <string>volatile</string> | ||
809 | </property> | ||
810 | </widget> | ||
811 | <widget> | ||
812 | <class>QCheckBox</class> | ||
813 | <property stdset="1"> | ||
814 | <name>name</name> | ||
815 | <cstring>removeable</cstring> | ||
816 | </property> | ||
817 | <property stdset="1"> | ||
818 | <name>enabled</name> | ||
819 | <bool>false</bool> | ||
820 | </property> | ||
821 | <property stdset="1"> | ||
822 | <name>text</name> | ||
823 | <string>removeable</string> | ||
824 | </property> | ||
825 | </widget> | ||
826 | </hbox> | ||
827 | </widget> | ||
828 | </grid> | ||
829 | </widget> | ||
715 | </grid> | 830 | </grid> |
@@ -738,2 +853,16 @@ | |||
738 | </connection> | 853 | </connection> |
854 | <connection> | ||
855 | <sender>createLinksButton</sender> | ||
856 | <signal>clicked()</signal> | ||
857 | <receiver>Form4</receiver> | ||
858 | <slot>createLinksToDest()</slot> | ||
859 | </connection> | ||
860 | <connection> | ||
861 | <sender>removeLinksButton</sender> | ||
862 | <signal>clicked()</signal> | ||
863 | <receiver>Form4</receiver> | ||
864 | <slot>removeLinksToDest()</slot> | ||
865 | </connection> | ||
866 | <slot access="public">activeServerChanged()</slot> | ||
867 | <slot access="public">createLinksToDest()</slot> | ||
739 | <slot access="public">destNameChanged(const QString&)</slot> | 868 | <slot access="public">destNameChanged(const QString&)</slot> |
@@ -748,5 +877,5 @@ | |||
748 | <slot access="public">newServer()</slot> | 877 | <slot access="public">newServer()</slot> |
749 | <slot access="public">activeServerChanged()</slot> | ||
750 | <slot access="public">removeDestination()</slot> | 878 | <slot access="public">removeDestination()</slot> |
751 | <slot access="public">removeInstallationSetting()</slot> | 879 | <slot access="public">removeInstallationSetting()</slot> |
880 | <slot access="public">removeLinksToDest()</slot> | ||
752 | <slot access="public">removeServer()</slot> | 881 | <slot access="public">removeServer()</slot> |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 9f6429a..fe200f5 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -212,30 +212,27 @@ void PmIpkg::processLinkDir( QString file, QString dest ) | |||
212 | 212 | ||
213 | void PmIpkg::commit( PackageList pl ) | 213 | void PmIpkg::loadList( PackageList pl ) |
214 | { | 214 | { |
215 | int sizecount = 0; | ||
216 | to_install.clear(); | ||
217 | to_remove.clear(); | ||
218 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
219 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
220 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 215 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
221 | { | 216 | { |
222 | if ( pack && (pack->name() != "") && pack) | 217 | if ( pack && (pack->name() != "") && pack) |
223 | { | 218 | { |
224 | if ( pack->toInstall() ) | 219 | if ( pack->toInstall() ) |
225 | { | ||
226 | to_install.append( pack ); | 220 | to_install.append( pack ); |
227 | sizecount += pack->size().toInt(); | 221 | if ( pack->toRemove() ) |
228 | inst += pack->name()+"\t("+tr("on ")+pack->dest()+")<br>"; | ||
229 | } | ||
230 | if ( pack->toRemove() ) | ||
231 | { | ||
232 | to_remove.append( pack ); | 222 | to_remove.append( pack ); |
233 | sizecount += 1; | 223 | } |
234 | rem += pack->name()+"<br>"; | 224 | } |
235 | } | 225 | } |
236 | } | ||
237 | } | ||
238 | 226 | ||
227 | void PmIpkg::commit( PackageList pl ) | ||
228 | { | ||
229 | sizecount = 0; | ||
230 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | ||
231 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | ||
232 | loadList(pl); | ||
233 | for (uint i=0; i < to_remove.count(); i++) | ||
234 | sizecount += 1; | ||
235 | for (uint i=0; i < to_install.count(); i++) | ||
236 | sizecount += to_install.at(i)->size().toInt(); | ||
239 | startDialog(); | 237 | startDialog(); |
240 | |||
241 | } | 238 | } |
@@ -268,3 +265,3 @@ void PmIpkg::startDialog() | |||
268 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); | 265 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); |
269 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().hasHeightForWidth() ) ); | 266 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); |
270 | GroupBox1->setTitle( tr( "Ipkg options" ) ); | 267 | GroupBox1->setTitle( tr( "Ipkg options" ) ); |
@@ -277,3 +274,2 @@ void PmIpkg::startDialog() | |||
277 | GroupBox1Layout->setMargin( 3 ); | 274 | GroupBox1Layout->setMargin( 3 ); |
278 | |||
279 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); | 275 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); |
@@ -281,2 +277,3 @@ void PmIpkg::startDialog() | |||
281 | _force_depends->setAutoResize( TRUE ); | 277 | _force_depends->setAutoResize( TRUE ); |
278 | _force_depends->setChecked(true); | ||
282 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); | 279 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); |
@@ -321,4 +318,4 @@ void PmIpkg::remove() | |||
321 | QStringList *fileList; | 318 | QStringList *fileList; |
322 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 319 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
323 | { | 320 | { |
324 | if ( it->link() )fileList = getList( it->name(), it->dest() ); | 321 | if ( it->link() )fileList = getList( it->name(), it->dest() ); |
@@ -335,2 +332,3 @@ void PmIpkg::remove() | |||
335 | it->processed(); | 332 | it->processed(); |
333 | |||
336 | out("<br><hr>"); | 334 | out("<br><hr>"); |
@@ -353,3 +351,3 @@ void PmIpkg::install() | |||
353 | 351 | ||
354 | if ( runIpkg("install " + it->getPackageName(), it->dest() ) == 0 ) | 352 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) |
355 | { | 353 | { |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 0625032..2b89023 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -25,2 +25,3 @@ public: | |||
25 | int linkOpp; | 25 | int linkOpp; |
26 | void loadList( PackageList ); | ||
26 | void commit( PackageList ); | 27 | void commit( PackageList ); |
@@ -41,2 +42,3 @@ public slots: | |||
41 | private: | 42 | private: |
43 | int sizecount; | ||
42 | PackageManagerSettings* settings; | 44 | PackageManagerSettings* settings; |
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index e2072f1..3be4334 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h | |||
@@ -63 +63,5 @@ private: | |||
63 | #endif | 63 | #endif |
64 | /** No descriptions */ | ||
65 | void createLinks(); | ||
66 | /** No descriptions */ | ||
67 | void removeLinks(); | ||