-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 | |||
@@ -40,59 +40,53 @@ | |||
40 | #include "utils.h" | 40 | #include "utils.h" |
41 | #include "packagelistitem.h" | 41 | #include "packagelistitem.h" |
42 | 42 | ||
43 | 43 | ||
44 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 44 | MainWindow::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 | ||
88 | void MainWindow::makeMenu() | 82 | void 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 ); |
@@ -130,125 +124,131 @@ void MainWindow::makeMenu() | |||
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(); |
@@ -264,58 +264,61 @@ void MainWindow::makeMenu() | |||
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 | ||
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(); |
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 | ||
317 | void MainWindow::updateList() | 320 | void MainWindow::updateList() |
318 | { | 321 | { |
319 | packageListServers.clear(); | 322 | packageListServers.clear(); |
320 | packageListSearch.clear(); | 323 | packageListSearch.clear(); |
321 | 324 | ||
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 | |||
@@ -46,80 +46,83 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag | |||
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 | ||
57 | PmIpkg::~PmIpkg() | 57 | PmIpkg::~PmIpkg() |
58 | { | 58 | { |
59 | #ifdef OPROCESS | 59 | #ifdef OPROCESS |
60 | delete ipkgProcess; | 60 | delete ipkgProcess; |
61 | #endif | 61 | #endif |
62 | } | 62 | } |
63 | 63 | ||
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 == "" ) |
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 | { |
@@ -149,73 +152,81 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
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 | ||
162 | void PmIpkg::makeLinks(Package *pack) | 165 | void 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 | ||
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 ) |
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 | ||
215 | void PmIpkg::processLinkDir( QString file, QString dest ) | 226 | void 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; |
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 | ||
22 | void setComboName( QComboBox* combo, QString s) | 15 | void 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 | ||
18 | void setComboName( QComboBox*, QString ); | 11 | void setComboName( QComboBox*, QString ); |