-rw-r--r-- | noncore/unsupported/oipkg/mainwindow.cpp | 35 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 21 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/utils.cpp | 9 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/utils.h | 9 |
4 files changed, 37 insertions, 37 deletions
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 084900d..53db477 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -58,23 +58,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
58 | packageListServers.setSettings( settings ); | 58 | packageListServers.setSettings( settings ); |
59 | packageListSearch.setSettings( settings ); | 59 | packageListSearch.setSettings( settings ); |
60 | packageListDocLnk.setSettings( settings ); | 60 | packageListDocLnk.setSettings( settings ); |
61 | pvDebug(9,"packageListServers.update"); | 61 | pvDebug(9,"packageListServers.update"); |
62 | packageListServers.update(); | 62 | packageListServers.update(); |
63 | pvDebug(9,"packageListDocLnk.update"); | 63 | pvDebug(9,"packageListDocLnk.update"); |
64 | pvDebug(0,"no UPDATE of DocLnk"); | ||
65 | packageListDocLnk.update(); | 64 | packageListDocLnk.update(); |
66 | pvDebug(9,"makeMenu"); | 65 | pvDebug(9,"makeMenu"); |
67 | makeMenu(); | 66 | makeMenu(); |
68 | makeChannel(); | 67 | makeChannel(); |
69 | //opie is hardcoded default ;) | 68 | |
70 | //pvDebug(9,"section->setCurrentItem"); | ||
71 | // for (int i=0;i<section->count();i++) | ||
72 | // if (section->text(i)=="opie") | ||
73 | // section->setCurrentItem(i); | ||
74 | // sectionChanged(); | ||
75 | 69 | ||
76 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); | 70 | connect( section, SIGNAL(activated(int)), SLOT(sectionChanged()) ); |
77 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); | 71 | connect( subsection, SIGNAL(activated(int)), SLOT(subSectionChanged()) ); |
78 | 72 | ||
79 | connect( settings->removeLinksButton, SIGNAL( clicked()), | 73 | connect( settings->removeLinksButton, SIGNAL( clicked()), |
80 | SLOT(removeLinks()) ); | 74 | SLOT(removeLinks()) ); |
@@ -148,34 +142,40 @@ void MainWindow::makeMenu() | |||
148 | QAction *a; | 142 | QAction *a; |
149 | 143 | ||
150 | // SECTIONS | 144 | // SECTIONS |
151 | sectionBar = new QPEToolBar( this ); | 145 | sectionBar = new QPEToolBar( this ); |
152 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); | 146 | addToolBar( sectionBar, "Section", QMainWindow::Top, TRUE ); |
153 | sectionBar->setHorizontalStretchable( true ); | 147 | sectionBar->setHorizontalStretchable( true ); |
154 | QLabel *label = new QLabel( tr("Section: "), sectionBar ); | 148 | QLabel *label = new QLabel( sectionBar, "section" ); |
155 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 149 | // label->setBackgroundMode( NoBackground ); |
150 | label->font().setPointSize( 8 ); | ||
151 | label->setText( tr( "Section:" ) ); | ||
152 | sectionBar->setStretchableWidget( label ); | ||
156 | section = new QComboBox( false, sectionBar ); | 153 | section = new QComboBox( false, sectionBar ); |
154 | section->font().setPointSize( 8 ); | ||
157 | label = new QLabel( " / ", sectionBar ); | 155 | label = new QLabel( " / ", sectionBar ); |
158 | label->setBackgroundColor( sectionBar->backgroundColor() ); | 156 | label->font().setPointSize( 8 ); |
157 | // label->setBackgroundMode( PaletteForeground ); | ||
159 | subsection = new QComboBox( false, sectionBar ); | 158 | subsection = new QComboBox( false, sectionBar ); |
159 | subsection->font().setPointSize( 8 ); | ||
160 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 160 | a = new QAction( tr( "Close Section" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
161 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); | 161 | connect( a, SIGNAL( activated() ), this, SLOT( sectionClose() ) ); |
162 | a->addTo( sectionBar ); | 162 | a->addTo( sectionBar ); |
163 | setSections(); | 163 | setSections(); |
164 | setSubSections(); | 164 | setSubSections(); |
165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); | 165 | sectionAction = new QAction( tr( "Sections" ), QString::null, 0, this, 0 ); |
166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); | 166 | connect( sectionAction, SIGNAL( toggled(bool) ), this, SLOT( sectionShow(bool) ) ); |
167 | sectionAction->setToggleAction( true ); | 167 | sectionAction->setToggleAction( true ); |
168 | sectionAction->addTo( viewMenu ); | 168 | sectionAction->addTo( viewMenu ); |
169 | sectionBar->setStretchableWidget( section ); | 169 | // sectionBar->setStretchableWidget( section ); |
170 | 170 | ||
171 | //FIND | 171 | //FIND |
172 | findBar = new QPEToolBar(this); | 172 | findBar = new QPEToolBar(this); |
173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); | 173 | addToolBar( findBar, "Filter", QMainWindow::Top, TRUE ); |
174 | label = new QLabel( tr("Filter: "), findBar ); | 174 | label = new QLabel( tr("Filter: "), findBar ); |
175 | label->setBackgroundColor( findBar->backgroundColor() ); | 175 | // label->setBackgroundMode( PaletteForeground ); |
176 | findBar->setHorizontalStretchable( TRUE ); | 176 | findBar->setHorizontalStretchable( TRUE ); |
177 | findEdit = new QLineEdit( findBar, "findEdit" ); | 177 | findEdit = new QLineEdit( findBar, "findEdit" ); |
178 | findBar->setStretchableWidget( findEdit ); | 178 | findBar->setStretchableWidget( findEdit ); |
179 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), | 179 | connect( findEdit, SIGNAL( textChanged( const QString & ) ), |
180 | this, SLOT( displayList() ) ); | 180 | this, SLOT( displayList() ) ); |
181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 181 | a = new QAction( tr( "Clear Find" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
@@ -190,13 +190,13 @@ void MainWindow::makeMenu() | |||
190 | findAction->addTo( viewMenu ); | 190 | findAction->addTo( viewMenu ); |
191 | 191 | ||
192 | //SEARCH | 192 | //SEARCH |
193 | searchBar = new QPEToolBar(this); | 193 | searchBar = new QPEToolBar(this); |
194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); | 194 | addToolBar( searchBar, "Search", QMainWindow::Top, TRUE ); |
195 | label = new QLabel( tr("ipkgfind: "), searchBar ); | 195 | label = new QLabel( tr("ipkgfind: "), searchBar ); |
196 | label->setBackgroundColor( searchBar->backgroundColor() ); | 196 | // label->setBackgroundMode( PaletteForeground ); |
197 | searchBar->setHorizontalStretchable( TRUE ); | 197 | searchBar->setHorizontalStretchable( TRUE ); |
198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); | 198 | searchEdit = new QLineEdit( searchBar, "seachEdit" ); |
199 | searchBar->setStretchableWidget( searchEdit ); | 199 | searchBar->setStretchableWidget( searchEdit ); |
200 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), | 200 | // connect( searchEdit, SIGNAL( textChanged( const QString & ) ), |
201 | // this, SLOT( displayList() ) ); | 201 | // this, SLOT( displayList() ) ); |
202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); | 202 | a = new QAction( tr( "Clear Search" ), Resource::loadPixmap( "back" ), QString::null, 0, this, 0 ); |
@@ -214,23 +214,23 @@ void MainWindow::makeMenu() | |||
214 | searchAction->addTo( viewMenu ); | 214 | searchAction->addTo( viewMenu ); |
215 | 215 | ||
216 | //DEST | 216 | //DEST |
217 | destBar = new QPEToolBar(this); | 217 | destBar = new QPEToolBar(this); |
218 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); | 218 | addToolBar( destBar, "Destination", QMainWindow::Top, TRUE ); |
219 | label = new QLabel( tr("Destination: "), destBar ); | 219 | label = new QLabel( tr("Destination: "), destBar ); |
220 | label->setBackgroundColor( destBar->backgroundColor() ); | 220 | // label->setBackgroundMode( PaletteForeground ); |
221 | destBar->setHorizontalStretchable( TRUE ); | 221 | destBar->setHorizontalStretchable( TRUE ); |
222 | destination = new QComboBox( false, destBar ); | 222 | destination = new QComboBox( false, destBar ); |
223 | destination->insertStringList( settings->getDestinationNames() ); | 223 | destination->insertStringList( settings->getDestinationNames() ); |
224 | setComboName(destination,settings->getDestinationName()); | 224 | setComboName(destination,settings->getDestinationName()); |
225 | connect( destination, SIGNAL(activated(int)), | 225 | connect( destination, SIGNAL(activated(int)), |
226 | settings, SLOT(activeDestinationChange(int)) ); | 226 | settings, SLOT(activeDestinationChange(int)) ); |
227 | spacer = new QLabel( " ", destBar ); | 227 | spacer = new QLabel( " ", destBar ); |
228 | spacer->setBackgroundColor( destBar->backgroundColor() ); | 228 | // spacer->setBackgroundMode( PaletteForeground ); |
229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); | 229 | CheckBoxLink = new QCheckBox( tr("Link"), destBar); |
230 | CheckBoxLink->setBackgroundColor( destBar->backgroundColor() ); | 230 | // CheckBoxLink->setBackgroundMode( PaletteForeground ); |
231 | CheckBoxLink->setChecked( settings->createLinks() ); | 231 | CheckBoxLink->setChecked( settings->createLinks() ); |
232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), | 232 | connect( CheckBoxLink, SIGNAL(toggled(bool)), |
233 | settings, SLOT(linkEnabled(bool)) ); | 233 | settings, SLOT(linkEnabled(bool)) ); |
234 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); | 234 | destAction = new QAction( tr( "Destinations" ), QString::null, 0, this, 0 ); |
235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); | 235 | connect( destAction, SIGNAL( toggled(bool) ), SLOT( destShow(bool) ) ); |
236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 236 | a = new QAction( tr( "Close Destinations" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
@@ -282,22 +282,25 @@ void MainWindow::makeMenu() | |||
282 | cfg.setGroup( "gui" ); | 282 | cfg.setGroup( "gui" ); |
283 | 283 | ||
284 | findShow( cfg.readBoolEntry( "findBar", true ) ); | 284 | findShow( cfg.readBoolEntry( "findBar", true ) ); |
285 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); | 285 | searchShow( cfg.readBoolEntry( "searchBar", true ) ); |
286 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); | 286 | sectionShow( cfg.readBoolEntry( "sectionBar", true ) ); |
287 | destShow( cfg.readBoolEntry( "destBar", false ) ); | 287 | destShow( cfg.readBoolEntry( "destBar", false ) ); |
288 | setComboName(section,cfg.readEntry("default_section")); | ||
289 | sectionChanged(); | ||
288 | } | 290 | } |
289 | 291 | ||
290 | MainWindow::~MainWindow() | 292 | MainWindow::~MainWindow() |
291 | { | 293 | { |
292 | Config cfg( "oipkg", Config::User ); | 294 | Config cfg( "oipkg", Config::User ); |
293 | cfg.setGroup( "gui" ); | 295 | cfg.setGroup( "gui" ); |
294 | cfg.writeEntry( "findBar", !findBar->isHidden() ); | 296 | cfg.writeEntry( "findBar", !findBar->isHidden() ); |
295 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); | 297 | cfg.writeEntry( "searchBar", !searchBar->isHidden() ); |
296 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); | 298 | cfg.writeEntry( "sectionBar", !sectionBar->isHidden() ); |
297 | cfg.writeEntry( "destBar", !destBar->isHidden() ); | 299 | cfg.writeEntry( "destBar", !destBar->isHidden() ); |
300 | cfg.writeEntry( "default_section", section->currentText() ); | ||
298 | 301 | ||
299 | } | 302 | } |
300 | 303 | ||
301 | void MainWindow::runIpkg() | 304 | void MainWindow::runIpkg() |
302 | { | 305 | { |
303 | packageListServers.allPackages(); | 306 | packageListServers.allPackages(); |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index de1f162..4a8a389 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -64,12 +64,13 @@ PmIpkg::~PmIpkg() | |||
64 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | 64 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) |
65 | { | 65 | { |
66 | bool ret=false; | 66 | bool ret=false; |
67 | QDir::setCurrent("/tmp"); | 67 | QDir::setCurrent("/tmp"); |
68 | QString cmd = "/usr/bin/ipkg "; | 68 | QString cmd = "/usr/bin/ipkg "; |
69 | #ifdef OPROCESS | 69 | #ifdef OPROCESS |
70 | ipkgProcess->kill(); | ||
70 | ipkgProcess->clearArguments(); | 71 | ipkgProcess->clearArguments(); |
71 | *ipkgProcess << "/usr/bin/ipkg "; | 72 | *ipkgProcess << "/usr/bin/ipkg "; |
72 | cmd = ""; | 73 | cmd = ""; |
73 | #endif | 74 | #endif |
74 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 75 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
75 | if ( dest == "" ) | 76 | if ( dest == "" ) |
@@ -96,12 +97,14 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
96 | #ifdef OPROCESS | 97 | #ifdef OPROCESS |
97 | *ipkgProcess << args; | 98 | *ipkgProcess << args; |
98 | out( "running:\n" + cmd); | 99 | out( "running:\n" + cmd); |
99 | *ipkgProcess << cmd; | 100 | *ipkgProcess << cmd; |
100 | 101 | ||
101 | //debug | 102 | //debug |
103 | delete ipkgProcess; | ||
104 | ipkgProcess = new OProcess(); | ||
102 | ipkgProcess->clearArguments(); | 105 | ipkgProcess->clearArguments(); |
103 | *ipkgProcess << "/bin/ls "; | 106 | *ipkgProcess << "/bin/ls "; |
104 | //debug | 107 | //debug |
105 | QValueList<QCString> a = ipkgProcess->args(); | 108 | QValueList<QCString> a = ipkgProcess->args(); |
106 | QValueList<QCString>::Iterator it; | 109 | QValueList<QCString>::Iterator it; |
107 | for( it = a.begin(); it != a.end(); ++it ) | 110 | for( it = a.begin(); it != a.end(); ++it ) |
@@ -167,37 +170,45 @@ void PmIpkg::makeLinks(Package *pack) | |||
167 | } | 170 | } |
168 | 171 | ||
169 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 172 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
170 | { | 173 | { |
171 | QString dest = settings->getDestinationUrlByName( d ); | 174 | QString dest = settings->getDestinationUrlByName( d ); |
172 | dest = dest==""?d:dest; | 175 | dest = dest==""?d:dest; |
173 | if (dest == "/" ) return 0; | 176 | // if (dest == "/" ) return 0; |
174 | { | 177 | { |
175 | Config cfg( "oipkg", Config::User ); | 178 | Config cfg( "oipkg", Config::User ); |
176 | cfg.setGroup( "Common" ); | 179 | cfg.setGroup( "Common" ); |
177 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 180 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
178 | } | 181 | } |
179 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 182 | QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
180 | QFile f( packFileName ); | 183 | QFile f( packFileName ); |
181 | if ( ! f.open(IO_ReadOnly) ) | 184 | if ( ! f.open(IO_ReadOnly) ) |
182 | { | 185 | { |
183 | pvDebug(1," Panik! Could not open"); | 186 | out( "Could not open:\n"+packFileDir ); |
184 | out( "Panik!\n Could not open:\n"+packFileName ); | 187 | f.close(); |
185 | return (QStringList*)0; | 188 | packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; |
189 | f.setName( packFileDir ); | ||
190 | if ( ! f.open(IO_ReadOnly) ) | ||
191 | { | ||
192 | qDebug(" Panik! Could not open"+packFileDir); | ||
193 | out( "Could not open:\n"+packFileDir+"\n Panik!" ); | ||
194 | } | ||
186 | } | 195 | } |
187 | QStringList *fileList = new QStringList(); | 196 | QStringList *fileList = new QStringList(); |
188 | QTextStream t( &f ); | 197 | QTextStream t( &f ); |
189 | while ( !t.eof() ) | 198 | while ( !t.eof() ) |
190 | { | 199 | { |
191 | *fileList += t.readLine(); | 200 | *fileList += t.readLine(); |
192 | } | 201 | } |
202 | f.close(); | ||
193 | return fileList; | 203 | return fileList; |
194 | } | 204 | } |
195 | 205 | ||
196 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 206 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
197 | { | 207 | { |
208 | if (dest == "root" || dest == "/" ) return; | ||
198 | QStringList *fileList = getList( packFileName, dest ); | 209 | QStringList *fileList = getList( packFileName, dest ); |
199 | processFileList( fileList, dest ); | 210 | processFileList( fileList, dest ); |
200 | delete fileList; | 211 | delete fileList; |
201 | } | 212 | } |
202 | 213 | ||
203 | void PmIpkg::processFileList( QStringList *fileList, QString d ) | 214 | void PmIpkg::processFileList( QStringList *fileList, QString d ) |
diff --git a/noncore/unsupported/oipkg/utils.cpp b/noncore/unsupported/oipkg/utils.cpp index 66dcf10..6821343 100644 --- a/noncore/unsupported/oipkg/utils.cpp +++ b/noncore/unsupported/oipkg/utils.cpp | |||
@@ -1,22 +1,15 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | utils.cpp - description | ||
3 | ------------------- | ||
4 | begin : Sun Apr 28 2002 | ||
5 | copyright : (C) 2002 by tille | ||
6 | email : tille@handhelds.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | 2 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
15 | * * | 7 | * * |
16 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
17 | 10 | ||
18 | #include <qcombobox.h> | 11 | #include <qcombobox.h> |
19 | #include <qstring.h> | 12 | #include <qstring.h> |
20 | #include "utils.h" | 13 | #include "utils.h" |
21 | 14 | ||
22 | void setComboName( QComboBox* combo, QString s) | 15 | void setComboName( QComboBox* combo, QString s) |
diff --git a/noncore/unsupported/oipkg/utils.h b/noncore/unsupported/oipkg/utils.h index ecc70dc..da33eda 100644 --- a/noncore/unsupported/oipkg/utils.h +++ b/noncore/unsupported/oipkg/utils.h | |||
@@ -1,18 +1,11 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | utils.h - description | ||
3 | ------------------- | ||
4 | begin : Sun Apr 28 2002 | ||
5 | copyright : (C) 2002 by tille | ||
6 | email : tille@handhelds.org | ||
7 | ***************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
10 | * * | 2 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
15 | * * | 7 | * * |
16 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | ||
17 | 10 | ||
18 | void setComboName( QComboBox*, QString ); | 11 | void setComboName( QComboBox*, QString ); |