summaryrefslogtreecommitdiff
path: root/noncore/settings
authordrw <drw>2003-06-11 02:04:00 (UTC)
committer drw <drw>2003-06-11 02:04:00 (UTC)
commitd47a08d2f8944deb1ee0945075c3443de82442ea (patch) (side-by-side diff)
tree807387a6bf5cfd9b445f14e6560118cc652e1868 /noncore/settings
parent57d61689f8212e317d8f578dc29cb63f572caf81 (diff)
downloadopie-d47a08d2f8944deb1ee0945075c3443de82442ea.zip
opie-d47a08d2f8944deb1ee0945075c3443de82442ea.tar.gz
opie-d47a08d2f8944deb1ee0945075c3443de82442ea.tar.bz2
Some missing/fixed tr()s for HEAD
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp19
-rw-r--r--noncore/settings/aqpkg/datamgr.h8
-rw-r--r--noncore/settings/aqpkg/global.h4
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp4
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp139
-rw-r--r--noncore/settings/aqpkg/main.cpp9
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp6
-rw-r--r--noncore/settings/aqpkg/mem.cpp2
-rw-r--r--noncore/settings/aqpkg/package.cpp35
-rw-r--r--noncore/settings/aqpkg/version.cpp39
10 files changed, 107 insertions, 158 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index cd0c78f..67f90a3 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -41,4 +41,7 @@
#include "global.h"
+QString LOCAL_SERVER;
+QString LOCAL_IPKGS;
+
QString DataManager::availableCategories = "";
@@ -48,5 +51,5 @@ DataManager::DataManager()
activeServer = "";
availableCategories = "#";
-
+
serverList.setAutoDelete( TRUE );
destList.setAutoDelete( TRUE );
@@ -138,5 +141,5 @@ void DataManager :: loadServers()
#endif
d->linkToRoot( linkToRoot );
-
+
destList.append( d );
}
@@ -181,5 +184,5 @@ void DataManager :: reloadServerData( )
QString serverName;
int i = 0;
-
+
Server *server;
QListIterator<Server> it( serverList );
@@ -191,5 +194,5 @@ void DataManager :: reloadServerData( )
emit progressUpdate( i );
qApp->processEvents();
-
+
// Now we've read the config file in we need to read the servers
// The local server is a special case. This holds the contents of the
@@ -202,5 +205,5 @@ void DataManager :: reloadServerData( )
server->readLocalIpks( getServer( LOCAL_SERVER ) );
else
- server->readPackageFile( getServer( LOCAL_SERVER ) );
+ server->readPackageFile( getServer( LOCAL_SERVER ) );
}
}
@@ -213,5 +216,5 @@ void DataManager :: writeOutIpkgConf()
return;
}
-
+
QTextStream t( &f );
/*
@@ -295,5 +298,5 @@ void DataManager :: writeOutIpkgConf()
t << "# Offline mode (for use in constructing flash images offline)\n";
t << "#option offline_root target\n";
-
+
f.close();
}
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h
index 32a1e57..9f8920d 100644
--- a/noncore/settings/aqpkg/datamgr.h
+++ b/noncore/settings/aqpkg/datamgr.h
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -41,6 +41,8 @@ using namespace std;
#include "destination.h"
-#define LOCAL_SERVER "Installed Pkgs"
-#define LOCAL_IPKGS "local IPKG"
+//#define LOCAL_SERVER "Installed Pkgs"
+//#define LOCAL_IPKGS "local IPKG"
+extern QString LOCAL_SERVER;
+extern QString LOCAL_IPKGS;
/**
diff --git a/noncore/settings/aqpkg/global.h b/noncore/settings/aqpkg/global.h
index 4fdd51d..0325a59 100644
--- a/noncore/settings/aqpkg/global.h
+++ b/noncore/settings/aqpkg/global.h
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -31,5 +31,5 @@
#define __GLOBAL_H
-#define VERSION_TEXT "AQPkg Version 1.11"
+//extern QString VERSION_TEXT;
// Uncomment the below line to run on a Linux box rather than a Zaurus
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp
index 17f7b08..ea2c47f 100644
--- a/noncore/settings/aqpkg/installdlgimpl.cpp
+++ b/noncore/settings/aqpkg/installdlgimpl.cpp
@@ -395,9 +395,7 @@ void InstallDlgImpl :: displayAvailableSpace( const QString &text )
if ( !mult ) mult = 1;
if ( !div ) div = 1;
-// long total = totalBlocks * mult / div;
long avail = availBlocks * mult / div;
-// long used = total - avail;
- space.sprintf( "%ld Kb", avail );
+ space = tr( "%1 Kb" ).arg( avail );
}
else
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 3df569b..43eaaae 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -112,5 +112,5 @@ void Ipkg :: runIpkg()
}
}
-
+
#ifdef X86
commands << "-f";
@@ -128,5 +128,5 @@ void Ipkg :: runIpkg()
if ( package != "" )
- emit outputText( QString( "Dealing with package " ) + package );
+ emit outputText( tr( "Dealing with package %1" ).arg( package) );
qApp->processEvents();
@@ -139,10 +139,10 @@ void Ipkg :: runIpkg()
if ( flags & MAKE_LINKS )
{
- emit outputText( QString( "Removing symbolic links...\n" ) );
+ emit outputText( tr( "Removing symbolic links...\n" ) );
linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
emit outputText( QString( " " ) );
}
}
-
+
// Execute command
dependantPackages = new QList<QString>;
@@ -163,5 +163,5 @@ void Ipkg :: createSymLinks()
{
emit outputText( " " );
- emit outputText( QString( "Creating symbolic links for " )+ package );
+ emit outputText( tr( "Creating symbolic links for %1." ).arg( package) );
linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
@@ -174,5 +174,5 @@ void Ipkg :: createSymLinks()
continue;
emit outputText( " " );
- emit outputText( QString( "Creating symbolic links for " )+ (*pkg) );
+ emit outputText( tr( "Creating symbolic links for %1" ).arg( *pkg ) );
linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir );
}
@@ -182,5 +182,5 @@ void Ipkg :: createSymLinks()
delete dependantPackages;
- emit outputText( "Finished" );
+ emit outputText( tr("Finished") );
emit outputText( "" );
}
@@ -196,17 +196,17 @@ void Ipkg :: removeStatusEntry()
emit outputText( "" );
- emit outputText( "Removing status entry..." );
- QString tempstr = "status file - ";
+ emit outputText( tr("Removing status entry...") );
+ QString tempstr = tr("status file - ");
tempstr.append( statusFile );
emit outputText( tempstr );
- tempstr = "package - ";
+ tempstr = tr("package - ");
tempstr.append( package );
emit outputText( tempstr );
-
+
ifstream in( statusFile );
ofstream out( outStatusFile );
if ( !in.is_open() )
{
- tempstr = "Couldn't open status file - ";
+ tempstr = tr("Couldn't open status file - ");
tempstr.append( statusFile );
emit outputText( tempstr );
@@ -216,5 +216,5 @@ void Ipkg :: removeStatusEntry()
if ( !out.is_open() )
{
- tempstr = "Couldn't create tempory status file - ";
+ tempstr = tr("Couldn't create tempory status file - ");
tempstr.append( outStatusFile );
emit outputText( tempstr );
@@ -257,5 +257,5 @@ void Ipkg :: removeStatusEntry()
out << line << endl;
- // Improve UI responsiveness
+ // Improve UI responsiveness
i++;
if ( ( i % 50 ) == 0 )
@@ -268,11 +268,11 @@ void Ipkg :: removeStatusEntry()
{
out << (const char *)(*it) << endl;
-
- // Improve UI responsiveness
+
+ // Improve UI responsiveness
i++;
if ( ( i % 50 ) == 0 )
qApp->processEvents();
}
-
+
in.close();
out.close();
@@ -291,5 +291,5 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
proc = 0;
}
-
+
// OK we're gonna use OProcess to run this thing
proc = new OProcess();
@@ -306,5 +306,5 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)),
this, SLOT(commandStderr(OProcess *, char *, int)));
-
+
for ( QStringList::Iterator it = cmd.begin(); it != cmd.end(); ++it )
{
@@ -316,5 +316,5 @@ int Ipkg :: executeIpkgCommand( QStringList &cmd, const QString /*option*/ )
if(!proc->start(OProcess::NotifyOnExit, OProcess::All))
{
- emit outputText( QString( "Couldn't start ipkg process" ) );
+ emit outputText( tr("Couldn't start ipkg process" ) );
}
}
@@ -347,5 +347,5 @@ void Ipkg::commandStdout(OProcess*, char *buffer, int buflen)
error = true;
}
-
+
buffer[0] = '\0';
}
@@ -369,5 +369,5 @@ void Ipkg::processFinished()
if ( !error && option == "remove" )
removeStatusEntry();
-
+
delete proc;
proc = 0;
@@ -387,75 +387,9 @@ void Ipkg :: abort()
}
-/*
-int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
-{
- FILE *fp = NULL;
- char line[130];
- QString lineStr, lineStrOld;
- int ret = false;
-
- fp = popen( (const char *) cmd, "r");
- if ( fp == NULL )
- {
- QString text;
- text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd );
- emit outputText( text );
- }
- else
- {
- while ( fgets( line, sizeof line, fp) != NULL )
- {
- lineStr = line;
- lineStr=lineStr.left( lineStr.length()-1 );
-
- if ( lineStr != lineStrOld )
- {
- //See if we're finished
- if ( option == "install" || option == "reinstall" )
- {
- // Need to keep track of any dependant packages that get installed
- // so that we can create links to them as necessary
- if ( lineStr.startsWith( "Installing " ) )
- {
- int start = lineStr.find( " " ) + 1;
- int end = lineStr.find( " ", start );
- QString *package = new QString( lineStr.mid( start, end-start ) );
- dependantPackages->append( package );
- }
- }
-
- if ( option == "update" )
- {
- if (lineStr.contains("Updated list"))
- ret = true;
- }
- else if ( option == "download" )
- {
- if (lineStr.contains("Downloaded"))
- ret = true;
- }
- else
- {
- if (lineStr.contains("Done"))
- ret = true;
- }
-
- emit outputText( lineStr );
- }
- lineStrOld = lineStr;
- qApp->processEvents();
- }
- pclose(fp);
- }
-
- return ret;
-}
-*/
-
void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, const QString &destDir )
{
if ( dest == "root" || dest == "/" )
return;
-
+
qApp->processEvents();
QStringList *fileList = getList( packFileName, destDir );
@@ -477,5 +411,5 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des
// Couldn't open from dest, try from /
f.close();
-
+
packageFileDir = "/usr/lib/ipkg/info/";
packageFileDir.append( packageFilename );
@@ -484,5 +418,5 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des
if ( ! f.open(IO_ReadOnly) )
{
- QString tempstr = "Could not open :";
+ QString tempstr = tr("Could not open :");
tempstr.append( packageFileDir );
emit outputText( tempstr );
@@ -529,10 +463,10 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const
QString sourceFile = baseDir;
sourceFile.append( file );
-
+
QString linkFile = destDir;
if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" )
{
linkFile.append( file.mid( 1 ) );
- }
+ }
else
{
@@ -549,5 +483,5 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const
if ( !f.exists() )
{
- QString tempstr = "Creating directory ";
+ QString tempstr = tr("Creating directory ");
tempstr.append( linkFile );
emit outputText( tempstr );
@@ -557,13 +491,12 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const
// else
// emit outputText( QString( "Directory " ) + linkFile + " already exists" );
-
+
}
else
{
int rc = symlink( sourceFile, linkFile );
- text = (rc == 0 ? "Linked " : "Failed to link ");
- text.append( sourceFile );
- text.append( " to " );
- text.append( linkFile );
+ text = ( rc == 0 ? tr( "Linked %1 to %2" ) : tr( "Failed to link %1 to %2" ) ).
+ arg( sourceFile ).
+ arg( linkFile );
emit outputText( text );
}
@@ -579,6 +512,5 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const
bool rc = f.remove();
- text = (rc ? "Removed " : "Failed to remove ");
- text.append( linkFile );
+ text = ( rc ? tr( "Removed %1" ) : tr( "Failed to remove %1" ) ).arg( linkFile );
emit outputText( text );
}
@@ -589,6 +521,5 @@ void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const
if ( rc )
{
- text = (rc ? "Removed " : "Failed to remove ");
- text.append( linkFile );
+ text = ( rc ? tr( "Removed " ) : tr( "Failed to remove " ) ).arg( linkFile );
emit outputText( text );
}
diff --git a/noncore/settings/aqpkg/main.cpp b/noncore/settings/aqpkg/main.cpp
index 066d79f..b7f8b7b 100644
--- a/noncore/settings/aqpkg/main.cpp
+++ b/noncore/settings/aqpkg/main.cpp
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -43,4 +43,8 @@
+/* be less intrusive for translation -zecke */
+extern QString LOCAL_SERVER;
+extern QString LOCAL_IPKGS;
+
int main(int argc, char *argv[])
{
@@ -56,4 +60,7 @@ int main(int argc, char *argv[])
#endif
+ LOCAL_SERVER = QObject::tr( "Installed packages" );
+ LOCAL_IPKGS = QObject::tr( "Local packages" );
+
MainWindow *win = new MainWindow();
a.setMainWidget(win);
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 0efa1e0..45a6663 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -1055,5 +1055,5 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
text = tr( "Remove or ReInstall" );
secondButton = tr( "ReInstall" );
- secondOption = tr( "R" );
+ secondOption = "R"; // Internal action code, do not translate
}
else if ( val == 1 )
@@ -1063,5 +1063,5 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
text = tr( "Remove or Upgrade" );
secondButton = tr( "Upgrade" );
- secondOption = tr( "U" );
+ secondOption = "U"; // Internal action code, do not translate
}
@@ -1072,6 +1072,4 @@ InstallData *MainWindow :: dealWithItem( QCheckListItem *item )
QString msgtext;
msgtext = caption.arg( ( const char * )name );
-// switch( QMessageBox::information( this, text,
-// msgtext, tr( "Remove" ), secondButton ) )
QuestionDlg dlg( text, msgtext, secondButton );
switch( dlg.exec() )
diff --git a/noncore/settings/aqpkg/mem.cpp b/noncore/settings/aqpkg/mem.cpp
index 5f32a26..4c6117b 100644
--- a/noncore/settings/aqpkg/mem.cpp
+++ b/noncore/settings/aqpkg/mem.cpp
@@ -100,5 +100,5 @@ void DumpUnfreed()
long totalSize = 0;
char buf[1024];
-
+ // Debug output, okay to leave untranslated
for(i = allocList.begin(); i != allocList.end(); i++) {
sprintf(buf, "%-15s: LINE %ld, ADDRESS %ld %ld unfreed",
diff --git a/noncore/settings/aqpkg/package.cpp b/noncore/settings/aqpkg/package.cpp
index 4c27c65..adda832 100644
--- a/noncore/settings/aqpkg/package.cpp
+++ b/noncore/settings/aqpkg/package.cpp
@@ -1,5 +1,5 @@
/*
                This file is part of the OPIE Project
-
+
=. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
             .=l. Dan Williams <drw@handhelds.org>
@@ -31,13 +31,16 @@
#include "global.h"
+#include <qobject.h>
+
Package::Package( QString &name )
{
packageName = name;
- version = "N/A";
- description = "N/A";
- packageSize = "N/A";
- section = "N/A";
-
+ QString tempstr = QObject::tr( "N/A" );
+ version = tempstr;
+ description = tempstr;
+ packageSize = tempstr;
+ section = tempstr;
+
localPackage = 0;
installed = false;
@@ -52,9 +55,10 @@ Package::Package( char *name )
packageName = name;
- version = "N/A";
- description = "N/A";
- packageSize = "N/A";
- section = "N/A";
-
+ QString tempstr = QObject::tr( "N/A" );
+ version = tempstr;
+ description = tempstr;
+ packageSize = tempstr;
+ section = tempstr;
+
localPackage = 0;
installed = false;
@@ -72,9 +76,10 @@ Package::~Package()
QString Package :: toString()
{
- QString ret = "Package - " + getPackageName() +
- "\n version - " + getVersion();
+ QString ret = QObject::tr( "Package - %1\n version - %2" ).
+ arg( getPackageName() ).
+ arg( getVersion() );
if ( localPackage )
- ret += "\n inst version - " + localPackage->getVersion();
+ ret.append( QObject::tr( "\n inst version - %1" ).arg( localPackage->getVersion() ) );
@@ -88,5 +93,5 @@ void Package :: setStatus( const QString &s )
status = s.simplifyWhiteSpace( );
-
+
two = status.find( " " ); // find second column
three = status.find( " ", two + 1 ); // find third column
diff --git a/noncore/settings/aqpkg/version.cpp b/noncore/settings/aqpkg/version.cpp
index e836da1..59e6f3f 100644
--- a/noncore/settings/aqpkg/version.cpp
+++ b/noncore/settings/aqpkg/version.cpp
@@ -24,5 +24,7 @@
#include <string.h>
-# define _(Text) Text
+#include <qobject.h>
+
+//# define _(Text) Text
class versionrevision
@@ -45,12 +47,12 @@ public:
strcpy( version, str );
}
-
+
unsigned long epoch;
char *version;
const char *revision;
const char *familiar_revision;
-};
+};
-static int verrevcmp(const char *val, const char *ref)
+static int verrevcmp(const char *val, const char *ref)
{
int vc, rc;
@@ -83,5 +85,5 @@ static int verrevcmp(const char *val, const char *ref)
int versioncompare(const struct versionrevision *version,
- const struct versionrevision *refversion)
+ const struct versionrevision *refversion)
{
int r;
@@ -96,5 +98,5 @@ int versioncompare(const struct versionrevision *version,
int versionsatisfied3(const struct versionrevision *it,
const struct versionrevision *ref,
- const char *op)
+ const char *op)
{
int r;
@@ -110,21 +112,24 @@ int versionsatisfied3(const struct versionrevision *it,
if (strcmp(op, "=") == 0)
return r == 0;
- fprintf(stderr, "unknown operator: %s", op);
+// fprintf(stderr, "unknown operator: %s", op);
exit(1);
}
-const char *parseversion(struct versionrevision *rversion, const char *string)
+const char *parseversion(struct versionrevision *rversion, const char *string)
{
char *hyphen, *colon, *eepochcolon;
unsigned long epoch;
- if (!*string) return _("version string is empty");
-
+ if ( !*string )
+ return QObject::tr( "Version string is empty." );
+
colon= strchr(string,':');
if (colon) {
epoch= strtoul(string,&eepochcolon,10);
- if (colon != eepochcolon) return _("epoch in version is not number");
- if (!*++colon) return _("nothing after colon in version number");
+ if ( colon != eepochcolon )
+ return QObject::tr( "Epoch in version is not number." );
+ if ( !*++colon )
+ return QObject::tr( "Nothing after colon in version number." );
string= colon;
rversion->epoch= epoch;
@@ -157,5 +162,5 @@ const char *parseversion(struct versionrevision *rversion, const char *string)
rversion->revision,
rversion->familiar_revision);
-*/
+*/
return 0;
}
@@ -168,5 +173,5 @@ int compareVersions( const char *v1, const char *v2 )
err = parseversion(&ref, v1);
if (err) {
- fprintf(stderr, "Invalid version `%s': %s\n", v2, err);
+// fprintf(stderr, "Invalid version `%s': %s\n", v2, err);
return -2;
}
@@ -174,5 +179,5 @@ int compareVersions( const char *v1, const char *v2 )
err = parseversion(&ver, v2);
if (err) {
- fprintf(stderr, "Invalid version `%s': %s\n", v1, err);
+// fprintf(stderr, "Invalid version `%s': %s\n", v1, err);
return -2;
}
@@ -187,5 +192,5 @@ int compareVersions( const char *v1, const char *v2 )
/*
-int main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
const char *err;
@@ -202,5 +207,5 @@ int main(int argc, char *argv[])
return 2;
}
-
+
err = parseversion(&ref, argv[3]);
if (err) {