summaryrefslogtreecommitdiff
path: root/noncore/settings
authorkergoth <kergoth>2003-08-09 16:12:19 (UTC)
committer kergoth <kergoth>2003-08-09 16:12:19 (UTC)
commit1c58d1407f9584fedcdae390a04e2b37e5853361 (patch) (side-by-side diff)
tree3c6e741c4d382d1a53c182930052b684d6e35b91 /noncore/settings
parente3f4607edd0c1ca1434adb446df1d4a1d27c6a86 (diff)
downloadopie-1c58d1407f9584fedcdae390a04e2b37e5853361.zip
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.gz
opie-1c58d1407f9584fedcdae390a04e2b37e5853361.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp12
-rw-r--r--noncore/settings/aqpkg/opie-aqpkg.control2
-rw-r--r--noncore/settings/aqpkg/package.cpp1
-rw-r--r--noncore/settings/aqpkg/packagewin.cpp7
-rw-r--r--noncore/settings/aqpkg/server.cpp13
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp6
-rw-r--r--noncore/settings/sysinfo/opie-sysinfo.control2
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp4
8 files changed, 34 insertions, 13 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 45a6663..42093cf 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -999,61 +999,70 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
if ( p->isPackageStoredLocally() )
name = p->getFilename();
QString option;
QString dest = "root";
if ( !p->isInstalled() )
{
InstallData *newitem = new InstallData();
newitem->option = "I";
newitem->packageName = name;
return newitem;
}
else
{
InstallData *newitem = new InstallData();
newitem->option = "D";
+
+ // If local file, remove using package name, not filename
+ if ( p->isPackageStoredLocally() )
+ name = item->text();
+
if ( !p->isPackageStoredLocally() )
newitem->packageName = p->getInstalledPackageName();
else
newitem->packageName = name;
if ( p->getInstalledTo() )
{
newitem->destination = p->getInstalledTo();
}
else
{
newitem->destination = p->getLocalPackage()->getInstalledTo();
}
// Now see if version is newer or not
int val = compareVersions( p->getInstalledVersion(), p->getVersion() );
// If the version requested is older and user selected a local ipk file, then reinstall the file
if ( p->isPackageStoredLocally() && val == -1 )
val = 0;
if ( val == -2 )
{
// Error - should handle
}
else if ( val == -1 )
{
// Version available is older - remove only
newitem->option = "D";
+
+ // If local file, remove using package name, not filename
+ if ( p->isPackageStoredLocally() )
+ name = item->text();
}
else
{
QString caption;
QString text;
QString secondButton;
QString secondOption;
if ( val == 0 )
{
// Version available is the same - option to remove or reinstall
caption = tr( "Do you wish to remove or reinstall\n%1?" );
text = tr( "Remove or ReInstall" );
secondButton = tr( "ReInstall" );
secondOption = "R"; // Internal action code, do not translate
}
else if ( val == 1 )
@@ -1067,32 +1076,35 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
// Sticky option not implemented yet, but will eventually allow
// the user to say something like 'remove all'
if ( stickyOption == "" )
{
QString msgtext;
msgtext = caption.arg( ( const char * )name );
QuestionDlg dlg( text, msgtext, secondButton );
switch( dlg.exec() )
{
case 0: // Cancel
delete newitem;
return 0x0;
break;
case 1: // Remove
newitem->option = "D";
+ // If local file, remove using package name, not filename
+ if ( p->isPackageStoredLocally() )
+ name = item->text();
break;
case 2: // Reinstall or Upgrade
newitem->option = secondOption;
break;
}
}
else
{
// newitem->option = stickyOption;
}
}
// Check if we are reinstalling the same version
if ( newitem->option != "R" )
newitem->recreateLinks = true;
diff --git a/noncore/settings/aqpkg/opie-aqpkg.control b/noncore/settings/aqpkg/opie-aqpkg.control
index b8ad1e8..46bffdd 100644
--- a/noncore/settings/aqpkg/opie-aqpkg.control
+++ b/noncore/settings/aqpkg/opie-aqpkg.control
@@ -1,11 +1,11 @@
Package: opie-aqpkg
Files: bin/aqpkg pics/aqpkg apps/Settings/aqpkg.desktop
Priority: optional
Section: Settings
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal
Replaces: aqpkg
Architecture: arm
Maintainer: Andy Qua (andy.qua@blueyonder.co.uk)
Description: A Package Manager
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index adda832..5a521d3 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -103,32 +103,33 @@ void Package :: setStatus( const QString &s )
}
void Package :: setLocalPackage( Package *p )
{
localPackage = p;
if ( localPackage )
if ( localPackage->getVersion() < getVersion() && !installed )
differentVersionAvailable = true;
else
differentVersionAvailable = false;
}
void Package :: setVersion( const QString &v )
{
version = v;
+ differentVersionAvailable = false;
if ( localPackage )
if ( localPackage->getVersion() < getVersion() && !installed )
differentVersionAvailable = true;
else
differentVersionAvailable = false;
}
void Package :: setPackageName( const QString &name )
{
packageName = name;
}
void Package :: setDescription( const QString &d )
{
description = d;
diff --git a/noncore/settings/aqpkg/packagewin.cpp b/noncore/settings/aqpkg/packagewin.cpp
index 9553cd1..499d647 100644
--- a/noncore/settings/aqpkg/packagewin.cpp
+++ b/noncore/settings/aqpkg/packagewin.cpp
@@ -31,37 +31,38 @@
#include "package.h"
#include "datamgr.h"
#include <qpe/resource.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qstring.h>
#include <qtextview.h>
PackageWindow::PackageWindow( Package *package, const QString &server )
: QWidget( 0, 0, 0 )
{
QString str;
if ( package )
{
+ Package *local = package->getLocalPackage();
setCaption( package->getPackageName() );
QString destName;
- if ( package->getLocalPackage() )
+ if ( local )
{
- if ( package->getLocalPackage()->getInstalledTo() )
+ if ( local->getInstalledTo() )
destName = package->getLocalPackage()->getInstalledTo()->getDestinationName();
}
else
{
if ( package->getInstalledTo() )
destName = package->getInstalledTo()->getDestinationName();
}
if ( !package->isPackageStoredLocally() )
{
str.append( tr( "<b>Description</b> - " ) );
str.append( package->getDescription() );
if ( !destName.isNull() )
{
str.append( tr( "<p><b>Installed To</b> - " ) );
str.append( destName );
@@ -73,33 +74,33 @@ PackageWindow::PackageWindow( Package *package, const QString &server )
}
else
{
str.append( tr( "<p><b>Filename</b> - " ) );
str.append( package->getFilename() );
}
if ( server == LOCAL_SERVER )
{
str.append( tr( "<p><b>Version Installed</b> - " ) );
str.append( package->getVersion() );
}
else
{
str.append( tr( "<p><b>Version Available</b> - " ) );
str.append( package->getVersion() );
- if ( package->getLocalPackage() )
+ if ( local )
{
if ( package->isInstalled() )
{
str.append( tr( "<p><b>Version Installed</b> - " ) );
str.append( package->getInstalledVersion() );
}
}
}
}
else
{
setCaption( tr( "Package Information" ) );
str = tr( "Package information is unavailable" );
}
QVBoxLayout *layout = new QVBoxLayout( this, 4, 4 );
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 4693db1..0282236 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -106,33 +106,33 @@ void Server :: readLocalIpks( Server *local )
// First, get any local IPKGs in the documents area
// Only applicable to Qtopie/Opie
DocLnkSet files;
Global::findDocuments( &files, "application/ipkg" );
// Now add the items to the list
QListIterator<DocLnk> it( files.children() );
for ( ; it.current() ; ++it )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = (*it)->file();
// Changed to display the filename (excluding the path)
- QString packageName = Utils::getFilenameFromIpkFilename( file );
+ QString packageName = Utils::getPackageNameFromIpkFilename( file );
QString ver = Utils::getPackageVersionFromIpkFilename( file );
Package *package = new Package( packageName );
package->setVersion( ver );
package->setFilename( file );
package->setPackageStoredLocally( true );
packageList.append( package );
}
#else
QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" };
for ( int i = 0 ; i < 4 ; ++i )
{
// OK, we have a local IPK file, I think the standard naming conventions
// for these are packagename_version_arm.ipk
QString file = names[i];
int p = file.find( "_" );
QString tmp = file.mid( 0, p );
@@ -231,47 +231,58 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
else if ( key == QString::null )
{
newPackage = true;
}
}
f.close();
// build local packages
buildLocalPackages( local );
}
void Server :: buildLocalPackages( Server *local )
{
Package *curr;
QListIterator<Package> it( packageList );
+
+ QList<Package> *locallist = &local->getPackageList();
+
for ( ; it.current(); ++it )
{
curr = it.current();
QString name = curr->getPackageName();
// If the package name is an ipk name, then convert the filename to a package name
if ( name.find( ".ipk" ) != -1 )
name = Utils::getPackageNameFromIpkFilename( curr->getFilename() );
if ( local )
{
Package *p = local->getPackage( name );
curr->setLocalPackage( p );
if ( p )
{
+ // Replace local version
+ if ( curr->getVersion() > p->getVersion() )
+ {
+ int pos = locallist->at();
+ locallist->remove( p );
+ locallist->insert( pos, curr );
+ }
+
// Set some default stuff like size and things
if ( p->getInstalledVersion() == curr->getVersion() )
{
p->setPackageSize( curr->getPackageSize() );
p->setSection( curr->getSection() );
p->setDescription( curr->getDescription() );
}
}
}
else
curr->setLocalPackage( 0 );
}
}
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index 3d127a8..8def0d6 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -35,33 +35,33 @@
#include "modulesinfo.h"
#include "detail.h"
ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
: QWidget( parent, name, fl )
{
QGridLayout *layout = new QGridLayout( this );
layout->setSpacing( 4 );
layout->setMargin( 4 );
ModulesView = new QListView( this );
int colnum = ModulesView->addColumn( tr( "Module" ) );
colnum = ModulesView->addColumn( tr( "Size" ) );
ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
colnum = ModulesView->addColumn( tr( "Use#" ) );
ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
- colnum = ModulesView->addColumn( tr( "Used By" ) );
+ colnum = ModulesView->addColumn( tr( "Used by" ) );
ModulesView->setAllColumnsShowFocus( TRUE );
layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 );
QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) );
// Test if we have /sbin/modinfo, and if so, allow module detail window
if ( QFile::exists( "/sbin/modinfo" ) )
{
QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
connect( ModulesView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
this, SLOT( viewModules( QListViewItem * ) ) );
}
CommandCB = new QComboBox( FALSE, this );
CommandCB->insertItem( "modprobe -r" );
CommandCB->insertItem( "rmmod" );
// I can't think of other useful commands yet. Anyone?
@@ -128,35 +128,33 @@ void ModulesInfo::updateData()
selecteditem = newitem;
}
}
ModulesView->setCurrentItem( selecteditem );
fclose( procfile );
}
}
void ModulesInfo::slotSendClicked()
{
if ( !ModulesView->currentItem() )
{
return;
}
- QString capstr = tr( "You really want to execute\n" );
- capstr.append( CommandCB->currentText() );
- capstr.append( "\nfor this module?" );
+ QString capstr = tr( "You really want to execute %1 for this module?" ).arg( CommandCB->currentText() );
QString modname = ModulesView->currentItem()->text( 0 );
if ( QMessageBox::warning( this, modname, capstr,
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
{
QString command = "/sbin/";
command.append( CommandCB->currentText() );
command.append( " " );
command.append( modname );
FILE* stream = popen( command, "r" );
if ( stream )
pclose( stream );
}
diff --git a/noncore/settings/sysinfo/opie-sysinfo.control b/noncore/settings/sysinfo/opie-sysinfo.control
index acb51e5..8250174 100644
--- a/noncore/settings/sysinfo/opie-sysinfo.control
+++ b/noncore/settings/sysinfo/opie-sysinfo.control
@@ -1,10 +1,10 @@
Package: opie-sysinfo
Files: bin/sysinfo apps/Settings/sysinfo.desktop pics/sysinfo
Priority: optional
Section: opie/applications
Maintainer: Dan Williams <williamsdr@acm.org>
Architecture: arm
-Version: $QPE_VERSION-$SUB_VERSION
Depends: task-opie-minimal, libopie1
Description: System Information dialog
For the Opie environment.
+Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 1de1a19..8dec9be 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -151,35 +151,33 @@ void ProcessInfo::updateData()
}
ProcessView->setCurrentItem( selecteditem );
}
delete proclist;
delete procdir;
}
void ProcessInfo::slotSendClicked()
{
QListViewItem *currprocess = ProcessView->currentItem();
if ( !currprocess )
{
return;
}
- QString capstr = tr( "You really want to send\n" );
- capstr.append( SignalCB->currentText() );
- capstr.append( "\nto this process?" );
+ QString capstr = tr( "You really want to send %1 to this process?" ).arg( SignalCB->currentText() );
if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr,
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
{
currprocess = ProcessView->currentItem();
if ( currprocess )
{
QString sigstr = SignalCB->currentText();
sigstr.truncate(2);
int sigid = sigstr.toUInt();
kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid );
}
}
}