-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.h | 3 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 128 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 5 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.cpp | 115 | ||||
-rw-r--r-- | noncore/apps/oxygen/oxygen.h | 3 |
6 files changed, 131 insertions, 127 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index f3984be..661eb5a 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp | |||
@@ -22,13 +22,15 @@ | |||
22 | #include <qhbox.h> | 22 | #include <qhbox.h> |
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qfont.h> | 24 | #include <qfont.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | ||
28 | OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) | 28 | #include <qstringlist.h> |
29 | |||
30 | OxydataWidget::OxydataWidget(QWidget *parent, const char *name, QStringList *list ) : QWidget( parent,name ) | ||
29 | { | 31 | { |
30 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); | 32 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); |
31 | 33 | ||
32 | QHBox *hbox = new QHBox( this ); | 34 | QHBox *hbox = new QHBox( this ); |
33 | left = new QLabel( hbox ); | 35 | left = new QLabel( hbox ); |
34 | middle = new QLabel( hbox ); | 36 | middle = new QLabel( hbox ); |
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h index f2eb71d..a8c9b6e 100644 --- a/noncore/apps/oxygen/dataTable.h +++ b/noncore/apps/oxygen/dataTable.h | |||
@@ -13,12 +13,13 @@ | |||
13 | 13 | ||
14 | #include <qwidget.h> | 14 | #include <qwidget.h> |
15 | #include <qtable.h> | 15 | #include <qtable.h> |
16 | 16 | ||
17 | class QLabel; | 17 | class QLabel; |
18 | class OxydataTable; | 18 | class OxydataTable; |
19 | //class QStringList; | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * A OxydataWidget shows all known data of an element. It can | 22 | * A OxydataWidget shows all known data of an element. It can |
22 | * be used for both the PSE and the pure Data-Dialog. It is | 23 | * be used for both the PSE and the pure Data-Dialog. It is |
23 | * a simple QHBox with 2 QStrings in it plus a OxydataTable | 24 | * a simple QHBox with 2 QStrings in it plus a OxydataTable |
24 | * which contains the rest of the data. | 25 | * which contains the rest of the data. |
@@ -28,13 +29,13 @@ class OxydataTable; | |||
28 | 29 | ||
29 | class OxydataWidget : public QWidget | 30 | class OxydataWidget : public QWidget |
30 | { | 31 | { |
31 | Q_OBJECT | 32 | Q_OBJECT |
32 | 33 | ||
33 | public: | 34 | public: |
34 | OxydataWidget(QWidget *parent=0); | 35 | OxydataWidget(QWidget *parent=0, const char *name=0, QStringList *list =0 ); |
35 | 36 | ||
36 | QLabel *left, *middle, *right; | 37 | QLabel *left, *middle, *right; |
37 | void setLayout(); | 38 | void setLayout(); |
38 | 39 | ||
39 | private: | 40 | private: |
40 | void setTable() const; | 41 | void setTable() const; |
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index 99c4fd7..b9000fa 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp | |||
@@ -25,29 +25,143 @@ | |||
25 | #include <qhbox.h> | 25 | #include <qhbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | 28 | ||
29 | dataWidgetUI::dataWidgetUI() : QWidget() | 29 | dataWidgetUI::dataWidgetUI() : QWidget() |
30 | { | 30 | { |
31 | this->setCaption( tr( "Chemical Data" )); | 31 | names = newQStringList(); |
32 | loadNames(); | ||
33 | |||
34 | this->setCaption( tr( "Chemical Data" )); | ||
32 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); | 35 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); |
33 | 36 | ||
34 | dataCombo = new QComboBox( this ); | 37 | dataCombo = new QComboBox( this ); |
35 | 38 | ||
36 | //read in all names of the 118 elements | 39 | //read in all names of the 118 elements |
37 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 40 | int i = 0; |
38 | for ( int i = 1 ; i < 119 ; i++ ) | 41 | for ( QStringList::Iterator it = names->begin() ; it != names->end() ; ++it,i++) |
39 | { | 42 | { |
40 | configobj.setGroup( QString::number( i ) ); | 43 | dataCombo->insertItem( QString::number( i )+" - "+*it ); |
41 | QString foo = configobj.readEntry( "Name" ); | ||
42 | dataCombo->insertItem( QString::number( i )+" - "+foo ); | ||
43 | } | 44 | } |
44 | 45 | ||
45 | OxydataWidget *oxyDW = new OxydataWidget(this); | 46 | OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names); |
46 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); | 47 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); |
47 | oxyDW->setElement( 0 ); | 48 | oxyDW->setElement( 0 ); |
48 | oxyDW->setLayout(); | 49 | oxyDW->setLayout(); |
49 | 50 | ||
50 | qgrid->addWidget( dataCombo, 0,0); | 51 | qgrid->addWidget( dataCombo, 0,0); |
51 | qgrid->addWidget( oxyDW , 1,0 ); | 52 | qgrid->addWidget( oxyDW , 1,0 ); |
52 | } | 53 | } |
53 | 54 | ||
55 | void dataWidgetUI::loadNames() | ||
56 | { | ||
57 | names->append( tr("Hydrogen") ); | ||
58 | names->append( tr("Helium") ); | ||
59 | names->append( tr("Lithium") ); | ||
60 | names->append( tr("Beryllium") ); | ||
61 | names->append( tr("Boron") ); | ||
62 | names->append( tr("Carbon") ); | ||
63 | names->append( tr("Nitrogen") ); | ||
64 | names->append( tr("Oxygen") ); | ||
65 | names->append( tr("Fluorine") ); | ||
66 | names->append( tr("Neon") ); | ||
67 | names->append( tr("Sodium") ); | ||
68 | names->append( tr("Magnesium") ); | ||
69 | names->append( tr("Aluminum") ); | ||
70 | names->append( tr("Silicon") ); | ||
71 | names->append( tr("Phosphorus") ); | ||
72 | names->append( tr("Sulfur") ); | ||
73 | names->append( tr("Chlorine") ); | ||
74 | names->append( tr("Argon") ); | ||
75 | names->append( tr("Potassium") ); | ||
76 | names->append( tr("Calcium") ); | ||
77 | names->append( tr("Scandium") ); | ||
78 | names->append( tr("Titanium") ); | ||
79 | names->append( tr("Vanadium") ); | ||
80 | names->append( tr("Chromium") ); | ||
81 | names->append( tr("Manganese") ); | ||
82 | names->append( tr("Iron") ); | ||
83 | names->append( tr("Cobalt") ); | ||
84 | names->append( tr("Nickel") ); | ||
85 | names->append( tr("Copper") ); | ||
86 | names->append( tr("Zinc") ); | ||
87 | names->append( tr("Gallium") ); | ||
88 | names->append( tr("Germanium") ); | ||
89 | names->append( tr("Arsenic") ); | ||
90 | names->append( tr("Selenium") ); | ||
91 | names->append( tr("Bromine") ); | ||
92 | names->append( tr("Krypton") ); | ||
93 | names->append( tr("Rubidium") ); | ||
94 | names->append( tr("Strontium") ); | ||
95 | names->append( tr("Yttrium") ); | ||
96 | names->append( tr("Zirconium") ); | ||
97 | names->append( tr("Niobium") ); | ||
98 | names->append( tr("Molybdenum") ); | ||
99 | names->append( tr("Technetium") ); | ||
100 | names->append( tr("Ruthenium") ); | ||
101 | names->append( tr("Rhodium") ); | ||
102 | names->append( tr("Palladium") ); | ||
103 | names->append( tr("Silver") ); | ||
104 | names->append( tr("Cadmium") ); | ||
105 | names->append( tr("Indium") ); | ||
106 | names->append( tr("Tin") ); | ||
107 | names->append( tr("Antimony") ); | ||
108 | names->append( tr("Tellurium") ); | ||
109 | names->append( tr("Iodine") ); | ||
110 | names->append( tr("Xenon") ); | ||
111 | names->append( tr("Cesium") ); | ||
112 | names->append( tr("Barium") ); | ||
113 | names->append( tr("Lanthanum") ); | ||
114 | names->append( tr("Cerium") ); | ||
115 | names->append( tr("Praseodymium") ); | ||
116 | names->append( tr("Neodymium") ); | ||
117 | names->append( tr("Promethium") ); | ||
118 | names->append( tr("Samarium") ); | ||
119 | names->append( tr("Europium") ); | ||
120 | names->append( tr("Gadolinium") ); | ||
121 | names->append( tr("Terbium") ); | ||
122 | names->append( tr("Dysprosium") ); | ||
123 | names->append( tr("Holmium") ); | ||
124 | names->append( tr("Erbium") ); | ||
125 | names->append( tr("Thulium") ); | ||
126 | names->append( tr("Ytterbium") ); | ||
127 | names->append( tr("Lutetium") ); | ||
128 | names->append( tr("Hafnium") ); | ||
129 | names->append( tr("Tantalum") ); | ||
130 | names->append( tr("Tungsten") ); | ||
131 | names->append( tr("Rhenium") ); | ||
132 | names->append( tr("Osmium") ); | ||
133 | names->append( tr("Iridium") ); | ||
134 | names->append( tr("Platinum") ); | ||
135 | names->append( tr("Gold") ); | ||
136 | names->append( tr("Mercury") ); | ||
137 | names->append( tr("Thallium") ); | ||
138 | names->append( tr("Lead") ); | ||
139 | names->append( tr("Bismuth") ); | ||
140 | names->append( tr("Polonium") ); | ||
141 | names->append( tr("Astatine") ); | ||
142 | names->append( tr("Radon") ); | ||
143 | names->append( tr("Francium") ); | ||
144 | names->append( tr("Radium") ); | ||
145 | names->append( tr("Actinium") ); | ||
146 | names->append( tr("Thorium") ); | ||
147 | names->append( tr("Protactinium") ); | ||
148 | names->append( tr("Uranium") ); | ||
149 | names->append( tr("Neptunium") ); | ||
150 | names->append( tr("Plutonium") ); | ||
151 | names->append( tr("Americium") ); | ||
152 | names->append( tr("Curium") ); | ||
153 | names->append( tr("Berkelium") ); | ||
154 | names->append( tr("Californium") ); | ||
155 | names->append( tr("Einsteinium") ); | ||
156 | names->append( tr("Fermium") ); | ||
157 | names->append( tr("Mendelevium") ); | ||
158 | names->append( tr("Nobelium") ); | ||
159 | names->append( tr("Lawrencium") ); | ||
160 | names->append( tr("Rutherfordium") ); | ||
161 | names->append( tr("Dubnium") ); | ||
162 | names->append( tr("Seaborgium") ); | ||
163 | names->append( tr("Bohrium") ); | ||
164 | names->append( tr("Hassium") ); | ||
165 | names->append( tr("Meitnerium") ); | ||
166 | } | ||
167 | |||
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h index cd716ad..154f4be 100644 --- a/noncore/apps/oxygen/datawidgetui.h +++ b/noncore/apps/oxygen/datawidgetui.h | |||
@@ -21,21 +21,26 @@ | |||
21 | 21 | ||
22 | 22 | ||
23 | class OxydataWidget; | 23 | class OxydataWidget; |
24 | class OxydataTable; | 24 | class OxydataTable; |
25 | 25 | ||
26 | class QComboBox; | 26 | class QComboBox; |
27 | class QStringList; | ||
28 | |||
27 | #include <qwidget.h> | 29 | #include <qwidget.h> |
28 | 30 | ||
29 | class dataWidgetUI : public QWidget | 31 | class dataWidgetUI : public QWidget |
30 | { | 32 | { |
31 | Q_OBJECT | 33 | Q_OBJECT |
32 | 34 | ||
33 | public: | 35 | public: |
34 | dataWidgetUI(); | 36 | dataWidgetUI(); |
37 | QStringList *names; | ||
35 | 38 | ||
36 | private: | 39 | private: |
37 | OxydataTable *DataTable; | 40 | OxydataTable *DataTable; |
38 | QComboBox *dataCombo; | 41 | QComboBox *dataCombo; |
39 | OxydataWidget *oxyDW; | 42 | OxydataWidget *oxyDW; |
43 | |||
44 | void loadNames(); | ||
40 | }; | 45 | }; |
41 | #endif | 46 | #endif |
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp index b1b5db5..22d1833 100644 --- a/noncore/apps/oxygen/oxygen.cpp +++ b/noncore/apps/oxygen/oxygen.cpp | |||
@@ -15,13 +15,12 @@ | |||
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "oxygen.h" | 17 | #include "oxygen.h" |
18 | 18 | ||
19 | #include <qapplication.h> | 19 | #include <qapplication.h> |
20 | #include <qtabwidget.h> | 20 | #include <qtabwidget.h> |
21 | #include <qvaluelist.h> | ||
22 | 21 | ||
23 | #include "calcdlg.h" | 22 | #include "calcdlg.h" |
24 | #include "calcdlgui.h" | 23 | #include "calcdlgui.h" |
25 | #include "datawidgetui.h" | 24 | #include "datawidgetui.h" |
26 | #include "psewidget.h" | 25 | #include "psewidget.h" |
27 | 26 | ||
@@ -36,122 +35,8 @@ Oxygen::Oxygen() : QMainWindow() | |||
36 | 35 | ||
37 | QTabWidget *tabw = new QTabWidget( this , "qtab" ); | 36 | QTabWidget *tabw = new QTabWidget( this , "qtab" ); |
38 | tabw->addTab( pse, tr( "PSE" )); | 37 | tabw->addTab( pse, tr( "PSE" )); |
39 | tabw->addTab( DataWidgetUI , tr( "Data" ) ); | 38 | tabw->addTab( DataWidgetUI , tr( "Data" ) ); |
40 | tabw->addTab( CalcDlgUI, tr( "Calculations" ) ); | 39 | tabw->addTab( CalcDlgUI, tr( "Calculations" ) ); |
41 | setCentralWidget( tabw ); | 40 | setCentralWidget( tabw ); |
42 | |||
43 | names = newQStringList(); | ||
44 | } | 41 | } |
45 | 42 | ||
46 | void Oxygen::loadNames() | ||
47 | { | ||
48 | names->append( tr("Hydrogen") ); | ||
49 | names->append( tr("Helium") ); | ||
50 | names->append( tr("Lithium") ); | ||
51 | names->append( tr("Beryllium") ); | ||
52 | names->append( tr("Boron") ); | ||
53 | names->append( tr("Carbon") ); | ||
54 | names->append( tr("Nitrogen") ); | ||
55 | names->append( tr("Oxygen") ); | ||
56 | names->append( tr("Fluorine") ); | ||
57 | names->append( tr("Neon") ); | ||
58 | names->append( tr("Sodium") ); | ||
59 | names->append( tr("Magnesium") ); | ||
60 | names->append( tr("Aluminum") ); | ||
61 | names->append( tr("Silicon") ); | ||
62 | names->append( tr("Phosphorus") ); | ||
63 | names->append( tr("Sulfur") ); | ||
64 | names->append( tr("Chlorine") ); | ||
65 | names->append( tr("Argon") ); | ||
66 | names->append( tr("Potassium") ); | ||
67 | names->append( tr("Calcium") ); | ||
68 | names->append( tr("Scandium") ); | ||
69 | names->append( tr("Titanium") ); | ||
70 | names->append( tr("Vanadium") ); | ||
71 | names->append( tr("Chromium") ); | ||
72 | names->append( tr("Manganese") ); | ||
73 | names->append( tr("Iron") ); | ||
74 | names->append( tr("Cobalt") ); | ||
75 | names->append( tr("Nickel") ); | ||
76 | names->append( tr("Copper") ); | ||
77 | names->append( tr("Zinc") ); | ||
78 | names->append( tr("Gallium") ); | ||
79 | names->append( tr("Germanium") ); | ||
80 | names->append( tr("Arsenic") ); | ||
81 | names->append( tr("Selenium") ); | ||
82 | names->append( tr("Bromine") ); | ||
83 | names->append( tr("Krypton") ); | ||
84 | names->append( tr("Rubidium") ); | ||
85 | names->append( tr("Strontium") ); | ||
86 | names->append( tr("Yttrium") ); | ||
87 | names->append( tr("Zirconium") ); | ||
88 | names->append( tr("Niobium") ); | ||
89 | names->append( tr("Molybdenum") ); | ||
90 | names->append( tr("Technetium") ); | ||
91 | names->append( tr("Ruthenium") ); | ||
92 | names->append( tr("Rhodium") ); | ||
93 | names->append( tr("Palladium") ); | ||
94 | names->append( tr("Silver") ); | ||
95 | names->append( tr("Cadmium") ); | ||
96 | names->append( tr("Indium") ); | ||
97 | names->append( tr("Tin") ); | ||
98 | names->append( tr("Antimony") ); | ||
99 | names->append( tr("Tellurium") ); | ||
100 | names->append( tr("Iodine") ); | ||
101 | names->append( tr("Xenon") ); | ||
102 | names->append( tr("Cesium") ); | ||
103 | names->append( tr("Barium") ); | ||
104 | names->append( tr("Lanthanum") ); | ||
105 | names->append( tr("Cerium") ); | ||
106 | names->append( tr("Praseodymium") ); | ||
107 | names->append( tr("Neodymium") ); | ||
108 | names->append( tr("Promethium") ); | ||
109 | names->append( tr("Samarium") ); | ||
110 | names->append( tr("Europium") ); | ||
111 | names->append( tr("Gadolinium") ); | ||
112 | names->append( tr("Terbium") ); | ||
113 | names->append( tr("Dysprosium") ); | ||
114 | names->append( tr("Holmium") ); | ||
115 | names->append( tr("Erbium") ); | ||
116 | names->append( tr("Thulium") ); | ||
117 | names->append( tr("Ytterbium") ); | ||
118 | names->append( tr("Lutetium") ); | ||
119 | names->append( tr("Hafnium") ); | ||
120 | names->append( tr("Tantalum") ); | ||
121 | names->append( tr("Tungsten") ); | ||
122 | names->append( tr("Rhenium") ); | ||
123 | names->append( tr("Osmium") ); | ||
124 | names->append( tr("Iridium") ); | ||
125 | names->append( tr("Platinum") ); | ||
126 | names->append( tr("Gold") ); | ||
127 | names->append( tr("Mercury") ); | ||
128 | names->append( tr("Thallium") ); | ||
129 | names->append( tr("Lead") ); | ||
130 | names->append( tr("Bismuth") ); | ||
131 | names->append( tr("Polonium") ); | ||
132 | names->append( tr("Astatine") ); | ||
133 | names->append( tr("Radon") ); | ||
134 | names->append( tr("Francium") ); | ||
135 | names->append( tr("Radium") ); | ||
136 | names->append( tr("Actinium") ); | ||
137 | names->append( tr("Thorium") ); | ||
138 | names->append( tr("Protactinium") ); | ||
139 | names->append( tr("Uranium") ); | ||
140 | names->append( tr("Neptunium") ); | ||
141 | names->append( tr("Plutonium") ); | ||
142 | names->append( tr("Americium") ); | ||
143 | names->append( tr("Curium") ); | ||
144 | names->append( tr("Berkelium") ); | ||
145 | names->append( tr("Californium") ); | ||
146 | names->append( tr("Einsteinium") ); | ||
147 | names->append( tr("Fermium") ); | ||
148 | names->append( tr("Mendelevium") ); | ||
149 | names->append( tr("Nobelium") ); | ||
150 | names->append( tr("Lawrencium") ); | ||
151 | names->append( tr("Rutherfordium") ); | ||
152 | names->append( tr("Dubnium") ); | ||
153 | names->append( tr("Seaborgium") ); | ||
154 | names->append( tr("Bohrium") ); | ||
155 | names->append( tr("Hassium") ); | ||
156 | names->append( tr("Meitnerium") ); | ||
157 | } | ||
diff --git a/noncore/apps/oxygen/oxygen.h b/noncore/apps/oxygen/oxygen.h index 0b7655a..36ee9bc 100644 --- a/noncore/apps/oxygen/oxygen.h +++ b/noncore/apps/oxygen/oxygen.h | |||
@@ -6,19 +6,16 @@ | |||
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | #include <qmainwindow.h> | 10 | #include <qmainwindow.h> |
11 | 11 | ||
12 | class QStringList; | ||
13 | |||
14 | class Oxygen : public QMainWindow | 12 | class Oxygen : public QMainWindow |
15 | { | 13 | { |
16 | Q_OBJECT | 14 | Q_OBJECT |
17 | 15 | ||
18 | public: | 16 | public: |
19 | Oxygen(); | 17 | Oxygen(); |
20 | QStringList *names; | ||
21 | 18 | ||
22 | private: | 19 | private: |
23 | void loadNames(); | 20 | void loadNames(); |
24 | }; | 21 | }; |