summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp6
-rw-r--r--noncore/settings/aqpkg/package.cpp12
-rw-r--r--noncore/settings/aqpkg/settings.ui2
3 files changed, 17 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index e8e2982..d9e62b6 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -243,116 +243,118 @@ void NetworkPackageManager :: serverSelected( int )
243 } 243 }
244 244
245 // Apply the section filter 245 // Apply the section filter
246 if ( categoryFilterEnabled && categoryFilter != "" ) 246 if ( categoryFilterEnabled && categoryFilter != "" )
247 { 247 {
248 if ( it->getSection() == "" || categoryFilter.find( it->getSection().lower() ) == -1 ) 248 if ( it->getSection() == "" || categoryFilter.find( it->getSection().lower() ) == -1 )
249 continue; 249 continue;
250 } 250 }
251 251
252 // If the local server, only display installed packages 252 // If the local server, only display installed packages
253 if ( serverName == LOCAL_SERVER && !it->isInstalled() ) 253 if ( serverName == LOCAL_SERVER && !it->isInstalled() )
254 continue; 254 continue;
255 255
256 256
257 text += it->getPackageName(); 257 text += it->getPackageName();
258 if ( it->isInstalled() ) 258 if ( it->isInstalled() )
259 { 259 {
260 text += " (installed)"; 260 text += " (installed)";
261 261
262 // If a different version of package is available, postfix it with an * 262 // If a different version of package is available, postfix it with an *
263 if ( it->getVersion() != it->getInstalledVersion() ) 263 if ( it->getVersion() != it->getInstalledVersion() )
264 { 264 {
265 265
266 if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) 266 if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 )
267 text += "*"; 267 text += "*";
268 } 268 }
269 } 269 }
270 270
271 QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox ); 271 QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox );
272 272
273 if ( it->isInstalled() ) 273 if ( it->isInstalled() )
274 { 274 {
275 QString destName = ""; 275 QString destName = "";
276 if ( it->getLocalPackage() ) 276 if ( it->getLocalPackage() )
277 { 277 {
278 if ( it->getLocalPackage()->getInstalledTo() ) 278 if ( it->getLocalPackage()->getInstalledTo() )
279 destName = it->getLocalPackage()->getInstalledTo()->getDestinationName(); 279 destName = it->getLocalPackage()->getInstalledTo()->getDestinationName();
280 } 280 }
281 else 281 else
282 { 282 {
283 if ( it->getInstalledTo() ) 283 if ( it->getInstalledTo() )
284 destName = it->getInstalledTo()->getDestinationName(); 284 destName = it->getInstalledTo()->getDestinationName();
285 } 285 }
286 if ( destName != "" ) 286 if ( destName != "" )
287 new QCheckListItem( item, QString( "Installed To - " ) + destName ); 287 new QCheckListItem( item, QString( "Installed To - " ) + destName );
288 } 288 }
289 289
290 if ( !it->isPackageStoredLocally() ) 290 if ( !it->isPackageStoredLocally() )
291 {
291 new QCheckListItem( item, QString( "Description - " ) + it->getDescription() ); 292 new QCheckListItem( item, QString( "Description - " ) + it->getDescription() );
293 new QCheckListItem( item, QString( "Size - " ) + it->getPackageSize() );
294 new QCheckListItem( item, QString( "Section - " ) + it->getSection() );
295 }
292 else 296 else
293 new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() ); 297 new QCheckListItem( item, QString( "Filename - " ) + it->getFilename() );
294 298
295 if ( serverName == LOCAL_SERVER ) 299 if ( serverName == LOCAL_SERVER )
296 { 300 {
297 new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() ); 301 new QCheckListItem( item, QString( "V. Installed - " ) + it->getVersion() );
298 } 302 }
299 else 303 else
300 { 304 {
301 new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() ); 305 new QCheckListItem( item, QString( "V. Available - " ) + it->getVersion() );
302 if ( it->getLocalPackage() ) 306 if ( it->getLocalPackage() )
303 { 307 {
304 if ( it->isInstalled() ) 308 if ( it->isInstalled() )
305 new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() ); 309 new QCheckListItem( item, QString( "V. Installed - " ) + it->getInstalledVersion() );
306 } 310 }
307 } 311 }
308 312
309 new QCheckListItem( item, QString( "Size - " ) + it->getPackageSize() );
310 new QCheckListItem( item, QString( "Section - " ) + it->getSection() );
311 packagesList->insertItem( item ); 313 packagesList->insertItem( item );
312 } 314 }
313 315
314 // If the local server or the local ipkgs server disable the download button 316 // If the local server or the local ipkgs server disable the download button
315 if ( serverName == LOCAL_SERVER ) 317 if ( serverName == LOCAL_SERVER )
316 { 318 {
317 upgrade->setEnabled( false ); 319 upgrade->setEnabled( false );
318 download->setText( "Download" ); 320 download->setText( "Download" );
319 download->setEnabled( true ); 321 download->setEnabled( true );
320 } 322 }
321 else if ( serverName == LOCAL_IPKGS ) 323 else if ( serverName == LOCAL_IPKGS )
322 { 324 {
323 upgrade->setEnabled( false ); 325 upgrade->setEnabled( false );
324 download->setEnabled( true ); 326 download->setEnabled( true );
325 download->setText( "Remove" ); 327 download->setText( "Remove" );
326 } 328 }
327 else 329 else
328 { 330 {
329 upgrade->setEnabled( true ); 331 upgrade->setEnabled( true );
330 download->setEnabled( true ); 332 download->setEnabled( true );
331 download->setText( "Download" ); 333 download->setText( "Download" );
332 } 334 }
333} 335}
334 336
335void NetworkPackageManager :: updateServer() 337void NetworkPackageManager :: updateServer()
336{ 338{
337 QString serverName = serversList->currentText(); 339 QString serverName = serversList->currentText();
338 340
339 // Update the current server 341 // Update the current server
340 // Display dialog 342 // Display dialog
341 343
342 // Disable buttons to stop silly people clicking lots on them :) 344 // Disable buttons to stop silly people clicking lots on them :)
343 345
344 // First, write out ipkg_conf file so that ipkg can use it 346 // First, write out ipkg_conf file so that ipkg can use it
345 dataMgr->writeOutIpkgConf(); 347 dataMgr->writeOutIpkgConf();
346 348
347 Ipkg ipkg; 349 Ipkg ipkg;
348 ipkg.setOption( "update" ); 350 ipkg.setOption( "update" );
349 351
350 InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true ); 352 InstallDlgImpl dlg( &ipkg, "Refreshing server package lists", this, "Upgrade", true );
351 dlg.showDlg(); 353 dlg.showDlg();
352 354
353 // Reload data 355 // Reload data
354 dataMgr->reloadServerData(); 356 dataMgr->reloadServerData();
355 serverSelected(-1); 357 serverSelected(-1);
356// delete progDlg; 358// delete progDlg;
357} 359}
358 360
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index 526de5e..db3e927 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -1,82 +1,94 @@
1/*************************************************************************** 1/***************************************************************************
2 package.cpp - description 2 package.cpp - description
3 ------------------- 3 -------------------
4 begin : Mon Aug 26 2002 4 begin : Mon Aug 26 2002
5 copyright : (C) 2002 by Andy Qua 5 copyright : (C) 2002 by Andy Qua
6 email : andy.qua@blueyonder.co.uk 6 email : andy.qua@blueyonder.co.uk
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "package.h" 18#include "package.h"
19#include "global.h" 19#include "global.h"
20 20
21Package::Package( QString &name ) 21Package::Package( QString &name )
22{ 22{
23 packageName = name; 23 packageName = name;
24
25 version = "N/A";
26 description = "N/A";
27 packageSize = "N/A";
28 section = "N/A";
29
24 localPackage = 0; 30 localPackage = 0;
25 installed = false; 31 installed = false;
26 packageStoredLocally = false; 32 packageStoredLocally = false;
27 installedToRoot = false; 33 installedToRoot = false;
28 installed = false; 34 installed = false;
29 installedTo = 0; 35 installedTo = 0;
30} 36}
31 37
32Package::Package( char *name ) 38Package::Package( char *name )
33{ 39{
34 packageName = name; 40 packageName = name;
41
42 version = "N/A";
43 description = "N/A";
44 packageSize = "N/A";
45 section = "N/A";
46
35 localPackage = 0; 47 localPackage = 0;
36 installed = false; 48 installed = false;
37 packageStoredLocally = false; 49 packageStoredLocally = false;
38 installedToRoot = false; 50 installedToRoot = false;
39 installed = false; 51 installed = false;
40 installedTo = 0; 52 installedTo = 0;
41} 53}
42 54
43Package::~Package() 55Package::~Package()
44{ 56{
45} 57}
46 58
47QString Package :: toString() 59QString Package :: toString()
48{ 60{
49 QString ret = "Package - " + getPackageName() + 61 QString ret = "Package - " + getPackageName() +
50 "\n version - " + getVersion(); 62 "\n version - " + getVersion();
51 63
52 if ( localPackage ) 64 if ( localPackage )
53 ret += "\n inst version - " + localPackage->getVersion(); 65 ret += "\n inst version - " + localPackage->getVersion();
54 66
55 67
56 return ret; 68 return ret;
57} 69}
58 70
59void Package :: setStatus( const QString &s ) 71void Package :: setStatus( const QString &s )
60{ 72{
61 status = s; 73 status = s;
62 74
63 if ( status.find( "installed" ) != -1 ) 75 if ( status.find( "installed" ) != -1 )
64 installed = true; 76 installed = true;
65} 77}
66 78
67void Package :: setLocalPackage( Package *p ) 79void Package :: setLocalPackage( Package *p )
68{ 80{
69 localPackage = p; 81 localPackage = p;
70 82
71 if ( localPackage ) 83 if ( localPackage )
72 if ( localPackage->getVersion() != getVersion() ) 84 if ( localPackage->getVersion() != getVersion() )
73 differentVersionAvailable = true; 85 differentVersionAvailable = true;
74 else 86 else
75 differentVersionAvailable = false; 87 differentVersionAvailable = false;
76} 88}
77 89
78void Package :: setVersion( const QString &v ) 90void Package :: setVersion( const QString &v )
79{ 91{
80 version = v; 92 version = v;
81 93
82 if ( localPackage ) 94 if ( localPackage )
diff --git a/noncore/settings/aqpkg/settings.ui b/noncore/settings/aqpkg/settings.ui
index c2db861..44e8fd9 100644
--- a/noncore/settings/aqpkg/settings.ui
+++ b/noncore/settings/aqpkg/settings.ui
@@ -434,97 +434,97 @@
434 <widget row="1" column="0" > 434 <widget row="1" column="0" >
435 <class>QLabel</class> 435 <class>QLabel</class>
436 <property stdset="1"> 436 <property stdset="1">
437 <name>name</name> 437 <name>name</name>
438 <cstring>TextLabel1_3_2_2</cstring> 438 <cstring>TextLabel1_3_2_2</cstring>
439 </property> 439 </property>
440 <property stdset="1"> 440 <property stdset="1">
441 <name>text</name> 441 <name>text</name>
442 <string>URL:</string> 442 <string>URL:</string>
443 </property> 443 </property>
444 </widget> 444 </widget>
445 <widget row="3" column="1" > 445 <widget row="3" column="1" >
446 <class>QPushButton</class> 446 <class>QPushButton</class>
447 <property stdset="1"> 447 <property stdset="1">
448 <name>name</name> 448 <name>name</name>
449 <cstring>btnChangeDest</cstring> 449 <cstring>btnChangeDest</cstring>
450 </property> 450 </property>
451 <property stdset="1"> 451 <property stdset="1">
452 <name>text</name> 452 <name>text</name>
453 <string>Change</string> 453 <string>Change</string>
454 </property> 454 </property>
455 </widget> 455 </widget>
456 <widget row="0" column="1" > 456 <widget row="0" column="1" >
457 <class>QLineEdit</class> 457 <class>QLineEdit</class>
458 <property stdset="1"> 458 <property stdset="1">
459 <name>name</name> 459 <name>name</name>
460 <cstring>destinationname</cstring> 460 <cstring>destinationname</cstring>
461 </property> 461 </property>
462 </widget> 462 </widget>
463 <widget row="0" column="0" > 463 <widget row="0" column="0" >
464 <class>QLabel</class> 464 <class>QLabel</class>
465 <property stdset="1"> 465 <property stdset="1">
466 <name>name</name> 466 <name>name</name>
467 <cstring>TextLabel1_3_2</cstring> 467 <cstring>TextLabel1_3_2</cstring>
468 </property> 468 </property>
469 <property stdset="1"> 469 <property stdset="1">
470 <name>text</name> 470 <name>text</name>
471 <string>Name:</string> 471 <string>Name:</string>
472 </property> 472 </property>
473 </widget> 473 </widget>
474 <widget row="2" column="1" > 474 <widget row="2" column="1" >
475 <class>QCheckBox</class> 475 <class>QCheckBox</class>
476 <property stdset="1"> 476 <property stdset="1">
477 <name>name</name> 477 <name>name</name>
478 <cstring>linkToRoot</cstring> 478 <cstring>linkToRoot</cstring>
479 </property> 479 </property>
480 <property stdset="1"> 480 <property stdset="1">
481 <name>text</name> 481 <name>text</name>
482 <string>LinkToRoot</string> 482 <string>Link To Root</string>
483 </property> 483 </property>
484 <property stdset="1"> 484 <property stdset="1">
485 <name>checked</name> 485 <name>checked</name>
486 <bool>true</bool> 486 <bool>true</bool>
487 </property> 487 </property>
488 </widget> 488 </widget>
489 <widget row="1" column="1" > 489 <widget row="1" column="1" >
490 <class>QLineEdit</class> 490 <class>QLineEdit</class>
491 <property stdset="1"> 491 <property stdset="1">
492 <name>name</name> 492 <name>name</name>
493 <cstring>destinationurl</cstring> 493 <cstring>destinationurl</cstring>
494 </property> 494 </property>
495 </widget> 495 </widget>
496 </grid> 496 </grid>
497 </widget> 497 </widget>
498 </grid> 498 </grid>
499 </widget> 499 </widget>
500 <widget> 500 <widget>
501 <class>QWidget</class> 501 <class>QWidget</class>
502 <property stdset="1"> 502 <property stdset="1">
503 <name>name</name> 503 <name>name</name>
504 <cstring>tab</cstring> 504 <cstring>tab</cstring>
505 </property> 505 </property>
506 <attribute> 506 <attribute>
507 <name>title</name> 507 <name>title</name>
508 <string>General</string> 508 <string>General</string>
509 </attribute> 509 </attribute>
510 <widget> 510 <widget>
511 <class>QLabel</class> 511 <class>QLabel</class>
512 <property stdset="1"> 512 <property stdset="1">
513 <name>name</name> 513 <name>name</name>
514 <cstring>TextLabel1</cstring> 514 <cstring>TextLabel1</cstring>
515 </property> 515 </property>
516 <property stdset="1"> 516 <property stdset="1">
517 <name>geometry</name> 517 <name>geometry</name>
518 <rect> 518 <rect>
519 <x>20</x> 519 <x>20</x>
520 <y>30</y> 520 <y>30</y>
521 <width>150</width> 521 <width>150</width>
522 <height>20</height> 522 <height>20</height>
523 </rect> 523 </rect>
524 </property> 524 </property>
525 <property stdset="1"> 525 <property stdset="1">
526 <name>text</name> 526 <name>text</name>
527 <string>(Will take effect on restart)</string> 527 <string>(Will take effect on restart)</string>
528 </property> 528 </property>
529 </widget> 529 </widget>
530 <widget> 530 <widget>