summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/networkpkgmgr.cpp
authordrw <drw>2003-01-10 21:07:59 (UTC)
committer drw <drw>2003-01-10 21:07:59 (UTC)
commit3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac (patch) (unidiff)
treea6cb5e1cc109fc9ec54aca9b61726111771f08bf /noncore/settings/aqpkg/networkpkgmgr.cpp
parent1c7ae0ce09caf37c3c7d5d284eee390940143a26 (diff)
downloadopie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.zip
opie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.tar.gz
opie-3d5b0fdc15ed9b3ee392e52254aa9db73e2b7dac.tar.bz2
Made find dialog a toolbar, fixed show options under View menu
Diffstat (limited to 'noncore/settings/aqpkg/networkpkgmgr.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp52
1 files changed, 31 insertions, 21 deletions
diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp
index 91afe02..c209589 100644
--- a/noncore/settings/aqpkg/networkpkgmgr.cpp
+++ b/noncore/settings/aqpkg/networkpkgmgr.cpp
@@ -260,17 +260,17 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress )
260 continue; 260 continue;
261 261
262 262
263 text += it->getPackageName(); 263 text.append( it->getPackageName() );
264 if ( it->isInstalled() ) 264 if ( it->isInstalled() )
265 { 265 {
266 text += " (installed)"; 266 text.append( " (installed)" );
267 267
268 // If a different version of package is available, postfix it with an * 268 // If a different version of package is available, postfix it with an *
269 if ( it->getVersion() != it->getInstalledVersion() ) 269 if ( it->getVersion() != it->getInstalledVersion() )
270 { 270 {
271 271
272 if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 ) 272 if ( compareVersions( it->getInstalledVersion(), it->getVersion() ) == 1 )
273 text += "*"; 273 text.append( "*" );
274 } 274 }
275 } 275 }
276 276
@@ -290,29 +290,29 @@ void NetworkPackageManager :: serverSelected( int, bool raiseProgress )
290 destName = it->getInstalledTo()->getDestinationName(); 290 destName = it->getInstalledTo()->getDestinationName();
291 } 291 }
292 if ( destName != "" ) 292 if ( destName != "" )
293 new QCheckListItem( item, QString( tr( "Installed To - " ) ) + destName ); 293 new QCheckListItem( item, QString( tr( "Installed To - %1" ).arg( destName ) ) );
294 } 294 }
295 295
296 if ( !it->isPackageStoredLocally() ) 296 if ( !it->isPackageStoredLocally() )
297 { 297 {
298 new QCheckListItem( item, QString( tr( "Description - " ) ) + it->getDescription() ); 298 new QCheckListItem( item, QString( tr( "Description - %1" ).arg( it->getDescription() ) ) );
299 new QCheckListItem( item, QString( tr( "Size - " ) ) + it->getPackageSize() ); 299 new QCheckListItem( item, QString( tr( "Size - %1" ).arg( it->getPackageSize() ) ) );
300 new QCheckListItem( item, QString( tr( "Section - " ) ) + it->getSection() ); 300 new QCheckListItem( item, QString( tr( "Section - %1" ).arg( it->getSection() ) ) );
301 } 301 }
302 else 302 else
303 new QCheckListItem( item, QString( tr( "Filename - " ) ) + it->getFilename() ); 303 new QCheckListItem( item, QString( tr( "Filename - %1" ).arg( it->getFilename() ) ) );
304 304
305 if ( serverName == LOCAL_SERVER ) 305 if ( serverName == LOCAL_SERVER )
306 { 306 {
307 new QCheckListItem( item, QString( tr( "V. Installed - " ) ) + it->getVersion() ); 307 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( it->getVersion() ) ) );
308 } 308 }
309 else 309 else
310 { 310 {
311 new QCheckListItem( item, QString( tr( "V. Available - " ) ) + it->getVersion() ); 311 new QCheckListItem( item, QString( tr( "V. Available - %1" ).arg( it->getVersion() ) ) );
312 if ( it->getLocalPackage() ) 312 if ( it->getLocalPackage() )
313 { 313 {
314 if ( it->isInstalled() ) 314 if ( it->isInstalled() )
315 new QCheckListItem( item, QString( tr( "V. Installed - " ) ) + it->getInstalledVersion() ); 315 new QCheckListItem( item, QString( tr( "V. Installed - %1" ).arg( it->getInstalledVersion() ) ) );
316 } 316 }
317 } 317 }
318 318
@@ -372,6 +372,7 @@ void NetworkPackageManager :: upgradePackages()
372{ 372{
373 // We're gonna do an upgrade of all packages 373 // We're gonna do an upgrade of all packages
374 // First warn user that this isn't recommended 374 // First warn user that this isn't recommended
375 // TODO - ODevice????
375 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" ); 376 QString text = tr( "WARNING: Upgrading while\nOpie/Qtopia is running\nis NOT recommended!\n\nAre you sure?\n" );
376 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning, 377 QMessageBox warn( tr( "Warning" ), text, QMessageBox::Warning,
377 QMessageBox::Yes, 378 QMessageBox::Yes,
@@ -773,17 +774,11 @@ void NetworkPackageManager :: letterPushed( QString t )
773} 774}
774 775
775 776
776void NetworkPackageManager :: searchForPackage( bool findNext ) 777void NetworkPackageManager :: searchForPackage( const QString &text )
777{ 778{
778 bool ok = false; 779 if ( !text.isEmpty() )
779 if ( !findNext || lastSearchText.isEmpty() )
780 lastSearchText = InputDialog::getText( tr( "Search for package" ), tr( "Enter package to search for" ), lastSearchText, &ok, this ).lower();
781 else
782 ok = true;
783
784 if ( ok && !lastSearchText.isEmpty() )
785 { 780 {
786 cout << "searching for " << lastSearchText << endl; 781 cout << "searching for " << text << endl;
787 // look through package list for text startng at current position 782 // look through package list for text startng at current position
788 vector<InstallData> workingPackages; 783 vector<InstallData> workingPackages;
789 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem(); 784 QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
@@ -797,7 +792,7 @@ void NetworkPackageManager :: searchForPackage( bool findNext )
797 item = (QCheckListItem *)item->nextSibling() ) 792 item = (QCheckListItem *)item->nextSibling() )
798 { 793 {
799 cout << "checking " << item->text().lower() << endl; 794 cout << "checking " << item->text().lower() << endl;
800 if ( item->text().lower().find( lastSearchText ) != -1 ) 795 if ( item->text().lower().find( text ) != -1 )
801 { 796 {
802 cout << "matched " << item->text() << endl; 797 cout << "matched " << item->text() << endl;
803 packagesList->ensureItemVisible( item ); 798 packagesList->ensureItemVisible( item );
@@ -811,18 +806,33 @@ void NetworkPackageManager :: searchForPackage( bool findNext )
811void NetworkPackageManager :: showOnlyUninstalledPackages( bool val ) 806void NetworkPackageManager :: showOnlyUninstalledPackages( bool val )
812{ 807{
813 showUninstalledPkgs = val; 808 showUninstalledPkgs = val;
809 if ( val )
810 {
811 showInstalledPkgs = FALSE;
812 showUpgradedPkgs = FALSE;
813 }
814 serverSelected( -1 ); 814 serverSelected( -1 );
815} 815}
816 816
817void NetworkPackageManager :: showOnlyInstalledPackages( bool val ) 817void NetworkPackageManager :: showOnlyInstalledPackages( bool val )
818{ 818{
819 showInstalledPkgs = val; 819 showInstalledPkgs = val;
820 if ( val )
821 {
822 showUninstalledPkgs = FALSE;
823 showUpgradedPkgs = FALSE;
824 }
820 serverSelected( -1 ); 825 serverSelected( -1 );
821} 826}
822 827
823void NetworkPackageManager :: showUpgradedPackages( bool val ) 828void NetworkPackageManager :: showUpgradedPackages( bool val )
824{ 829{
825 showUpgradedPkgs = val; 830 showUpgradedPkgs = val;
831 if ( val )
832 {
833 showUninstalledPkgs = FALSE;
834 showInstalledPkgs = FALSE;
835 }
826 serverSelected( -1 ); 836 serverSelected( -1 );
827} 837}
828 838