summaryrefslogtreecommitdiff
path: root/noncore/tools/calculator/calculatorimpl.cpp
authormickeyl <mickeyl>2003-10-29 16:45:13 (UTC)
committer mickeyl <mickeyl>2003-10-29 16:45:13 (UTC)
commite8697a4281f7a265b69e6bf5253383c73a38626b (patch) (side-by-side diff)
tree040470f8f5c90c0d72ff5f01a272143571842078 /noncore/tools/calculator/calculatorimpl.cpp
parentd5d9b307e950d9038215e4d63e64bc9cd5d85352 (diff)
downloadopie-e8697a4281f7a265b69e6bf5253383c73a38626b.zip
opie-e8697a4281f7a265b69e6bf5253383c73a38626b.tar.gz
opie-e8697a4281f7a265b69e6bf5253383c73a38626b.tar.bz2
merge noncore/tools/*
Diffstat (limited to 'noncore/tools/calculator/calculatorimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/calculator/calculatorimpl.cpp56
1 files changed, 54 insertions, 2 deletions
diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp
index 8d11132..163b4da 100644
--- a/noncore/tools/calculator/calculatorimpl.cpp
+++ b/noncore/tools/calculator/calculatorimpl.cpp
@@ -97,48 +97,100 @@ static char *xtopowerofy_xpm[] = {
".#.#.....",
"#...#...."
};
CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
WFlags f )
: Calculator( parent, name, f )
{
// xtopowerofy = Resource::loadPixmap("xtopowerofy");
// ythrootofx = Resource::loadPixmap("ythrootofx");
// oneoverx = Resource::loadPixmap("oneoverx");
memMark = new QLabel( "m", LCD );
memMark->setFont( QFont( "helvetica", 12, QFont::Bold, TRUE ) );
memMark->resize( 12, 12 );
memMark->move( 4, 2 );
memMark->hide();
mem = 0;
PushButtonMR->setEnabled( FALSE );
current_mode = max_mode = conversion_mode_count = 0;
last_conversion = -1;
+ // translation trick mode - with this stuff parsed in from a file is translatable
+ QObject::tr("Standard");
+ QObject::tr("Weight");
+ QObject::tr("Distance");
+ QObject::tr("Area");
+ QObject::tr("Temperatures");
+ QObject::tr("Volume");
+ QObject::tr("acres");
+ QObject::tr("°C");
+ QObject::tr("carats");
+ QObject::tr("cm");
+ QObject::tr("cu cm");
+ QObject::tr("cu ft");
+ QObject::tr("cu in");
+ QObject::tr("°F");
+ QObject::tr("fl oz (US)");
+ QObject::tr("ft");
+ QObject::tr("g");
+ QObject::tr("gal (US)");
+ QObject::tr("hectares");
+ QObject::tr("in");
+ QObject::tr("kg");
+ QObject::tr("km");
+ QObject::tr("l");
+ QObject::tr("lb");
+ QObject::tr("Lg tons");
+ QObject::tr("m");
+ QObject::tr("mg");
+ QObject::tr("mi");
+ QObject::tr("ml");
+ QObject::tr("mm");
+ QObject::tr("naut. mi");
+ QObject::tr("oz");
+ QObject::tr("points");
+ QObject::tr("pt");
+ QObject::tr("qt");
+ QObject::tr("sq cm");
+ QObject::tr("sq ft");
+ QObject::tr("sq in");
+ QObject::tr("sq km");
+ QObject::tr("sq m");
+ QObject::tr("sq mi");
+ QObject::tr("sq mm");
+ QObject::tr("sq yd");
+ QObject::tr("st");
+ QObject::tr("St tons");
+ QObject::tr("tblspoon");
+ QObject::tr("teaspoons");
+ QObject::tr("tonnes");
+ QObject::tr("yd");
+
+
//bgr_command.insert( PushButtonFunction);
bgr_command.insert( PushButtonMPlus);
bgr_command.insert( PushButtonMR);
bgr_command.insert( PushButtonMC);
bgr_command.insert( PushButtonCE);
connect( &bgr_command, SIGNAL(clicked(int) ), this, SLOT(command_buttons(int)));
bgr_digits.insert(PushButton0);
bgr_digits.insert(PushButton1);
bgr_digits.insert(PushButton2);
bgr_digits.insert(PushButton3);
bgr_digits.insert(PushButton4);
bgr_digits.insert(PushButton5);
bgr_digits.insert(PushButton6);
bgr_digits.insert(PushButton7);
bgr_digits.insert(PushButton8);
bgr_digits.insert(PushButton9);
connect( &bgr_digits, SIGNAL(clicked(int) ), this, SLOT(enterNumber(int)));
bgr_std.insert(PushButtonEquals);
bgr_std.insert(PushButtonDecimal);
bgr_std.insert(PushButtonAdd);
bgr_std.insert(PushButtonMinus);
@@ -187,54 +239,54 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
}
else {
QString line, line2;
QTextStream ts(&myfile);
// first pass, see how many conversion types there are in order to allocate for them
while ( ! ts.eof() ) {
line = ts.readLine();
if ( line.contains ("STARTTYPE" ) )
conversion_mode_count++;
}
entry_list = new double[conversion_mode_count*func_button_count];
preoffset_list = new double[conversion_mode_count*func_button_count];
postoffset_list = new double[conversion_mode_count*func_button_count];
myfile.close();
myfile.open( IO_Translate | IO_ReadOnly );
QTextStream ts2(&myfile);
// second pass, read in values
int x = 0;
while ( ! ts2.eof() ) {
line = ts2.readLine();
if ( line.contains("STARTTYPE") ) {
- captions << line.remove(0,10);
+ captions << tr( line.remove(0,10) );
ComboBoxFunction->insertItem(captions.last());
while ( !line.contains("ENDTYPE") ) {
line = ts2.readLine();
if ( line.contains("NAME") ) {
- faces << line.remove(0,5);
+ faces << tr( line.remove(0,5) );
line2 = ts2.readLine();
line2.remove(0,6);
entry_list[x] = line2.toDouble();
line2 = ts2.readLine();
line2.remove(0,7);
preoffset_list[x] = line2.toDouble();
line2 = ts2.readLine();
line2.remove(0,8);
postoffset_list[x] = line2.toDouble();
x++;
}
}
}
}
}
myfile.close();
clear();
max_mode = pre_conv_modes_count + conversion_mode_count + post_conv_modes_count - 1;
display_pixmap_faces();
qApp->installEventFilter( this );
}
bool CalculatorImpl::eventFilter( QObject *o, QEvent *e )