-rw-r--r-- | noncore/settings/aqpkg/aqpkg.pro | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/main.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 5 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 85 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.h | 4 |
5 files changed, 47 insertions, 58 deletions
diff --git a/noncore/settings/aqpkg/aqpkg.pro b/noncore/settings/aqpkg/aqpkg.pro index 5fc323a..b69bae4 100644 --- a/noncore/settings/aqpkg/aqpkg.pro +++ b/noncore/settings/aqpkg/aqpkg.pro | |||
@@ -1,3 +1,3 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on release |
3 | HEADERS = global.h \ | 3 | HEADERS = global.h \ |
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp index 53c392e..15ef9d6 100644 --- a/noncore/settings/aqpkg/main.cpp +++ b/noncore/settings/aqpkg/main.cpp | |||
@@ -17,5 +17,2 @@ | |||
17 | 17 | ||
18 | #include <iostream> | ||
19 | using namespace std; | ||
20 | |||
21 | #ifdef QWS | 18 | #ifdef QWS |
@@ -37,3 +34,3 @@ int main(int argc, char *argv[]) | |||
37 | { | 34 | { |
38 | cout << "Root dir = " << ROOT << endl; | 35 | // cout << "Root dir = " << ROOT << endl; |
39 | #ifdef QWS | 36 | #ifdef QWS |
@@ -46,3 +43,3 @@ int main(int argc, char *argv[]) | |||
46 | // Disable suspend mode | 43 | // Disable suspend mode |
47 | cout << "Disabling suspend mode" << endl; | 44 | // cout << "Disabling suspend mode" << endl; |
48 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; | 45 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; |
@@ -58,3 +55,3 @@ int main(int argc, char *argv[]) | |||
58 | // Reenable suspend mode | 55 | // Reenable suspend mode |
59 | cout << "Enabling suspend mode" << endl; | 56 | // cout << "Enabling suspend mode" << endl; |
60 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 57 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 1a2ac37..d79673f 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -17,5 +17,2 @@ | |||
17 | 17 | ||
18 | #include <iostream> | ||
19 | using namespace std; | ||
20 | |||
21 | #include <qpe/qpemenubar.h> | 18 | #include <qpe/qpemenubar.h> |
@@ -226,3 +223,3 @@ void MainWindow :: setDocument( const QString &doc ) | |||
226 | QString package = Utils::getPackageNameFromIpkFilename( doc ); | 223 | QString package = Utils::getPackageNameFromIpkFilename( doc ); |
227 | std::cout << "Selecting package " << package << std::endl; | 224 | // std::cout << "Selecting package " << package << std::endl; |
228 | networkPkgWindow->selectLocalPackage( package ); | 225 | networkPkgWindow->selectLocalPackage( package ); |
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index c209589..b4b6475 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp | |||
@@ -17,9 +17,3 @@ | |||
17 | 17 | ||
18 | #include <fstream> | ||
19 | #include <iostream> | ||
20 | using namespace std; | ||
21 | |||
22 | #include <unistd.h> | 18 | #include <unistd.h> |
23 | #include <stdlib.h> | ||
24 | #include <linux/limits.h> | ||
25 | 19 | ||
@@ -29,2 +23,3 @@ using namespace std; | |||
29 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/resource.h> | ||
30 | #else | 25 | #else |
@@ -35,2 +30,3 @@ using namespace std; | |||
35 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
31 | #include <qwhatsthis.h> | ||
36 | 32 | ||
@@ -99,3 +95,3 @@ void NetworkPackageManager :: updateData() | |||
99 | { | 95 | { |
100 | cout << serverName << " is not active" << endl; | 96 | // cout << serverName << " is not active" << endl; |
101 | i--; | 97 | i--; |
@@ -147,4 +143,10 @@ void NetworkPackageManager :: initGui() | |||
147 | connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); | 143 | connect( serversList, SIGNAL(activated( int )), this, SLOT(serverSelected( int ))); |
144 | QWhatsThis::add( serversList, tr( "Click here to select a package feed." ) ); | ||
145 | |||
146 | installedIcon = Resource::loadPixmap( "aqpkg/installed" ); | ||
147 | updatedIcon = Resource::loadPixmap( "aqpkg/updated" ); | ||
148 | 148 | ||
149 | packagesList = new QListView( this ); | 149 | packagesList = new QListView( this ); |
150 | packagesList->addColumn( tr( "Packages" ), 225 ); | ||
151 | QWhatsThis::add( packagesList, tr( "This is a listing of all packages for the server feed selected above.\n\nA blue dot next to the package name indicates that the package is currently installed.\n\nA blue dot with a star indicates that a newer version of the package is available from the server feed.\n\nClick inside the box at the left to select a package." ) ); | ||
150 | 152 | ||
@@ -176,4 +178,3 @@ void NetworkPackageManager :: initGui() | |||
176 | vbox->addWidget( packagesList ); | 178 | vbox->addWidget( packagesList ); |
177 | packagesList->addColumn( tr( "Packages" ) ); | 179 | |
178 | |||
179 | downloadEnabled = TRUE; | 180 | downloadEnabled = TRUE; |
@@ -188,2 +189,5 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress ) | |||
188 | { | 189 | { |
190 | QPixmap nullIcon( installedIcon.size() ); | ||
191 | nullIcon.fill( colorGroup().base() ); | ||
192 | |||
189 | // display packages | 193 | // display packages |
@@ -262,20 +266,19 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress ) | |||
262 | 266 | ||
263 | text.append( it->getPackageName() ); | 267 | QCheckListItem *item = new QCheckListItem( packagesList, it->getPackageName(), QCheckListItem::CheckBox ); |
268 | |||
264 | if ( it->isInstalled() ) | 269 | if ( it->isInstalled() ) |
265 | { | 270 | { |
266 | text.append( " (installed)" ); | 271 | // If a different version of package is available, show update available icon |
267 | 272 | // Otherwise, show installed icon | |
268 | // If a different version of package is available, postfix it with an * | 273 | if ( it->getVersion() != it->getInstalledVersion() && |
269 | if ( it->getVersion() != it->getInstalledVersion() ) | 274 | compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1) |
270 | { | 275 | { |
271 | 276 | ||
272 | if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) | 277 | item->setPixmap( 0, updatedIcon ); |
273 | text.append( "*" ); | ||
274 | } | 278 | } |
275 | } | 279 | else |
276 | 280 | { | |
277 | QCheckListItem *item = new QCheckListItem( packagesList, text, QCheckListItem::CheckBox ); | 281 | item->setPixmap( 0, installedIcon ); |
278 | 282 | } | |
279 | if ( it->isInstalled() ) | 283 | |
280 | { | ||
281 | QString destName = ""; | 284 | QString destName = ""; |
@@ -294,2 +297,6 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress ) | |||
294 | } | 297 | } |
298 | else | ||
299 | { | ||
300 | item->setPixmap( 0, nullIcon ); | ||
301 | } | ||
295 | 302 | ||
@@ -300,3 +307,3 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress ) | |||
300 | new QCheckListItem( item, QString( tr( "Section - %1" ).arg( it->getSection() ) ) ); | 307 | new QCheckListItem( item, QString( tr( "Section - %1" ).arg( it->getSection() ) ) ); |
301 | } | 308 | } |
302 | else | 309 | else |
@@ -510,12 +517,3 @@ void NetworkPackageManager :: downloadSelectedPackages() | |||
510 | { | 517 | { |
511 | QString name = item->text(); | 518 | ipkg.setPackage( item->text() ); |
512 | int pos = name.find( "*" ); | ||
513 | name.truncate( pos ); | ||
514 | |||
515 | // if (there is a (installed), remove it | ||
516 | pos = name.find( "(installed)" ); | ||
517 | if ( pos > 0 ) | ||
518 | name.truncate( pos - 1 ); | ||
519 | |||
520 | ipkg.setPackage( name ); | ||
521 | ipkg.runIpkg( ); | 519 | ipkg.runIpkg( ); |
@@ -616,9 +614,2 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) | |||
616 | QString name = item->text(); | 614 | QString name = item->text(); |
617 | int pos = name.find( "*" ); | ||
618 | name.truncate( pos ); | ||
619 | |||
620 | // if (there is a (installed), remove it | ||
621 | pos = name.find( "(installed)" ); | ||
622 | if ( pos > 0 ) | ||
623 | name.truncate( pos - 1 ); | ||
624 | 615 | ||
@@ -653,4 +644,4 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) | |||
653 | item.destination = p->getInstalledTo(); | 644 | item.destination = p->getInstalledTo(); |
654 | cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; | 645 | // cout << "dest - " << p->getInstalledTo()->getDestinationName() << endl; |
655 | cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; | 646 | // cout << "dest - " << p->getInstalledTo()->getDestinationPath() << endl; |
656 | } | 647 | } |
@@ -736,5 +727,5 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) | |||
736 | 727 | ||
737 | void NetworkPackageManager :: displayText( const QString &t ) | 728 | void NetworkPackageManager :: displayText( const QString &/*t*/ ) |
738 | { | 729 | { |
739 | cout << t << endl; | 730 | // cout << t << endl; |
740 | } | 731 | } |
@@ -780,3 +771,3 @@ void NetworkPackageManager :: searchForPackage( const QString &text ) | |||
780 | { | 771 | { |
781 | cout << "searching for " << text << endl; | 772 | // cout << "searching for " << text << endl; |
782 | // look through package list for text startng at current position | 773 | // look through package list for text startng at current position |
@@ -793,6 +784,6 @@ void NetworkPackageManager :: searchForPackage( const QString &text ) | |||
793 | { | 784 | { |
794 | cout << "checking " << item->text().lower() << endl; | 785 | // cout << "checking " << item->text().lower() << endl; |
795 | if ( item->text().lower().find( text ) != -1 ) | 786 | if ( item->text().lower().find( text ) != -1 ) |
796 | { | 787 | { |
797 | cout << "matched " << item->text() << endl; | 788 | // cout << "matched " << item->text() << endl; |
798 | packagesList->ensureItemVisible( item ); | 789 | packagesList->ensureItemVisible( item ); |
diff --git a/noncore/settings/aqpkg/networkpkgmgr.h b/noncore/settings/aqpkg/networkpkgmgr.h index bd005e2..99eff2e 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.h +++ b/noncore/settings/aqpkg/networkpkgmgr.h | |||
@@ -21,2 +21,3 @@ | |||
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qpixmap.h> | ||
22 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
@@ -55,2 +56,5 @@ private: | |||
55 | QListView *packagesList; | 56 | QListView *packagesList; |
57 | |||
58 | QPixmap installedIcon; | ||
59 | QPixmap updatedIcon; | ||
56 | 60 | ||