author | tille <tille> | 2002-05-02 19:11:55 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-02 19:11:55 (UTC) |
commit | ce6758eccada41f5c3fef13e6b4808c525213bee (patch) (unidiff) | |
tree | 236d015e4c037254d7862620e41bd75ab701a696 | |
parent | b4f04de71fea42fa32a048f42d27e4f5be6804f9 (diff) | |
download | opie-ce6758eccada41f5c3fef13e6b4808c525213bee.zip opie-ce6758eccada41f5c3fef13e6b4808c525213bee.tar.gz opie-ce6758eccada41f5c3fef13e6b4808c525213bee.tar.bz2 |
added doclnk support
-rw-r--r-- | noncore/unsupported/oipkg/main.cpp | 7 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 51 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.h | 6 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/oipkg.pro | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.cpp | 6 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/package.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.cpp | 36 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistdoclnk.h | 22 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.cpp | 8 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistitem.h | 1 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.cpp | 14 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistremote.h | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/packagelistview.cpp | 3 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 21 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 4 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/settings.h | 9 |
16 files changed, 128 insertions, 65 deletions
diff --git a/noncore/unsupported/oipkg/main.cpp b/noncore/unsupported/oipkg/main.cpp index 5cef2dc..bacc973 100644 --- a/noncore/unsupported/oipkg/main.cpp +++ b/noncore/unsupported/oipkg/main.cpp | |||
@@ -1,22 +1,23 @@ | |||
1 | 1 | ||
2 | #include "mainwindow.h" | 2 | #include "mainwindow.h" |
3 | 3 | ||
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qstring.h> | 5 | #include <qstring.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | int debugLevel; | 7 | int debugLevel; |
8 | 8 | ||
9 | int main( int argc, char ** argv ) | 9 | int main( int argc, char ** argv ) |
10 | { | 10 | { |
11 | 11 | ||
12 | debugLevel = 2; | 12 | debugLevel = 2; |
13 | if (argc > 0) | 13 | if (argc > 0) |
14 | { | 14 | { |
15 | debugLevel = QString ( argv[1] ).toInt(); | 15 | debugLevel = QString ( argv[1] ).toInt(); |
16 | } | 16 | } |
17 | QPEApplication a( argc, argv ); | 17 | QPEApplication a( argc, argv ); |
18 | MainWindow mw; | 18 | MainWindow mw; |
19 | QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); | 19 | if (debugLevel < 4) |
20 | QMessageBox::information( &mw, "oipkg","While ipkg is working\noipkg is hanging.\nPlease be patient!"); | ||
20 | a.showMainDocumentWidget( &mw ); | 21 | a.showMainDocumentWidget( &mw ); |
21 | return a.exec(); | 22 | return a.exec(); |
22 | } | 23 | } |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 0422d65..b668660 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -1,114 +1,117 @@ | |||
1 | // adadpted form qpe/qipkg | 1 | // adadpted form qpe/qipkg |
2 | 2 | ||
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | 5 | ||
6 | #include <qpe/qpemenubar.h> | 6 | #include <qpe/qpemenubar.h> |
7 | #include <qpe/qpemessagebox.h> | 7 | #include <qpe/qpemessagebox.h> |
8 | #include <qpe/resource.h> | 8 | #include <qpe/resource.h> |
9 | #include <qpe/config.h> | 9 | #include <qpe/config.h> |
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qaction.h> | 12 | #include <qaction.h> |
13 | #include <qmessagebox.h> | 13 | #include <qmessagebox.h> |
14 | #include <qpopupmenu.h> | 14 | #include <qpopupmenu.h> |
15 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
16 | #include <qstring.h> | 16 | #include <qstring.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qfile.h> | 18 | #include <qfile.h> |
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | #include <qtextview.h> | 20 | #include <qtextview.h> |
21 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #include <qtabwidget.h> | 23 | #include <qtabwidget.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | 28 | ||
29 | #include "pksettingsbase.h" | 29 | #include "pksettingsbase.h" |
30 | #include "utils.h" | 30 | #include "utils.h" |
31 | #include "packagelistitem.h" | 31 | #include "packagelistitem.h" |
32 | 32 | ||
33 | 33 | ||
34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : |
35 | QMainWindow( parent, name, f ) | 35 | QMainWindow( parent, name, f ) |
36 | { | 36 | { |
37 | setCaption( tr("Package Manager") ); | 37 | setCaption( tr("Package Manager") ); |
38 | settings = new PackageManagerSettings(this,0,TRUE); | 38 | settings = new PackageManagerSettings(this,0,TRUE); |
39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 39 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
40 | setCentralWidget( listViewPackages ); | 40 | setCentralWidget( listViewPackages ); |
41 | listViewPackages->addList( tr("local"), &packageList ); | 41 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 42 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); |
43 | listViewPackages->addList( tr("documents"), &packageListDocLnk ); | ||
43 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); | 44 | //wait = new QMessageBox(tr("oipkg"),tr("Please wait")//,QMessageBox::Information,QMessageBox::NoButton,QMessageBox::NoButton,QMessageBox::NoButton); |
44 | //wait = new QMessageBox(this); | 45 | //wait = new QMessageBox(this); |
45 | // wait->setText(tr("Please wait")); | 46 | // wait->setText(tr("Please wait")); |
46 | ipkg = new PmIpkg( settings, this ); | 47 | ipkg = new PmIpkg( settings, this ); |
47 | // settings->setIpkg( ipkg ); | 48 | // settings->setIpkg( ipkg ); |
48 | packageList.setSettings( settings ); | 49 | packageListServers.setSettings( settings ); |
49 | packageListSearch.setSettings( settings ); | 50 | packageListSearch.setSettings( settings ); |
50 | packageList.update(); | 51 | packageListDocLnk.setSettings( settings ); |
52 | packageListServers.update(); | ||
53 | packageListDocLnk.update(); | ||
51 | makeMenu(); | 54 | makeMenu(); |
52 | makeChannel(); | 55 | makeChannel(); |
53 | //opie is hardcoded default ;) | 56 | //opie is hardcoded default ;) |
54 | for (int i=0;i<section->count();i++) | 57 | for (int i=0;i<section->count();i++) |
55 | if (section->text(i)=="opie") | 58 | if (section->text(i)=="opie") |
56 | section->setCurrentItem(i); | 59 | section->setCurrentItem(i); |
57 | sectionChanged(); | 60 | sectionChanged(); |
58 | 61 | ||
59 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 62 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
60 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 63 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
61 | 64 | ||
62 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 65 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
63 | SLOT(removeLinks()) ); | 66 | SLOT(removeLinks()) ); |
64 | connect( settings->createLinksButton, SIGNAL( clicked()), | 67 | connect( settings->createLinksButton, SIGNAL( clicked()), |
65 | SLOT(createLinks()) ); | 68 | SLOT(createLinks()) ); |
66 | 69 | ||
67 | displayList(); | 70 | displayList(); |
68 | } | 71 | } |
69 | 72 | ||
70 | void MainWindow::makeMenu() | 73 | void MainWindow::makeMenu() |
71 | { | 74 | { |
72 | 75 | ||
73 | QPEToolBar *toolBar = new QPEToolBar( this ); | 76 | QPEToolBar *toolBar = new QPEToolBar( this ); |
74 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); | 77 | QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); |
75 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); | 78 | QPopupMenu *srvMenu = new QPopupMenu( menuBar ); |
76 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); | 79 | QPopupMenu *viewMenu = new QPopupMenu( menuBar ); |
77 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); | 80 | QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); |
78 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); | 81 | // QPopupMenu *sectMenu = new QPopupMenu( menuBar ); |
79 | 82 | ||
80 | setToolBarsMovable( false ); | 83 | setToolBarsMovable( false ); |
81 | toolBar->setHorizontalStretchable( true ); | 84 | toolBar->setHorizontalStretchable( true ); |
82 | menuBar->insertItem( tr( "Package" ), srvMenu ); | 85 | menuBar->insertItem( tr( "Package" ), srvMenu ); |
83 | menuBar->insertItem( tr( "View" ), viewMenu ); | 86 | menuBar->insertItem( tr( "View" ), viewMenu ); |
84 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); | 87 | menuBar->insertItem( tr( "Settings" ), cfgMenu ); |
85 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); | 88 | // menuBar->insertItem( tr( "Sections" ), sectMenu ); |
86 | 89 | ||
87 | QLabel *spacer = new QLabel( "", toolBar ); | 90 | QLabel *spacer = new QLabel( "", toolBar ); |
88 | spacer->setBackgroundColor( toolBar->backgroundColor() ); | 91 | spacer->setBackgroundColor( toolBar->backgroundColor() ); |
89 | toolBar->setStretchableWidget( spacer ); | 92 | toolBar->setStretchableWidget( spacer ); |
90 | 93 | ||
91 | 94 | ||
92 | runAction = new QAction( tr( "Apply" ), | 95 | runAction = new QAction( tr( "Apply" ), |
93 | Resource::loadPixmap( "oipkg/install" ), | 96 | Resource::loadPixmap( "oipkg/install" ), |
94 | QString::null, 0, this, 0 ); | 97 | QString::null, 0, this, 0 ); |
95 | connect( runAction, SIGNAL( activated() ), | 98 | connect( runAction, SIGNAL( activated() ), |
96 | this, SLOT( runIpkg() ) ); | 99 | this, SLOT( runIpkg() ) ); |
97 | runAction->addTo( toolBar ); | 100 | runAction->addTo( toolBar ); |
98 | runAction->addTo( srvMenu ); | 101 | runAction->addTo( srvMenu ); |
99 | 102 | ||
100 | srvMenu->insertSeparator (); | 103 | srvMenu->insertSeparator (); |
101 | 104 | ||
102 | updateAction = new QAction( tr( "Update" ), | 105 | updateAction = new QAction( tr( "Update" ), |
103 | Resource::loadIconSet( "oipkg/update" ), | 106 | Resource::loadIconSet( "oipkg/update" ), |
104 | QString::null, 0, this, 0 ); | 107 | QString::null, 0, this, 0 ); |
105 | connect( updateAction, SIGNAL( activated() ), | 108 | connect( updateAction, SIGNAL( activated() ), |
106 | this , SLOT( updateList() ) ); | 109 | this , SLOT( updateList() ) ); |
107 | updateAction->addTo( toolBar ); | 110 | updateAction->addTo( toolBar ); |
108 | updateAction->addTo( srvMenu ); | 111 | updateAction->addTo( srvMenu ); |
109 | 112 | ||
110 | QAction *cfgact; | 113 | QAction *cfgact; |
111 | 114 | ||
112 | cfgact = new QAction( tr( "Setups" ), | 115 | cfgact = new QAction( tr( "Setups" ), |
113 | QString::null, 0, this, 0 ); | 116 | QString::null, 0, this, 0 ); |
114 | connect( cfgact, SIGNAL( activated() ), | 117 | connect( cfgact, SIGNAL( activated() ), |
@@ -183,227 +186,213 @@ void MainWindow::makeMenu() | |||
183 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 186 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
184 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); | 187 | connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); |
185 | a->addTo( searchBar ); | 188 | a->addTo( searchBar ); |
186 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); | 189 | searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); |
187 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); | 190 | connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); |
188 | searchCommit->addTo( searchBar ); | 191 | searchCommit->addTo( searchBar ); |
189 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 192 | a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
190 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); | 193 | connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); |
191 | a->addTo( searchBar ); | 194 | a->addTo( searchBar ); |
192 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); | 195 | searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); |
193 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); | 196 | connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); |
194 | searchAction->setToggleAction( true ); | 197 | searchAction->setToggleAction( true ); |
195 | searchAction->addTo( viewMenu ); | 198 | searchAction->addTo( viewMenu ); |
196 | 199 | ||
197 | //DEST | 200 | //DEST |
198 | destBar = new QPEToolBar(this); | 201 | destBar = new QPEToolBar(this); |
199 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 202 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
200 | label = new QLabel( tr("Destination: "), destBar ); | 203 | label = new QLabel( tr("Destination: "), destBar ); |
201 | label->setBackgroundColor( destBar->backgroundColor() ); | 204 | label->setBackgroundColor( destBar->backgroundColor() ); |
202 | destBar->setHorizontalStretchable( TRUE ); | 205 | destBar->setHorizontalStretchable( TRUE ); |
203 | destination = new QComboBox( false, destBar ); | 206 | destination = new QComboBox( false, destBar ); |
204 | destination->insertStringList( settings->getDestinationNames() ); | 207 | destination->insertStringList( settings->getDestinationNames() ); |
205 | setComboName(destination,settings->getDestinationName()); | 208 | setComboName(destination,settings->getDestinationName()); |
206 | connect( destination, SIGNAL(activated(int)), | 209 | connect( destination, SIGNAL(activated(int)), |
207 | settings, SLOT(activeDestinationChange(int)) ); | 210 | settings, SLOT(activeDestinationChange(int)) ); |
208 | spacer = new QLabel( " ", destBar ); | 211 | spacer = new QLabel( " ", destBar ); |
209 | spacer->setBackgroundColor( destBar->backgroundColor() ); | 212 | spacer->setBackgroundColor( destBar->backgroundColor() ); |
210 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 213 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
211 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); | 214 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); |
212 | CheckBoxLink->setChecked( settings->createLinks() ); | 215 | CheckBoxLink->setChecked( settings->createLinks() ); |
213 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 216 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
214 | settings, SLOT(linkEnabled(bool)) ); | 217 | settings, SLOT(linkEnabled(bool)) ); |
215 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 218 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
216 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 219 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
217 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 220 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
218 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); | 221 | connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); |
219 | a->addTo( destBar ); | 222 | a->addTo( destBar ); |
220 | destBar->setStretchableWidget( CheckBoxLink ); | 223 | destBar->setStretchableWidget( CheckBoxLink ); |
221 | destAction->setToggleAction( true ); | 224 | destAction->setToggleAction( true ); |
222 | // destAction->addTo( viewMenu ); | 225 | // destAction->addTo( viewMenu ); |
223 | 226 | ||
224 | // configure the menus | 227 | // configure the menus |
225 | Config cfg( "oipkg", Config::User ); | 228 | Config cfg( "oipkg", Config::User ); |
226 | cfg.setGroup( "gui" ); | 229 | cfg.setGroup( "gui" ); |
227 | 230 | ||
228 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 231 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
229 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 232 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
230 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 233 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
231 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 234 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
232 | } | 235 | } |
233 | 236 | ||
234 | MainWindow::~MainWindow() | 237 | MainWindow::~MainWindow() |
235 | { | 238 | { |
236 | Config cfg( "oipkg", Config::User ); | 239 | Config cfg( "oipkg", Config::User ); |
237 | cfg.setGroup( "gui" ); | 240 | cfg.setGroup( "gui" ); |
238 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 241 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
239 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | 242 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); |
240 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 243 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
241 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 244 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
242 | 245 | ||
243 | } | 246 | } |
244 | 247 | ||
245 | void MainWindow::runIpkg() | 248 | void MainWindow::runIpkg() |
246 | { | 249 | { |
247 | packageList.allPackages(); | 250 | packageListServers.allPackages(); |
248 | ipkg->loadList( packageListSearch ); | 251 | ipkg->loadList( packageListSearch ); |
249 | ipkg->commit( packageList ); | 252 | ipkg->loadList( packageListDocLnk ); |
253 | ipkg->commit( packageListServers ); | ||
250 | // ##### If we looked in the list of files, we could send out accurate | 254 | // ##### If we looked in the list of files, we could send out accurate |
251 | // ##### messages. But we don't bother yet, and just do an "all". | 255 | // ##### messages. But we don't bother yet, and just do an "all". |
252 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); | 256 | QCopEnvelope e("QPE/System", "linkChanged(QString)"); |
253 | QString lf = QString::null; | 257 | QString lf = QString::null; |
254 | e << lf; | 258 | e << lf; |
255 | displayList(); | 259 | displayList(); |
256 | } | 260 | } |
257 | 261 | ||
258 | void MainWindow::updateList() | 262 | void MainWindow::updateList() |
259 | { | 263 | { |
260 | //wait->show(); | 264 | //wait->show(); |
261 | QTimer *t = new QTimer( this ); | 265 | QTimer *t = new QTimer( this ); |
262 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); | 266 | connect( t, SIGNAL(timeout()), SLOT( rotateUpdateIcon() ) ); |
263 | t->start( 0, false ); | 267 | t->start( 0, false ); |
264 | packageList.clear(); | 268 | packageListServers.clear(); |
269 | packageListSearch.clear(); | ||
270 | packageListDocLnk.clear(); | ||
265 | ipkg->update(); | 271 | ipkg->update(); |
266 | packageList.update(); | 272 | packageListServers.update(); |
273 | packageListSearch.update(); | ||
274 | packageListDocLnk.update(); | ||
267 | t->stop(); | 275 | t->stop(); |
268 | // wait->hide(); | 276 | // wait->hide(); |
269 | } | 277 | } |
270 | 278 | ||
271 | void MainWindow::filterList() | 279 | void MainWindow::filterList() |
272 | { | 280 | { |
273 | //wait->show(); | 281 | //wait->show(); |
274 | QString f = ""; | 282 | QString f = ""; |
275 | if ( findAction->isOn() ) f = findEdit->text(); | 283 | if ( findAction->isOn() ) f = findEdit->text(); |
276 | packageList.filterPackages( f ); | 284 | packageListServers.filterPackages( f ); |
277 | //wait->hide(); | 285 | //wait->hide(); |
278 | } | 286 | } |
279 | 287 | ||
280 | void MainWindow::displayList() | 288 | void MainWindow::displayList() |
281 | { | 289 | { |
282 | //wait->hide(); | 290 | //wait->hide(); |
283 | filterList(); | 291 | filterList(); |
284 | listViewPackages->display(); | 292 | listViewPackages->display(); |
285 | //// if (!rootLocal) | ||
286 | //// { | ||
287 | //QCheckListItem *rootLocal = new QCheckListItem(listViewPackages,tr("local")); | ||
288 | //QCheckListItem *rootSearch = new QCheckListItem(listViewPackages,tr("ipkgfind")); | ||
289 | //// } | ||
290 | // listViewPackages->clear(); | ||
291 | // Package *pack = packageList.first(); | ||
292 | // PackageListItem *item; | ||
293 | // while( pack ) | ||
294 | // { | ||
295 | // item = new PackageListItem( rootLocal, pack, settings ); | ||
296 | // pack = packageList.next(); | ||
297 | // } | ||
298 | // pack = packageListSearch.first(); | ||
299 | // while( pack ) | ||
300 | // { | ||
301 | // item = new PackageListItem( rootSearch, pack, settings ); | ||
302 | // pack = packageListSearch.next(); | ||
303 | // } | ||
304 | } | 293 | } |
305 | 294 | ||
306 | void MainWindow::sectionChanged() | 295 | void MainWindow::sectionChanged() |
307 | { | 296 | { |
308 | disconnect( section, SIGNAL( activated(int) ), | 297 | disconnect( section, SIGNAL( activated(int) ), |
309 | this, SLOT( sectionChanged() ) ); | 298 | this, SLOT( sectionChanged() ) ); |
310 | disconnect( subsection, SIGNAL(activated(int) ), | 299 | disconnect( subsection, SIGNAL(activated(int) ), |
311 | this, SLOT( subSectionChanged() ) ); | 300 | this, SLOT( subSectionChanged() ) ); |
312 | subsection->clear(); | 301 | subsection->clear(); |
313 | packageList.setSection( section->currentText() ); | 302 | packageListServers.setSection( section->currentText() ); |
314 | setSubSections(); | 303 | setSubSections(); |
315 | connect( section, SIGNAL( activated(int) ), | 304 | connect( section, SIGNAL( activated(int) ), |
316 | this, SLOT( sectionChanged() ) ); | 305 | this, SLOT( sectionChanged() ) ); |
317 | connect( subsection, SIGNAL(activated(int) ), | 306 | connect( subsection, SIGNAL(activated(int) ), |
318 | this, SLOT( subSectionChanged() ) ); | 307 | this, SLOT( subSectionChanged() ) ); |
319 | displayList(); | 308 | displayList(); |
320 | } | 309 | } |
321 | 310 | ||
322 | void MainWindow::subSectionChanged() | 311 | void MainWindow::subSectionChanged() |
323 | { | 312 | { |
324 | disconnect( section, SIGNAL( activated(int) ), | 313 | disconnect( section, SIGNAL( activated(int) ), |
325 | this, SLOT( sectionChanged() ) ); | 314 | this, SLOT( sectionChanged() ) ); |
326 | disconnect( subsection, SIGNAL(activated(int) ), | 315 | disconnect( subsection, SIGNAL(activated(int) ), |
327 | this, SLOT( subSectionChanged() ) ); | 316 | this, SLOT( subSectionChanged() ) ); |
328 | packageList.setSubSection( subsection->currentText() ); | 317 | packageListServers.setSubSection( subsection->currentText() ); |
329 | connect( section, SIGNAL( activated(int) ), | 318 | connect( section, SIGNAL( activated(int) ), |
330 | this, SLOT( sectionChanged() ) ); | 319 | this, SLOT( sectionChanged() ) ); |
331 | connect( subsection, SIGNAL(activated(int) ), | 320 | connect( subsection, SIGNAL(activated(int) ), |
332 | this, SLOT( subSectionChanged() ) ); | 321 | this, SLOT( subSectionChanged() ) ); |
333 | displayList(); | 322 | displayList(); |
334 | } | 323 | } |
335 | 324 | ||
336 | void MainWindow::setSections() | 325 | void MainWindow::setSections() |
337 | { | 326 | { |
338 | section->clear(); | 327 | section->clear(); |
339 | section->insertStringList( packageList.getSections() ); | 328 | section->insertStringList( packageListServers.getSections() ); |
340 | } | 329 | } |
341 | 330 | ||
342 | void MainWindow::setSubSections() | 331 | void MainWindow::setSubSections() |
343 | { | 332 | { |
344 | subsection->clear(); | 333 | subsection->clear(); |
345 | subsection->insertStringList( packageList.getSubSections() ); | 334 | subsection->insertStringList( packageListServers.getSubSections() ); |
346 | } | 335 | } |
347 | 336 | ||
348 | 337 | ||
349 | void MainWindow::showSettings() | 338 | void MainWindow::showSettings() |
350 | { | 339 | { |
351 | if ( settings->showDialog( 0 ) ) | 340 | if ( settings->showDialog( 0 ) ) |
352 | updateList(); | 341 | updateList(); |
353 | } | 342 | } |
354 | void MainWindow::showSettingsSrv() | 343 | void MainWindow::showSettingsSrv() |
355 | { | 344 | { |
356 | if ( settings->showDialog( 1 ) ) | 345 | if ( settings->showDialog( 1 ) ) |
357 | updateList(); | 346 | updateList(); |
358 | } | 347 | } |
359 | void MainWindow::showSettingsDst() | 348 | void MainWindow::showSettingsDst() |
360 | { | 349 | { |
361 | if ( settings->showDialog( 2 ) ) | 350 | if ( settings->showDialog( 2 ) ) |
362 | updateList(); | 351 | updateList(); |
363 | } | 352 | } |
364 | 353 | ||
365 | void MainWindow::sectionShow(bool b) | 354 | void MainWindow::sectionShow(bool b) |
366 | { | 355 | { |
367 | if (b) sectionBar->show(); | 356 | if (b) sectionBar->show(); |
368 | else sectionBar->hide(); | 357 | else sectionBar->hide(); |
369 | sectionAction->setOn( b ); | 358 | sectionAction->setOn( b ); |
370 | } | 359 | } |
371 | 360 | ||
372 | void MainWindow::sectionClose() | 361 | void MainWindow::sectionClose() |
373 | { | 362 | { |
374 | sectionAction->setOn( false ); | 363 | sectionAction->setOn( false ); |
375 | } | 364 | } |
376 | 365 | ||
377 | void MainWindow::findShow(bool b) | 366 | void MainWindow::findShow(bool b) |
378 | { | 367 | { |
379 | if (b) findBar->show(); | 368 | if (b) findBar->show(); |
380 | else findBar->hide(); | 369 | else findBar->hide(); |
381 | findAction->setOn( b ); | 370 | findAction->setOn( b ); |
382 | } | 371 | } |
383 | 372 | ||
384 | void MainWindow::findClose() | 373 | void MainWindow::findClose() |
385 | { | 374 | { |
386 | findAction->setOn( false ); | 375 | findAction->setOn( false ); |
387 | } | 376 | } |
388 | 377 | ||
389 | void MainWindow::searchShow(bool b) | 378 | void MainWindow::searchShow(bool b) |
390 | { | 379 | { |
391 | if (b) searchBar->show(); | 380 | if (b) searchBar->show(); |
392 | else searchBar->hide(); | 381 | else searchBar->hide(); |
393 | searchAction->setOn( b ); | 382 | searchAction->setOn( b ); |
394 | } | 383 | } |
395 | 384 | ||
396 | void MainWindow::searchClose() | 385 | void MainWindow::searchClose() |
397 | { | 386 | { |
398 | searchAction->setOn( false ); | 387 | searchAction->setOn( false ); |
399 | } | 388 | } |
400 | 389 | ||
401 | 390 | ||
402 | void MainWindow::destShow(bool b) | 391 | void MainWindow::destShow(bool b) |
403 | { | 392 | { |
404 | if (b) destBar->show(); | 393 | if (b) destBar->show(); |
405 | else destBar->hide(); | 394 | else destBar->hide(); |
406 | destAction->setOn( b ); | 395 | destAction->setOn( b ); |
407 | } | 396 | } |
408 | 397 | ||
409 | void MainWindow::destClose() | 398 | void MainWindow::destClose() |
diff --git a/noncore/unsupported/oipkg/mainwindow.h b/noncore/unsupported/oipkg/mainwindow.h index 4a73b78..f6023b0 100644 --- a/noncore/unsupported/oipkg/mainwindow.h +++ b/noncore/unsupported/oipkg/mainwindow.h | |||
@@ -1,98 +1,98 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qpopupmenu.h> | 7 | #include <qpopupmenu.h> |
8 | 8 | ||
9 | #include "packagelist.h" | 9 | #include "packagelist.h" |
10 | #include "packagelistremote.h" | 10 | #include "packagelistremote.h" |
11 | #include "packagelistlocal.h" | 11 | #include "packagelistlocal.h" |
12 | #include "packagelistdoclnk.h" | ||
12 | #include "pmipkg.h" | 13 | #include "pmipkg.h" |
13 | #include "pksettings.h" | 14 | #include "pksettings.h" |
14 | #include "packagelistview.h" | 15 | #include "packagelistview.h" |
15 | 16 | ||
16 | class QComboBox; | 17 | class QComboBox; |
17 | class QPEToolBar; | 18 | class QPEToolBar; |
18 | class QLineEdit; | 19 | class QLineEdit; |
19 | class PackageListItem; | 20 | class PackageListItem; |
20 | class QCopChannel; | 21 | class QCopChannel; |
21 | class QMessageBox; | 22 | class QMessageBox; |
22 | class QCheckBox; | 23 | class QCheckBox; |
23 | 24 | ||
24 | class MainWindow : public QMainWindow | 25 | class MainWindow : public QMainWindow |
25 | { | 26 | { |
26 | Q_OBJECT | 27 | Q_OBJECT |
27 | 28 | ||
28 | 29 | ||
29 | public: | 30 | public: |
30 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); | 31 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); |
31 | ~MainWindow(); | 32 | ~MainWindow(); |
32 | void makeChannel(); | 33 | void makeChannel(); |
33 | 34 | ||
34 | QCopChannel *channel; | 35 | QCopChannel *channel; |
35 | 36 | ||
36 | protected slots: | 37 | protected slots: |
37 | void runIpkg(); | 38 | void runIpkg(); |
38 | void updateList(); | 39 | void updateList(); |
39 | void displayList(); | 40 | void displayList(); |
40 | void subSectionChanged(); | 41 | void subSectionChanged(); |
41 | void sectionChanged(); | 42 | void sectionChanged(); |
42 | void showSettings(); | 43 | void showSettings(); |
43 | void showSettingsSrv(); | 44 | void showSettingsSrv(); |
44 | void showSettingsDst(); | 45 | void showSettingsDst(); |
45 | 46 | ||
46 | public slots: | 47 | public slots: |
47 | void sectionClose(); | 48 | void sectionClose(); |
48 | void sectionShow(bool); | 49 | void sectionShow(bool); |
49 | void findClose(); | 50 | void findClose(); |
50 | void findShow(bool); | 51 | void findShow(bool); |
51 | void searchClose(); | 52 | void searchClose(); |
52 | void searchShow(bool); | 53 | void searchShow(bool); |
53 | void destClose(); | 54 | void destClose(); |
54 | void destShow(bool); | 55 | void destShow(bool); |
55 | void filterList(); | 56 | void filterList(); |
56 | void createLinks(); | 57 | void createLinks(); |
57 | void removeLinks(); | 58 | void removeLinks(); |
58 | void receive (const QCString &, const QByteArray &); | 59 | void receive (const QCString &, const QByteArray &); |
59 | void setDocument (const QString &); | 60 | void setDocument (const QString &); |
60 | void remotePackageQuery(); | 61 | void remotePackageQuery(); |
61 | 62 | ||
62 | private: | 63 | private: |
63 | void makeMenu(); | 64 | void makeMenu(); |
64 | void setSections(); | 65 | void setSections(); |
65 | void setSubSections(); | 66 | void setSubSections(); |
66 | void installFile(const QString &); | 67 | void installFile(const QString &); |
67 | bool updateIcon; | 68 | bool updateIcon; |
68 | 69 | ||
69 | PmIpkg* ipkg; | 70 | PmIpkg* ipkg; |
70 | PackageManagerSettings *settings; | 71 | PackageManagerSettings *settings; |
71 | PackageListLocal packageList; | 72 | PackageListLocal packageListServers; |
72 | PackageListRemote packageListSearch; | 73 | PackageListRemote packageListSearch; |
74 | PackageListDocLnk packageListDocLnk; | ||
73 | PackageListView *listViewPackages; | 75 | PackageListView *listViewPackages; |
74 | // QCheckListItem* rootSearch; | ||
75 | // QCheckListItem* rootLocal; | ||
76 | QAction *runAction; | 76 | QAction *runAction; |
77 | QAction *updateAction; | 77 | QAction *updateAction; |
78 | QAction *findAction; | 78 | QAction *findAction; |
79 | QPEToolBar *findBar; | 79 | QPEToolBar *findBar; |
80 | QLineEdit *findEdit; | 80 | QLineEdit *findEdit; |
81 | QAction *searchAction; | 81 | QAction *searchAction; |
82 | QAction *searchCommit; | 82 | QAction *searchCommit; |
83 | QPEToolBar *searchBar; | 83 | QPEToolBar *searchBar; |
84 | QLineEdit *searchEdit; | 84 | QLineEdit *searchEdit; |
85 | QAction *sectionAction; | 85 | QAction *sectionAction; |
86 | QPEToolBar *sectionBar; | 86 | QPEToolBar *sectionBar; |
87 | QComboBox *section; | 87 | QComboBox *section; |
88 | QComboBox *subsection; | 88 | QComboBox *subsection; |
89 | QAction *destAction; | 89 | QAction *destAction; |
90 | QPEToolBar *destBar; | 90 | QPEToolBar *destBar; |
91 | QComboBox *destination; | 91 | QComboBox *destination; |
92 | QCheckBox* CheckBoxLink; | 92 | QCheckBox* CheckBoxLink; |
93 | // QMessageBox *wait; | 93 | // QMessageBox *wait; |
94 | private slots: | 94 | private slots: |
95 | void rotateUpdateIcon(); | 95 | void rotateUpdateIcon(); |
96 | }; | 96 | }; |
97 | 97 | ||
98 | #endif | 98 | #endif |
diff --git a/noncore/unsupported/oipkg/oipkg.pro b/noncore/unsupported/oipkg/oipkg.pro index 98f92c8..6ee1963 100644 --- a/noncore/unsupported/oipkg/oipkg.pro +++ b/noncore/unsupported/oipkg/oipkg.pro | |||
@@ -1,32 +1,34 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE= app | 2 | TEMPLATE= app |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | CONFIG = qt warn_on debug | 4 | CONFIG = qt warn_on debug |
5 | HEADERS = mainwindow.h \ | 5 | HEADERS = mainwindow.h \ |
6 | pksettings.h \ | 6 | pksettings.h \ |
7 | pmipkg.h \ | 7 | pmipkg.h \ |
8 | packagelistdoclnk.h \ | ||
8 | utils.h \ | 9 | utils.h \ |
9 | packagelistitem.h \ | 10 | packagelistitem.h \ |
10 | packagelistremote.h \ | 11 | packagelistremote.h \ |
11 | packagelist.h \ | 12 | packagelist.h \ |
12 | packagelistlocal.h \ | 13 | packagelistlocal.h \ |
13 | packagelistview.h \ | 14 | packagelistview.h \ |
14 | package.h | 15 | package.h |
15 | SOURCES = main.cpp \ | 16 | SOURCES = main.cpp \ |
16 | mainwindow.cpp \ | 17 | mainwindow.cpp \ |
17 | utils.cpp \ | 18 | utils.cpp \ |
19 | packagelistdoclnk.cpp \ | ||
18 | packagelistview.cpp \ | 20 | packagelistview.cpp \ |
19 | packagelistremote.cpp \ | 21 | packagelistremote.cpp \ |
20 | packagelistlocal.cpp \ | 22 | packagelistlocal.cpp \ |
21 | pksettings.cpp \ | 23 | pksettings.cpp \ |
22 | pmipkg.cpp \ | 24 | pmipkg.cpp \ |
23 | packagelistitem.cpp \ | 25 | packagelistitem.cpp \ |
24 | packagelist.cpp \ | 26 | packagelist.cpp \ |
25 | package.cpp | 27 | package.cpp |
26 | INCLUDEPATH += $(OPIEDIR)/include | 28 | INCLUDEPATH += $(OPIEDIR)/include |
27 | DEPENDPATH+= $(OPIEDIR)/ioclude | 29 | DEPENDPATH+= $(OPIEDIR)/ioclude |
28 | LIBS += -lqpe | 30 | LIBS += -lqpe |
29 | INTERFACES= runwindow.ui \ | 31 | INTERFACES= runwindow.ui \ |
30 | pksettingsbase.ui | 32 | pksettingsbase.ui |
31 | TARGET = oipkg | 33 | TARGET = oipkg |
32 | 34 | ||
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index f992641..9280d89 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,115 +1,114 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | 9 | ||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | //Package::~Package() | 12 | //Package::~Package() |
13 | //{ | 13 | //{ |
14 | //} | 14 | //} |
15 | 15 | ||
16 | Package::Package( PackageManagerSettings *s ) | 16 | Package::Package( PackageManagerSettings *s ) |
17 | { | 17 | { |
18 | init(s); | 18 | init(s); |
19 | } | 19 | } |
20 | 20 | ||
21 | void Package::init( PackageManagerSettings *s ) | 21 | void Package::init( PackageManagerSettings *s ) |
22 | { | 22 | { |
23 | settings = s; | 23 | settings = s; |
24 | _size = ""; | 24 | _size = ""; |
25 | _section = ""; | 25 | _section = ""; |
26 | _subsection = ""; | 26 | _subsection = ""; |
27 | _shortDesc = ""; | 27 | _shortDesc = ""; |
28 | _desc = ""; | 28 | _desc = ""; |
29 | _name = ""; | 29 | _name = ""; |
30 | _toProcess = false; | 30 | _toProcess = false; |
31 | _useFileName = false; | 31 | _useFileName = false; |
32 | _status = ""; | 32 | _status = ""; |
33 | _dest = settings->getDestinationName(); | 33 | _dest = settings->getDestinationName(); |
34 | _link = settings->createLinks(); | 34 | _link = settings->createLinks(); |
35 | } | 35 | } |
36 | 36 | ||
37 | Package::Package( QStringList pack, PackageManagerSettings *s ) | 37 | Package::Package( QStringList pack, PackageManagerSettings *s ) |
38 | { | 38 | { |
39 | init(s); | 39 | init(s); |
40 | parsePackage( pack ); | 40 | parsePackage( pack ); |
41 | } | 41 | } |
42 | 42 | ||
43 | Package::Package( QString n, PackageManagerSettings *s ) | 43 | Package::Package( QString n, PackageManagerSettings *s ) |
44 | { | 44 | { |
45 | init(s); | 45 | init(s); |
46 | if ( !QFile::exists( n ) ) | 46 | if ( !QFile::exists( n ) ) |
47 | { | 47 | { |
48 | _name = QString( n ); | 48 | _name = QString( n ); |
49 | }else{ | 49 | }else{ |
50 | parseIpkgFile( n ); | 50 | parseIpkgFile( n ); |
51 | _toProcess = true; | ||
52 | _useFileName = true; | 51 | _useFileName = true; |
53 | _fileName = QString( n ); | 52 | _fileName = QString( n ); |
54 | } | 53 | } |
55 | } | 54 | } |
56 | 55 | ||
57 | Package::Package( Package *pi ) | 56 | Package::Package( Package *pi ) |
58 | { | 57 | { |
59 | init(pi->settings); | 58 | init(pi->settings); |
60 | copyValues( pi ); | 59 | copyValues( pi ); |
61 | } | 60 | } |
62 | 61 | ||
63 | 62 | ||
64 | void Package::setValue( QString n, QString t ) | 63 | void Package::setValue( QString n, QString t ) |
65 | { | 64 | { |
66 | if ( n == "Package" ) | 65 | if ( n == "Package" ) |
67 | { | 66 | { |
68 | _name = QString( t ); | 67 | _name = QString( t ); |
69 | }else if ( n == "Installed-Size" ) | 68 | }else if ( n == "Installed-Size" ) |
70 | { | 69 | { |
71 | _size = t; | 70 | _size = t; |
72 | // }else if ( n == "Priority") | 71 | // }else if ( n == "Priority") |
73 | // { | 72 | // { |
74 | 73 | ||
75 | }else if ( n == "Section") | 74 | }else if ( n == "Section") |
76 | { | 75 | { |
77 | setSection( t ); | 76 | setSection( t ); |
78 | // }else if ( n == "Maintainer") | 77 | // }else if ( n == "Maintainer") |
79 | // { | 78 | // { |
80 | // | 79 | // |
81 | // }else if ( n == "Architecture") | 80 | // }else if ( n == "Architecture") |
82 | // { | 81 | // { |
83 | 82 | ||
84 | }else if ( n == "Version") | 83 | }else if ( n == "Version") |
85 | { | 84 | { |
86 | _version = t; | 85 | _version = t; |
87 | // }else if ( n == "Pre-Depends") | 86 | // }else if ( n == "Pre-Depends") |
88 | // { | 87 | // { |
89 | // | 88 | // |
90 | // }else if ( n == "Depends") | 89 | // }else if ( n == "Depends") |
91 | // { | 90 | // { |
92 | 91 | ||
93 | }else if ( n == "Filename") | 92 | }else if ( n == "Filename") |
94 | { | 93 | { |
95 | _fileName = t; | 94 | _fileName = t; |
96 | // }else if ( n == "Size") | 95 | // }else if ( n == "Size") |
97 | // { | 96 | // { |
98 | // | 97 | // |
99 | //}else if ( n == "MD5Sum") | 98 | //}else if ( n == "MD5Sum") |
100 | //{ | 99 | //{ |
101 | 100 | ||
102 | }else if ( n == "Description") | 101 | }else if ( n == "Description") |
103 | { | 102 | { |
104 | setDesc( t ); | 103 | setDesc( t ); |
105 | }else if ( n == "Status") | 104 | }else if ( n == "Status") |
106 | { | 105 | { |
107 | if ( installed() ) return; | 106 | if ( installed() ) return; |
108 | _status = t; | 107 | _status = t; |
109 | // }else if ( n == "Essential") | 108 | // }else if ( n == "Essential") |
110 | // { | 109 | // { |
111 | 110 | ||
112 | }else{ | 111 | }else{ |
113 | _values.insert(n,new QString(t)); | 112 | _values.insert(n,new QString(t)); |
114 | } | 113 | } |
115 | } | 114 | } |
@@ -305,64 +304,69 @@ QString Package::dest() | |||
305 | return _dest!=""?_dest:settings->getDestinationName(); | 304 | return _dest!=""?_dest:settings->getDestinationName(); |
306 | else return ""; | 305 | else return ""; |
307 | } | 306 | } |
308 | 307 | ||
309 | void Package::setDest( QString d ) | 308 | void Package::setDest( QString d ) |
310 | { | 309 | { |
311 | _dest = d; | 310 | _dest = d; |
312 | } | 311 | } |
313 | 312 | ||
314 | void Package::setOn() | 313 | void Package::setOn() |
315 | { | 314 | { |
316 | _toProcess = true; | 315 | _toProcess = true; |
317 | } | 316 | } |
318 | 317 | ||
319 | bool Package::link() | 318 | bool Package::link() |
320 | { | 319 | { |
321 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; | 320 | if ( _dest == "root" || (!installed() && !_toProcess) ) return false; |
322 | return _link; | 321 | return _link; |
323 | } | 322 | } |
324 | 323 | ||
325 | void Package::setLink(bool b) | 324 | void Package::setLink(bool b) |
326 | { | 325 | { |
327 | _link = b; | 326 | _link = b; |
328 | } | 327 | } |
329 | 328 | ||
330 | void Package::parseIpkgFile( QString file) | 329 | void Package::parseIpkgFile( QString file) |
331 | { | 330 | { |
332 | system("tar xzf "+file+" -C /tmp"); | 331 | system("tar xzf "+file+" -C /tmp"); |
333 | system("tar xzf /tmp/control.tar.gz -C /tmp"); | 332 | system("tar xzf /tmp/control.tar.gz -C /tmp"); |
334 | QFile f("/tmp/control"); | 333 | QFile f("/tmp/control"); |
335 | if ( f.open(IO_ReadOnly) ) | 334 | if ( f.open(IO_ReadOnly) ) |
336 | { | 335 | { |
337 | QTextStream t( &f ); | 336 | QTextStream t( &f ); |
338 | QStringList pack; | 337 | QStringList pack; |
339 | while ( !t.eof() ) | 338 | while ( !t.eof() ) |
340 | { | 339 | { |
341 | pack << t.readLine(); | 340 | pack << t.readLine(); |
342 | } | 341 | } |
343 | f.close(); | 342 | f.close(); |
344 | parsePackage( pack ); | 343 | parsePackage( pack ); |
345 | } | 344 | } |
346 | 345 | ||
347 | } | 346 | } |
348 | 347 | ||
349 | //QString Package::getPackageName() | 348 | //QString Package::getPackageName() |
350 | //{ | 349 | //{ |
351 | //if ( _packageName.isEmpty() ) return _name; | 350 | //if ( _packageName.isEmpty() ) return _name; |
352 | //else return _packageName; | 351 | //else return _packageName; |
353 | //} | 352 | //} |
354 | 353 | ||
355 | void Package::instalFromFile(bool iff) | 354 | void Package::instalFromFile(bool iff) |
356 | { | 355 | { |
357 | _useFileName = iff; | 356 | _useFileName = iff; |
358 | } | 357 | } |
359 | 358 | ||
360 | void Package::setName(QString n) | 359 | void Package::setName(QString n) |
361 | { | 360 | { |
362 | _displayName = n; | 361 | _displayName = n; |
363 | } | 362 | } |
364 | 363 | ||
365 | QDict<QString>* Package::getFields() | 364 | QDict<QString>* Package::getFields() |
366 | { | 365 | { |
367 | return &_values; | 366 | return &_values; |
368 | } | 367 | } |
368 | |||
369 | QString Package::status() | ||
370 | { | ||
371 | return _status; | ||
372 | } | ||
diff --git a/noncore/unsupported/oipkg/package.h b/noncore/unsupported/oipkg/package.h index fc725bc..257d9c7 100644 --- a/noncore/unsupported/oipkg/package.h +++ b/noncore/unsupported/oipkg/package.h | |||
@@ -1,78 +1,79 @@ | |||
1 | #ifndef PK_ITEM_H | 1 | #ifndef PK_ITEM_H |
2 | #define PK_ITEM_H | 2 | #define PK_ITEM_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qpainter.h> | 6 | #include <qpainter.h> |
7 | #include <qpixmap.h> | 7 | #include <qpixmap.h> |
8 | #include <qdict.h> | 8 | #include <qdict.h> |
9 | #include <qobject.h> | 9 | #include <qobject.h> |
10 | 10 | ||
11 | #include "pksettings.h" | 11 | #include "pksettings.h" |
12 | 12 | ||
13 | class Package //: public QObject | 13 | 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 * ); |
20 | Package( QString, PackageManagerSettings * ); | 20 | Package( QString, PackageManagerSettings * ); |
21 | Package( Package* ); | 21 | Package( Package* ); |
22 | 22 | ||
23 | void setValue( QString, QString ); | 23 | void setValue( QString, QString ); |
24 | void copyValues( Package* ); | 24 | void copyValues( Package* ); |
25 | 25 | ||
26 | QString name() ; | 26 | QString name() ; |
27 | QString installName() ; | 27 | QString installName() ; |
28 | bool installed(); | 28 | bool installed(); |
29 | 29 | ||
30 | void setDesc( QString ); | 30 | void setDesc( QString ); |
31 | QString shortDesc(); | 31 | QString shortDesc(); |
32 | QString desc(); | 32 | QString desc(); |
33 | QString size(); | 33 | QString size(); |
34 | QString sizeUnits(); | 34 | QString sizeUnits(); |
35 | QString version(); | 35 | QString version(); |
36 | void setSection( QString ); | 36 | void setSection( QString ); |
37 | QString section(); | 37 | QString section(); |
38 | QString subSection(); | 38 | QString subSection(); |
39 | QString details(); | 39 | QString details(); |
40 | bool toProcess(); | 40 | bool toProcess(); |
41 | bool toInstall(); | 41 | bool toInstall(); |
42 | bool toRemove(); | 42 | bool toRemove(); |
43 | void processed(); | 43 | void processed(); |
44 | QString dest(); | 44 | QString dest(); |
45 | void setDest( QString d ); | 45 | void setDest( QString d ); |
46 | void setOn(); | 46 | void setOn(); |
47 | bool link(); | 47 | bool link(); |
48 | void setLink(bool); | 48 | void setLink(bool); |
49 | void parseIpkgFile( QString ); | 49 | void parseIpkgFile( QString ); |
50 | void instalFromFile(bool iff=true); | 50 | void instalFromFile(bool iff=true); |
51 | void setName(QString); | 51 | void setName(QString); |
52 | QDict<QString>* getFields(); | 52 | QDict<QString>* getFields(); |
53 | QString status(); | ||
53 | public slots: | 54 | public slots: |
54 | void toggleProcess(); | 55 | void toggleProcess(); |
55 | 56 | ||
56 | private: | 57 | private: |
57 | PackageManagerSettings *settings; | 58 | PackageManagerSettings *settings; |
58 | QString _displayName; | 59 | QString _displayName; |
59 | QString _name; | 60 | QString _name; |
60 | QString _fileName; | 61 | QString _fileName; |
61 | bool _toProcess; | 62 | bool _toProcess; |
62 | bool _link; | 63 | bool _link; |
63 | QString _status; | 64 | QString _status; |
64 | QString _size; | 65 | QString _size; |
65 | QString _section; | 66 | QString _section; |
66 | QString _subsection; | 67 | QString _subsection; |
67 | QString _shortDesc; | 68 | QString _shortDesc; |
68 | QString _desc; | 69 | QString _desc; |
69 | QString _version; | 70 | QString _version; |
70 | QString _dest; | 71 | QString _dest; |
71 | QDict<QString> _values; | 72 | QDict<QString> _values; |
72 | bool _useFileName; | 73 | bool _useFileName; |
73 | void parsePackage( QStringList ); | 74 | void parsePackage( QStringList ); |
74 | void init(PackageManagerSettings *); | 75 | void init(PackageManagerSettings *); |
75 | }; | 76 | }; |
76 | 77 | ||
77 | 78 | ||
78 | #endif | 79 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp new file mode 100644 index 0000000..575ac62 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp | |||
@@ -0,0 +1,36 @@ | |||
1 | |||
2 | #include "packagelistdoclnk.h" | ||
3 | |||
4 | #include <qpe/applnk.h> | ||
5 | #include <qlist.h> | ||
6 | |||
7 | #include "package.h" | ||
8 | #include "pksettings.h" | ||
9 | |||
10 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s) | ||
11 | : PackageList(s) | ||
12 | { | ||
13 | PackageListDocLnk(); | ||
14 | } | ||
15 | |||
16 | PackageListDocLnk::PackageListDocLnk() | ||
17 | : PackageList() | ||
18 | { | ||
19 | doclnkset = new DocLnkSet("/mnt/nfs/ipk","application/ipkg"); | ||
20 | } | ||
21 | |||
22 | PackageListDocLnk::~PackageListDocLnk() | ||
23 | { | ||
24 | } | ||
25 | |||
26 | |||
27 | |||
28 | void PackageListDocLnk::update() | ||
29 | { | ||
30 | pvDebug(2,"PackageListDocLnk::update "); | ||
31 | QList<DocLnk> packlist = doclnkset->children(); | ||
32 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) | ||
33 | { | ||
34 | insertPackage( new Package(pack->file(), settings) ); | ||
35 | } | ||
36 | } | ||
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.h b/noncore/unsupported/oipkg/packagelistdoclnk.h new file mode 100644 index 0000000..3864ace --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistdoclnk.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef PACKAGELISTDOCLNK_H | ||
2 | #define PACKAGELISTDOCLNK_H | ||
3 | |||
4 | #include "packagelist.h" | ||
5 | #include "debug.h" | ||
6 | |||
7 | class DocLnkSet; | ||
8 | |||
9 | class PackageListDocLnk : public PackageList | ||
10 | { | ||
11 | public: | ||
12 | PackageListDocLnk(); | ||
13 | PackageListDocLnk( PackageManagerSettings* s); | ||
14 | virtual ~PackageListDocLnk(); | ||
15 | public slots: | ||
16 | void update(); | ||
17 | private: | ||
18 | DocLnkSet *doclnkset; | ||
19 | }; | ||
20 | |||
21 | |||
22 | #endif | ||
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 2f81714..45aaf1d 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -1,140 +1,144 @@ | |||
1 | #include "packagelistitem.h" | 1 | #include "packagelistitem.h" |
2 | 2 | ||
3 | #include <qpe/resource.h> | 3 | #include <qpe/resource.h> |
4 | #include <qobject.h> | 4 | #include <qobject.h> |
5 | 5 | ||
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | static QPixmap *pm_uninstalled=0; | 8 | static QPixmap *pm_uninstalled=0; |
9 | static QPixmap *pm_installed=0; | 9 | static QPixmap *pm_installed=0; |
10 | static QPixmap *pm_uninstall=0; | 10 | static QPixmap *pm_uninstall=0; |
11 | static QPixmap *pm_install=0; | 11 | static QPixmap *pm_install=0; |
12 | 12 | ||
13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) | 13 | PackageListItem::PackageListItem(QListView* lv, Package *pi, PackageManagerSettings *s) |
14 | :QCheckListItem(lv,pi->name(),CheckBox) | 14 | :QCheckListItem(lv,pi->name(),CheckBox) |
15 | { | 15 | { |
16 | init(pi,s); | 16 | init(pi,s); |
17 | } | 17 | } |
18 | 18 | ||
19 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) | 19 | PackageListItem::PackageListItem(QListViewItem *lvi, Package *pi, PackageManagerSettings *s) |
20 | :QCheckListItem(lvi,pi->name(),CheckBox) | 20 | :QCheckListItem(lvi,pi->name(),CheckBox) |
21 | { | 21 | { |
22 | init(pi,s); | 22 | init(pi,s); |
23 | } | 23 | } |
24 | 24 | ||
25 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) | 25 | void PackageListItem::init( Package *pi, PackageManagerSettings *s) |
26 | { | 26 | { |
27 | package = pi; | 27 | package = pi; |
28 | settings = s; | 28 | settings = s; |
29 | setExpandable( true ); | 29 | setExpandable( true ); |
30 | QCheckListItem *item; | 30 | QCheckListItem *item; |
31 | nameItem = new QCheckListItem( this, "" ); | 31 | nameItem = new QCheckListItem( this, "" ); |
32 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); | 32 | item = new QCheckListItem( this, QObject::tr("Size: ")+pi->size() ); |
33 | destItem = new QCheckListItem( this, "" ); | 33 | destItem = new QCheckListItem( this, "" ); |
34 | linkItem = new QCheckListItem( this, "" ); | 34 | linkItem = new QCheckListItem( this, "" ); |
35 | statusItem = new QCheckListItem( this, "" ); | ||
35 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); | 36 | QCheckListItem *otherItem = new QCheckListItem( this, QObject::tr("other") ); |
36 | item = new QCheckListItem( otherItem, QObject::tr("Description: ")+pi->desc() ); | 37 | item = new QCheckListItem( otherItem, QObject::tr("Description: ")+pi->desc() ); |
37 | QDict<QString> *fields = pi->getFields(); | 38 | QDict<QString> *fields = pi->getFields(); |
38 | QDictIterator<QString> it( *fields ); | 39 | QDictIterator<QString> it( *fields ); |
39 | while ( it.current() ) { | 40 | while ( it.current() ) { |
40 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); | 41 | item = new QCheckListItem( otherItem, QString(it.currentKey()+": "+*it.current()) ); |
41 | ++it; | 42 | ++it; |
42 | } | 43 | } |
43 | displayDetails(); | 44 | displayDetails(); |
44 | 45 | ||
45 | if (!pm_uninstalled) | 46 | if (!pm_uninstalled) |
46 | { | 47 | { |
47 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); | 48 | pm_uninstalled = new QPixmap(Resource::loadPixmap("oipkg/uninstalled")); |
48 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); | 49 | pm_installed = new QPixmap(Resource::loadPixmap("oipkg/installed")); |
49 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); | 50 | pm_install = new QPixmap(Resource::loadPixmap("oipkg/install")); |
50 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); | 51 | pm_uninstall = new QPixmap(Resource::loadPixmap("oipkg/uninstall")); |
51 | } | 52 | } |
52 | } | 53 | } |
53 | 54 | ||
54 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, | 55 | void PackageListItem::paintCell( QPainter *p, const QColorGroup & cg, |
55 | int column, int width, int alignment ) | 56 | int column, int width, int alignment ) |
56 | { | 57 | { |
57 | if ( !p ) | 58 | if ( !p ) |
58 | return; | 59 | return; |
59 | 60 | ||
60 | p->fillRect( 0, 0, width, height(), | 61 | p->fillRect( 0, 0, width, height(), |
61 | isSelected()? cg.highlight() : cg.base() ); | 62 | isSelected()? cg.highlight() : cg.base() ); |
62 | 63 | ||
63 | if ( column != 0 ) { | 64 | if ( column != 0 ) { |
64 | // The rest is text | 65 | // The rest is text |
65 | QListViewItem::paintCell( p, cg, column, width, alignment ); | 66 | QListViewItem::paintCell( p, cg, column, width, alignment ); |
66 | return; | 67 | return; |
67 | } | 68 | } |
68 | 69 | ||
69 | QListView *lv = listView(); | 70 | QListView *lv = listView(); |
70 | if ( !lv ) | 71 | if ( !lv ) |
71 | return; | 72 | return; |
72 | int marg = lv->itemMargin(); | 73 | int marg = lv->itemMargin(); |
73 | int r = marg; | 74 | int r = marg; |
74 | 75 | ||
75 | QPixmap pm = statePixmap(); | 76 | QPixmap pm = statePixmap(); |
76 | p->drawPixmap(marg,(height()-pm.height())/2,pm); | 77 | p->drawPixmap(marg,(height()-pm.height())/2,pm); |
77 | r += pm.width()+1; | 78 | r += pm.width()+1; |
78 | 79 | ||
79 | p->translate( r, 0 ); | 80 | p->translate( r, 0 ); |
80 | QListViewItem::paintCell( p, cg, column, width - r, alignment ); | 81 | QListViewItem::paintCell( p, cg, column, width - r, alignment ); |
81 | } | 82 | } |
82 | 83 | ||
83 | 84 | ||
84 | void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, | 85 | void PackageListItem::paintFocus( QPainter *p, const QColorGroup & cg, |
85 | const QRect & r ) | 86 | const QRect & r ) |
86 | { | 87 | { |
87 | // Skip QCheckListItem | 88 | // Skip QCheckListItem |
88 | // (makes you wonder what we're getting from QCheckListItem) | 89 | // (makes you wonder what we're getting from QCheckListItem) |
89 | QListViewItem::paintFocus(p,cg,r); | 90 | QListViewItem::paintFocus(p,cg,r); |
90 | } | 91 | } |
91 | 92 | ||
92 | QPixmap PackageListItem::statePixmap() const | 93 | QPixmap PackageListItem::statePixmap() const |
93 | { | 94 | { |
94 | bool installed = package->installed(); | 95 | bool installed = package->installed(); |
95 | if ( !package->toProcess() ) { | 96 | if ( !package->toProcess() ) { |
96 | if ( !installed ) | 97 | if ( !installed ) |
97 | return *pm_uninstalled; | 98 | return *pm_uninstalled; |
98 | else | 99 | else |
99 | return *pm_installed; | 100 | return *pm_installed; |
100 | } else { | 101 | } else { |
101 | if ( !installed ) | 102 | if ( !installed ) |
102 | return *pm_install; | 103 | return *pm_install; |
103 | else | 104 | else |
104 | return *pm_uninstall; | 105 | return *pm_uninstall; |
105 | } | 106 | } |
106 | } | 107 | } |
107 | 108 | ||
108 | QString PackageListItem::key( int column, bool ascending ) const | 109 | QString PackageListItem::key( int column, bool ascending ) const |
109 | { | 110 | { |
110 | if ( column == 2 ) { | 111 | if ( column == 2 ) { |
111 | QString t = text(2); | 112 | QString t = text(2); |
112 | double bytes=t.toDouble(); | 113 | double bytes=t.toDouble(); |
113 | if ( t.contains('M') ) bytes*=1024*1024; | 114 | if ( t.contains('M') ) bytes*=1024*1024; |
114 | else if ( t.contains('K') || t.contains('k') ) bytes*=1024; | 115 | else if ( t.contains('K') || t.contains('k') ) bytes*=1024; |
115 | if ( !ascending ) bytes=999999999-bytes; | 116 | if ( !ascending ) bytes=999999999-bytes; |
116 | return QString().sprintf("%09d",(int)bytes); | 117 | return QString().sprintf("%09d",(int)bytes); |
117 | } else { | 118 | } else { |
118 | return QListViewItem::key(column,ascending); | 119 | return QListViewItem::key(column,ascending); |
119 | } | 120 | } |
120 | } | 121 | } |
121 | 122 | ||
122 | void PackageListItem::setOn( bool b ) | 123 | void PackageListItem::setOn( bool b ) |
123 | { | 124 | { |
124 | QCheckListItem::setOn( b ); | 125 | QCheckListItem::setOn( b ); |
125 | package->toggleProcess(); | 126 | package->toggleProcess(); |
126 | package->setLink( settings->createLinks() ); | 127 | package->setLink( settings->createLinks() ); |
127 | displayDetails(); | 128 | displayDetails(); |
128 | } | 129 | } |
129 | 130 | ||
130 | void PackageListItem::displayDetails() | 131 | void PackageListItem::displayDetails() |
131 | { | 132 | { |
132 | QString sod = " ("+package->sizeUnits(); | 133 | QString sod; |
134 | sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); | ||
135 | //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); | ||
133 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); | 136 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); |
134 | sod += ")"; | 137 | sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); |
135 | setText(0, package->name()+sod ); | 138 | setText(0, package->name()+sod ); |
136 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); | 139 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); |
137 | linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); | 140 | linkItem->setText( 0, QObject::tr("Link: ")+QString(package->link()?QObject::tr("Yes"):QObject::tr("No")) ); |
138 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); | 141 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); |
142 | statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); | ||
139 | repaint(); | 143 | repaint(); |
140 | } | 144 | } |
diff --git a/noncore/unsupported/oipkg/packagelistitem.h b/noncore/unsupported/oipkg/packagelistitem.h index b128f0d..65e9711 100644 --- a/noncore/unsupported/oipkg/packagelistitem.h +++ b/noncore/unsupported/oipkg/packagelistitem.h | |||
@@ -1,40 +1,41 @@ | |||
1 | #ifndef PK_LISTITEM_H | 1 | #ifndef PK_LISTITEM_H |
2 | #define PK_LISTITEM_H | 2 | #define PK_LISTITEM_H |
3 | 3 | ||
4 | #include "package.h" | 4 | #include "package.h" |
5 | 5 | ||
6 | #include <qstring.h> | 6 | #include <qstring.h> |
7 | #include <qlistview.h> | 7 | #include <qlistview.h> |
8 | #include <qpainter.h> | 8 | #include <qpainter.h> |
9 | #include <qpixmap.h> | 9 | #include <qpixmap.h> |
10 | #include <qdict.h> | 10 | #include <qdict.h> |
11 | 11 | ||
12 | #include "pksettings.h" | 12 | #include "pksettings.h" |
13 | 13 | ||
14 | class PackageListItem | 14 | class PackageListItem |
15 | : public QCheckListItem | 15 | : public QCheckListItem |
16 | { | 16 | { |
17 | public: | 17 | public: |
18 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); | 18 | PackageListItem(QListViewItem*, Package*, PackageManagerSettings*); |
19 | PackageListItem(QListView*, Package*, PackageManagerSettings*); | 19 | PackageListItem(QListView*, Package*, PackageManagerSettings*); |
20 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); | 20 | void paintCell( QPainter*, const QColorGroup&, int, int, int ); |
21 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); | 21 | void paintFocus( QPainter*, const QColorGroup&, const QRect& ); |
22 | QPixmap statePixmap() const; | 22 | QPixmap statePixmap() const; |
23 | QString key( int, bool ) const; | 23 | QString key( int, bool ) const; |
24 | Package* getPackage() { return package; } ; | 24 | Package* getPackage() { return package; } ; |
25 | QString getName() { return package->name(); } ; | 25 | QString getName() { return package->name(); } ; |
26 | bool isInstalled(){ return package->installed(); }; | 26 | bool isInstalled(){ return package->installed(); }; |
27 | virtual void setOn ( bool ); | 27 | virtual void setOn ( bool ); |
28 | void displayDetails(); | 28 | void displayDetails(); |
29 | 29 | ||
30 | private: | 30 | private: |
31 | void init(Package*, PackageManagerSettings*); | 31 | void init(Package*, PackageManagerSettings*); |
32 | QCheckListItem *nameItem; | 32 | QCheckListItem *nameItem; |
33 | QCheckListItem *destItem; | 33 | QCheckListItem *destItem; |
34 | QCheckListItem *linkItem; | 34 | QCheckListItem *linkItem; |
35 | QCheckListItem *statusItem; | ||
35 | PackageManagerSettings *settings; | 36 | PackageManagerSettings *settings; |
36 | Package *package; | 37 | Package *package; |
37 | }; | 38 | }; |
38 | 39 | ||
39 | 40 | ||
40 | #endif | 41 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistremote.cpp b/noncore/unsupported/oipkg/packagelistremote.cpp index 721d4a6..1ec7292 100644 --- a/noncore/unsupported/oipkg/packagelistremote.cpp +++ b/noncore/unsupported/oipkg/packagelistremote.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | 1 | ||
2 | #include "packagelistremote.h" | 2 | #include "packagelistremote.h" |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <stdlib.h> | 5 | #include <stdlib.h> |
6 | #include <unistd.h> | 6 | #include <unistd.h> |
7 | 7 | ||
8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) | 8 | PackageListRemote::PackageListRemote(PackageManagerSettings* s) |
9 | : PackageList(s) | 9 | : PackageList(s) |
10 | { | 10 | { |
11 | PackageListRemote(); | 11 | PackageListRemote(); |
12 | } | 12 | } |
13 | 13 | ||
14 | PackageListRemote::PackageListRemote() | 14 | PackageListRemote::PackageListRemote() |
15 | : PackageList() | 15 | : PackageList() |
16 | { | 16 | { |
17 | } | 17 | } |
18 | 18 | ||
19 | PackageListRemote::~PackageListRemote() | 19 | PackageListRemote::~PackageListRemote() |
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | void PackageListRemote::query(QString s) | 23 | void PackageListRemote::query(QString s) |
24 | { | 24 | { |
25 | searchString = s; | ||
26 | } | ||
27 | |||
28 | void PackageListRemote::update() | ||
29 | { | ||
30 | pvDebug(2,"PackageListRemote::update"); | ||
25 | int r=0; | 31 | int r=0; |
26 | QString cmd = "wget"; | 32 | QString cmd = "wget"; |
27 | QString redirect = "/tmp/oipkg.query"; | 33 | QString redirect = "/tmp/oipkg.query"; |
28 | 34 | ||
29 | // use file for output | 35 | // use file for output |
30 | cmd += " --output-document="+redirect; | 36 | cmd += " --output-document="+redirect; |
31 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= | 37 | //http://ipkgfind.handhelds.org/packages.phtml?format=pda&query=ipkg&searchtype=package§ion= |
32 | QString server="http://ipkgfind.handhelds.org/"; | 38 | QString server="http://ipkgfind.handhelds.org/"; |
33 | cmd += " \""+server+"/packages.phtml"; | 39 | cmd += " \""+server+"/packages.phtml"; |
34 | cmd += "?format=pda&searchtype=package§ion="; | 40 | cmd += "?format=pda&searchtype=package§ion="; |
35 | cmd += "&query="+s; | 41 | cmd += "&query="+searchString; |
36 | cmd += "\""; | 42 | cmd += "\""; |
37 | 43 | ||
38 | pvDebug(2,"search :"+cmd); | 44 | pvDebug(2,"search :"+cmd); |
39 | r = system(cmd.latin1()); | 45 | r = system(cmd.latin1()); |
40 | readFileEntries( redirect ); | 46 | readFileEntries( redirect ); |
41 | |||
42 | } | ||
43 | |||
44 | void PackageListRemote::update() | ||
45 | { | ||
46 | pvDebug(2,"PackageListRemote::update\ndoing nothing "); | ||
47 | } | 47 | } |
diff --git a/noncore/unsupported/oipkg/packagelistremote.h b/noncore/unsupported/oipkg/packagelistremote.h index 147da1e..87bf10d 100644 --- a/noncore/unsupported/oipkg/packagelistremote.h +++ b/noncore/unsupported/oipkg/packagelistremote.h | |||
@@ -1,19 +1,21 @@ | |||
1 | #ifndef PACKAGELISTREMOTE_H | 1 | #ifndef PACKAGELISTREMOTE_H |
2 | #define PACKAGELISTREMOTE_H | 2 | #define PACKAGELISTREMOTE_H |
3 | 3 | ||
4 | #include "packagelist.h" | 4 | #include "packagelist.h" |
5 | #include "package.h" | 5 | #include "package.h" |
6 | #include "pksettings.h" | 6 | #include "pksettings.h" |
7 | #include "debug.h" | 7 | #include "debug.h" |
8 | 8 | ||
9 | class PackageListRemote : public PackageList { | 9 | class PackageListRemote : public PackageList { |
10 | public: | 10 | public: |
11 | PackageListRemote(); | 11 | PackageListRemote(); |
12 | PackageListRemote( PackageManagerSettings* s); | 12 | PackageListRemote( PackageManagerSettings* s); |
13 | virtual ~PackageListRemote(); | 13 | virtual ~PackageListRemote(); |
14 | void query(QString); | 14 | void query(QString); |
15 | public slots: | 15 | public slots: |
16 | void update(); | 16 | void update(); |
17 | private: | ||
18 | QString searchString; | ||
17 | }; | 19 | }; |
18 | 20 | ||
19 | #endif | 21 | #endif |
diff --git a/noncore/unsupported/oipkg/packagelistview.cpp b/noncore/unsupported/oipkg/packagelistview.cpp index 5137c64..b6b520b 100644 --- a/noncore/unsupported/oipkg/packagelistview.cpp +++ b/noncore/unsupported/oipkg/packagelistview.cpp | |||
@@ -67,66 +67,67 @@ void PackageListView::showPopup() | |||
67 | popupAction = new QAction( QObject::tr("Remove"),QString::null, 0, this, 0 ); | 67 | popupAction = new QAction( QObject::tr("Remove"),QString::null, 0, this, 0 ); |
68 | popupAction->addTo( popupMenu ); | 68 | popupAction->addTo( popupMenu ); |
69 | connect( popupAction, SIGNAL( activated() ), | 69 | connect( popupAction, SIGNAL( activated() ), |
70 | this , SLOT( toggleProcess() ) ); | 70 | this , SLOT( toggleProcess() ) ); |
71 | popupAction = new QAction( QObject::tr("Reinstall"),QString::null, 0, this, 0 ); | 71 | popupAction = new QAction( QObject::tr("Reinstall"),QString::null, 0, this, 0 ); |
72 | popupAction->addTo( popupMenu ); | 72 | popupAction->addTo( popupMenu ); |
73 | popupAction->setEnabled( false ); | 73 | popupAction->setEnabled( false ); |
74 | } | 74 | } |
75 | popupMenu->popup( QCursor::pos() ); | 75 | popupMenu->popup( QCursor::pos() ); |
76 | } | 76 | } |
77 | 77 | ||
78 | void PackageListView::stopTimer( QListViewItem* ) | 78 | void PackageListView::stopTimer( QListViewItem* ) |
79 | { | 79 | { |
80 | popupTimer->stop(); | 80 | popupTimer->stop(); |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | void PackageListView::changePackageDest( int i ) | 84 | void PackageListView::changePackageDest( int i ) |
85 | { | 85 | { |
86 | activePackage->setDest( destsMenu->text(i) ); | 86 | activePackage->setDest( destsMenu->text(i) ); |
87 | activePackage->setOn(); | 87 | activePackage->setOn(); |
88 | activePackage->setLink( settings->createLinks() ); | 88 | activePackage->setLink( settings->createLinks() ); |
89 | activePackageListItem->displayDetails(); | 89 | activePackageListItem->displayDetails(); |
90 | } | 90 | } |
91 | 91 | ||
92 | void PackageListView::toggleProcess() | 92 | void PackageListView::toggleProcess() |
93 | { | 93 | { |
94 | activePackage->toggleProcess() ; | 94 | activePackage->toggleProcess() ; |
95 | activePackageListItem->displayDetails(); | 95 | activePackageListItem->displayDetails(); |
96 | } | 96 | } |
97 | 97 | ||
98 | void PackageListView::display() | 98 | void PackageListView::display() |
99 | { | 99 | { |
100 | QDictIterator<PackageList> list( PackageLists ); | 100 | QDictIterator<PackageList> list( PackageLists ); |
101 | PackageList *packlist; | 101 | PackageList *packlist; |
102 | Package *pack; | 102 | Package *pack; |
103 | PackageListItem *item; | 103 | PackageListItem *item; |
104 | QCheckListItem *rootItem; | 104 | QCheckListItem *rootItem; |
105 | QListViewItem* it; | 105 | QListViewItem* it; |
106 | QListViewItem* itdel; | 106 | QListViewItem* itdel; |
107 | while ( list.current() ) { | 107 | while ( list.current() ) { |
108 | packlist = list.current(); | 108 | packlist = list.current(); |
109 | rootItem = rootItems.find( list.currentKey() ); | 109 | rootItem = rootItems.find( list.currentKey() ); |
110 | //rootItem->clear(); | 110 | //rootItem->clear(); |
111 | it=rootItem->firstChild(); | 111 | it=rootItem->firstChild(); |
112 | while ( it ) | 112 | while ( it ) |
113 | { | 113 | { |
114 | itdel = it; | 114 | itdel = it; |
115 | it = it->nextSibling(); | 115 | it = it->nextSibling(); |
116 | delete itdel; | 116 | delete itdel; |
117 | } | 117 | } |
118 | pack = packlist->first(); | 118 | pack = packlist->first(); |
119 | while( pack ) | 119 | while( pack ) |
120 | { | 120 | { |
121 | item = new PackageListItem( rootItem, pack, settings ); | 121 | item = new PackageListItem( rootItem, pack, settings ); |
122 | pack = packlist->next(); | 122 | pack = packlist->next(); |
123 | } | 123 | } |
124 | ++list; | 124 | ++list; |
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | void PackageListView::addList( QString n, PackageList* pl) | 128 | void PackageListView::addList( QString n, PackageList* pl) |
129 | { | 129 | { |
130 | PackageLists.insert(n, pl); | 130 | PackageLists.insert(n, pl); |
131 | rootItems.insert(n, new QCheckListItem(this,n)); | 131 | QCheckListItem *item = new QCheckListItem(this,n); |
132 | rootItems.insert(n, item); | ||
132 | } | 133 | } |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 2559a51..be9d6da 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,416 +1,417 @@ | |||
1 | #include "pmipkg.h" | 1 | #include "pmipkg.h" |
2 | #include "pksettings.h" | 2 | #include "pksettings.h" |
3 | #include "package.h" | 3 | #include "package.h" |
4 | #include "packagelistitem.h" | 4 | #include "packagelistitem.h" |
5 | 5 | ||
6 | #include <qpe/process.h> | 6 | #include <qpe/process.h> |
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <qpe/config.h> | 8 | #include <qpe/config.h> |
9 | #include <qpe/stringutil.h> | 9 | #include <qpe/stringutil.h> |
10 | #include <qdir.h> | 10 | #include <qdir.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qgroupbox.h> | 12 | #include <qgroupbox.h> |
13 | #include <qmultilineedit.h> | 13 | #include <qmultilineedit.h> |
14 | #include <qstring.h> | 14 | #include <qstring.h> |
15 | #include <qcheckbox.h> | 15 | #include <qcheckbox.h> |
16 | #include <qtextstream.h> | 16 | #include <qtextstream.h> |
17 | #include <qtextview.h> | 17 | #include <qtextview.h> |
18 | 18 | ||
19 | #include <qprogressbar.h> | 19 | #include <qprogressbar.h> |
20 | #include <qpushbutton.h> | 20 | #include <qpushbutton.h> |
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | 22 | ||
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
24 | #include <unistd.h> | 24 | #include <unistd.h> |
25 | 25 | ||
26 | #include "mainwindow.h" | 26 | #include "mainwindow.h" |
27 | 27 | ||
28 | 28 | ||
29 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 29 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
30 | : QObject ( p ) | 30 | : QObject ( p ) |
31 | { | 31 | { |
32 | settings = s; | 32 | settings = s; |
33 | runwindowopen = false; | ||
34 | runwindow = new RunWindow( p, name, true, f ); | 33 | runwindow = new RunWindow( p, name, true, f ); |
35 | } | 34 | } |
36 | 35 | ||
37 | PmIpkg::~PmIpkg() | 36 | PmIpkg::~PmIpkg() |
38 | { | 37 | { |
39 | } | 38 | } |
40 | 39 | ||
41 | //#define PROC | 40 | //#define PROC |
42 | #define SYSTEM | 41 | #define SYSTEM |
43 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) | 42 | int PmIpkg::runIpkg(const QString& args, const QString& dest ) |
44 | { | 43 | { |
45 | pvDebug(2,"PmIpkg::runIpkg "+args); | 44 | pvDebug(2,"PmIpkg::runIpkg "+args); |
46 | 45 | ||
47 | #ifdef PROC | 46 | #ifdef PROC |
48 | QStringList cmd = "/usr/bin/ipkg "; | 47 | QStringList cmd = "/usr/bin/ipkg "; |
49 | #endif | 48 | #endif |
50 | #ifdef SYSTEM | 49 | #ifdef SYSTEM |
51 | QString cmd = "/usr/bin/ipkg "; | 50 | QString cmd = "/usr/bin/ipkg "; |
52 | #endif | 51 | #endif |
53 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 52 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
54 | if ( dest == "" ) | 53 | if ( dest == "" ) |
55 | cmd += " -dest "+settings->getDestinationName(); | 54 | cmd += " -dest "+settings->getDestinationName(); |
56 | else | 55 | else |
57 | cmd += " -dest "+ dest; | 56 | cmd += " -dest "+ dest; |
58 | 57 | ||
59 | cmd += " -force-defaults "; | 58 | cmd += " -force-defaults "; |
60 | 59 | ||
61 | if (_force_depends) | 60 | if (_force_depends) |
62 | { | 61 | { |
63 | if (_force_depends->isChecked()) | 62 | if (_force_depends->isChecked()) |
64 | cmd += " -force-depends "; | 63 | cmd += " -force-depends "; |
65 | if (_force_reinstall->isChecked()) | 64 | if (_force_reinstall->isChecked()) |
66 | cmd += " -force-reinstall "; | 65 | cmd += " -force-reinstall "; |
67 | if (_force_remove->isChecked()) | 66 | if (_force_remove->isChecked()) |
68 | cmd += " -force-removal-of-essential-packages "; | 67 | cmd += " -force-removal-of-essential-packages "; |
69 | } | 68 | } |
70 | 69 | ||
71 | out( "<hr><br>Starting to "+ args+"<br>\n"); | 70 | out( "<hr><br>Starting to "+ args+"<br>\n"); |
72 | cmd += args; | 71 | cmd += args; |
73 | int r = 0; | 72 | int r = 0; |
74 | #ifdef PROC | 73 | #ifdef PROC |
75 | QString o = "start"; | 74 | QString o = "start"; |
76 | Process *ipkg = new Process( "ls");//cmd ); | 75 | Process *ipkg = new Process( cmd ); |
77 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); | 76 | out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); |
78 | QString description; | 77 | QString description; |
79 | ipkg->exec("",o); | 78 | ipkg->exec("",o); |
80 | // out( o ); | 79 | // out( o ); |
81 | #endif | 80 | #endif |
82 | #ifdef SYSTEM | 81 | #ifdef SYSTEM |
83 | out( "running:<br>\n"+cmd+"<br>\n" ); | 82 | out( "running:<br>\n"+cmd+"<br>\n" ); |
84 | QString redirect = "/tmp/oipkg.pipe"; | 83 | QString redirect = "/tmp/oipkg.pipe"; |
85 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; | 84 | cmd += " 2>&1 | tee "+redirect+" 2>&1"; |
86 | pvDebug(2, "running >"+cmd+"<"); | 85 | pvDebug(2, "running >"+cmd+"<"); |
87 | r = system(cmd.latin1()); | 86 | r = system(cmd.latin1()); |
88 | QFile f( redirect ); | 87 | QFile f( redirect ); |
89 | QString line; | 88 | QString line; |
90 | QString oldLine; | 89 | QString oldLine; |
91 | while ( ! f.open(IO_ReadOnly) ) {}; | 90 | while ( ! f.open(IO_ReadOnly) ) {}; |
92 | QTextStream t( &f ); | 91 | QTextStream t( &f ); |
93 | while ( !t.eof() ) | 92 | while ( !t.eof() ) |
94 | { | 93 | { |
95 | line = t.readLine(); | 94 | line = t.readLine(); |
96 | if ( line != oldLine ) | 95 | if ( line != oldLine ) |
97 | { | 96 | { |
98 | out( line +"<br>" ); | 97 | out( line +"<br>" ); |
99 | oldLine = line; | 98 | oldLine = line; |
100 | } | 99 | } |
101 | } | 100 | } |
102 | f.close(); | 101 | f.close(); |
103 | out( "Finished!<br>"); | 102 | out( "Finished!<br>"); |
104 | #endif | 103 | #endif |
105 | 104 | ||
106 | return r; | 105 | return r; |
107 | } | 106 | } |
108 | 107 | ||
109 | void PmIpkg::makeLinks(Package *pack) | 108 | void PmIpkg::makeLinks(Package *pack) |
110 | { | 109 | { |
111 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 110 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
112 | linkPackage( pack->name(), pack->dest() ); | 111 | linkPackage( pack->name(), pack->dest() ); |
113 | } | 112 | } |
114 | 113 | ||
115 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 114 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
116 | { | 115 | { |
117 | QString dest = settings->getDestinationUrlByName( d ); | 116 | QString dest = settings->getDestinationUrlByName( d ); |
118 | dest = dest==""?d:dest; | 117 | dest = dest==""?d:dest; |
119 | if (dest == "/" ) return 0; | 118 | if (dest == "/" ) return 0; |
120 | { | 119 | { |
121 | Config cfg( "oipkg", Config::User ); | 120 | Config cfg( "oipkg", Config::User ); |
122 | cfg.setGroup( "Common" ); | 121 | cfg.setGroup( "Common" ); |
123 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 122 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
124 | } | 123 | } |
125 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 124 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
126 | QFile f( packFileName ); | 125 | QFile f( packFileName ); |
127 | if ( ! f.open(IO_ReadOnly) ) | 126 | if ( ! f.open(IO_ReadOnly) ) |
128 | { | 127 | { |
129 | pvDebug(1," Panik! Could not open"); | 128 | pvDebug(1," Panik! Could not open"); |
130 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); | 129 | out( "<b>Panik!</b> Could not open:<br>"+packFileName ); |
131 | return (QStringList*)0; | 130 | return (QStringList*)0; |
132 | } | 131 | } |
133 | QStringList *fileList = new QStringList(); | 132 | QStringList *fileList = new QStringList(); |
134 | QTextStream t( &f ); | 133 | QTextStream t( &f ); |
135 | while ( !t.eof() ) | 134 | while ( !t.eof() ) |
136 | { | 135 | { |
137 | *fileList += t.readLine(); | 136 | *fileList += t.readLine(); |
138 | } | 137 | } |
139 | return fileList; | 138 | return fileList; |
140 | } | 139 | } |
141 | 140 | ||
142 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 141 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
143 | { | 142 | { |
144 | QStringList *fileList = getList( packFileName, dest ); | 143 | QStringList *fileList = getList( packFileName, dest ); |
145 | processFileList( fileList, dest ); | 144 | processFileList( fileList, dest ); |
146 | delete fileList; | 145 | delete fileList; |
147 | } | 146 | } |
148 | 147 | ||
149 | void PmIpkg::processFileList( QStringList *fileList, QString d ) | 148 | void PmIpkg::processFileList( QStringList *fileList, QString d ) |
150 | { | 149 | { |
151 | if (!fileList) return; | 150 | if (!fileList) return; |
152 | for (uint i=0; i < fileList->count(); i++) | 151 | for (uint i=0; i < fileList->count(); i++) |
153 | { | 152 | { |
154 | QString dest = settings->getDestinationUrlByName( d ); | 153 | QString dest = settings->getDestinationUrlByName( d ); |
155 | dest = dest==""?d:dest; | 154 | dest = dest==""?d:dest; |
156 | processLinkDir( (*fileList)[i], dest ); | 155 | processLinkDir( (*fileList)[i], dest ); |
157 | } | 156 | } |
158 | } | 157 | } |
159 | 158 | ||
160 | 159 | ||
161 | void PmIpkg::processLinkDir( QString file, QString dest ) | 160 | void PmIpkg::processLinkDir( QString file, QString dest ) |
162 | { | 161 | { |
163 | pvDebug( 7,"PmIpkg::processLinkDir "+file+" to "+ dest); | 162 | pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); |
164 | if (linkOpp==createLink) pvDebug( 2,"opp: createLink"); | 163 | if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); |
165 | if (linkOpp==removeLink) pvDebug( 2,"opp:removeLink"); | 164 | if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); |
166 | if ( dest == "???" || dest == "" ) return; | 165 | if ( dest == "???" || dest == "" ) return; |
167 | QString destFile = file; | 166 | QString destFile = file; |
168 | file = dest+"/"+file; | 167 | file = dest+"/"+file; |
169 | if (file == dest) return; | 168 | if (file == dest) return; |
170 | QFileInfo fileInfo( file ); | 169 | QFileInfo fileInfo( file ); |
171 | if ( fileInfo.isDir() ) | 170 | if ( fileInfo.isDir() ) |
172 | { | 171 | { |
172 | pvDebug(4, "process dir "+file); | ||
173 | QDir destDir( destFile ); | 173 | QDir destDir( destFile ); |
174 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); | 174 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); |
175 | QDir d( file ); | 175 | QDir d( file ); |
176 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 176 | d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
177 | const QFileInfoList *list = d.entryInfoList(); | 177 | const QFileInfoList *list = d.entryInfoList(); |
178 | QFileInfoListIterator it( *list ); | 178 | QFileInfoListIterator it( *list ); |
179 | QFileInfo *fi; | 179 | QFileInfo *fi; |
180 | while ( (fi=it.current()) ) | 180 | while ( (fi=it.current()) ) |
181 | { | 181 | { |
182 | pvDebug(4, "process dir "+fi->absFilePath()); | ||
183 | processLinkDir( fi->absFilePath(), dest ); | 182 | processLinkDir( fi->absFilePath(), dest ); |
184 | ++it; | 183 | ++it; |
185 | } | 184 | } |
186 | // if (linkOpp==removeLink) | 185 | // if (linkOpp==removeLink) |
187 | // { | 186 | // { |
188 | // pvDebug(2,"remove destDir "+ destFile ); | 187 | // pvDebug(2,"remove destDir "+ destFile ); |
189 | // destDir.remove( destFile, true ); | 188 | // destDir.remove( destFile, true ); |
190 | // } | 189 | // } |
191 | } else | 190 | } else |
192 | if ( fileInfo.isFile() ) | 191 | if ( fileInfo.isFile() ) |
193 | { | 192 | { |
194 | const char *instFile = strdup( (file).ascii() ); | 193 | const char *instFile = strdup( (file).ascii() ); |
195 | const char *linkFile = strdup( (destFile).ascii()); | 194 | const char *linkFile = strdup( (destFile).ascii()); |
196 | if( linkOpp==createLink ) | 195 | if( linkOpp==createLink ) |
197 | { | 196 | { |
198 | pvDebug(4, "linking: "+file+" -> "+destFile ); | 197 | pvDebug(4, "linking: "+file+" -> "+destFile ); |
199 | symlink( instFile, linkFile ); | 198 | symlink( instFile, linkFile ); |
200 | } | 199 | } |
201 | } else { | 200 | } else { |
202 | const char *linkFile = strdup( (destFile).ascii()); | 201 | const char *linkFile = strdup( (destFile).ascii()); |
203 | if( linkOpp==removeLink ) | 202 | if( linkOpp==removeLink ) |
204 | { | 203 | { |
205 | pvDebug(4,"removing "+destFile+" no "+file); | 204 | pvDebug(4,"removing "+destFile+" no "+file); |
206 | QFileInfo toRemoveLink( destFile ); | 205 | QFileInfo toRemoveLink( destFile ); |
207 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) | 206 | if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) |
208 | unlink( linkFile ); | 207 | unlink( linkFile ); |
209 | } | 208 | } |
210 | } | 209 | } |
211 | } | 210 | } |
212 | 211 | ||
213 | void PmIpkg::loadList( PackageList pl ) | 212 | void PmIpkg::loadList( PackageList pl ) |
214 | { | 213 | { |
215 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) | 214 | for( Package *pack = pl.first();pack ; (pack = pl.next()) ) |
216 | { | 215 | { |
217 | if ( pack && (pack->name() != "") && pack) | 216 | if ( pack && (pack->name() != "") && pack) |
218 | { | 217 | { |
219 | if ( pack->toInstall() ) | 218 | if ( pack->toInstall() ) |
220 | to_install.append( pack ); | 219 | to_install.append( pack ); |
221 | if ( pack->toRemove() ) | 220 | if ( pack->toRemove() ) |
222 | to_remove.append( pack ); | 221 | to_remove.append( pack ); |
223 | } | 222 | } |
224 | } | 223 | } |
225 | } | 224 | } |
226 | 225 | ||
227 | void PmIpkg::commit( PackageList pl ) | 226 | void PmIpkg::commit( PackageList pl ) |
228 | { | 227 | { |
229 | sizecount = 0; | 228 | int sizecount = 0; |
230 | QString rem="<b>"+tr("To remove:")+"</b><br>\n"; | 229 | // QString rem="<b>"+tr("To remove:")+"</b><br>\n"; |
231 | QString inst="<b>"+tr("To install:")+"</b><br>\n"; | 230 | // QString inst="<b>"+tr("To install:")+"</b><br>\n"; |
232 | loadList(pl); | 231 | loadList(pl); |
233 | for (uint i=0; i < to_remove.count(); i++) | 232 | for (uint i=0; i < to_remove.count(); i++) |
234 | sizecount += 1; | 233 | sizecount += 1; |
235 | for (uint i=0; i < to_install.count(); i++) | 234 | for (uint i=0; i < to_install.count(); i++) |
236 | sizecount += to_install.at(i)->size().toInt(); | 235 | sizecount += to_install.at(i)->size().toInt(); |
236 | runwindow->progress->setTotalSteps(sizecount); | ||
237 | startDialog(); | 237 | startDialog(); |
238 | } | 238 | } |
239 | 239 | ||
240 | void PmIpkg::startDialog() | 240 | void PmIpkg::startDialog() |
241 | { | 241 | { |
242 | installDialog = new QDialog(0,0,true); | 242 | installDialog = new QDialog(0,0,true); |
243 | QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); | 243 | QGridLayout *RunWindowLayout = new QGridLayout( installDialog ); |
244 | RunWindowLayout->setSpacing( 2 ); | 244 | RunWindowLayout->setSpacing( 2 ); |
245 | RunWindowLayout->setMargin( 2 ); | 245 | RunWindowLayout->setMargin( 2 ); |
246 | 246 | ||
247 | PackageListView *plv = new PackageListView(installDialog, "install",settings); | 247 | PackageListView *plv = new PackageListView(installDialog, "install",settings); |
248 | plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); | 248 | plv->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding, plv->sizePolicy().mayShrinkVertically()) ); |
249 | RunWindowLayout->addWidget( plv, 1, 0 ); | 249 | RunWindowLayout->addWidget( plv, 1, 0 ); |
250 | QCheckListItem *toRemoveItem; | 250 | QCheckListItem *toRemoveItem; |
251 | toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); | 251 | toRemoveItem= new QCheckListItem( plv, QObject::tr("To remove") ); |
252 | toRemoveItem->setOpen( true ); | 252 | toRemoveItem->setOpen( true ); |
253 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 253 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
254 | { | 254 | { |
255 | toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); | 255 | toRemoveItem->insertItem( new PackageListItem(plv, it,settings) ); |
256 | } | 256 | } |
257 | QCheckListItem *toInstallItem; | 257 | QCheckListItem *toInstallItem; |
258 | toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); | 258 | toInstallItem = new QCheckListItem( plv, QObject::tr("To install") ); |
259 | toInstallItem->setOpen( true ); | 259 | toInstallItem->setOpen( true ); |
260 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 260 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) |
261 | { | 261 | { |
262 | toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); | 262 | toInstallItem->insertItem( new PackageListItem(plv, it,settings) ); |
263 | } | 263 | } |
264 | 264 | ||
265 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); | 265 | QGroupBox *GroupBox1 = new QGroupBox( installDialog, "Ipkg" ); |
266 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); | 266 | GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, GroupBox1->sizePolicy().mayShrinkVertically() ) ); |
267 | GroupBox1->setTitle( tr( "Ipkg options" ) ); | 267 | GroupBox1->setTitle( tr( "Ipkg options" ) ); |
268 | GroupBox1->setColumnLayout(0, Qt::Vertical ); | 268 | GroupBox1->setColumnLayout(0, Qt::Vertical ); |
269 | GroupBox1->layout()->setSpacing( 0 ); | 269 | GroupBox1->layout()->setSpacing( 0 ); |
270 | GroupBox1->layout()->setMargin( 0 ); | 270 | GroupBox1->layout()->setMargin( 0 ); |
271 | QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); | 271 | QGridLayout *GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); |
272 | GroupBox1Layout->setAlignment( Qt::AlignTop ); | 272 | GroupBox1Layout->setAlignment( Qt::AlignTop ); |
273 | GroupBox1Layout->setSpacing( 3 ); | 273 | GroupBox1Layout->setSpacing( 3 ); |
274 | GroupBox1Layout->setMargin( 3 ); | 274 | GroupBox1Layout->setMargin( 3 ); |
275 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); | 275 | _force_depends = new QCheckBox( GroupBox1, "_force_depends" ); |
276 | _force_depends->setText( tr( "-force-depends" ) ); | 276 | _force_depends->setText( tr( "-force-depends" ) ); |
277 | _force_depends->setAutoResize( TRUE ); | 277 | _force_depends->setAutoResize( TRUE ); |
278 | _force_depends->setChecked(true); | 278 | _force_depends->setChecked(true); |
279 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); | 279 | GroupBox1Layout->addWidget( _force_depends, 0, 0 ); |
280 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); | 280 | _force_reinstall = new QCheckBox( GroupBox1, "_force_reinstall" ); |
281 | _force_reinstall->setText( tr( "-force-reinstall" ) ); | 281 | _force_reinstall->setText( tr( "-force-reinstall" ) ); |
282 | _force_reinstall->setAutoResize( TRUE ); | 282 | _force_reinstall->setAutoResize( TRUE ); |
283 | GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); | 283 | GroupBox1Layout->addWidget( _force_reinstall, 1, 0 ); |
284 | _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); | 284 | _force_remove = new QCheckBox( GroupBox1, "_force_remove" ); |
285 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); | 285 | _force_remove->setText( tr( "-force-removal-of-essential-packages" ) ); |
286 | _force_remove->setAutoResize( TRUE ); | 286 | _force_remove->setAutoResize( TRUE ); |
287 | GroupBox1Layout->addWidget( _force_remove, 1, 0 ); | 287 | GroupBox1Layout->addWidget( _force_remove, 1, 0 ); |
288 | RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); | 288 | RunWindowLayout->addWidget( GroupBox1 , 3, 0 ); |
289 | installDialog->showMaximized(); | 289 | installDialog->showMaximized(); |
290 | if ( installDialog->exec() ) doIt(); | 290 | if ( installDialog->exec() ) doIt(); |
291 | installDialog->close(); | 291 | installDialog->close(); |
292 | out(tr("<b>All done.</b>")); | 292 | out(tr("<b>All done.</b>")); |
293 | } | 293 | } |
294 | 294 | ||
295 | void PmIpkg::doIt() | 295 | void PmIpkg::doIt() |
296 | { | 296 | { |
297 | show( true ); | 297 | show( true ); |
298 | remove(); | 298 | remove(); |
299 | install(); | 299 | install(); |
300 | } | 300 | } |
301 | 301 | ||
302 | 302 | ||
303 | void PmIpkg::remove() | 303 | void PmIpkg::remove() |
304 | { | 304 | { |
305 | if ( to_remove.count() == 0 ) return; | 305 | if ( to_remove.count() == 0 ) return; |
306 | 306 | ||
307 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); | 307 | out("<b>"+tr("Removing")+"<br>"+tr("please wait")+"</b><br><hr>"); |
308 | 308 | ||
309 | QStringList *fileList; | 309 | QStringList *fileList; |
310 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) | 310 | for (Package *it=to_remove.first(); it != 0; it=to_remove.next() ) |
311 | { | 311 | { |
312 | if ( it->link() )fileList = getList( it->name(), it->dest() ); | 312 | if ( it->link() )fileList = getList( it->name(), it->dest() ); |
313 | if ( runIpkg("remove " + it->name(), it->dest() ) == 0) | 313 | if ( runIpkg("remove " + it->name(), it->dest() ) == 0) |
314 | { | 314 | { |
315 | runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); | 315 | runwindow->progress->setProgress( 1 + runwindow->progress->progress() ); |
316 | linkOpp = removeLink; | 316 | linkOpp = removeLink; |
317 | if ( it->link() ) | 317 | if ( it->link() ) |
318 | { | 318 | { |
319 | out( "<br>removing links<br>" ); | 319 | out( "<br>removing links<br>" ); |
320 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 320 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); |
321 | processFileList( fileList, it->dest() ); | 321 | processFileList( fileList, it->dest() ); |
322 | } | 322 | } |
323 | it->processed(); | 323 | it->processed(); |
324 | 324 | // to_install.take( it ); | |
325 | out("<br><hr>"); | 325 | out("<br><hr>"); |
326 | }else{ | 326 | }else{ |
327 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); | 327 | out("<b>"+tr("Error while removing")+"</b><hr>"+it->name()); |
328 | } | 328 | } |
329 | if ( it->link() )delete fileList; | 329 | if ( it->link() )delete fileList; |
330 | } | 330 | } |
331 | out("<br>"); | 331 | out("<br>"); |
332 | } | 332 | } |
333 | 333 | ||
334 | 334 | ||
335 | void PmIpkg::install() | 335 | void PmIpkg::install() |
336 | { | 336 | { |
337 | if ( to_install.count() == 0 ) return; | 337 | if ( to_install.count() == 0 ) return; |
338 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); | 338 | out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); |
339 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) | 339 | for (Package *it=to_install.first(); it != 0; it=to_install.next() ) |
340 | { | 340 | { |
341 | 341 | ||
342 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) | 342 | if ( runIpkg("install " + it->installName(), it->dest() ) == 0 ) |
343 | { | 343 | { |
344 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); | 344 | runwindow->progress->setProgress( it->size().toInt() + runwindow->progress->progress()); |
345 | linkOpp = createLink; | 345 | linkOpp = createLink; |
346 | if ( it->link() ) | 346 | if ( it->link() ) |
347 | { | 347 | { |
348 | out( "<br>creating links<br>" ); | 348 | out( "<br>creating links<br>" ); |
349 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); | 349 | out( "for package "+it->name()+" in "+it->dest()+"<br>" ); |
350 | makeLinks( it ); | 350 | makeLinks( it ); |
351 | } | 351 | } |
352 | it->processed(); | 352 | it->processed(); |
353 | // to_install.take( it->name() ); | ||
353 | out("<br><hr>"); | 354 | out("<br><hr>"); |
354 | }else{ | 355 | }else{ |
355 | out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); | 356 | out("<b>"+tr("Error while installing")+"</b><hr>"+it->name()); |
356 | } | 357 | } |
357 | } | 358 | } |
358 | out("<br>"); | 359 | out("<br>"); |
359 | } | 360 | } |
360 | 361 | ||
361 | void PmIpkg::createLinks( const QString &dest ) | 362 | void PmIpkg::createLinks( const QString &dest ) |
362 | { | 363 | { |
363 | pvDebug(2,"PmIpkg::createLinks "+dest); | 364 | pvDebug(2,"PmIpkg::createLinks "+dest); |
364 | linkOpp=createLink; | 365 | linkOpp=createLink; |
365 | QString url = settings->getDestinationUrlByName( dest ); | 366 | QString url = settings->getDestinationUrlByName( dest ); |
366 | url = url==""?dest:url; | 367 | url = url==""?dest:url; |
367 | processLinkDir( "/", url ); | 368 | processLinkDir( "/", url ); |
368 | } | 369 | } |
369 | 370 | ||
370 | void PmIpkg::removeLinks( const QString &dest ) | 371 | void PmIpkg::removeLinks( const QString &dest ) |
371 | { | 372 | { |
372 | pvDebug(2,"PmIpkg::removeLinks "+dest); | 373 | pvDebug(2,"PmIpkg::removeLinks "+dest); |
373 | linkOpp=removeLink; | 374 | linkOpp=removeLink; |
374 | QString url = settings->getDestinationUrlByName( dest ); | 375 | QString url = settings->getDestinationUrlByName( dest ); |
375 | url = url==""?dest:url; | 376 | url = url==""?dest:url; |
376 | processLinkDir( "/", url ); | 377 | processLinkDir( "/", url ); |
377 | } | 378 | } |
378 | 379 | ||
379 | void PmIpkg::update() | 380 | void PmIpkg::update() |
380 | { | 381 | { |
381 | show( false ); | 382 | show( false ); |
382 | runIpkg( "update" ); | 383 | runIpkg( "update" ); |
383 | runwindow->close(); | 384 | runwindow->close(); |
384 | } | 385 | } |
385 | 386 | ||
386 | void PmIpkg::out( QString o ) | 387 | void PmIpkg::out( QString o ) |
387 | { | 388 | { |
388 | runwindow->outPut->append(o); | 389 | runwindow->outPut->append(o); |
389 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); | 390 | //runwindow->outPut->setCursorPosition(0, runwindow->outPut->contentsHeight()); |
390 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); | 391 | //runwindow->outPut->setText( runwindow->outPut->text()+o ); |
391 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); | 392 | runwindow->outPut->setContentsPos(0, runwindow->outPut->contentsHeight()); |
392 | } | 393 | } |
393 | 394 | ||
394 | 395 | ||
395 | void PmIpkg::showButtons(bool b) | 396 | void PmIpkg::showButtons(bool b) |
396 | { | 397 | { |
397 | if ( b ) | 398 | if ( b ) |
398 | { | 399 | { |
399 | runwindow->cancelButton->hide(); | 400 | runwindow->cancelButton->hide(); |
400 | runwindow->doItButton->hide(); | 401 | runwindow->doItButton->hide(); |
401 | runwindow->removeButton->hide(); | 402 | runwindow->removeButton->hide(); |
402 | runwindow->installButton->hide(); | 403 | runwindow->installButton->hide(); |
403 | }else{ | 404 | }else{ |
404 | runwindow->cancelButton->show(); | 405 | runwindow->cancelButton->show(); |
405 | runwindow->doItButton->show(); | 406 | runwindow->doItButton->show(); |
406 | runwindow->removeButton->show(); | 407 | runwindow->removeButton->show(); |
407 | runwindow->installButton->show(); | 408 | runwindow->installButton->show(); |
408 | 409 | ||
409 | } | 410 | } |
410 | } | 411 | } |
411 | 412 | ||
412 | void PmIpkg::show(bool b) | 413 | void PmIpkg::show(bool b) |
413 | { | 414 | { |
414 | if (!runwindow->isVisible()) | 415 | if (!runwindow->isVisible()) |
415 | runwindow->showMaximized(); | 416 | runwindow->showMaximized(); |
416 | showButtons(b); | 417 | showButtons(b); |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index fa00048..3799969 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,65 +1,65 @@ | |||
1 | #ifndef PMIPKG_H | 1 | #ifndef PMIPKG_H |
2 | #define PMIPKG_H | 2 | #define PMIPKG_H |
3 | 3 | ||
4 | 4 | ||
5 | #include <qobject.h> | 5 | #include <qobject.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | #include <qwidget.h> | 8 | #include <qwidget.h> |
9 | #include "pksettings.h" | 9 | #include "pksettings.h" |
10 | #include "runwindow.h" | 10 | #include "runwindow.h" |
11 | #include "packagelist.h" | 11 | #include "packagelist.h" |
12 | #include "debug.h" | 12 | #include "debug.h" |
13 | 13 | ||
14 | #define createLink 0 | 14 | #define createLink 0 |
15 | #define removeLink 1 | 15 | #define removeLink 1 |
16 | 16 | ||
17 | class Package; | 17 | class Package; |
18 | class PmIpkg : public QObject | 18 | class PmIpkg : public QObject |
19 | { | 19 | { |
20 | Q_OBJECT | 20 | Q_OBJECT |
21 | public: | 21 | public: |
22 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 22 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
23 | ~PmIpkg(); | 23 | ~PmIpkg(); |
24 | 24 | ||
25 | int linkOpp; | 25 | int linkOpp; |
26 | void loadList( PackageList ); | 26 | void loadList( PackageList ); |
27 | void commit( PackageList ); | 27 | void commit( PackageList ); |
28 | void update(); | 28 | void update(); |
29 | void showButtons(bool b=true); | 29 | void showButtons(bool b=true); |
30 | void show( bool buttons=true ); | 30 | void show( bool buttons=true ); |
31 | 31 | ||
32 | public slots: | 32 | public slots: |
33 | void doIt(); | 33 | void doIt(); |
34 | void install(); | 34 | void install(); |
35 | void remove(); | 35 | void remove(); |
36 | void installFile(const QString &fileName, const QString &dest=""); | 36 | void installFile(const QString &fileName, const QString &dest=""); |
37 | void removeFile(const QString &fileName, const QString &dest=""); | 37 | void removeFile(const QString &fileName, const QString &dest=""); |
38 | void createLinks( const QString &dest ); | 38 | void createLinks( const QString &dest ); |
39 | void removeLinks( const QString &dest ); | 39 | void removeLinks( const QString &dest ); |
40 | 40 | ||
41 | private: | 41 | private: |
42 | int sizecount; | 42 | //int sizecount; |
43 | PackageManagerSettings* settings; | 43 | PackageManagerSettings* settings; |
44 | RunWindow *runwindow; | 44 | RunWindow *runwindow; |
45 | QDialog *installDialog; | 45 | QDialog *installDialog; |
46 | QList<Package> to_remove; | 46 | QList<Package> to_remove; |
47 | QList<Package> to_install; | 47 | QList<Package> to_install; |
48 | bool runwindowopen; | 48 | // bool runwindowopen; |
49 | QString fileNameToInstall; | 49 | QString fileNameToInstall; |
50 | QCheckBox *_force_reinstall; | 50 | QCheckBox *_force_reinstall; |
51 | QCheckBox *_force_remove; | 51 | QCheckBox *_force_remove; |
52 | QCheckBox *_force_depends; | 52 | QCheckBox *_force_depends; |
53 | void startDialog(); | 53 | void startDialog(); |
54 | void makeLinks(Package*); | 54 | void makeLinks(Package*); |
55 | void linkPackage( QString, QString ); | 55 | void linkPackage( QString, QString ); |
56 | void processLinkDir( QString , QString ); | 56 | void processLinkDir( QString , QString ); |
57 | int runIpkg(const QString& args, const QString& dest="" ); | 57 | int runIpkg(const QString& args, const QString& dest="" ); |
58 | void out( QString ); | 58 | void out( QString ); |
59 | QStringList* getList( QString, QString ); | 59 | QStringList* getList( QString, QString ); |
60 | void processFileList( QStringList*, QString ); | 60 | void processFileList( QStringList*, QString ); |
61 | 61 | ||
62 | 62 | ||
63 | }; | 63 | }; |
64 | 64 | ||
65 | #endif | 65 | #endif |
diff --git a/noncore/unsupported/oipkg/settings.h b/noncore/unsupported/oipkg/settings.h index 3be4334..bab7a4f 100644 --- a/noncore/unsupported/oipkg/settings.h +++ b/noncore/unsupported/oipkg/settings.h | |||
@@ -1,67 +1,66 @@ | |||
1 | #ifndef PACKAGEMANAGERSETTINGS_H | 1 | #ifndef PACKAGEMANAGERSETTINGS_H |
2 | #define PACKAGEMANAGERSETTINGS_H | 2 | #define PACKAGEMANAGERSETTINGS_H |
3 | 3 | ||
4 | #include "pksettingsbase.h" | 4 | #include "pksettingsbase.h" |
5 | #include <qintdict.h> | 5 | #include <qintdict.h> |
6 | 6 | ||
7 | 7 | ||
8 | class PackageManagerSettings : public PackageManagerSettingsBase | 8 | class PackageManagerSettings : public PackageManagerSettingsBase |
9 | //class PackageManagerSettings : private PackageManagerSettingsBase | 9 | //class PackageManagerSettings : private PackageManagerSettingsBase |
10 | { | 10 | { |
11 | // Q_OBJECT | 11 | // Q_OBJECT |
12 | public: | 12 | public: |
13 | PackageManagerSettings( QWidget* , const char* , WFlags ); | 13 | PackageManagerSettings( QWidget* , const char* , WFlags ); |
14 | ~PackageManagerSettings(); | 14 | ~PackageManagerSettings(); |
15 | 15 | ||
16 | bool showDialog( int ) ; | 16 | bool showDialog( int ) ; |
17 | QString getDestinationUrl(); | 17 | QString getDestinationUrl(); |
18 | QString getDestinationName(); | 18 | QString getDestinationName(); |
19 | QString getLinkDestinationName(); | 19 | QString getLinkDestinationName(); |
20 | bool createLinks(); | 20 | bool createLinks(); |
21 | QStringList getActiveServers(); | 21 | QStringList getActiveServers(); |
22 | QStringList getDestinationUrls(); | 22 | QStringList getDestinationUrls(); |
23 | 23 | ||
24 | public slots: | 24 | public slots: /** No descriptions */ |
25 | void createLinks(); | ||
26 | void removeLinks(); | ||
25 | void writeInstallationSettings(); | 27 | void writeInstallationSettings(); |
26 | void readInstallationSettings(); | 28 | void readInstallationSettings(); |
27 | void writeCurrentInstallationSetting(); | 29 | void writeCurrentInstallationSetting(); |
28 | void readInstallationSetting(int); | 30 | void readInstallationSetting(int); |
29 | void installationSettingSetName(const QString &); | 31 | void installationSettingSetName(const QString &); |
30 | void activeDestinationChange(int) | 32 | void activeDestinationChange(int) |
31 | void newServer(); | 33 | void newServer(); |
32 | void editServer(int); | 34 | void editServer(int); |
33 | void removeDestination(); | 35 | void removeDestination(); |
34 | void newDestination(); | 36 | void newDestination(); |
35 | void editDestination(int); | 37 | void editDestination(int); |
36 | void linkEnabled(bool); | 38 | void linkEnabled(bool); |
37 | void removeServer(); | 39 | void removeServer(); |
38 | void serverNameChanged(const QString&); | 40 | void serverNameChanged(const QString&); |
39 | void serverUrlChanged(const QString&); | 41 | void serverUrlChanged(const QString&); |
40 | void destNameChanged(const QString&); | 42 | void destNameChanged(const QString&); |
41 | void destUrlChanged(const QString&); | 43 | void destUrlChanged(const QString&); |
42 | void installationSettingChange(int); | 44 | void installationSettingChange(int); |
43 | void newInstallationSetting(); | 45 | void newInstallationSetting(); |
44 | void removeInstallationSetting(); | 46 | void removeInstallationSetting(); |
45 | void renameInstallationSetting(); | 47 | void renameInstallationSetting(); |
46 | 48 | ||
47 | private: | 49 | private: |
48 | QIntDict<QString> serverurlDic; | 50 | QIntDict<QString> serverurlDic; |
49 | QIntDict<QString> destinationurlDic; | 51 | QIntDict<QString> destinationurlDic; |
50 | int ipkg_old; | 52 | int ipkg_old; |
51 | int editedserver; | 53 | int editedserver; |
52 | int editeddestination; | 54 | int editeddestination; |
53 | int currentSetting; | 55 | int currentSetting; |
54 | int installationSettingsCount; | 56 | int installationSettingsCount; |
55 | bool changed; | 57 | bool changed; |
56 | 58 | ||
57 | bool readIpkgConfig(const QString&); | 59 | bool readIpkgConfig(const QString&); |
58 | void writeIpkgConfig(const QString&); | 60 | void writeIpkgConfig(const QString&); |
59 | void writeSettings(); | 61 | void writeSettings(); |
60 | void readSettings(); | 62 | void readSettings(); |
61 | }; | 63 | }; |
62 | 64 | ||
63 | #endif | 65 | #endif |
64 | /** No descriptions */ | 66 | |
65 | void createLinks(); | ||
66 | /** No descriptions */ | ||
67 | void removeLinks(); | ||