summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO4
-rw-r--r--noncore/unsupported/oipkg/debug.h2
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp165
-rw-r--r--noncore/unsupported/oipkg/mainwindow.h12
-rw-r--r--noncore/unsupported/oipkg/oipkg.pro2
-rw-r--r--noncore/unsupported/oipkg/package.cpp89
-rw-r--r--noncore/unsupported/oipkg/package.h6
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.cpp33
-rw-r--r--noncore/unsupported/oipkg/packagelistitem.h1
-rw-r--r--noncore/unsupported/oipkg/packagelistview.cpp38
-rw-r--r--noncore/unsupported/oipkg/packagelistview.h2
-rw-r--r--noncore/unsupported/oipkg/pkdesc.ui96
-rw-r--r--noncore/unsupported/oipkg/pksettings.cpp57
-rw-r--r--noncore/unsupported/oipkg/pksettings.h4
-rw-r--r--noncore/unsupported/oipkg/pksettingsbase.ui23
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp284
-rw-r--r--noncore/unsupported/oipkg/pmipkg.h30
-rw-r--r--noncore/unsupported/oipkg/settings.cpp5
-rw-r--r--noncore/unsupported/oipkg/settings.h34
-rw-r--r--noncore/unsupported/oipkg/utils.cpp27
-rw-r--r--noncore/unsupported/oipkg/utils.h18
21 files changed, 545 insertions, 387 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index 3fc84e5..790766c 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -1,2 +1 @@
1* setDocument function
2* Settings Class * Settings Class
@@ -5,3 +4,3 @@
5* parse "to install" and "to remove" from status 4* parse "to install" and "to remove" from status
6* install local file 5* install local file dialog
7* qcop 6* qcop
@@ -10,2 +9 @@
10* dependency checking * dependency checking
11* ipkg options in runwindow \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/debug.h b/noncore/unsupported/oipkg/debug.h
index 973d96c..206dea5 100644
--- a/noncore/unsupported/oipkg/debug.h
+++ b/noncore/unsupported/oipkg/debug.h
@@ -17,3 +17,3 @@ if ( debugLevel < 3 ) \
17 if ( I <= debugLevel ) \ 17 if ( I <= debugLevel ) \
18 qDebug("# %s \t\t(Level: %i)\n",QString(S).latin1(),I);\ 18 qDebug("#%s:%i: %s \t\t(Level: %i)",__FILE__,__LINE__,QString(S).latin1(),I);\
19} 19}
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp
index c95f482..ca1e5e8 100644
--- a/noncore/unsupported/oipkg/mainwindow.cpp
+++ b/noncore/unsupported/oipkg/mainwindow.cpp
@@ -8,2 +8,3 @@
8#include <qpe/resource.h> 8#include <qpe/resource.h>
9#include <qpe/config.h>
9#include <qpe/qpetoolbar.h> 10#include <qpe/qpetoolbar.h>
@@ -19,2 +20,3 @@
19#include <qtextview.h> 20#include <qtextview.h>
21#include <qcheckbox.h>
20#include <qlineedit.h> 22#include <qlineedit.h>
@@ -26,2 +28,3 @@
26#include "pksettingsbase.h" 28#include "pksettingsbase.h"
29#include "utils.h"
27#include "packagelistitem.h" 30#include "packagelistitem.h"
@@ -32,29 +35,23 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) :
32 { 35 {
36 setCaption( tr("Package Manager") );
33 settings = new PackageManagerSettings(this,0,TRUE); 37 settings = new PackageManagerSettings(this,0,TRUE);
34 listViewPackages = new PackageListView( this,"listViewPackages",settings ); 38 listViewPackages = new PackageListView( this,"listViewPackages",settings );
35 ipkg = new PmIpkg( settings, this );
36
37 setCentralWidget( listViewPackages ); 39 setCentralWidget( listViewPackages );
38 setCaption( tr("Package Manager") );
39 40
40 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); 41 //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton);
41 wait = new QMessageBox(this); 42 //wait = new QMessageBox(this);
42 wait->setText(tr("Please wait")); 43 // wait->setText(tr("Please wait"));
43
44 channel = new QCopChannel( "QPE/Application/oipkg", this );
45 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
46 this, SLOT(receive(const QCString&, const QByteArray&)) );
47
48 makeMenu();
49
50 connect( section, SIGNAL( activated(int) ),
51 this, SLOT( sectionChanged() ) );
52 connect( subsection, SIGNAL(activated(int) ),
53 this, SLOT( subSectionChanged() ) );
54
55 ipkg = new PmIpkg( settings, this ); 44 ipkg = new PmIpkg( settings, this );
56 packageList.setSettings( settings ); 45 packageList.setSettings( settings );
57 getList(); 46 packageList.update();
58 setSections(); 47 makeMenu();
59 setSubSections(); 48 makeChannel();
49 //opie is hardcoded default ;)
50 for (int i=0;i<section->count();i++)
51 if (section->text(i)=="opie")
52 section->setCurrentItem(i);
53 sectionChanged();
54
55 connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) );
56 connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) );
60 displayList(); 57 displayList();
@@ -102,4 +99,4 @@ void MainWindow::makeMenu()
102 99
103// would we use for find 100// could we use for find
104// detailsAction = new QAction( tr( "Details" ), 101// detailsAction = new QAction( tr( "Find" ),
105 // Resource::loadIconSet( "find" ), 102 // Resource::loadIconSet( "find" ),
@@ -107,5 +104,4 @@ void MainWindow::makeMenu()
107// connect( detailsAction, SIGNAL( activated() ), 104// connect( detailsAction, SIGNAL( activated() ),
108// this , SLOT( showDetails() ) ); 105// this , SLOT( showFind() ) );
109// detailsAction->addTo( toolBar ); 106// detailsAction->addTo( toolBar );
110// detailsAction->addTo( srvMenu );
111 107
@@ -114,3 +110,2 @@ void MainWindow::makeMenu()
114 cfgact = new QAction( tr( "Setups" ), 110 cfgact = new QAction( tr( "Setups" ),
115 // Resource::loadIconSet( "" ),
116 QString::null, 0, this, 0 ); 111 QString::null, 0, this, 0 );
@@ -121,3 +116,2 @@ void MainWindow::makeMenu()
121 cfgact = new QAction( tr( "Servers" ), 116 cfgact = new QAction( tr( "Servers" ),
122 // Resource::loadIconSet( "" ),
123 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
@@ -127,3 +121,2 @@ void MainWindow::makeMenu()
127 cfgact = new QAction( tr( "Destinations" ), 121 cfgact = new QAction( tr( "Destinations" ),
128 //Resource::loadIconSet( "" ),
129 QString::null, 0, this, 0 ); 122 QString::null, 0, this, 0 );
@@ -133,3 +126,3 @@ void MainWindow::makeMenu()
133 126
134 QAction *a; 127 QAction *a;
135 128
@@ -142,3 +135,2 @@ void MainWindow::makeMenu()
142 section = new QComboBox( false, sectionBar ); 135 section = new QComboBox( false, sectionBar );
143// section->setBackgroundMode( PaletteBackground );
144 label = new QLabel( " / ", sectionBar ); 136 label = new QLabel( " / ", sectionBar );
@@ -146,3 +138,2 @@ void MainWindow::makeMenu()
146 subsection = new QComboBox( false, sectionBar ); 138 subsection = new QComboBox( false, sectionBar );
147
148 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 139 a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
@@ -151,2 +142,5 @@ void MainWindow::makeMenu()
151 142
143 setSections();
144 setSubSections();
145
152 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); 146 sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 );
@@ -154,3 +148,2 @@ void MainWindow::makeMenu()
154 sectionAction->setToggleAction( true ); 148 sectionAction->setToggleAction( true );
155 sectionAction->setOn( true );
156 sectionAction->addTo( viewMenu ); 149 sectionAction->addTo( viewMenu );
@@ -167,2 +160,5 @@ void MainWindow::makeMenu()
167 160
161 a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 );
162 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
163 a->addTo( findBar );
168 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 164 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
@@ -173,12 +169,37 @@ void MainWindow::makeMenu()
173 findAction->setToggleAction( true ); 169 findAction->setToggleAction( true );
174 findAction->setOn( true );
175 findAction->addTo( viewMenu ); 170 findAction->addTo( viewMenu );
176 171
177 #ifdef NEW 172 destBar = new QPEToolBar(this);
173 addToolBar( destBar, "Destination", QMainWindow::Top, TRUE );
174 label = new QLabel( tr("Destination: "), destBar );
175 label->setBackgroundColor( destBar->backgroundColor() );
176 destBar->setHorizontalStretchable( TRUE );
177 destination = new QComboBox( false, destBar );
178 destination->insertStringList( settings->getDestinationNames() );
179 setComboName(destination,settings->getDestinationName());
180// connect( destination, SIGNAL(activated(int)),
181 // SLOT(activeDestinationChange(int)) );
182 spacer = new QLabel( " ", destBar );
183 spacer->setBackgroundColor( destBar->backgroundColor() );
184 CheckBoxLink = new QCheckBox( tr("Link"), destBar);
185 CheckBoxLink->setBackgroundColor( destBar->backgroundColor() );
186 CheckBoxLink->setChecked( settings->createLinks() );
187// connect( CheckBoxLink, SIGNAL(toggled(bool)),
188 // settings, SLOT(linkEnabled(bool)) );
189 destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 );
190 connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) );
191 a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
192 connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
193 a->addTo( destBar );
194 destBar->setStretchableWidget( CheckBoxLink );
195 destAction->setToggleAction( true );
196 // destAction->addTo( viewMenu );
197
198 // configure the menus
178 Config cfg( "oipkg", Config::User ); 199 Config cfg( "oipkg", Config::User );
179 cfg.setGroup( "Setting_" + QString::number( setting ) ); 200 cfg.setGroup( "gui" );
180 CheckBoxLink->setChecked( cfg.readBoolEntry( "link", false ) ); 201
181 findShow(bool b) 202 findShow( cfg.readBoolEntry( "findBar", true ) );
182 sectionShow(bool b) 203 sectionShow( cfg.readBoolEntry( "sectionBar", true ) );
183 #endif 204 destShow( cfg.readBoolEntry( "destBar", false ) );
184} 205}
@@ -187,2 +208,8 @@ MainWindow::~MainWindow()
187{ 208{
209 Config cfg( "oipkg", Config::User );
210 cfg.setGroup( "gui" );
211 cfg.writeEntry( "findBar", !findBar->isHidden() );
212 cfg.writeEntry( "sectionBar", !sectionBar->isHidden() );
213 cfg.writeEntry( "destBar", !destBar->isHidden() );
214
188} 215}
@@ -191,2 +218,3 @@ void MainWindow::runIpkg()
191{ 218{
219 packageList.allPackages();
192 ipkg->commit( packageList ); 220 ipkg->commit( packageList );
@@ -202,3 +230,3 @@ void MainWindow::updateList()
202{ 230{
203 wait->show(); 231 //wait->show();
204 QTimer *t = new QTimer( this ); 232 QTimer *t = new QTimer( this );
@@ -208,14 +236,5 @@ void MainWindow::updateList()
208 ipkg->update(); 236 ipkg->update();
209 getList();
210 t->stop();
211 wait->hide();
212
213}
214
215void MainWindow::getList()
216{
217 wait->show();
218 packageList.update(); 237 packageList.update();
219 displayList(); 238 t->stop();
220 wait->hide(); 239 // wait->hide();
221} 240}
@@ -224,3 +243,3 @@ void MainWindow::filterList()
224{ 243{
225 wait->show(); 244 //wait->show();
226 QString f = ""; 245 QString f = "";
@@ -228,3 +247,3 @@ void MainWindow::filterList()
228 packageList.filterPackages( f ); 247 packageList.filterPackages( f );
229 wait->hide(); 248 //wait->hide();
230} 249}
@@ -233,3 +252,3 @@ void MainWindow::displayList()
233{ 252{
234 wait->hide(); 253 //wait->hide();
235 filterList(); 254 filterList();
@@ -328,2 +347,14 @@ void MainWindow::findClose()
328 347
348void MainWindow::destShow(bool b)
349{
350 if (b) destBar->show();
351 else destBar->hide();
352 destAction->setOn( b );
353}
354
355void MainWindow::destClose()
356{
357 destAction->setOn( false );
358}
359
329void MainWindow::rotateUpdateIcon() 360void MainWindow::rotateUpdateIcon()
@@ -363,9 +394,29 @@ void MainWindow::installFile(const QString &fileName)
363 394
395void MainWindow::makeChannel()
396 {
397 channel = new QCopChannel( "QPE/Application/oipkg", this );
398 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
399 this, SLOT(receive(const QCString&, const QByteArray&)) );
400}
401
402
403
364void MainWindow::receive(const QCString &msg, const QByteArray &arg) 404void MainWindow::receive(const QCString &msg, const QByteArray &arg)
365{ 405{
366 pvDebug(3, "QCop "+msg); 406 pvDebug(3, "QCop "+msg+" "+QCString(arg));
367 if ( msg == "installFile(QString)" ) 407 if ( msg == "installFile(QString)" )
368 { 408 {
369 installFile( QString(arg) ); 409 ipkg->installFile( QString(arg) );
370 } 410 }else if( msg == "removeFile(QString)" )
371} \ No newline at end of file 411 {
412 ipkg->removeFile( QString(arg) );
413 }else if( msg == "createLinks(QString)" )
414 {
415 ipkg->createLinks( QString(arg) );
416 }else if( msg == "removeLinks(QString)" )
417 {
418 ipkg->removeLinks( QString(arg) );
419 }else{
420 pvDebug(2,"Huh what do ya want")
421 }
422}
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h
index a713d00..7615b09 100644
--- a/noncore/unsupported/oipkg/mainwindow.h
+++ b/noncore/unsupported/oipkg/mainwindow.h
@@ -19,2 +19,3 @@ class QCopChannel;
19class QMessageBox; 19class QMessageBox;
20class QCheckBox;
20 21
@@ -28,2 +29,3 @@ public:
28 ~MainWindow(); 29 ~MainWindow();
30 void makeChannel();
29 31
@@ -33,3 +35,2 @@ protected slots:
33 void runIpkg(); 35 void runIpkg();
34 void getList();
35 void updateList(); 36 void updateList();
@@ -47,2 +48,4 @@ public slots:
47 void findShow(bool); 48 void findShow(bool);
49 void destClose();
50 void destShow(bool);
48 void filterList(); 51 void filterList();
@@ -62,3 +65,2 @@ private:
62 QAction *runAction; 65 QAction *runAction;
63 QAction *detailsAction;
64 QAction *updateAction; 66 QAction *updateAction;
@@ -66,2 +68,3 @@ private:
66 QAction *sectionAction; 68 QAction *sectionAction;
69 QAction *destAction;
67 PackageListView *listViewPackages; 70 PackageListView *listViewPackages;
@@ -72,3 +75,6 @@ private:
72 QComboBox *subsection; 75 QComboBox *subsection;
73 QMessageBox *wait; 76 QPEToolBar *destBar;
77 QComboBox *destination;
78 QCheckBox* CheckBoxLink;
79// QMessageBox *wait;
74private slots: 80private slots:
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro
index 1f7a70d..c5d3b3d 100644
--- a/noncore/unsupported/oipkg/oipkg.pro
+++ b/noncore/unsupported/oipkg/oipkg.pro
@@ -7,2 +7,3 @@ HEADERS = mainwindow.h \
7 pmipkg.h \ 7 pmipkg.h \
8 utils.h \
8 packagelistitem.h \ 9 packagelistitem.h \
@@ -13,2 +14,3 @@ SOURCES = main.cpp \
13 mainwindow.cpp \ 14 mainwindow.cpp \
15 utils.cpp \
14 packagelistview.cpp \ 16 packagelistview.cpp \
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp
index 5f0e5fa..0499e19 100644
--- a/noncore/unsupported/oipkg/package.cpp
+++ b/noncore/unsupported/oipkg/package.cpp
@@ -11,5 +11,5 @@
11 11
12Package::~Package() 12//Package::~Package()
13{ 13//{
14} 14//}
15 15
@@ -63,61 +63,52 @@ void Package::setValue( QString n, QString t )
63{ 63{
64 if ( n == "Status" && installed() ) return;
65 if ( n == "Package" ) 64 if ( n == "Package" )
66 { 65 {
67 _name = QString( t ); 66 _name = QString( t );
68 } 67 }else if ( n == "Installed-Size" )
69 if ( n == "Installed-Size" ) 68 {
70 {
71 _size = t; 69 _size = t;
72 } 70 }else if ( n == "Priority")
73 if ( n == "Priority") 71 {
74 {
75 72
76 } 73 }else if ( n == "Section")
77 if ( n == "Section") 74 {
78 {
79 setSection( t ); 75 setSection( t );
80 } 76 }else if ( n == "Maintainer")
81 if ( n == "Maintainer") 77 {
82 {
83 78
84 } 79 }else if ( n == "Architecture")
85 if ( n == "Architecture") 80 {
86 {
87 81
88 } 82 }else if ( n == "Version")
89 if ( n == "Version") 83 {
90 {
91 84
92 } 85 }else if ( n == "Pre-Depends")
93 if ( n == "Pre-Depends") 86 {
94 {
95 87
96 } 88 }else if ( n == "Depends")
97 if ( n == "Depends") 89 {
98 {
99 90
100 }else if ( n == "Filename") 91 }else if ( n == "Filename")
101 { 92 {
102 93
103 }else if ( n == "Size") 94 }else if ( n == "Size")
104 { 95 {
105 96
106 }else if ( n == "MD5Sum") 97 }else if ( n == "MD5Sum")
107 { 98 {
108 99
109 } 100 }
110 if ( n == "Description") 101 if ( n == "Description")
111 { 102 {
112 setDesc( t ); 103 setDesc( t );
113 } 104 }
114 if ( n == "Status") 105 if ( n == "Status")
115 { 106 {
116 if ( installed() ) return; 107 if ( installed() ) return;
117 _status = t; 108 _status = t;
118 } 109 }
119 if ( t == "Essential") 110 if ( t == "Essential")
120 { 111 {
121 112
122 } 113 }
123}; 114};
@@ -155,2 +146,18 @@ QString Package::size()
155 146
147QString Package::sizeUnits()
148{
149 int i = _size.toInt();
150 int c = 0;
151 QString ret;
152 QStringList unit;
153 unit << "B" << "KB" << "MB" << "GB" << "TB"; //prepair for the future ;)
154 while (i > 1)
155 {
156 ret=QString::number(i)+" "+unit[c];
157 c++;
158 i /= 1024;
159 }
160 return ret;
161}
162
156bool Package::toProcess() 163bool Package::toProcess()
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h
index 31b0010..49bb3bf 100644
--- a/noncore/unsupported/oipkg/package.h
+++ b/noncore/unsupported/oipkg/package.h
@@ -14,6 +14,6 @@ class Package //: public QObject
14{ 14{
15 //Q_OBJECT 15 // Q_OBJECT
16 public: 16 public:
17 Package(PackageManagerSettings *); 17 Package(PackageManagerSettings *);
18 ~Package(); 18 // ~Package();
19 Package( QStringList, PackageManagerSettings * ); 19 Package( QStringList, PackageManagerSettings * );
@@ -32,2 +32,3 @@ class Package //: public QObject
32 QString size(); 32 QString size();
33 QString sizeUnits();
33 void setSection( QString ); 34 void setSection( QString );
@@ -47,3 +48,2 @@ class Package //: public QObject
47public slots: 48public slots:
48 /** No descriptions */
49 QString getPackageName(); 49 QString getPackageName();
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp
index 149ba35..0c7c928 100644
--- a/noncore/unsupported/oipkg/packagelistitem.cpp
+++ b/noncore/unsupported/oipkg/packagelistitem.cpp
@@ -19,14 +19,3 @@ PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSetti
19 QCheckListItem *item; 19 QCheckListItem *item;
20#ifndef NEWLAYOUT 20 nameItem = new QCheckListItem( this, "" );
21 item = new QCheckListItem( this, QObject::tr("Name") );
22 item->setText(1,pi->name());
23 item = new QCheckListItem( this, QObject::tr("Description") );
24 item->setText(1,pi->desc()+"\ntest multi\nline");
25 item = new QCheckListItem( this, QObject::tr("Size") );
26 item->setText(1,pi->size());
27 item = new QCheckListItem( this, QObject::tr("Destination") );
28 item->setText(1,pi->getDest());
29#endif
30#ifdef NEWLAYOUT
31 item = new QCheckListItem( this, QObject::tr("Name: ")+pi->name() );
32 item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() ); 21 item = new QCheckListItem( this, QObject::tr("Description: ")+pi->desc() );
@@ -36,5 +25,5 @@ PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSetti
36 displayDetails(); 25 displayDetails();
37#endif
38 26
39 if (!pm_uninstalled) { 27 if (!pm_uninstalled)
28 {
40 pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); 29 pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled"));
@@ -44,6 +33,2 @@ PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSetti
44 } 33 }
45#ifndef NEWLAYOUT
46 setText(1, package->shortDesc() );
47 setText(2, package->size() );
48#endif
49} 34}
@@ -122,9 +107,2 @@ void PackageListItem::setOn( bool b )
122 package->toggleProcess(); 107 package->toggleProcess();
123// if ( b )
124// {
125// if ((package->dest()).isEmpty)
126 // package->setDest( settings->getDestinationName() );
127// }else{
128// package->setDest( QObject::tr("not installed"));
129// }
130 package->setLink( settings->createLinks() ); 108 package->setLink( settings->createLinks() );
@@ -135,2 +113,7 @@ void PackageListItem::displayDetails()
135{ 113{
114 QString sod = " ("+package->sizeUnits();
115 sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest());
116 sod += ")";
117 setText(0, package->name()+sod );
118 nameItem->setText( 0, QObject::tr("Name: ")+package->name());
136 linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); 119 linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) );
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h
index f695432..54d9f9e 100644
--- a/noncore/unsupported/oipkg/packagelistitem.h
+++ b/noncore/unsupported/oipkg/packagelistitem.h
@@ -29,2 +29,3 @@ public:
29private: 29private:
30 QCheckListItem *nameItem;
30 QCheckListItem *destItem; 31 QCheckListItem *destItem;
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp
index 693ea6a..2915ac6 100644
--- a/noncore/unsupported/oipkg/packagelistview.cpp
+++ b/noncore/unsupported/oipkg/packagelistview.cpp
@@ -54,3 +54,3 @@ void PackageListView::setCurrent( QListViewItem* p )
54 activePackage = activePackageListItem->getPackage(); 54 activePackage = activePackageListItem->getPackage();
55 pvDebug(5, "start timer"); 55 if (!activePackage) return;
56 popupTimer->start( 750, true ); 56 popupTimer->start( 750, true );
@@ -65,11 +65,22 @@ void PackageListView::showPopup()
65 QAction *popupAction; 65 QAction *popupAction;
66 popupMenu->insertItem( QObject::tr("Install to"), destsMenu ); 66 if ( !activePackage->installed() )
67 QStringList dests = settings->getDestinationNames(); 67 {
68 for (uint i = 0; i < dests.count(); i++ ) 68 popupMenu->insertItem( QObject::tr("Install to"), destsMenu );
69 { 69 QStringList dests = settings->getDestinationNames();
70 popupAction = new QAction( dests[i], QString::null, 0, this, 0 ); 70 QString ad = settings->getDestinationName();
71 popupAction->addTo( destsMenu ); 71 for (uint i = 0; i < dests.count(); i++ )
72 } 72 {
73 connect( destsMenu, SIGNAL( activated( int ) ), 73 popupAction = new QAction( dests[i], QString::null, 0, this, 0 );
74 this, SLOT( changePackageDest( int ) ) ); 74 popupAction->addTo( destsMenu );
75 if ( dests[i] == ad && activePackage->toInstall() )
76 {
77 popupAction->setToggleAction( true );
78 popupAction->setOn(true);
79 };
80 }
81 connect( destsMenu, SIGNAL( activated( int ) ),
82 this, SLOT( changePackageDest( int ) ) );
83 }else{
84 // popupActcat setOn( activePackage->toProcess() );
85 }
75 popupMenu->popup( QCursor::pos() ); 86 popupMenu->popup( QCursor::pos() );
@@ -79,3 +90,2 @@ void PackageListView::stopTimer( QListViewItem* )
79{ 90{
80 pvDebug( 5, "stop timer" );
81 popupTimer->stop(); 91 popupTimer->stop();
@@ -91 +101,7 @@ void PackageListView::changePackageDest( int i )
91} 101}
102
103void PackageListView::toggleProcess()
104{
105 activePackage->toggleProcess() ;
106 activePackageListItem->displayDetails();
107}
diff --git a/noncore/unsupported/oipkg/packagelistview.h b/noncore/unsupported/oipkg/packagelistview.h
index 15e200b..a3db0d0 100644
--- a/noncore/unsupported/oipkg/packagelistview.h
+++ b/noncore/unsupported/oipkg/packagelistview.h
@@ -50,2 +50,4 @@ public slots:
50 void stopTimer( QListViewItem* ); 50 void stopTimer( QListViewItem* );
51 /** No descriptions */
52 void toggleProcess();
51}; 53};
diff --git a/noncore/unsupported/oipkg/pkdesc.ui b/noncore/unsupported/oipkg/pkdesc.ui
deleted file mode 100644
index 494d3d6..0000000
--- a/noncore/unsupported/oipkg/pkdesc.ui
+++ b/dev/null
@@ -1,96 +0,0 @@
1<!DOCTYPE UI><UI>
2<class>PackageDetails</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>Form7</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>221</width>
15 <height>291</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>(pkgname)</string>
21 </property>
22 <property>
23 <name>layoutMargin</name>
24 </property>
25 <property>
26 <name>layoutSpacing</name>
27 </property>
28 <vbox>
29 <property stdset="1">
30 <name>margin</name>
31 <number>6</number>
32 </property>
33 <property stdset="1">
34 <name>spacing</name>
35 <number>3</number>
36 </property>
37 <widget>
38 <class>QTextView</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>description</cstring>
42 </property>
43 </widget>
44 <widget>
45 <class>QLayoutWidget</class>
46 <property stdset="1">
47 <name>name</name>
48 <cstring>Layout4</cstring>
49 </property>
50 <hbox>
51 <property stdset="1">
52 <name>margin</name>
53 <number>0</number>
54 </property>
55 <property stdset="1">
56 <name>spacing</name>
57 <number>6</number>
58 </property>
59 <widget>
60 <class>QToolButton</class>
61 <property stdset="1">
62 <name>name</name>
63 <cstring>install</cstring>
64 </property>
65 <property stdset="1">
66 <name>text</name>
67 <string>Install</string>
68 </property>
69 </widget>
70 <widget>
71 <class>QToolButton</class>
72 <property stdset="1">
73 <name>name</name>
74 <cstring>remove</cstring>
75 </property>
76 <property stdset="1">
77 <name>text</name>
78 <string>Remove</string>
79 </property>
80 </widget>
81 <widget>
82 <class>QToolButton</class>
83 <property stdset="1">
84 <name>name</name>
85 <cstring>ignore</cstring>
86 </property>
87 <property stdset="1">
88 <name>text</name>
89 <string>Ignore</string>
90 </property>
91 </widget>
92 </hbox>
93 </widget>
94 </vbox>
95</widget>
96</UI>
diff --git a/noncore/unsupported/oipkg/pksettings.cpp b/noncore/unsupported/oipkg/pksettings.cpp
index be01837..6c8dc2a 100644
--- a/noncore/unsupported/oipkg/pksettings.cpp
+++ b/noncore/unsupported/oipkg/pksettings.cpp
@@ -33,2 +33,3 @@
33#include "debug.h" 33#include "debug.h"
34//#include "utils.h"
34 35
@@ -58,2 +59,3 @@ PackageManagerSettings::PackageManagerSettings( QWidget* parent, const char* na
58 readSettings(); 59 readSettings();
60 activeLinkDestination->hide();
59} 61}
@@ -78,4 +80,6 @@ void PackageManagerSettings::newServer()
78 } 80 }
81 changed = true;
79 servers->setSelected(i,TRUE); 82 servers->setSelected(i,TRUE);
80 editServer(i); 83 editServer(i);
84 changed = true;
81} 85}
@@ -99,2 +103,3 @@ void PackageManagerSettings::newDestination()
99 editDestination(i); 103 editDestination(i);
104 changed = true;
100} 105}
@@ -119,2 +124,3 @@ void PackageManagerSettings::editServer(int i)
119 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) ); 124 connect( serverurl, SIGNAL(textChanged(const QString&)), this, SLOT(serverUrlChanged(const QString&)) );
125 changed = true;
120} 126}
@@ -139,2 +145,3 @@ void PackageManagerSettings::editDestination(int i)
139 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) ); 145 connect( destinationurl, SIGNAL(textChanged(const QString&)), this, SLOT(destUrlChanged(const QString&)) );
146 changed = true;
140} 147}
@@ -153,2 +160,3 @@ void PackageManagerSettings::removeServer()
153 serverurl->setEnabled(FALSE); 160 serverurl->setEnabled(FALSE);
161 changed = true;
154} 162}
@@ -168,2 +176,3 @@ void PackageManagerSettings::removeDestination()
168 destinationurl->setEnabled(FALSE); 176 destinationurl->setEnabled(FALSE);
177 changed = true;
169} 178}
@@ -175,3 +184,5 @@ void PackageManagerSettings::serverNameChanged(const QString& t)
175 activeServers->changeItem( t, editedserver ); 184 activeServers->changeItem( t, editedserver );
185 changed = true;
176 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) ); 186 connect( servers, SIGNAL(highlighted(int)), this, SLOT(editServer(int)) );
187 changed = true;
177} 188}
@@ -185,2 +196,3 @@ void PackageManagerSettings::destNameChanged(const QString& t)
185 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) ); 196 connect( destinations, SIGNAL(highlighted(int)), this, SLOT(editDestination(int)) );
197 changed = true;
186} 198}
@@ -190,2 +202,3 @@ void PackageManagerSettings::serverUrlChanged(const QString& t)
190 serverurlDic.replace(editedserver, new QString(t)); 202 serverurlDic.replace(editedserver, new QString(t));
203 changed = true;
191} 204}
@@ -195,2 +208,3 @@ void PackageManagerSettings::destUrlChanged(const QString& t)
195 destinationurlDic.replace(editeddestination, new QString(t)); 208 destinationurlDic.replace(editeddestination, new QString(t));
209 changed = true;
196} 210}
@@ -267,2 +281,3 @@ void PackageManagerSettings::installationSettingChange(int cs)
267 readInstallationSetting( cs ); 281 readInstallationSetting( cs );
282 changed = true;
268} 283}
@@ -271,3 +286,2 @@ void PackageManagerSettings::writeInstallationSettings()
271{ 286{
272 if ( ! changed ) return ;
273 { 287 {
@@ -287,3 +301,3 @@ void PackageManagerSettings::readInstallationSetting(int setting)
287 cfg.setGroup( "Setting_" + QString::number( setting ) ); 301 cfg.setGroup( "Setting_" + QString::number( setting ) );
288 CheckBoxLink->setChecked( cfg.readBoolEntry( "link", false ) ); 302 CheckBoxLink->setChecked( cfg.readBoolEntry( "link", true ) );
289 QString dest = cfg.readEntry( "dest" ); 303 QString dest = cfg.readEntry( "dest" );
@@ -292,10 +306,9 @@ void PackageManagerSettings::readInstallationSetting(int setting)
292 pvDebug(3, "linkdest="+linkdest); 306 pvDebug(3, "linkdest="+linkdest);
293
294 for ( int i = 0; i < activeDestination->count(); i++) 307 for ( int i = 0; i < activeDestination->count(); i++)
295 { 308 {
296 if ( activeDestination->text( i ) == dest ) 309 if ( activeDestination->text( i ) == dest )
297 activeDestination->setCurrentItem( i ); 310 activeDestination->setCurrentItem( i );
298 if ( activeLinkDestination->text( i ) == linkdest ) 311 if ( activeLinkDestination->text( i ) == linkdest )
299 activeLinkDestination->setCurrentItem( i ); 312 activeLinkDestination->setCurrentItem( i );
300 } 313 }
301} 314}
@@ -305,3 +318,2 @@ void PackageManagerSettings::writeCurrentInstallationSetting()
305 Config cfg( "oipkg", Config::User ); 318 Config cfg( "oipkg", Config::User );
306 changed = false;
307 cfg.setGroup( "Setting_" + QString::number(currentSetting) ); 319 cfg.setGroup( "Setting_" + QString::number(currentSetting) );
@@ -334,2 +346,3 @@ bool PackageManagerSettings::readIpkgConfig(const QString& conffile)
334 QFile conf(conffile); 346 QFile conf(conffile);
347 changed = false;
335 if ( conf.open(IO_ReadOnly) ) { 348 if ( conf.open(IO_ReadOnly) ) {
@@ -426,3 +439,3 @@ void PackageManagerSettings::writeSettings()
426{ 439{
427 writeIpkgConfig("/etc/ipkg.conf"); 440 if ( changed ) writeIpkgConfig("/etc/ipkg.conf");
428 writeInstallationSettings(); 441 writeInstallationSettings();
@@ -437,3 +450,3 @@ bool PackageManagerSettings::showDialog( int i )
437 else readSettings(); 450 else readSettings();
438 return ret; 451 return (changed && ret);
439} 452}
@@ -471,2 +484,11 @@ QStringList PackageManagerSettings::getActiveServers()
471} 484}
485 QStringList PackageManagerSettings::getServers()
486{
487 QStringList sl;
488 for (int i=0; i<(int)activeServers->count(); i++)
489 {
490 sl += activeServers->text(i);
491 }
492 return sl;
493}
472 494
@@ -508,4 +530,13 @@ void PackageManagerSettings::linkEnabled( bool b )
508{ 530{
509 changed = true;
510 activeLinkDestination->setEnabled( b ); 531 activeLinkDestination->setEnabled( b );
511} 532}
533
534void PackageManagerSettings::activeServerChanged()
535{
536 changed = true;
537}
538
539QComboBox* PackageManagerSettings::getDestCombo()
540{
541 return new QComboBox(activeDestination);
542}
diff --git a/noncore/unsupported/oipkg/pksettings.h b/noncore/unsupported/oipkg/pksettings.h
index 11ba55c..fbb3b99 100644
--- a/noncore/unsupported/oipkg/pksettings.h
+++ b/noncore/unsupported/oipkg/pksettings.h
@@ -19,2 +19,3 @@ public:
19 bool createLinks(); 19 bool createLinks();
20 QStringList getServers();
20 QStringList getActiveServers(); 21 QStringList getActiveServers();
@@ -23,2 +24,4 @@ public:
23 QString getDestinationUrlByName(QString); 24 QString getDestinationUrlByName(QString);
25 /** No descriptions */
26 QComboBox* getDestCombo();
24 27
@@ -61,2 +64,3 @@ public slots:
61 void renameInstallationSetting(); 64 void renameInstallationSetting();
65 void activeServerChanged();
62}; 66};
diff --git a/noncore/unsupported/oipkg/pksettingsbase.ui b/noncore/unsupported/oipkg/pksettingsbase.ui
index 196a89f..fd6d208 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>349</width> 14 <width>345</width>
15 <height>454</height> 15 <height>454</height>
@@ -178,3 +178,3 @@
178 <name>text</name> 178 <name>text</name>
179 <string>Link Destination: root</string> 179 <string>Link to root destination</string>
180 </property> 180 </property>
@@ -720,2 +720,20 @@
720<connections> 720<connections>
721 <connection>
722 <sender>activeServers</sender>
723 <signal>pressed(QListBoxItem*)</signal>
724 <receiver>Form4</receiver>
725 <slot>activeServerChanged()</slot>
726 </connection>
727 <connection>
728 <sender>activeServers</sender>
729 <signal>selectionChanged(QListBoxItem*)</signal>
730 <receiver>Form4</receiver>
731 <slot>activeServerChanged()</slot>
732 </connection>
733 <connection>
734 <sender>activeServers</sender>
735 <signal>pressed(QListBoxItem*)</signal>
736 <receiver>Form4</receiver>
737 <slot>activeServerChanged()</slot>
738 </connection>
721 <slot access="public">destNameChanged(const QString&amp;)</slot> 739 <slot access="public">destNameChanged(const QString&amp;)</slot>
@@ -730,2 +748,3 @@
730 <slot access="public">newServer()</slot> 748 <slot access="public">newServer()</slot>
749 <slot access="public">activeServerChanged()</slot>
731 <slot access="public">removeDestination()</slot> 750 <slot access="public">removeDestination()</slot>
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index ecc97b2..9f6429a 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -11,2 +11,3 @@
11#include <qfile.h> 11#include <qfile.h>
12#include <qgroupbox.h>
12#include <qmultilineedit.h> 13#include <qmultilineedit.h>
@@ -59,4 +60,11 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
59 60
60// if (runwindow->forcedepends->isChecked()) 61 if (_force_depends)
61 // cmd += " -force-depends "; 62 {
63 if (_force_depends->isChecked())
64 cmd += " -force-depends ";
65 if (_force_reinstall->isChecked())
66 cmd += " -force-reinstall ";
67 if (_force_remove->isChecked())
68 cmd += " -force-removal-of-essential-packages ";
69 }
62 70
@@ -78,3 +86,3 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
78 pvDebug(2, "running >"+cmd+"<"); 86 pvDebug(2, "running >"+cmd+"<");
79 r = system(cmd.latin1()); 87 r = system(cmd.latin1());
80 QFile f( redirect ); 88 QFile f( redirect );
@@ -83,5 +91,3 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
83 while ( ! f.open(IO_ReadOnly) ) {}; 91 while ( ! f.open(IO_ReadOnly) ) {};
84 // {
85 QTextStream t( &f ); 92 QTextStream t( &f );
86 // QString fp;
87 while ( !t.eof() ) 93 while ( !t.eof() )
@@ -95,3 +101,2 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
95 } 101 }
96// }
97 f.close(); 102 f.close();
@@ -106,4 +111,10 @@ void PmIpkg::makeLinks(Package *pack)
106 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 111 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
107 QString dest = settings->getDestinationUrlByName( pack->dest() ); 112 linkPackage( pack->name(), pack->dest() );
108 if (dest == "/" ) return; 113}
114
115QStringList* PmIpkg::getList( QString packFileName, QString d )
116{
117 QString dest = settings->getDestinationUrlByName( d );
118 dest = dest==""?d:dest;
119 if (dest == "/" ) return 0;
109 { 120 {
@@ -113,26 +124,38 @@ void PmIpkg::makeLinks(Package *pack)
113 } 124 }
114 QString fn = dest+"/"+statusDir+"/info/"+pack->name()+".list"; 125 packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list";
115 linkPackage( fn, dest ); 126 QFile f( packFileName );
116} 127 if ( ! f.open(IO_ReadOnly) )
117
118void PmIpkg::linkPackage( QString packFileName, QString dest )
119{
120 QFile f( packFileName );
121 if ( ! f.open(IO_ReadOnly) )
122 { 128 {
129 pvDebug(1," Panik! Could not open");
123 out( "<b>Panik!</b> Could not open:<br>"+packFileName ); 130 out( "<b>Panik!</b> Could not open:<br>"+packFileName );
124 return; 131 return (QStringList*)0;
125 }; 132 }
126 out( "<br>creating links<br>" ); 133 QStringList *fileList = new QStringList();
127 out("for package "+packFileName+" in "+dest+"<br>");
128 QTextStream t( &f ); 134 QTextStream t( &f );
129 QString fp;
130 while ( !t.eof() ) 135 while ( !t.eof() )
131 { 136 {
132 fp = t.readLine(); 137 *fileList += t.readLine();
133 processLinkDir( fp, dest );
134 } 138 }
135 f.close(); 139 return fileList;
136} 140}
137 141
142void PmIpkg::linkPackage( QString packFileName, QString dest )
143{
144 QStringList *fileList = getList( packFileName, dest );
145 processFileList( fileList, dest );
146 delete fileList;
147}
148
149void PmIpkg::processFileList( QStringList *fileList, QString d )
150{
151 if (!fileList) return;
152 for (uint i=0; i < fileList->count(); i++)
153 {
154 QString dest = settings->getDestinationUrlByName( d );
155 dest = dest==""?d:dest;
156 processLinkDir( (*fileList)[i], dest );
157 }
158}
159
160
138void PmIpkg::processLinkDir( QString file, QString dest ) 161void PmIpkg::processLinkDir( QString file, QString dest )
@@ -140,3 +163,5 @@ void PmIpkg::processLinkDir( QString file, QString dest )
140 pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest); 163 pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest);
141 if ( dest == "???" ) return; 164 if (linkOpp==createLink) pvDebug( 2,"opp: createLink");
165 if (linkOpp==removeLink) pvDebug( 2,"opp:removeLink");
166 if ( dest == "???" || dest == "" ) return;
142 QString destFile = file; 167 QString destFile = file;
@@ -148,3 +173,3 @@ void PmIpkg::processLinkDir( QString file, QString dest )
148 QDir destDir( destFile ); 173 QDir destDir( destFile );
149 destDir.mkdir( destFile, true ); 174 if (linkOpp==createLink) destDir.mkdir( destFile, true );
150 QDir d( file ); 175 QDir d( file );
@@ -156,3 +181,3 @@ void PmIpkg::processLinkDir( QString file, QString dest )
156 { 181 {
157 // out( "<b>"+fi->absFilePath()+"</b>" ); 182 pvDebug(4, "process dir "+fi->absFilePath());
158 processLinkDir( fi->absFilePath(), dest ); 183 processLinkDir( fi->absFilePath(), dest );
@@ -160,2 +185,7 @@ void PmIpkg::processLinkDir( QString file, QString dest )
160 } 185 }
186// if (linkOpp==removeLink)
187// {
188 // pvDebug(2,"remove destDir "+ destFile );
189 // destDir.remove( destFile, true );
190// }
161 } else 191 } else
@@ -165,5 +195,16 @@ void PmIpkg::processLinkDir( QString file, QString dest )
165 const char *linkFile = strdup( (destFile).ascii()); 195 const char *linkFile = strdup( (destFile).ascii());
166// out( "linking: "+file+" -> "+destFile ); 196 if( linkOpp==createLink )
167 qDebug( "linking: %s -> %s", instFile, linkFile ); 197 {
168 symlink( instFile, linkFile ); 198 pvDebug(4, "linking: "+file+" -> "+destFile );
199 symlink( instFile, linkFile );
200 }
201 } else {
202 const char *linkFile = strdup( (destFile).ascii());
203 if( linkOpp==removeLink )
204 {
205 pvDebug(4,"removing "+destFile+" no "+file);
206 QFileInfo toRemoveLink( destFile );
207 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
208 unlink( linkFile );
209 }
169 } 210 }
@@ -178,3 +219,2 @@ void PmIpkg::commit( PackageList pl )
178 QString inst="<b>"+tr("To install:")+"</b><br>\n"; 219 QString inst="<b>"+tr("To install:")+"</b><br>\n";
179 pl.allPackages();
180 for( Package *pack = pl.first();pack ; (pack = pl.next()) ) 220 for( Package *pack = pl.first();pack ; (pack = pl.next()) )
@@ -209,59 +249,53 @@ void PmIpkg::startDialog()
209 249
210 QHBoxLayout *buttons = new QHBoxLayout;
211 buttons->setSpacing( 6 );
212 buttons->setMargin( 0 );
213
214 PackageListView *plv = new PackageListView(installDialog, "install",settings); 250 PackageListView *plv = new PackageListView(installDialog, "install",settings);
251 plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) );
215 RunWindowLayout->addWidget( plv, 1, 0 ); 252 RunWindowLayout->addWidget( plv, 1, 0 );
253 QCheckListItem *toRemoveItem;
254 toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") );
255 toRemoveItem->setOpen( true );
216 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) 256 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
217 { 257 {
218 plv->insertItem( new PackageListItem(plv, it,settings) ); 258 toRemoveItem->insertItem( new PackageListItem(plv, it,settings) );
219 } 259 }
260 QCheckListItem *toInstallItem;
261 toInstallItem = new QCheckListItem( plv, QObject::tr("To install") );
262 toInstallItem->setOpen( true );
220 for (Package *it=to_install.first(); it != 0; it=to_install.next() ) 263 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
221 { 264 {
222 plv->insertItem( new PackageListItem(plv, it,settings) ); 265 toInstallItem->insertItem( new PackageListItem(plv, it,settings) );
223 } 266 }
224 QPushButton *doItButton = new QPushButton( installDialog, "doItButton" ); 267
225 doItButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, doItButton->sizePolicy().hasHeightForWidth() ) ); 268 QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" );
226 QFont doItButton_font( doItButton->font() ); 269 GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().hasHeightForWidth() ) );
227 doItButton_font.setPointSize( 8 ); 270 GroupBox1->setTitle( tr( "Ipkg options" ) );
228 doItButton->setFont( doItButton_font ); 271 GroupBox1->setColumnLayout(0, Qt::Vertical );
229 doItButton->setText( tr( "Do all " ) ); 272 GroupBox1->layout()->setSpacing( 0 );
230 doItButton->setAutoResize( FALSE ); 273 GroupBox1->layout()->setMargin( 0 );
231 buttons->addWidget( doItButton ); 274 QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
232 275 GroupBox1Layout->setAlignment( Qt::AlignTop );
233 QPushButton *installButton = new QPushButton( installDialog, "installButton" ); 276 GroupBox1Layout->setSpacing( 3 );
234 QFont installButton_font( installButton->font() ); 277 GroupBox1Layout->setMargin( 3 );
235 installButton_font.setPointSize( 8 ); 278
236 installButton->setFont( installButton_font ); 279 _force_depends = new QCheckBox( GroupBox1, "_force_depends" );
237 installButton->setText( tr( "Install" ) ); 280 _force_depends->setText( tr( "-force-depends" ) );
238 installButton->setAutoResize( TRUE ); 281 _force_depends->setAutoResize( TRUE );
239 buttons->addWidget( installButton ); 282 GroupBox1Layout->addWidget( _force_depends, 0, 0 );
240 283 _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" );
241 QPushButton *removeButton = new QPushButton( installDialog, "removeButton" ); 284 _force_reinstall->setText( tr( "-force-reinstall" ) );
242 QFont removeButton_font( removeButton->font() ); 285 _force_reinstall->setAutoResize( TRUE );
243 removeButton_font.setPointSize( 7 ); 286 GroupBox1Layout->addWidget( _force_reinstall, 1, 0 );
244 removeButton->setFont( removeButton_font ); 287 _force_remove = new QCheckBox( GroupBox1, "_force_remove" );
245 removeButton->setText( tr( "Remove" ) ); 288 _force_remove->setText( tr( "-force-removal-of-essential-packages" ) );
246 removeButton->setAutoResize( TRUE ); 289 _force_remove->setAutoResize( TRUE );
247 buttons->addWidget( removeButton ); 290 GroupBox1Layout->addWidget( _force_remove, 1, 0 );
248 291 RunWindowLayout->addWidget( GroupBox1 , 3, 0 );
249 QPushButton *cancelButton = new QPushButton( installDialog, "cancelButton" ); 292
250 QFont cancelButton_font( cancelButton->font() ); 293// connect( doItButton, SIGNAL( clicked() ),
251 cancelButton_font.setPointSize( 8 ); 294 // this, SLOT( doIt() ) );
252 cancelButton->setFont( cancelButton_font ); 295// connect( installButton, SIGNAL( clicked() ),
253 cancelButton->setText( tr( "Cancel" ) ); 296 // this, SLOT( install() ) );
254 cancelButton->setAutoResize( TRUE ); 297// connect( removeButton, SIGNAL( clicked() ),
255 buttons->addWidget( cancelButton ); 298 // this, SLOT( remove() ) );
256 299// connect( cancelButton, SIGNAL( clicked() ),
257 RunWindowLayout->addLayout( buttons, 3, 0 ); 300 // installDialog, SLOT( close() ) );
258
259 connect( doItButton, SIGNAL( clicked() ),
260 this, SLOT( doIt() ) );
261 connect( installButton, SIGNAL( clicked() ),
262 this, SLOT( install() ) );
263 connect( removeButton, SIGNAL( clicked() ),
264 this, SLOT( remove() ) );
265 connect( cancelButton, SIGNAL( clicked() ),
266 installDialog, SLOT( close() ) );
267 installDialog->showMaximized(); 301 installDialog->showMaximized();
@@ -269,2 +303,3 @@ void PmIpkg::startDialog()
269 installDialog->close(); 303 installDialog->close();
304 out(tr("<b>All done.</b>"));
270} 305}
@@ -273,2 +308,3 @@ void PmIpkg::doIt()
273{ 308{
309 show( true );
274 remove(); 310 remove();
@@ -281,18 +317,28 @@ void PmIpkg::remove()
281 if ( to_remove.count() == 0 ) return; 317 if ( to_remove.count() == 0 ) return;
282 installDialog->close();
283 show( true );
284 318
285 out("<hr><hr><b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br>"); 319 out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>");
286 320
321 QStringList *fileList;
287 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) 322 for (Package *it=to_remove.first(); it != 0; it=to_remove.next() )
288 { 323 {
324 if ( it->link() )fileList = getList( it->name(), it->dest() );
289 if ( runIpkg("remove " + it->name()) == 0) 325 if ( runIpkg("remove " + it->name()) == 0)
290 { 326 {
291 runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); 327 runwindow->progress->setProgress( 1 + runwindow->progress->progress() );
292 it->processed(); 328 linkOpp = removeLink;
293 runwindow->progress->setProgress( 1 ); 329 if ( it->link() )
330 {
331 out( "<br>removing links<br>" );
332 out( "for package "+it->name()+" in "+it->dest()+"<br>" );
333 processFileList( fileList, it->dest() );
334 }
335 it->processed();
336 out("<br><hr>");
294 }else{ 337 }else{
295 out("<b>"+tr("Error while removing")+"</b>"+it->name()); 338 out("<b>"+tr("Error while removing")+"</b><hr>"+it->name());
296 } 339 }
340 pvDebug(2,"delete File List");
341 if ( it->link() )delete fileList;
297 } 342 }
343 out("<br>");
298} 344}
@@ -303,5 +349,3 @@ void PmIpkg::install()
303 if ( to_install.count() == 0 ) return; 349 if ( to_install.count() == 0 ) return;
304 installDialog->close(); 350 out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
305 show( true );
306 out("<hr><hr><b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
307 for (Package *it=to_install.first(); it != 0; it=to_install.next() ) 351 for (Package *it=to_install.first(); it != 0; it=to_install.next() )
@@ -312,24 +356,34 @@ void PmIpkg::install()
312 runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); 356 runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress());
357 linkOpp = createLink;
313 if ( it->link() ) 358 if ( it->link() )
359 {
360 out( "<br>creating links<br>" );
361 out( "for package "+it->name()+" in "+it->dest()+"<br>" );
314 makeLinks( it ); 362 makeLinks( it );
363 }
315 it->processed(); 364 it->processed();
365 out("<br><hr>");
316 }else{ 366 }else{
317 out("<b>"+tr("Error while installing")+"</b>"+it->name()); 367 out("<b>"+tr("Error while installing")+"</b><hr>"+it->name());
318 } 368 }
319 } 369 }
370 out("<br>");
320} 371}
321 372
322void PmIpkg::linkDestination( const QString msg, const QByteArray dest ) 373void PmIpkg::createLinks( const QString &dest )
323{ 374{
324 qDebug("msg="+msg+" -- "+QString(dest) ); 375 pvDebug(2,"PmIpkg::createLinks "+dest);
325// QDir d( src ); 376 linkOpp=createLink;
326// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 377 QString url = settings->getDestinationUrlByName( dest );
327//// if (! d.exists() ) return; 378 url = url==""?dest:url;
328// const QFileInfoList *list = d.entryInfoList(); 379 processLinkDir( "/", url );
329// QFileInfoListIterator it( *list ); 380}
330// QFileInfo *fi; 381
331// while ( (fi=it.current()) ) { 382void PmIpkg::removeLinks( const QString &dest )
332 // processLinkDir( fi->absFilePath(), dest ); 383{
333// ++it; 384 pvDebug(2,"PmIpkg::removeLinks "+dest);
334// } 385 linkOpp=removeLink;
386 QString url = settings->getDestinationUrlByName( dest );
387 url = url==""?dest:url;
388 processLinkDir( "/", url );
335} 389}
@@ -345,3 +399,5 @@ void PmIpkg::out( QString o )
345{ 399{
346 runwindow->outPut->setText( runwindow->outPut->text()+o ); 400 runwindow->outPut->append(o);
401 //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight());
402 //runwindow->outPut->setText( runwindow->outPut->text()+o );
347 runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); 403 runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight());
@@ -378,3 +434,3 @@ void PmIpkg::show(bool b)
378 434
379void PmIpkg::installFile(const QString &fileName) 435void PmIpkg::installFile(const QString &fileName, const QString &dest)
380{ 436{
@@ -384,4 +440,20 @@ void PmIpkg::installFile(const QString &fileName)
384 pvDebug( 2,"PmIpkg::installFile "+ fileName); 440 pvDebug( 2,"PmIpkg::installFile "+ fileName);
385 to_install.append( new Package(fileName,settings) ); 441 Package *p = new Package(fileName,settings);
442 if ( dest!="") p->setDest( dest );
443 to_install.append( p );
444 startDialog();
445 delete p;
446}
447
448void PmIpkg::removeFile(const QString &fileName, const QString &dest)
449{
450
451 to_install.clear();
452 to_remove.clear();
453 pvDebug( 2,"PmIpkg::removeFile "+ fileName);
454 Package *p = new Package(fileName,settings);
455 if ( dest!="") p->setDest( dest );
456 to_remove.append( p );
386 startDialog(); 457 startDialog();
458 delete p;
387} 459}
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h
index c5e6255..0625032 100644
--- a/noncore/unsupported/oipkg/pmipkg.h
+++ b/noncore/unsupported/oipkg/pmipkg.h
@@ -13,2 +13,5 @@
13 13
14#define createLink 0
15#define removeLink 1
16
14class Package; 17class Package;
@@ -21,5 +24,6 @@ public:
21 24
25 int linkOpp;
22 void commit( PackageList ); 26 void commit( PackageList );
23 void update(); 27 void update();
24 PackageList* getPackageList(); 28 // PackageList* getPackageList();
25 void showButtons(bool b=true); 29 void showButtons(bool b=true);
@@ -27,2 +31,11 @@ public:
27 31
32public slots:
33 void doIt();
34 void install();
35 void remove();
36 void installFile(const QString &fileName, const QString &dest="");
37 void removeFile(const QString &fileName, const QString &dest="");
38 void createLinks( const QString &dest );
39 void removeLinks( const QString &dest );
40
28private: 41private:
@@ -35,3 +48,5 @@ private:
35 QString fileNameToInstall; 48 QString fileNameToInstall;
36 49 QCheckBox *_force_reinstall;
50 QCheckBox *_force_remove;
51 QCheckBox *_force_depends;
37 void startDialog(); 52 void startDialog();
@@ -39,12 +54,9 @@ private:
39 void linkPackage( QString, QString ); 54 void linkPackage( QString, QString );
40 void processLinkDir( QString, QString ); 55 void processLinkDir( QString , QString );
41 int runIpkg(const QString& args, const QString& dest="" ); 56 int runIpkg(const QString& args, const QString& dest="" );
42 void out( QString ); 57 void out( QString );
58 QStringList* getList( QString, QString );
59 void processFileList( QStringList*, QString );
60
43 61
44public slots:
45 void doIt();
46 void install();
47 void remove();
48 void installFile(const QString &fileName);
49 void linkDestination( const QString, const QByteArray );
50}; 62};
diff --git a/noncore/unsupported/oipkg/settings.cpp b/noncore/unsupported/oipkg/settings.cpp
index 2b324be..8f91995 100644
--- a/noncore/unsupported/oipkg/settings.cpp
+++ b/noncore/unsupported/oipkg/settings.cpp
@@ -436 +436,6 @@ void PackageManagerSettings::linkEnabled( bool b )
436} 436}
437
438void PackageManagerSettings::activeDestinationChange(int i)
439{
440 activeLinkDestination->setCurrentItem( i );
441} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h
index cf6e614..e2072f1 100644
--- a/noncore/unsupported/oipkg/settings.h
+++ b/noncore/unsupported/oipkg/settings.h
@@ -23,19 +23,4 @@ public:
23 23
24private:
25 QIntDict<QString> serverurlDic;
26 QIntDict<QString> destinationurlDic;
27 int ipkg_old;
28 int editedserver;
29 int editeddestination;
30 int currentSetting;
31 int installationSettingsCount;
32 bool changed;
33
34 bool readIpkgConfig(const QString&);
35 void writeIpkgConfig(const QString&);
36 void writeSettings();
37 void readSettings();
38
39public slots: 24public slots:
40 void writeInstallationSettings(); 25 void writeInstallationSettings();
41 void readInstallationSettings(); 26 void readInstallationSettings();
@@ -44,3 +29,3 @@ public slots:
44 void installationSettingSetName(const QString &); 29 void installationSettingSetName(const QString &);
45 30 void activeDestinationChange(int)
46 void newServer(); 31 void newServer();
@@ -60,2 +45,17 @@ public slots:
60 void renameInstallationSetting(); 45 void renameInstallationSetting();
46
47private:
48 QIntDict<QString> serverurlDic;
49 QIntDict<QString> destinationurlDic;
50 int ipkg_old;
51 int editedserver;
52 int editeddestination;
53 int currentSetting;
54 int installationSettingsCount;
55 bool changed;
56
57 bool readIpkgConfig(const QString&);
58 void writeIpkgConfig(const QString&);
59 void writeSettings();
60 void readSettings();
61}; 61};
diff --git a/noncore/unsupported/oipkg/utils.cpp b/noncore/unsupported/oipkg/utils.cpp
new file mode 100644
index 0000000..13b17fb
--- a/dev/null
+++ b/noncore/unsupported/oipkg/utils.cpp
@@ -0,0 +1,27 @@
1/***************************************************************************
2 utils.cpp - description
3 -------------------
4 begin : Sun Apr 28 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 <qcombobox.h>
19#include <qstring.h>
20#include "utils.h"
21
22void setComboName( QComboBox* combo, QString s)
23{
24 for ( int i = 0; i < combo->count(); i++)
25 if ( combo->text( i ) == s )
26 combo->setCurrentItem( i );
27} \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/utils.h b/noncore/unsupported/oipkg/utils.h
new file mode 100644
index 0000000..bb033c5
--- a/dev/null
+++ b/noncore/unsupported/oipkg/utils.h
@@ -0,0 +1,18 @@
1/***************************************************************************
2 utils.h - description
3 -------------------
4 begin : Sun Apr 28 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
18void setComboName( QComboBox*, QString ); \ No newline at end of file