summaryrefslogtreecommitdiff
path: root/noncore/apps/oxygen/calcdlgui.cpp
authorcniehaus <cniehaus>2002-09-21 21:45:32 (UTC)
committer cniehaus <cniehaus>2002-09-21 21:45:32 (UTC)
commitf4a389bf66404f7c7474c4ef27491f5910da550b (patch) (side-by-side diff)
tree3371d43fb78359eb406797918eeabf85cb59d30a /noncore/apps/oxygen/calcdlgui.cpp
parent2e6dd40a0ba17ccf5503fa02bec810b0eeb82f8c (diff)
downloadopie-f4a389bf66404f7c7474c4ef27491f5910da550b.zip
opie-f4a389bf66404f7c7474c4ef27491f5910da550b.tar.gz
opie-f4a389bf66404f7c7474c4ef27491f5910da550b.tar.bz2
Now that I understand Harlekin I like his idea: Tabs
Diffstat (limited to 'noncore/apps/oxygen/calcdlgui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlgui.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/apps/oxygen/calcdlgui.cpp b/noncore/apps/oxygen/calcdlgui.cpp
index b6dfff3..ca3a9f2 100644
--- a/noncore/apps/oxygen/calcdlgui.cpp
+++ b/noncore/apps/oxygen/calcdlgui.cpp
@@ -3,49 +3,48 @@
begin : September 2002
copyright : ( C ) 2002 by Carsten Niehaus
email : cniehaus@handhelds.org
**************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* ( at your option ) any later version. *
* *
**************************************************************************/
#include "oxygen.h"
#include "calcdlgui.h"
#include "kmolcalc.h"
#include <qlineedit.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
calcDlgUI::calcDlgUI() : CalcDlg()
{
- this->showMaximized();
kmolcalc = new KMolCalc;
connect( calculate, SIGNAL( clicked() ), this, SLOT( calc() ) );
connect( clear_fields, SIGNAL( clicked() ), this, SLOT( clear() ) );
result->setReadOnly( true );
}
void calcDlgUI::calc()
{
QString compound( formula->text() );
if ( compound.isEmpty() ) {
clear();
return;
}
QString errors( kmolcalc->readFormula( compound ) );
QString mw, ea;
double weight = kmolcalc->getWeight();
if ( errors == "OK" ) {
mw.setNum( weight );
ea = kmolcalc->getEmpFormula() + " :\n" + kmolcalc->getEA();
} else {
mw = "???";
ea = tr( "ERROR: \n" ) + errors + "\n";
}
result->setText( mw );