summaryrefslogtreecommitdiff
authortille <tille>2002-07-01 13:31:20 (UTC)
committer tille <tille>2002-07-01 13:31:20 (UTC)
commit1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1 (patch) (unidiff)
treeeaf5284b3841c247c9f048e6c529053ca9ded412
parent346ea8fa0d904e940659bc35fad0fc0da8cc7f80 (diff)
downloadopie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.zip
opie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.tar.gz
opie-1f42fc6dd4ef09b5a9526e81784ab3d05b9300b1.tar.bz2
cosmetics
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/mainwindow.cpp35
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp21
-rw-r--r--noncore/unsupported/oipkg/utils.cpp9
-rw-r--r--noncore/unsupported/oipkg/utils.h9
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
@@ -1,507 +1,510 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// Copyright (C) 2000 Trolltech AS. 9// Copyright (C) 2000 Trolltech AS.
10// adadpted form qpe/qipkg 10// adadpted form qpe/qipkg
11// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 11// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
12 12
13 13
14#include "mainwindow.h" 14#include "mainwindow.h"
15 15
16#include <qpe/qpemenubar.h> 16#include <qpe/qpemenubar.h>
17#include <qpe/qpemessagebox.h> 17#include <qpe/qpemessagebox.h>
18#include <qpe/resource.h> 18#include <qpe/resource.h>
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/qpetoolbar.h> 20#include <qpe/qpetoolbar.h>
21#include <qpe/qcopenvelope_qws.h> 21#include <qpe/qcopenvelope_qws.h>
22#include <qaction.h> 22#include <qaction.h>
23#include <qmessagebox.h> 23#include <qmessagebox.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25#include <qtoolbutton.h> 25#include <qtoolbutton.h>
26#include <qstring.h> 26#include <qstring.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qfile.h> 28#include <qfile.h>
29#include <qlistview.h> 29#include <qlistview.h>
30#include <qtextview.h> 30#include <qtextview.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qtabwidget.h> 33#include <qtabwidget.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qmessagebox.h> 35#include <qmessagebox.h>
36#include <qpushbutton.h> 36#include <qpushbutton.h>
37#include <qlayout.h> 37#include <qlayout.h>
38 38
39#include "pksettingsbase.h" 39#include "pksettingsbase.h"
40#include "utils.h" 40#include "utils.h"
41#include "packagelistitem.h" 41#include "packagelistitem.h"
42 42
43 43
44MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 44MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
45 QMainWindow( parent, name, f ) 45 QMainWindow( parent, name, f )
46// packageListServers( QObject(parent), name ), 46// packageListServers( QObject(parent), name ),
47// packageListSearch( parent, name ), 47// packageListSearch( parent, name ),
48// packageListDocLnk( parent, name ) 48// packageListDocLnk( parent, name )
49 { 49 {
50 setCaption( tr("Package Manager") ); 50 setCaption( tr("Package Manager") );
51 settings = new PackageManagerSettings(this,0,TRUE); 51 settings = new PackageManagerSettings(this,0,TRUE);
52 listViewPackages = new PackageListView( this,"listViewPackages",settings ); 52 listViewPackages = new PackageListView( this,"listViewPackages",settings );
53 setCentralWidget( listViewPackages ); 53 setCentralWidget( listViewPackages );
54 listViewPackages->addList( tr("feeds"), &packageListServers ); 54 listViewPackages->addList( tr("feeds"), &packageListServers );
55 listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); 55 listViewPackages->addList( tr("ipkgfind"), &packageListSearch );
56 listViewPackages->addList( tr("documents"), &packageListDocLnk ); 56 listViewPackages->addList( tr("documents"), &packageListDocLnk );
57 ipkg = new PmIpkg( settings, this ); 57 ipkg = new PmIpkg( settings, this );
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()) );
81 connect( settings->createLinksButton, SIGNAL( clicked()), 75 connect( settings->createLinksButton, SIGNAL( clicked()),
82 SLOT(createLinks()) ); 76 SLOT(createLinks()) );
83 77
84 pvDebug(9,"displayList"); 78 pvDebug(9,"displayList");
85 displayList(); 79 displayList();
86} 80}
87 81
88void MainWindow::makeMenu() 82void MainWindow::makeMenu()
89{ 83{
90 84
91 QPEToolBar *toolBar = new QPEToolBar( this ); 85 QPEToolBar *toolBar = new QPEToolBar( this );
92 QPEMenuBar *menuBar = new QPEMenuBar( toolBar ); 86 QPEMenuBar *menuBar = new QPEMenuBar( toolBar );
93 QPopupMenu *srvMenu = new QPopupMenu( menuBar ); 87 QPopupMenu *srvMenu = new QPopupMenu( menuBar );
94 QPopupMenu *viewMenu = new QPopupMenu( menuBar ); 88 QPopupMenu *viewMenu = new QPopupMenu( menuBar );
95 QPopupMenu *cfgMenu = new QPopupMenu( menuBar ); 89 QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
96 QPopupMenu *helpMenu = new QPopupMenu( menuBar ); 90 QPopupMenu *helpMenu = new QPopupMenu( menuBar );
97 91
98 setToolBarsMovable( false ); 92 setToolBarsMovable( false );
99 toolBar->setHorizontalStretchable( true ); 93 toolBar->setHorizontalStretchable( true );
100 menuBar->insertItem( tr( "Package" ), srvMenu ); 94 menuBar->insertItem( tr( "Package" ), srvMenu );
101 menuBar->insertItem( tr( "View" ), viewMenu ); 95 menuBar->insertItem( tr( "View" ), viewMenu );
102 menuBar->insertItem( tr( "Settings" ), cfgMenu ); 96 menuBar->insertItem( tr( "Settings" ), cfgMenu );
103 menuBar->insertItem( tr( "Help" ), helpMenu ); 97 menuBar->insertItem( tr( "Help" ), helpMenu );
104 98
105 QLabel *spacer; 99 QLabel *spacer;
106// spacer = new QLabel( "", toolBar ); 100// spacer = new QLabel( "", toolBar );
107// spacer->setBackgroundColor( toolBar->backgroundColor() ); 101// spacer->setBackgroundColor( toolBar->backgroundColor() );
108// toolBar->setStretchableWidget( spacer ); 102// toolBar->setStretchableWidget( spacer );
109 103
110 104
111 runAction = new QAction( tr( "Apply" ), 105 runAction = new QAction( tr( "Apply" ),
112 Resource::loadPixmap( "oipkg/install" ), 106 Resource::loadPixmap( "oipkg/install" ),
113 QString::null, 0, this, 0 ); 107 QString::null, 0, this, 0 );
114 connect( runAction, SIGNAL( activated() ), 108 connect( runAction, SIGNAL( activated() ),
115 this, SLOT( runIpkg() ) ); 109 this, SLOT( runIpkg() ) );
116 runAction->addTo( toolBar ); 110 runAction->addTo( toolBar );
117 runAction->addTo( srvMenu ); 111 runAction->addTo( srvMenu );
118 112
119 srvMenu->insertSeparator(); 113 srvMenu->insertSeparator();
120 114
121 updateAction = new QAction( tr( "Update" ), 115 updateAction = new QAction( tr( "Update" ),
122 Resource::loadIconSet( "oipkg/update" ), 116 Resource::loadIconSet( "oipkg/update" ),
123 QString::null, 0, this, 0 ); 117 QString::null, 0, this, 0 );
124 connect( updateAction, SIGNAL( activated() ), 118 connect( updateAction, SIGNAL( activated() ),
125 this , SLOT( updateList() ) ); 119 this , SLOT( updateList() ) );
126 updateAction->addTo( toolBar ); 120 updateAction->addTo( toolBar );
127 updateAction->addTo( srvMenu ); 121 updateAction->addTo( srvMenu );
128 122
129 QAction *cfgact; 123 QAction *cfgact;
130 124
131 cfgact = new QAction( tr( "Setups" ), 125 cfgact = new QAction( tr( "Setups" ),
132 QString::null, 0, this, 0 ); 126 QString::null, 0, this, 0 );
133 connect( cfgact, SIGNAL( activated() ), 127 connect( cfgact, SIGNAL( activated() ),
134 SLOT( showSettings() ) ); 128 SLOT( showSettings() ) );
135 cfgact->addTo( cfgMenu ); 129 cfgact->addTo( cfgMenu );
136 130
137 cfgact = new QAction( tr( "Servers" ), 131 cfgact = new QAction( tr( "Servers" ),
138 QString::null, 0, this, 0 ); 132 QString::null, 0, this, 0 );
139 connect( cfgact, SIGNAL( activated() ), 133 connect( cfgact, SIGNAL( activated() ),
140 SLOT( showSettingsSrv() ) ); 134 SLOT( showSettingsSrv() ) );
141 cfgact->addTo( cfgMenu ); 135 cfgact->addTo( cfgMenu );
142 cfgact = new QAction( tr( "Destinations" ), 136 cfgact = new QAction( tr( "Destinations" ),
143 QString::null, 0, this, 0 ); 137 QString::null, 0, this, 0 );
144 connect( cfgact, SIGNAL( activated() ), 138 connect( cfgact, SIGNAL( activated() ),
145 SLOT( showSettingsDst() ) ); 139 SLOT( showSettingsDst() ) );
146 cfgact->addTo( cfgMenu ); 140 cfgact->addTo( cfgMenu );
147 141
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 );
182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) ); 182 connect( a, SIGNAL( activated() ), findEdit, SLOT( clear() ) );
183 a->addTo( findBar ); 183 a->addTo( findBar );
184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 184 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 185 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
186 a->addTo( findBar ); 186 a->addTo( findBar );
187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 ); 187 findAction = new QAction( tr( "Filter" ), QString::null, 0, this, 0 );
188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) ); 188 connect( findAction, SIGNAL( toggled(bool) ), this, SLOT( findShow(bool) ) );
189 findAction->setToggleAction( true ); 189 findAction->setToggleAction( true );
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 );
203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) ); 203 connect( a, SIGNAL( activated() ), searchEdit, SLOT( clear() ) );
204 a->addTo( searchBar ); 204 a->addTo( searchBar );
205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 ); 205 searchCommit = new QAction( tr( "Do Search" ), Resource::loadPixmap( "find" ), QString::null, 0, this, 0 );
206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) ); 206 connect( searchCommit, SIGNAL( activated() ), SLOT( remotePackageQuery() ) );
207 searchCommit->addTo( searchBar ); 207 searchCommit->addTo( searchBar );
208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); 208 a = new QAction( tr( "Close Find" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 );
209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) ); 209 connect( a, SIGNAL( activated() ), this, SLOT( searchClose() ) );
210 a->addTo( searchBar ); 210 a->addTo( searchBar );
211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 ); 211 searchAction = new QAction( tr( "Search" ), QString::null, 0, this, 0 );
212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) ); 212 connect( searchAction, SIGNAL( toggled(bool) ), this, SLOT( searchShow(bool) ) );
213 searchAction->setToggleAction( true ); 213 searchAction->setToggleAction( true );
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 );
237 connect( a, SIGNAL( activated() ), SLOT( destClose() ) ); 237 connect( a, SIGNAL( activated() ), SLOT( destClose() ) );
238 a->addTo( destBar ); 238 a->addTo( destBar );
239 destBar->setStretchableWidget( CheckBoxLink ); 239 destBar->setStretchableWidget( CheckBoxLink );
240 destAction->setToggleAction( true ); 240 destAction->setToggleAction( true );
241 // destAction->addTo( viewMenu ); 241 // destAction->addTo( viewMenu );
242 242
243// helpMenu 243// helpMenu
244 helpMenu->insertSeparator(); 244 helpMenu->insertSeparator();
245 a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 ); 245 a = new QAction( tr( "Package Actions" ), QString::null, 0, this, 0 );
246 a->addTo( helpMenu ); 246 a->addTo( helpMenu );
247 helpMenu->insertSeparator(); 247 helpMenu->insertSeparator();
248 a = new QAction( tr( "Install" ), 248 a = new QAction( tr( "Install" ),
249 Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 ); 249 Resource::loadPixmap( "oipkg/install" ), QString::null, 0, this, 0 );
250 a->addTo( helpMenu ); 250 a->addTo( helpMenu );
251 a = new QAction( tr( "Remove" ), 251 a = new QAction( tr( "Remove" ),
252 Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 ); 252 Resource::loadPixmap( "oipkg/uninstall" ), QString::null, 0, this, 0 );
253 a->addTo( helpMenu ); 253 a->addTo( helpMenu );
254 helpMenu->insertSeparator(); 254 helpMenu->insertSeparator();
255 a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 ); 255 a = new QAction( tr( "Package Status" ), QString::null, 0, this, 0 );
256 a->addTo( helpMenu ); 256 a->addTo( helpMenu );
257 helpMenu->insertSeparator(); 257 helpMenu->insertSeparator();
258 a = new QAction( tr( "New version, installed" ), 258 a = new QAction( tr( "New version, installed" ),
259 Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 ); 259 Resource::loadPixmap( "oipkg/installed" ), QString::null, 0, this, 0 );
260 a->addTo( helpMenu ); 260 a->addTo( helpMenu );
261 a = new QAction( tr( "New version, not installed" ), 261 a = new QAction( tr( "New version, not installed" ),
262 Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 ); 262 Resource::loadPixmap( "oipkg/uninstalled" ), QString::null, 0, this, 0 );
263 a->addTo( helpMenu ); 263 a->addTo( helpMenu );
264 a = new QAction( tr( "Old version, installed" ), 264 a = new QAction( tr( "Old version, installed" ),
265 Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 ); 265 Resource::loadPixmap( "oipkg/installedOld" ), QString::null, 0, this, 0 );
266 a->addTo( helpMenu ); 266 a->addTo( helpMenu );
267 a = new QAction( tr( "Old version, not installed" ), 267 a = new QAction( tr( "Old version, not installed" ),
268 Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 ); 268 Resource::loadPixmap( "oipkg/uninstalledOld" ), QString::null, 0, this, 0 );
269 a->addTo( helpMenu ); 269 a->addTo( helpMenu );
270 a = new QAction( tr( "Old version, new version installed" ), 270 a = new QAction( tr( "Old version, new version installed" ),
271 Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 ); 271 Resource::loadPixmap( "oipkg/uninstalledOldinstalledNew" ), QString::null, 0, this, 0 );
272 a->addTo( helpMenu ); 272 a->addTo( helpMenu );
273 a = new QAction( tr( "New version, old version installed" ), 273 a = new QAction( tr( "New version, old version installed" ),
274 Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 ); 274 Resource::loadPixmap( "oipkg/uninstalledInstalledOld" ), QString::null, 0, this, 0 );
275 a->addTo( helpMenu ); 275 a->addTo( helpMenu );
276 //a = new QAction( tr( "" ), 276 //a = new QAction( tr( "" ),
277 // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 ); 277 // Resource::loadPixmap( "oipkg/" ), QString::null, 0, this, 0 );
278 // a->addTo( helpMenu ); 278 // a->addTo( helpMenu );
279 279
280 // configure the menus 280 // configure the menus
281 Config cfg( "oipkg", Config::User ); 281 Config cfg( "oipkg", Config::User );
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
290MainWindow::~MainWindow() 292MainWindow::~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
301void MainWindow::runIpkg() 304void MainWindow::runIpkg()
302{ 305{
303 packageListServers.allPackages(); 306 packageListServers.allPackages();
304 ipkg->loadList( &packageListSearch ); 307 ipkg->loadList( &packageListSearch );
305 ipkg->loadList( &packageListDocLnk ); 308 ipkg->loadList( &packageListDocLnk );
306 ipkg->loadList( &packageListServers ); 309 ipkg->loadList( &packageListServers );
307 ipkg->commit(); 310 ipkg->commit();
308 ipkg->clearLists(); 311 ipkg->clearLists();
309 // ##### If we looked in the list of files, we could send out accurate 312 // ##### If we looked in the list of files, we could send out accurate
310 // ##### messages. But we don't bother yet, and just do an "all". 313 // ##### messages. But we don't bother yet, and just do an "all".
311 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 314 QCopEnvelope e("QPE/System", "linkChanged(QString)");
312 QString lf = QString::null; 315 QString lf = QString::null;
313 e << lf; 316 e << lf;
314 displayList(); 317 displayList();
315} 318}
316 319
317void MainWindow::updateList() 320void MainWindow::updateList()
318{ 321{
319 packageListServers.clear(); 322 packageListServers.clear();
320 packageListSearch.clear(); 323 packageListSearch.clear();
321 324
322 packageListDocLnk.clear(); 325 packageListDocLnk.clear();
323 ipkg->update(); 326 ipkg->update();
324 packageListServers.update(); 327 packageListServers.update();
325 packageListSearch.update(); 328 packageListSearch.update();
326 packageListDocLnk.update(); 329 packageListDocLnk.update();
327} 330}
328 331
329void MainWindow::filterList() 332void MainWindow::filterList()
330{ 333{
331 QString f = ""; 334 QString f = "";
332 if ( findAction->isOn() ) f = findEdit->text(); 335 if ( findAction->isOn() ) f = findEdit->text();
333 packageListServers.filterPackages( f ); 336 packageListServers.filterPackages( f );
334} 337}
335 338
336void MainWindow::displayList() 339void MainWindow::displayList()
337{ 340{
338 filterList(); 341 filterList();
339 listViewPackages->display(); 342 listViewPackages->display();
340} 343}
341 344
342void MainWindow::sectionChanged() 345void MainWindow::sectionChanged()
343{ 346{
344 disconnect( section, SIGNAL( activated(int) ), 347 disconnect( section, SIGNAL( activated(int) ),
345 this, SLOT( sectionChanged() ) ); 348 this, SLOT( sectionChanged() ) );
346 disconnect( subsection, SIGNAL(activated(int) ), 349 disconnect( subsection, SIGNAL(activated(int) ),
347 this, SLOT( subSectionChanged() ) ); 350 this, SLOT( subSectionChanged() ) );
348 subsection->clear(); 351 subsection->clear();
349 packageListServers.setSection( section->currentText() ); 352 packageListServers.setSection( section->currentText() );
350 setSubSections(); 353 setSubSections();
351 connect( section, SIGNAL( activated(int) ), 354 connect( section, SIGNAL( activated(int) ),
352 this, SLOT( sectionChanged() ) ); 355 this, SLOT( sectionChanged() ) );
353 connect( subsection, SIGNAL(activated(int) ), 356 connect( subsection, SIGNAL(activated(int) ),
354 this, SLOT( subSectionChanged() ) ); 357 this, SLOT( subSectionChanged() ) );
355 displayList(); 358 displayList();
356} 359}
357 360
358void MainWindow::subSectionChanged() 361void MainWindow::subSectionChanged()
359{ 362{
360 disconnect( section, SIGNAL( activated(int) ), 363 disconnect( section, SIGNAL( activated(int) ),
361 this, SLOT( sectionChanged() ) ); 364 this, SLOT( sectionChanged() ) );
362 disconnect( subsection, SIGNAL(activated(int) ), 365 disconnect( subsection, SIGNAL(activated(int) ),
363 this, SLOT( subSectionChanged() ) ); 366 this, SLOT( subSectionChanged() ) );
364 packageListServers.setSubSection( subsection->currentText() ); 367 packageListServers.setSubSection( subsection->currentText() );
365 connect( section, SIGNAL( activated(int) ), 368 connect( section, SIGNAL( activated(int) ),
366 this, SLOT( sectionChanged() ) ); 369 this, SLOT( sectionChanged() ) );
367 connect( subsection, SIGNAL(activated(int) ), 370 connect( subsection, SIGNAL(activated(int) ),
368 this, SLOT( subSectionChanged() ) ); 371 this, SLOT( subSectionChanged() ) );
369 displayList(); 372 displayList();
370} 373}
371 374
372void MainWindow::setSections() 375void MainWindow::setSections()
373{ 376{
374 section->clear(); 377 section->clear();
375 section->insertStringList( packageListServers.getSections() ); 378 section->insertStringList( packageListServers.getSections() );
376} 379}
377 380
378void MainWindow::setSubSections() 381void MainWindow::setSubSections()
379{ 382{
380 subsection->clear(); 383 subsection->clear();
381 subsection->insertStringList( packageListServers.getSubSections() ); 384 subsection->insertStringList( packageListServers.getSubSections() );
382} 385}
383 386
384 387
385void MainWindow::showSettings() 388void MainWindow::showSettings()
386{ 389{
387 if ( settings->showDialog( 0 ) ) 390 if ( settings->showDialog( 0 ) )
388 updateList(); 391 updateList();
389} 392}
390void MainWindow::showSettingsSrv() 393void MainWindow::showSettingsSrv()
391{ 394{
392 if ( settings->showDialog( 1 ) ) 395 if ( settings->showDialog( 1 ) )
393 updateList(); 396 updateList();
394} 397}
395void MainWindow::showSettingsDst() 398void MainWindow::showSettingsDst()
396{ 399{
397 if ( settings->showDialog( 2 ) ) 400 if ( settings->showDialog( 2 ) )
398 updateList(); 401 updateList();
399} 402}
400 403
401void MainWindow::sectionShow(bool b) 404void MainWindow::sectionShow(bool b)
402{ 405{
403 if (b) sectionBar->show(); 406 if (b) sectionBar->show();
404 else sectionBar->hide(); 407 else sectionBar->hide();
405 sectionAction->setOn( b ); 408 sectionAction->setOn( b );
406} 409}
407 410
408void MainWindow::sectionClose() 411void MainWindow::sectionClose()
409{ 412{
410 sectionAction->setOn( false ); 413 sectionAction->setOn( false );
411} 414}
412 415
413void MainWindow::findShow(bool b) 416void MainWindow::findShow(bool b)
414{ 417{
415 if (b) findBar->show(); 418 if (b) findBar->show();
416 else findBar->hide(); 419 else findBar->hide();
417 findAction->setOn( b ); 420 findAction->setOn( b );
418} 421}
419 422
420void MainWindow::findClose() 423void MainWindow::findClose()
421{ 424{
422 findAction->setOn( false ); 425 findAction->setOn( false );
423} 426}
424 427
425void MainWindow::searchShow(bool b) 428void MainWindow::searchShow(bool b)
426{ 429{
427 if (b) searchBar->show(); 430 if (b) searchBar->show();
428 else searchBar->hide(); 431 else searchBar->hide();
429 searchAction->setOn( b ); 432 searchAction->setOn( b );
430} 433}
431 434
432void MainWindow::searchClose() 435void MainWindow::searchClose()
433{ 436{
434 searchAction->setOn( false ); 437 searchAction->setOn( false );
435} 438}
436 439
437 440
438void MainWindow::destShow(bool b) 441void MainWindow::destShow(bool b)
439{ 442{
440 if (b) destBar->show(); 443 if (b) destBar->show();
441 else destBar->hide(); 444 else destBar->hide();
442 destAction->setOn( b ); 445 destAction->setOn( b );
443} 446}
444 447
445void MainWindow::destClose() 448void MainWindow::destClose()
446{ 449{
447 destAction->setOn( false ); 450 destAction->setOn( false );
448} 451}
449 452
450void MainWindow::setDocument(const QString &fileName) 453void MainWindow::setDocument(const QString &fileName)
451{ 454{
452 if ( !QFile::exists( fileName ) ) return; 455 if ( !QFile::exists( fileName ) ) return;
453 ipkg->installFile( fileName ); 456 ipkg->installFile( fileName );
454 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 457 QCopEnvelope e("QPE/System", "linkChanged(QString)");
455 QString lf = QString::null; 458 QString lf = QString::null;
456 e << lf; 459 e << lf;
457} 460}
458 461
459 462
460void MainWindow::makeChannel() 463void MainWindow::makeChannel()
461 { 464 {
462 channel = new QCopChannel( "QPE/Application/oipkg", this ); 465 channel = new QCopChannel( "QPE/Application/oipkg", this );
463 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 466 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
464 this, SLOT(receive(const QCString&, const QByteArray&)) ); 467 this, SLOT(receive(const QCString&, const QByteArray&)) );
465} 468}
466 469
467 470
468 471
469void MainWindow::receive(const QCString &msg, const QByteArray &arg) 472void MainWindow::receive(const QCString &msg, const QByteArray &arg)
470{ 473{
471 pvDebug(3, "QCop "+msg+" "+QCString(arg)); 474 pvDebug(3, "QCop "+msg+" "+QCString(arg));
472 if ( msg == "installFile(QString)" ) 475 if ( msg == "installFile(QString)" )
473 { 476 {
474 ipkg->installFile( QString(arg) ); 477 ipkg->installFile( QString(arg) );
475 }else if( msg == "removeFile(QString)" ) 478 }else if( msg == "removeFile(QString)" )
476 { 479 {
477 ipkg->removeFile( QString(arg) ); 480 ipkg->removeFile( QString(arg) );
478 }else if( msg == "createLinks(QString)" ) 481 }else if( msg == "createLinks(QString)" )
479 { 482 {
480 ipkg->createLinks( QString(arg) ); 483 ipkg->createLinks( QString(arg) );
481 }else if( msg == "removeLinks(QString)" ) 484 }else if( msg == "removeLinks(QString)" )
482 { 485 {
483 ipkg->removeLinks( QString(arg) ); 486 ipkg->removeLinks( QString(arg) );
484 }else{ 487 }else{
485 pvDebug(2,"Huh what do ya want") 488 pvDebug(2,"Huh what do ya want")
486 } 489 }
487} 490}
488 491
489 492
490void MainWindow::createLinks() 493void MainWindow::createLinks()
491{ 494{
492 pvDebug(2,"creating links..."); 495 pvDebug(2,"creating links...");
493 ipkg->createLinks( settings->destinationurl->text() ); 496 ipkg->createLinks( settings->destinationurl->text() );
494} 497}
495 498
496void MainWindow::removeLinks() 499void MainWindow::removeLinks()
497{ 500{
498 pvDebug(2,"removing links..."); 501 pvDebug(2,"removing links...");
499 ipkg->removeLinks( settings->destinationurl->text() ); 502 ipkg->removeLinks( settings->destinationurl->text() );
500} 503}
501 504
502void MainWindow::remotePackageQuery() 505void MainWindow::remotePackageQuery()
503{ 506{
504 packageListSearch.query( searchEdit->text() ); 507 packageListSearch.query( searchEdit->text() );
505 packageListSearch.update(); 508 packageListSearch.update();
506 displayList(); 509 displayList();
507} 510}
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
@@ -1,453 +1,464 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * 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 *
4 * 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 *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10#include "pmipkg.h" 10#include "pmipkg.h"
11#include "pksettings.h" 11#include "pksettings.h"
12#include "package.h" 12#include "package.h"
13#include "packagelistitem.h" 13#include "packagelistitem.h"
14 14
15#include <opie/oprocess.h> 15#include <opie/oprocess.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18#include <qpe/stringutil.h> 18#include <qpe/stringutil.h>
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <qdir.h> 20#include <qdir.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qgroupbox.h> 22#include <qgroupbox.h>
23#include <qmultilineedit.h> 23#include <qmultilineedit.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qcheckbox.h> 25#include <qcheckbox.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27#include <qtextview.h> 27#include <qtextview.h>
28 28
29#include <qprogressbar.h> 29#include <qprogressbar.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31#include <qlayout.h> 31#include <qlayout.h>
32 32
33#include <stdlib.h> 33#include <stdlib.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#include "mainwindow.h" 36#include "mainwindow.h"
37 37
38 38
39//#define OPROCESS 39//#define OPROCESS
40 40
41PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) 41PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f )
42 : QObject ( p ) 42 : QObject ( p )
43{ 43{
44 settings = s; 44 settings = s;
45 runwindow = new RunWindow( p, name, true, f ); 45 runwindow = new RunWindow( p, name, true, f );
46#ifdef OPROCESS 46#ifdef OPROCESS
47 ipkgProcess = new OProcess(); 47 ipkgProcess = new OProcess();
48 connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), 48 connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)),
49 this, SLOT(getIpkgOutput(OProcess*,char*,int))); 49 this, SLOT(getIpkgOutput(OProcess*,char*,int)));
50 50
51 connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), 51 connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)),
52 this, SLOT(getIpkgOutput(OProcess*,char*,int))); 52 this, SLOT(getIpkgOutput(OProcess*,char*,int)));
53 installDialog = 0; 53 installDialog = 0;
54#endif 54#endif
55} 55}
56 56
57PmIpkg::~PmIpkg() 57PmIpkg::~PmIpkg()
58{ 58{
59#ifdef OPROCESS 59#ifdef OPROCESS
60 delete ipkgProcess; 60 delete ipkgProcess;
61#endif 61#endif
62} 62}
63 63
64bool PmIpkg::runIpkg(const QString& args, const QString& dest ) 64bool 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 == "" )
76 cmd += " -dest "+settings->getDestinationName(); 77 cmd += " -dest "+settings->getDestinationName();
77 else 78 else
78 cmd += " -dest "+ dest; 79 cmd += " -dest "+ dest;
79 80
80 cmd += " -force-defaults "; 81 cmd += " -force-defaults ";
81 82
82 if (installDialog && installDialog->_force_depends) 83 if (installDialog && installDialog->_force_depends)
83 { 84 {
84 if (installDialog->_force_depends->isChecked()) 85 if (installDialog->_force_depends->isChecked())
85 cmd += " -force-depends "; 86 cmd += " -force-depends ";
86 if (installDialog->_force_reinstall->isChecked()) 87 if (installDialog->_force_reinstall->isChecked())
87 cmd += " -force-reinstall "; 88 cmd += " -force-reinstall ";
88 if (installDialog->_force_remove->isChecked()) 89 if (installDialog->_force_remove->isChecked())
89 cmd += " -force-removal-of-essential-packages "; 90 cmd += " -force-removal-of-essential-packages ";
90 } 91 }
91 92
92 out( "Starting to "+ args+"\n"); 93 out( "Starting to "+ args+"\n");
93 cmd += args; 94 cmd += args;
94 out( "running:\n"+cmd+"\n" ); 95 out( "running:\n"+cmd+"\n" );
95 pvDebug(2,"running:"+cmd); 96 pvDebug(2,"running:"+cmd);
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 )
108 { 111 {
109 out( *it ); 112 out( *it );
110 cmd += *it; 113 cmd += *it;
111 } 114 }
112 115
113 pvDebug(2,"running:"+cmd); 116 pvDebug(2,"running:"+cmd);
114 qApp->processEvents(); 117 qApp->processEvents();
115// sleep(1); 118// sleep(1);
116 ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); 119 ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput);
117 if ( !ret ) { 120 if ( !ret ) {
118 pvDebug(2,"Could not execute '" + cmd); 121 pvDebug(2,"Could not execute '" + cmd);
119 out("\nError while executing "+ cmd+"\n\n"); 122 out("\nError while executing "+ cmd+"\n\n");
120 out("\nError while executing\n\n"); 123 out("\nError while executing\n\n");
121 // return false; 124 // return false;
122 } 125 }
123 126
124 while ( ipkgProcess->isRunning() ) 127 while ( ipkgProcess->isRunning() )
125 { 128 {
126 out("."); 129 out(".");
127 pvDebug(7,"wait for oprocess to terminate"); 130 pvDebug(7,"wait for oprocess to terminate");
128 qApp->processEvents(); 131 qApp->processEvents();
129 }; 132 };
130#else 133#else
131 qApp->processEvents(); 134 qApp->processEvents();
132 FILE *fp; 135 FILE *fp;
133 char line[130]; 136 char line[130];
134 QString lineStr, lineStrOld; 137 QString lineStr, lineStrOld;
135 sleep(1); 138 sleep(1);
136 cmd +=" 2>&1"; 139 cmd +=" 2>&1";
137 fp = popen( (const char *) cmd, "r"); 140 fp = popen( (const char *) cmd, "r");
138 if ( fp == NULL ) { 141 if ( fp == NULL ) {
139 qDebug("Could not execute '" + cmd + "'! err=%d", fp); 142 qDebug("Could not execute '" + cmd + "'! err=%d", fp);
140 out("\nError while executing "+ cmd+"\n\n"); 143 out("\nError while executing "+ cmd+"\n\n");
141 ret = false; 144 ret = false;
142 } else { 145 } else {
143 while ( fgets( line, sizeof line, fp) != NULL) 146 while ( fgets( line, sizeof line, fp) != NULL)
144 { 147 {
145 lineStr = line; 148 lineStr = line;
146 lineStr=lineStr.left(lineStr.length()-1); 149 lineStr=lineStr.left(lineStr.length()-1);
147 //Configuring opie-oipkg...Done 150 //Configuring opie-oipkg...Done
148 if (lineStr.contains("Done")) ret = true; 151 if (lineStr.contains("Done")) ret = true;
149 if (lineStr!=lineStrOld) 152 if (lineStr!=lineStrOld)
150 out(lineStr); 153 out(lineStr);
151 lineStrOld = lineStr; 154 lineStrOld = lineStr;
152 qApp->processEvents(); 155 qApp->processEvents();
153 } 156 }
154 } 157 }
155 pclose(fp); 158 pclose(fp);
156#endif 159#endif
157 //out( "Finished!"); 160 //out( "Finished!");
158 pvDebug(2,QString(ret?"success\n":"failure\n")); 161 pvDebug(2,QString(ret?"success\n":"failure\n"));
159 return ret; 162 return ret;
160} 163}
161 164
162void PmIpkg::makeLinks(Package *pack) 165void PmIpkg::makeLinks(Package *pack)
163{ 166{
164 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 167 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
165 QString pn = pack->name(); 168 QString pn = pack->name();
166 linkPackage( pack->packageName(), pack->dest() ); 169 linkPackage( pack->packageName(), pack->dest() );
167} 170}
168 171
169QStringList* PmIpkg::getList( QString packFileName, QString d ) 172QStringList* 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
196void PmIpkg::linkPackage( QString packFileName, QString dest ) 206void 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
203void PmIpkg::processFileList( QStringList *fileList, QString d ) 214void PmIpkg::processFileList( QStringList *fileList, QString d )
204{ 215{
205 if (!fileList) return; 216 if (!fileList) return;
206 for (uint i=0; i < fileList->count(); i++) 217 for (uint i=0; i < fileList->count(); i++)
207 { 218 {
208 QString dest = settings->getDestinationUrlByName( d ); 219 QString dest = settings->getDestinationUrlByName( d );
209 dest = dest==""?d:dest; 220 dest = dest==""?d:dest;
210 processLinkDir( (*fileList)[i], dest ); 221 processLinkDir( (*fileList)[i], dest );
211 } 222 }
212} 223}
213 224
214 225
215void PmIpkg::processLinkDir( QString file, QString dest ) 226void PmIpkg::processLinkDir( QString file, QString dest )
216{ 227{
217 pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); 228 pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest);
218 if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); 229 if (linkOpp==createLink) pvDebug( 4,"opp: createLink");
219 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); 230 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
220 if ( dest == "???" || dest == "" ) return; 231 if ( dest == "???" || dest == "" ) return;
221 QString destFile = file; 232 QString destFile = file;
222 file = dest+"/"+file; 233 file = dest+"/"+file;
223 if (file == dest) return; 234 if (file == dest) return;
224// if (linkOpp==createLink) out( "\ncreating links\n" ); 235// if (linkOpp==createLink) out( "\ncreating links\n" );
225 // if (linkOpp==removeLink) out( "\nremoving links\n" ); 236 // if (linkOpp==removeLink) out( "\nremoving links\n" );
226 QFileInfo fileInfo( file ); 237 QFileInfo fileInfo( file );
227 if ( fileInfo.isDir() ) 238 if ( fileInfo.isDir() )
228 { 239 {
229 pvDebug(4, "process dir "+file); 240 pvDebug(4, "process dir "+file);
230 QDir destDir( destFile ); 241 QDir destDir( destFile );
231 if (linkOpp==createLink) destDir.mkdir( destFile, true ); 242 if (linkOpp==createLink) destDir.mkdir( destFile, true );
232 QDir d( file ); 243 QDir d( file );
233// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 244// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
234 const QFileInfoList *list = d.entryInfoList(); 245 const QFileInfoList *list = d.entryInfoList();
235 QFileInfoListIterator it( *list ); 246 QFileInfoListIterator it( *list );
236 QFileInfo *fi; 247 QFileInfo *fi;
237 while ( (fi=it.current()) ) 248 while ( (fi=it.current()) )
238 { 249 {
239 pvDebug(4, "processLinkDir "+fi->absFilePath()); 250 pvDebug(4, "processLinkDir "+fi->absFilePath());
240 processLinkDir( fi->absFilePath(), dest ); 251 processLinkDir( fi->absFilePath(), dest );
241 ++it; 252 ++it;
242 } 253 }
243 } else 254 } else
244 if ( fileInfo.isFile() ) 255 if ( fileInfo.isFile() )
245 { 256 {
246 const char *instFile = strdup( (file).latin1() ); 257 const char *instFile = strdup( (file).latin1() );
247 const char *linkFile = strdup( (destFile).latin1()); 258 const char *linkFile = strdup( (destFile).latin1());
248 if( linkOpp==createLink ) 259 if( linkOpp==createLink )
249 { 260 {
250 pvDebug(4, "linking: "+file+" -> "+destFile ); 261 pvDebug(4, "linking: "+file+" -> "+destFile );
251 symlink( instFile, linkFile ); 262 symlink( instFile, linkFile );
252 } 263 }
253 } else { 264 } else {
254 const char *linkFile = strdup( (destFile).latin1()); 265 const char *linkFile = strdup( (destFile).latin1());
255 if( linkOpp==removeLink ) 266 if( linkOpp==removeLink )
256 { 267 {
257 QFileInfo toRemoveLink( destFile ); 268 QFileInfo toRemoveLink( destFile );
258 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() ) 269 if ( !QFile::exists( file ) && toRemoveLink.isSymLink() )
259 { 270 {
260 pvDebug(4,"removing "+destFile+" no "+file); 271 pvDebug(4,"removing "+destFile+" no "+file);
261 unlink( linkFile ); 272 unlink( linkFile );
262 } 273 }
263 } 274 }
264 } 275 }
265} 276}
266 277
267void PmIpkg::loadList( PackageList *pl ) 278void PmIpkg::loadList( PackageList *pl )
268 { 279 {
269 for( Package *pack = pl->first();pack ; (pack = pl->next()) ) 280 for( Package *pack = pl->first();pack ; (pack = pl->next()) )
270 { 281 {
271 if ( pack && (pack->name() != "") && pack) 282 if ( pack && (pack->name() != "") && pack)
272 { 283 {
273 if ( pack->toInstall() ) 284 if ( pack->toInstall() )
274 to_install.append( pack ); 285 to_install.append( pack );
275 if ( pack->toRemove() ) 286 if ( pack->toRemove() )
276 to_remove.append( pack ); 287 to_remove.append( pack );
277 } 288 }
278 } 289 }
279} 290}
280 291
281void PmIpkg::commit() 292void PmIpkg::commit()
282 { 293 {
283 int sizecount = 0; 294 int sizecount = 0;
284 installDialog = new InstallDialog(settings,0,0,true); 295 installDialog = new InstallDialog(settings,0,0,true);
285 installDialog->toRemoveItem->setOpen( true ); 296 installDialog->toRemoveItem->setOpen( true );
286 installDialog->toInstallItem->setOpen( true ); 297 installDialog->toInstallItem->setOpen( true );
287 for (uint i=0; i < to_remove.count(); i++) 298 for (uint i=0; i < to_remove.count(); i++)
288 { 299 {
289 sizecount += 1; 300 sizecount += 1;
290 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) ); 301 installDialog->toRemoveItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_remove.at(i),settings) );
291 } 302 }
292 for (uint i=0; i < to_install.count(); i++) 303 for (uint i=0; i < to_install.count(); i++)
293 { 304 {
294 sizecount += to_install.at(i)->size().toInt(); 305 sizecount += to_install.at(i)->size().toInt();
295 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) ); 306 installDialog->toInstallItem->insertItem( new PackageListItem(installDialog->ListViewPackages, to_install.at(i),settings) );
296 } 307 }
297 runwindow->progress->setTotalSteps(sizecount); 308 runwindow->progress->setTotalSteps(sizecount);
298 qDebug("Install size %i",sizecount); 309 qDebug("Install size %i",sizecount);
299 installDialog->showMaximized(); 310 installDialog->showMaximized();
300 installDialog->show(); 311 installDialog->show();
301 if ( installDialog->exec() ) 312 if ( installDialog->exec() )
302 { 313 {
303 doIt(); 314 doIt();
304 runwindow->showMaximized(); 315 runwindow->showMaximized();
305 runwindow->show(); 316 runwindow->show();
306 } 317 }
307 installDialog->close(); 318 installDialog->close();
308 delete installDialog; 319 delete installDialog;
309 installDialog = 0; 320 installDialog = 0;
310 out(tr("\nAll done.")); 321 out(tr("\nAll done."));
311} 322}
312 323
313void PmIpkg::doIt() 324void PmIpkg::doIt()
314{ 325{
315 runwindow->progress->setProgress(0); 326 runwindow->progress->setProgress(0);
316 show(); 327 show();
317 remove(); 328 remove();
318 install(); 329 install();
319} 330}
320 331
321 332
322void PmIpkg::remove() 333void PmIpkg::remove()
323{ 334{
324 if ( to_remove.count() == 0 ) return; 335 if ( to_remove.count() == 0 ) return;
325 336
326 out(tr("Removing")+"\n"+tr("please wait")+"\n\n"); 337 out(tr("Removing")+"\n"+tr("please wait")+"\n\n");
327 338
328 QStringList *fileList; 339 QStringList *fileList;
329 for (uint i=0; i < to_remove.count(); i++) 340 for (uint i=0; i < to_remove.count(); i++)
330 { 341 {
331 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() ); 342 if ( to_remove.at(i)->link() )fileList = getList( to_remove.at(i)->name(), to_remove.at(i)->dest() );
332 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() )) 343 if ( runIpkg("remove " + to_remove.at(i)->installName(), to_remove.at(i)->dest() ))
333 { 344 {
334 runwindow->progress->setProgress( 1 ); 345 runwindow->progress->setProgress( 1 );
335 linkOpp = removeLink; 346 linkOpp = removeLink;
336 to_remove.at(i)->processed(); 347 to_remove.at(i)->processed();
337 pvDebug(3,"link "+QString::number(i)); 348 pvDebug(3,"link "+QString::number(i));
338 if ( to_remove.at(i)->link() ) 349 if ( to_remove.at(i)->link() )
339 processFileList( fileList, to_remove.at(i)->dest() ); 350 processFileList( fileList, to_remove.at(i)->dest() );
340 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count())); 351 //pvDebug(3,"take "+QString::number(i)+" of "+QString::number(to_remove.count()));
341 //if ( to_remove.at(i) ) to_remove.take( i ); 352 //if ( to_remove.at(i) ) to_remove.take( i );
342 353
343 out("\n"); 354 out("\n");
344 }else{ 355 }else{
345 out(tr("Error while removing ")+to_remove.at(i)->name()+"\n"); 356 out(tr("Error while removing ")+to_remove.at(i)->name()+"\n");
346 if ( to_remove.at(i)->link() ) 357 if ( to_remove.at(i)->link() )
347 processFileList( fileList, to_remove.at(i)->dest() ); 358 processFileList( fileList, to_remove.at(i)->dest() );
348 } 359 }
349 if ( to_remove.at(i)->link() ) 360 if ( to_remove.at(i)->link() )
350 processFileList( fileList, to_remove.at(i)->dest() ); 361 processFileList( fileList, to_remove.at(i)->dest() );
351 if ( to_remove.at(i)->link() )delete fileList; 362 if ( to_remove.at(i)->link() )delete fileList;
352 } 363 }
353 to_remove.clear(); 364 to_remove.clear();
354 out("\n"); 365 out("\n");
355} 366}
356 367
357 368
358void PmIpkg::install() 369void PmIpkg::install()
359{ 370{
360 if ( to_install.count() == 0 ) return; 371 if ( to_install.count() == 0 ) return;
361 out(tr("Installing")+"\n"+tr("please wait")+"\n"); 372 out(tr("Installing")+"\n"+tr("please wait")+"\n");
362 for (uint i=0; i < to_install.count(); i++) 373 for (uint i=0; i < to_install.count(); i++)
363 { 374 {
364 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug 375 qDebug("install loop %i of %i installing %s",i,to_install.count(),to_install.at(i)->installName().latin1()); //pvDebug
365 if (to_install.at(i)->link()) 376 if (to_install.at(i)->link())
366 { 377 {
367 // hack to have package.list 378 // hack to have package.list
368 // in "dest"/usr/lib/ipkg/info/ 379 // in "dest"/usr/lib/ipkg/info/
369 QString rds = settings->getDestinationUrlByName("root"); 380 QString rds = settings->getDestinationUrlByName("root");
370 QString lds = settings->getDestinationUrlByName(to_install.at(i)->dest()); 381 QString lds = settings->getDestinationUrlByName(to_install.at(i)->dest());
371 QString listFile = "usr/lib/ipkg/lists/"+to_install.at(i)->name()+".list"; 382 QString listFile = "usr/lib/ipkg/lists/"+to_install.at(i)->name()+".list";
372 rds += listFile; 383 rds += listFile;
373 lds += listFile; 384 lds += listFile;
374 const char *rd = rds.latin1(); 385 const char *rd = rds.latin1();
375 const char *ld = lds.latin1(); 386 const char *ld = lds.latin1();
376 pvDebug(4, "linking: "+rds+" -> "+lds ); 387 pvDebug(4, "linking: "+rds+" -> "+lds );
377 symlink( rd, ld ); 388 symlink( rd, ld );
378 } 389 }
379 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() )) 390 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ))
380 { 391 {
381 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress()); 392 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
382 to_install.at(i)->processed(); 393 to_install.at(i)->processed();
383 linkOpp = createLink; 394 linkOpp = createLink;
384 if ( to_install.at(i)->link() ) 395 if ( to_install.at(i)->link() )
385 makeLinks( to_install.at(i) ); 396 makeLinks( to_install.at(i) );
386 // to_install.take( i ); 397 // to_install.take( i );
387 out("\n"); 398 out("\n");
388 }else{ 399 }else{
389 out(tr("Error while installing")+to_install.at(i)->name()+"\n"); 400 out(tr("Error while installing")+to_install.at(i)->name()+"\n");
390 linkOpp = createLink; 401 linkOpp = createLink;
391 if ( to_install.at(i)->link() ) 402 if ( to_install.at(i)->link() )
392 makeLinks( to_install.at(i) ); 403 makeLinks( to_install.at(i) );
393 } 404 }
394 } 405 }
395 out("\n"); 406 out("\n");
396 to_install.clear(); 407 to_install.clear();
397} 408}
398 409
399void PmIpkg::createLinks( const QString &dest ) 410void PmIpkg::createLinks( const QString &dest )
400{ 411{
401 pvDebug(2,"PmIpkg::createLinks "+dest); 412 pvDebug(2,"PmIpkg::createLinks "+dest);
402 linkOpp=createLink; 413 linkOpp=createLink;
403 QString url = settings->getDestinationUrlByName( dest ); 414 QString url = settings->getDestinationUrlByName( dest );
404 url = url==""?dest:url; 415 url = url==""?dest:url;
405 processLinkDir( "/opt", url ); 416 processLinkDir( "/opt", url );
406 processLinkDir( "/usr", url ); 417 processLinkDir( "/usr", url );
407} 418}
408 419
409void PmIpkg::removeLinks( const QString &dest ) 420void PmIpkg::removeLinks( const QString &dest )
410{ 421{
411 pvDebug(2,"PmIpkg::removeLinks "+dest); 422 pvDebug(2,"PmIpkg::removeLinks "+dest);
412 linkOpp=removeLink; 423 linkOpp=removeLink;
413 QString url = settings->getDestinationUrlByName( dest ); 424 QString url = settings->getDestinationUrlByName( dest );
414 url = url==""?dest:url; 425 url = url==""?dest:url;
415 processLinkDir( "/opt", url ); 426 processLinkDir( "/opt", url );
416 processLinkDir( "/usr", url ); 427 processLinkDir( "/usr", url );
417} 428}
418 429
419void PmIpkg::update() 430void PmIpkg::update()
420{ 431{
421 show(); 432 show();
422 if ( runIpkg( "update" ) ) 433 if ( runIpkg( "update" ) )
423 runwindow->close(); 434 runwindow->close();
424 else out("An error occurred!\nPlease check the log."); 435 else out("An error occurred!\nPlease check the log.");
425} 436}
426 437
427void PmIpkg::out( QString o ) 438void PmIpkg::out( QString o )
428{ 439{
429 runwindow->outPut->append(o); 440 runwindow->outPut->append(o);
430 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE); 441 runwindow->outPut->setCursorPosition(runwindow->outPut->numLines() + 1,0,FALSE);
431} 442}
432 443
433 444
434 445
435 446
436void PmIpkg::show() 447void PmIpkg::show()
437{ 448{
438 if (!runwindow->isVisible()) 449 if (!runwindow->isVisible())
439 { 450 {
440 runwindow->showMaximized(); 451 runwindow->showMaximized();
441 runwindow->show(); 452 runwindow->show();
442 } 453 }
443 runwindow->outPut->setText(""); 454 runwindow->outPut->setText("");
444} 455}
445 456
446void PmIpkg::installFile(const QString &fileName, const QString &dest) 457void PmIpkg::installFile(const QString &fileName, const QString &dest)
447{ 458{
448 459
449 to_install.clear(); 460 to_install.clear();
450 to_remove.clear(); 461 to_remove.clear();
451 pvDebug( 2,"PmIpkg::installFile "+ fileName); 462 pvDebug( 2,"PmIpkg::installFile "+ fileName);
452 Package *p = new Package(fileName,settings); 463 Package *p = new Package(fileName,settings);
453 if ( dest!="") p->setDest( dest ); 464 if ( dest!="") p->setDest( dest );
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,27 +1,20 @@
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
22void setComboName( QComboBox* combo, QString s) 15void setComboName( QComboBox* combo, QString s)
23{ 16{
24 for ( int i = 0; i < combo->count(); i++) 17 for ( int i = 0; i < combo->count(); i++)
25 if ( combo->text( i ) == s ) 18 if ( combo->text( i ) == s )
26 combo->setCurrentItem( i ); 19 combo->setCurrentItem( i );
27} 20}
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
18void setComboName( QComboBox*, QString ); 11void setComboName( QComboBox*, QString );