author | kergoth <kergoth> | 2002-09-15 17:23:20 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-09-15 17:23:20 (UTC) |
commit | 9bd6edd077df796677c9d069200172f930ac1304 (patch) (unidiff) | |
tree | 3b473d4280249b5ade8e5276758cc8f9aa3c2822 /noncore/apps/checkbook/calcdlgui.cpp | |
parent | 33ec9ead7ce30bf9450b9048506f0bda49ba4791 (diff) | |
download | opie-9bd6edd077df796677c9d069200172f930ac1304.zip opie-9bd6edd077df796677c9d069200172f930ac1304.tar.gz opie-9bd6edd077df796677c9d069200172f930ac1304.tar.bz2 |
Reverting to checkbook in its previous state, hopefully i got everything.
Diffstat (limited to 'noncore/apps/checkbook/calcdlgui.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/calcdlgui.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/noncore/apps/checkbook/calcdlgui.cpp b/noncore/apps/checkbook/calcdlgui.cpp deleted file mode 100644 index e9b40d3..0000000 --- a/noncore/apps/checkbook/calcdlgui.cpp +++ b/dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /*************************************************************************** | ||
2 | * * | ||
3 | * This program is free software; you can redistribute it and/or modify * | ||
4 | * it under the terms of the GNU General Public License as published by * | ||
5 | * the Free Software Foundation; either version 2 of the License, or * | ||
6 | * ( at your option ) any later version. * | ||
7 | * * | ||
8 | **************************************************************************/ | ||
9 | #include "oxygen.h" | ||
10 | |||
11 | #include "calcdlgui.h" | ||
12 | #include "kmolcalc.h" | ||
13 | #include <qlineedit.h> | ||
14 | #include <qmultilineedit.h> | ||
15 | #include <qpushbutton.h> | ||
16 | |||
17 | calcDlgUI::calcDlgUI() : CalcDlg() | ||
18 | { | ||
19 | kmolcalc = new KMolCalc; | ||
20 | connect( calculate, SIGNAL( clicked() ), this, SLOT( calc() ) ); | ||
21 | connect( clear_fields, SIGNAL( clicked() ), this, SLOT( clear() ) ); | ||
22 | } | ||
23 | |||
24 | void calcDlgUI::calc() | ||
25 | { | ||
26 | QString compound( formula->text() ); | ||
27 | if ( compound.isEmpty() ) { | ||
28 | clear(); | ||
29 | return; | ||
30 | } | ||
31 | QString errors( kmolcalc->readFormula( compound ) ); | ||
32 | QString mw, ea; | ||
33 | double weight = kmolcalc->getWeight(); | ||
34 | if ( errors == "OK" ) { | ||
35 | mw.setNum( weight ); | ||
36 | ea = kmolcalc->getEmpFormula() + " :\n" + kmolcalc->getEA(); | ||
37 | } else { | ||
38 | mw = "???"; | ||
39 | ea = tr( "ERROR: \n" ) + errors + "\n"; | ||
40 | } | ||
41 | result->setText( mw ); | ||
42 | anal_display->setText( ea ); | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * * Clear all text entry / result fields. | ||
47 | * */ | ||
48 | void calcDlgUI::clear() | ||
49 | { | ||
50 | formula->clear(); | ||
51 | result->clear(); | ||
52 | anal_display->clear(); | ||
53 | } | ||
54 | |||
55 | |||