summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/oxygen/calcdlg.ui119
-rw-r--r--noncore/apps/oxygen/calcdlgui.cpp2
-rw-r--r--noncore/apps/oxygen/kmolcalc.cpp40
-rw-r--r--noncore/apps/oxygen/kmolcalc.h5
4 files changed, 57 insertions, 109 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui
index e0b19f9..5b0c53e 100644
--- a/noncore/apps/oxygen/calcdlg.ui
+++ b/noncore/apps/oxygen/calcdlg.ui
@@ -13,4 +13,4 @@
<y>0</y>
- <width>218</width>
- <height>274</height>
+ <width>275</width>
+ <height>357</height>
</rect>
@@ -36,6 +36,6 @@
<rect>
- <x>10</x>
+ <x>0</x>
<y>0</y>
- <width>200</width>
- <height>260</height>
+ <width>270</width>
+ <height>350</height>
</rect>
@@ -67,6 +67,6 @@
<rect>
- <x>2</x>
- <y>2</y>
- <width>180</width>
- <height>220</height>
+ <x>0</x>
+ <y>0</y>
+ <width>260</width>
+ <height>320</height>
</rect>
@@ -82,6 +82,6 @@
<widget>
- <class>QLabel</class>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_4</cstring>
+ <cstring>Layout7</cstring>
</property>
@@ -90,8 +90,23 @@
<rect>
- <x>1</x>
- <y>1</y>
- <width>298</width>
- <height>16</height>
+ <x>0</x>
+ <y>0</y>
+ <width>260</width>
+ <height>320</height>
</rect>
</property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_4</cstring>
+ </property>
<property stdset="1">
@@ -102,15 +117,13 @@
<widget>
- <class>QLayoutWidget</class>
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>Layout7</cstring>
+ <cstring>formula</cstring>
</property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
<property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>50</y>
- <width>175</width>
- <height>30</height>
- </rect>
+ <name>name</name>
+ <cstring>Layout7</cstring>
</property>
@@ -150,15 +163,10 @@
<widget>
- <class>QLineEdit</class>
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>formula</cstring>
+ <cstring>TextLabel2_4</cstring>
</property>
<property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>20</y>
- <width>170</width>
- <height>22</height>
- </rect>
+ <name>text</name>
+ <string>Result:</string>
</property>
@@ -166,15 +174,6 @@
<widget>
- <class>QMultiLineEdit</class>
+ <class>QLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>anal_display</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>130</y>
- <width>170</width>
- <height>80</height>
- </rect>
+ <cstring>result</cstring>
</property>
@@ -182,15 +181,10 @@
<widget>
- <class>QLineEdit</class>
+ <class>QLabel</class>
<property stdset="1">
<name>name</name>
- <cstring>result</cstring>
+ <cstring>TextLabel1</cstring>
</property>
<property stdset="1">
- <name>geometry</name>
- <rect>
- <x>0</x>
- <y>100</y>
- <width>170</width>
- <height>22</height>
- </rect>
+ <name>text</name>
+ <string>Elemental composition (%):</string>
</property>
@@ -198,21 +192,14 @@
<widget>
- <class>QLabel</class>
+ <class>QMultiLineEdit</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel2_4</cstring>
- </property>
- <property stdset="1">
- <name>geometry</name>
- <rect>
- <x>1</x>
- <y>86</y>
- <width>298</width>
- <height>16</height>
- </rect>
+ <cstring>anal_display</cstring>
</property>
<property stdset="1">
- <name>text</name>
- <string>Result:</string>
+ <name>readOnly</name>
+ <bool>true</bool>
</property>
</widget>
+ </vbox>
+ </widget>
</widget>
diff --git a/noncore/apps/oxygen/calcdlgui.cpp b/noncore/apps/oxygen/calcdlgui.cpp
index e9b40d3..e40e2c7 100644
--- a/noncore/apps/oxygen/calcdlgui.cpp
+++ b/noncore/apps/oxygen/calcdlgui.cpp
@@ -18,2 +18,3 @@ calcDlgUI::calcDlgUI() : CalcDlg()
{
+ this->showMaximized();
kmolcalc = new KMolCalc;
@@ -21,2 +22,3 @@ calcDlgUI::calcDlgUI() : CalcDlg()
connect( clear_fields, SIGNAL( clicked() ), this, SLOT( clear() ) );
+ result->setReadOnly( true );
}
diff --git a/noncore/apps/oxygen/kmolcalc.cpp b/noncore/apps/oxygen/kmolcalc.cpp
index 7257c4a..0ba52da 100644
--- a/noncore/apps/oxygen/kmolcalc.cpp
+++ b/noncore/apps/oxygen/kmolcalc.cpp
@@ -3,3 +3,3 @@
*
- * Copyright (C) 2000 Tomislav Gountchev <tomi@idiom.com>
+ * Copyright (C) 2000,2001 Tomislav Gountchev <tomi@idiom.com>
* Copyright (C) 2002 Carsten Niehaus <cniehaus@handhelds.org>
@@ -38,24 +38,5 @@ void KMolCalc::readElstable() {
elstable->setAutoDelete(TRUE);
- QStringList files = "/home/opie/opie/noncore/apps/oxigen/kmolweights";
- mwfile = "/home/opie/opie/noncore/apps/oxigen/kmolweights";
+ mwfile = "/home/opie/opie/noncore/apps/oxygen/kmolweights";
QFile f(mwfile);
- QString* latest_f = &mwfile;
- for (uint i=0; i<files.count(); i++) {
- if (QFileInfo(QFile(files[i])).lastModified() > QFileInfo(QFile(*latest_f)).lastModified()) {
- latest_f = &files[i];
- }
- }
- QFile lf(*latest_f);
if (f.exists()) readMwfile(f);
- if (!f.exists()) {
- readMwfile(lf);
- writeElstable();
- } else if (QFileInfo(f).lastModified() < QFileInfo(lf).lastModified()) {
- // announce
- QMessageBox::information
- (0, "Warning:", "Found new global Mw file.\nLocal definitions will be updated.", QMessageBox::Ok);
- readMwfile(lf);
- writeElstable();
- }
-
}
@@ -190,19 +171,2 @@ void KMolCalc::readMwfile(QFile& f) {
/**
- * Save the element definitions file.
- */
-void KMolCalc::writeElstable() {
- QFile f(mwfile);
- if (! f.open(IO_WriteOnly)) return; //ERROR
- QTextStream fs (&f);
- QString line;
- QDictIterator<SubUnit> it(*elstable);
- while (it.current()) {
- it.current()->writeOut(line);
- fs << line << endl;
- ++it;
- }
- f.close();
-}
-
-/**
* Remove a group or element definition from ELSTABLE.
diff --git a/noncore/apps/oxygen/kmolcalc.h b/noncore/apps/oxygen/kmolcalc.h
index c3e02f3..c589133 100644
--- a/noncore/apps/oxygen/kmolcalc.h
+++ b/noncore/apps/oxygen/kmolcalc.h
@@ -80,7 +80,2 @@ public:
/**
- * Save the element definitions file.
- */
- void writeElstable();
-
- /**
* Read the element definitions file and construct ELSTABLE.