summaryrefslogtreecommitdiff
path: root/noncore/tools
Side-by-side diff
Diffstat (limited to 'noncore/tools') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp7
-rw-r--r--noncore/tools/euroconv/main.cpp2
-rw-r--r--noncore/tools/formatter/formatter.cpp3
3 files changed, 7 insertions, 5 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 41c99a8..ecbf12f 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -388,116 +388,117 @@ void Clock::slotSnooze()
int warn = 0;
QTime t = QTime::currentTime();
QDateTime whenl( when.date(), t.addSecs( snoozeTime * 60 ) );
when = whenl;
AlarmServer::addAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
}
//toggles alarm on/off
void Clock::slotToggleAlarm()
{
Config config( "qpe" );
config.setGroup( "Time" );
if ( alarmBool )
{
config.writeEntry( "clockAlarmSet", "FALSE" );
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
snoozeBtn->hide();
alarmBool = FALSE;
alarmOff();
}
else
{
config.writeEntry( "clockAlarmSet", "TRUE" );
alarmOffBtn->setText( tr( "Alarm Is On" ) );
snoozeBtn->show();
alarmBool = TRUE;
alarmOn();
}
config.write();
}
void Clock::alarmOn()
{
QDate d = QDate::currentDate();
QTime tm( ( int ) hour, ( int ) minute, 0 );
qDebug( "Time set " + tm.toString() );
QTime t = QTime::currentTime();
if ( t > tm )
d = d.addDays( 1 );
int warn = 0;
QDateTime whenl( d, tm );
when = whenl;
AlarmServer::addAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
- setCaption( "Alarm set: " + whenl.toString() );
+// setCaption( "Alarm set: " + whenl.toString() );
+ setCaption( tr("Alarm set: %1" ).arg(whenl.toString()) );
}
void Clock::alarmOff()
{
int warn = 0;
bSound = FALSE;
AlarmServer::deleteAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
qDebug( "Alarm Off " + when.toString() );
- setCaption( "Clock" );
+ setCaption( tr("Clock") );
}
void Clock::clearTimer()
{
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
alarmBool = FALSE;
snoozeBtn->hide();
- setCaption( "Clock" );
+ setCaption( tr("Clock") );
}
void Clock::appMessage( const QCString& msg, const QByteArray& /*data*/ )
{
int stopTimer = 0;
int timerStay = 5000;
bSound = TRUE;
qDebug( "Message received in clock" );
if ( msg == "alarm(QDateTime,int)" )
{
Config config( "qpe" );
config.setGroup( "Time" );
if ( config.readBoolEntry( "mp3Alarm", 0 ) )
{
clearTimer();
pthread_t thread;
pthread_create(&thread, NULL, (void * (*) (void *))startPlayer, NULL/* &*/);
}
else
{
Sound::soundAlarm();
stopTimer = startTimer( timerStay );
}
}
if ( msg == "timerStart()" )
{
slotStartTimer();
}
if ( msg == "timerStop()" )
{
slotStopTimer();
}
if ( msg == "timerReset()" )
{
slotResetTimer();
}
show();
raise();
QPEApplication::setKeepRunning();
setActiveWindow();
}
void Clock::timerEvent( QTimerEvent *e )
{
diff --git a/noncore/tools/euroconv/main.cpp b/noncore/tools/euroconv/main.cpp
index 2d97f4e..7d69535 100644
--- a/noncore/tools/euroconv/main.cpp
+++ b/noncore/tools/euroconv/main.cpp
@@ -1,39 +1,39 @@
/****************************************************************************
*
* File: main.cpp
*
* Description: main file for OPIE Euroconv aapp
*
*
* Authors: Eric Santonacci <Eric.Santonacci@talc.fr>
*
* Requirements: Qt
*
* $Id$
*
***************************************************************************/
#include <qpe/qpeapplication.h>
#include <qvbox.h>
//#include <qapplication.h>
#include "calcdisplay.h"
#include "calckeypad.h"
int main( int argc, char **argv ) {
QPEApplication app( argc, argv );
QVBox *layout = new QVBox(0, "fond");
LCDDisplay lcd (layout, "lcd");
KeyPad num(&lcd, layout, "keypad");
app.setMainWidget(layout);
- layout->setCaption("Euroconv");
+ layout->setCaption( QObject::tr("Euroconv") );
layout->showMaximized ();
layout->show();
return app.exec();
}
diff --git a/noncore/tools/formatter/formatter.cpp b/noncore/tools/formatter/formatter.cpp
index 21de4d2..49f6355 100644
--- a/noncore/tools/formatter/formatter.cpp
+++ b/noncore/tools/formatter/formatter.cpp
@@ -355,97 +355,98 @@ void FormatterApp::storageComboSelected(int index ) {
TextLabel4->setText( tr( "Storage Type: %1").arg( nameS) );
currentText = currentText.right( currentText.length() - currentText.find(" -> ",0,TRUE) - 4);
QString fsType = getFileSystemType((const QString &) currentText);
// qDebug(fsType);
for(int i = 0; i < fileSystemsCombo->count(); i++) {
if( fsType == fileSystemsCombo->text(i))
fileSystemsCombo->setCurrentItem(i);
}
// deviceComboSelected(index);
}
void FormatterApp::deviceComboSelected(int index) {
StorageInfo storageInfo;
QString totalS, usedS, avS, diskS, nameS, fsType, selectedText;
selectedText = deviceComboBox->text(index);
const QList<FileSystem> &fs = storageInfo.fileSystems();
QListIterator<FileSystem> it ( fs );
QString storage;
for( ; it.current(); ++it ){
const QString name = (*it)->name();
const QString path = (*it)->path();
const QString disk = (*it)->disk();
// const QString options = (*it)->options();
if( selectedText == disk) {
diskS = disk; nameS= name;
mountPointLineEdit->setText(path);
long mult = (*it)->blockSize() / 1024;
long div = 1024 / (*it)->blockSize();
if ( !mult ) mult = 1;
if ( !div ) div = 1;
long total = (*it)->totalBlocks() * mult / div;
long totalMb = total/1024;
long avail = (*it)->availBlocks() * mult / div;
long availMb = avail/1024;
long used = total - avail;
long usedMb = used/1024;
totalS.sprintf(tr("Total: %1 kB ( %d mB)\n").arg( total ), totalMb );
usedS.sprintf(tr("Used: %1 kB ( %d mB)\n").arg(used) ,usedMb);
avS.sprintf( tr("Available: %1 kB ( %d mB)").arg(avail), availMb );
}
}
fsType = getFileSystemType((const QString &)selectedText);
- TextLabel5->setText(tr("Type: %1\nFormatted with %1\n%1, %1, %1").arg( nameS).arg( fsType).arg(totalS).arg( usedS).arg( avS ));
+ TextLabel5->setText(tr("Type: %1\nFormatted with %2\n%3, %4, %5").arg( nameS).arg( fsType).arg(totalS).arg( usedS).arg( avS ));
+ TextLabel5->setTextFormat( Qt::RichText );
// storageComboSelected(0);
}
void FormatterApp::cleanUp() {
}
void FormatterApp::editFstab() {
QCopEnvelope e("QPE/Application/textedit","setDocument(QString)");
e << (const QString &)"/etc/fstab";
}
void FormatterApp::parsetab(const QString &fileName) {
fileSystemTypeList.clear();
fsList.clear();
struct mntent *me;
// if(fileName == "/etc/mtab") {
FILE *mntfp = setmntent( fileName.latin1(), "r" );
if ( mntfp ) {
while ( (me = getmntent( mntfp )) != 0 ) {
QString deviceName = me->mnt_fsname;
QString filesystemType = me->mnt_type;
if(deviceName != "none") {
if( fsList.contains(filesystemType) == 0
& filesystemType.find("proc",0,TRUE) == -1
& filesystemType.find("cramfs",0,TRUE) == -1
& filesystemType.find("auto",0,TRUE) == -1)
fsList << filesystemType;
deviceList << deviceName;
qDebug(deviceName+"::"+filesystemType);
fileSystemTypeList << deviceName+"::"+filesystemType;
}
}
}
endmntent( mntfp );
// } else if(fileName == "/etc/fstab") {
// QFile f("/etc/fstab");
// if ( f.open(IO_ReadOnly) ) {
// QTextStream t (&f);
// QString s;
// while (! t.eof()) {
// s=t.readLine();
// s=s.simplifyWhiteSpace();
// if ( (!s.isEmpty() ) && (s.find(" ")!=0) ) {
// // = me->mnt_fsname;
// QString filesystemType = me->mnt_type;