summaryrefslogtreecommitdiff
authorandyq <andyq>2002-11-21 18:57:01 (UTC)
committer andyq <andyq>2002-11-21 18:57:01 (UTC)
commite6cb9bb71d4849263ada2f5549c85740c96b065a (patch) (unidiff)
treed44c457f77722342ccb5a0c7b99dcfcae6f17a94
parent1efe11a03d5cd3c0b81c5fee7d0e88dca2e06da8 (diff)
downloadopie-e6cb9bb71d4849263ada2f5549c85740c96b065a.zip
opie-e6cb9bb71d4849263ada2f5549c85740c96b065a.tar.gz
opie-e6cb9bb71d4849263ada2f5549c85740c96b065a.tar.bz2
Package sections default to N/A unless they are set (description, etc), changed LinkToRoot to Link To Root, and couple of other small fixes
Diffstat (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
@@ -259,84 +259,86 @@ void NetworkPackageManager :: serverSelected( int )
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 :)
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,66 +1,78 @@
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
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
@@ -450,65 +450,65 @@
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>