summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp120
-rw-r--r--noncore/apps/oxygen/datawidgetui.h6
-rw-r--r--noncore/apps/oxygen/oxyframe.cpp2
-rw-r--r--noncore/apps/oxygen/oxygen.cpp119
-rw-r--r--noncore/apps/oxygen/oxygen.h3
-rw-r--r--noncore/apps/oxygen/psewidget.cpp5
-rw-r--r--noncore/apps/oxygen/psewidget.h5
7 files changed, 132 insertions, 128 deletions
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index 91d669f..e1d6e41 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -27,9 +27,7 @@
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28 28
29dataWidgetUI::dataWidgetUI() : QWidget() 29dataWidgetUI::dataWidgetUI(const QStringList &list) : QWidget()
30{ 30{
31 31 names = list;
32 names = 0;
33 loadNames();
34 32
35 this->setCaption( tr( "Chemical Data" )); 33 this->setCaption( tr( "Chemical Data" ));
@@ -44,5 +42,4 @@ dataWidgetUI::dataWidgetUI() : QWidget()
44 dataCombo->insertItem( QString::number( i+1 )+" - "+*it ); 42 dataCombo->insertItem( QString::number( i+1 )+" - "+*it );
45 } 43 }
46 QStringList::ConstIterator it = names.begin();
47 OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names); 44 OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names);
48 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); 45 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
@@ -54,116 +51,3 @@ dataWidgetUI::dataWidgetUI() : QWidget()
54} 51}
55 52
56void dataWidgetUI::loadNames()
57{
58 names.clear();
59 names.append( tr("Hydrogen") );
60 names.append( tr("Helium") );
61 names.append( tr("Lithium") );
62 names.append( tr("Beryllium") );
63 names.append( tr("Boron") );
64 names.append( tr("Carbon") );
65 names.append( tr("Nitrogen") );
66 names.append( tr("Oxygen") );
67 names.append( tr("Fluorine") );
68 names.append( tr("Neon") );
69 names.append( tr("Sodium") );
70 names.append( tr("Magnesium") );
71 names.append( tr("Aluminum") );
72 names.append( tr("Silicon") );
73 names.append( tr("Phosphorus") );
74 names.append( tr("Sulfur") );
75 names.append( tr("Chlorine") );
76 names.append( tr("Argon") );
77 names.append( tr("Potassium") );
78 names.append( tr("Calcium") );
79 names.append( tr("Scandium") );
80 names.append( tr("Titanium") );
81 names.append( tr("Vanadium") );
82 names.append( tr("Chromium") );
83 names.append( tr("Manganese") );
84 names.append( tr("Iron") );
85 names.append( tr("Cobalt") );
86 names.append( tr("Nickel") );
87 names.append( tr("Copper") );
88 names.append( tr("Zinc") );
89 names.append( tr("Gallium") );
90 names.append( tr("Germanium") );
91 names.append( tr("Arsenic") );
92 names.append( tr("Selenium") );
93 names.append( tr("Bromine") );
94 names.append( tr("Krypton") );
95 names.append( tr("Rubidium") );
96 names.append( tr("Strontium") );
97 names.append( tr("Yttrium") );
98 names.append( tr("Zirconium") );
99 names.append( tr("Niobium") );
100 names.append( tr("Molybdenum") );
101 names.append( tr("Technetium") );
102 names.append( tr("Ruthenium") );
103 names.append( tr("Rhodium") );
104 names.append( tr("Palladium") );
105 names.append( tr("Silver") );
106 names.append( tr("Cadmium") );
107 names.append( tr("Indium") );
108 names.append( tr("Tin") );
109 names.append( tr("Antimony") );
110 names.append( tr("Tellurium") );
111 names.append( tr("Iodine") );
112 names.append( tr("Xenon") );
113 names.append( tr("Cesium") );
114 names.append( tr("Barium") );
115 names.append( tr("Lanthanum") );
116 names.append( tr("Cerium") );
117 names.append( tr("Praseodymium") );
118 names.append( tr("Neodymium") );
119 names.append( tr("Promethium") );
120 names.append( tr("Samarium") );
121 names.append( tr("Europium") );
122 names.append( tr("Gadolinium") );
123 names.append( tr("Terbium") );
124 names.append( tr("Dysprosium") );
125 names.append( tr("Holmium") );
126 names.append( tr("Erbium") );
127 names.append( tr("Thulium") );
128 names.append( tr("Ytterbium") );
129 names.append( tr("Lutetium") );
130 names.append( tr("Hafnium") );
131 names.append( tr("Tantalum") );
132 names.append( tr("Tungsten") );
133 names.append( tr("Rhenium") );
134 names.append( tr("Osmium") );
135 names.append( tr("Iridium") );
136 names.append( tr("Platinum") );
137 names.append( tr("Gold") );
138 names.append( tr("Mercury") );
139 names.append( tr("Thallium") );
140 names.append( tr("Lead") );
141 names.append( tr("Bismuth") );
142 names.append( tr("Polonium") );
143 names.append( tr("Astatine") );
144 names.append( tr("Radon") );
145 names.append( tr("Francium") );
146 names.append( tr("Radium") );
147 names.append( tr("Actinium") );
148 names.append( tr("Thorium") );
149 names.append( tr("Protactinium") );
150 names.append( tr("Uranium") );
151 names.append( tr("Neptunium") );
152 names.append( tr("Plutonium") );
153 names.append( tr("Americium") );
154 names.append( tr("Curium") );
155 names.append( tr("Berkelium") );
156 names.append( tr("Californium") );
157 names.append( tr("Einsteinium") );
158 names.append( tr("Fermium") );
159 names.append( tr("Mendelevium") );
160 names.append( tr("Nobelium") );
161 names.append( tr("Lawrencium") );
162 names.append( tr("Rutherfordium") );
163 names.append( tr("Dubnium") );
164 names.append( tr("Seaborgium") );
165 names.append( tr("Bohrium") );
166 names.append( tr("Hassium") );
167 names.append( tr("Meitnerium") );
168}
169 53
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h
index a2b48fa..3797418 100644
--- a/noncore/apps/oxygen/datawidgetui.h
+++ b/noncore/apps/oxygen/datawidgetui.h
@@ -34,6 +34,5 @@ class dataWidgetUI : public QWidget
34 34
35 public: 35 public:
36 dataWidgetUI(); 36 dataWidgetUI(const QStringList &list=0);
37 QStringList names;
38 37
39 private: 38 private:
@@ -41,6 +40,5 @@ class dataWidgetUI : public QWidget
41 QComboBox *dataCombo; 40 QComboBox *dataCombo;
42 OxydataWidget *oxyDW; 41 OxydataWidget *oxyDW;
43 42 QStringList names;
44 void loadNames();
45}; 43};
46#endif 44#endif
diff --git a/noncore/apps/oxygen/oxyframe.cpp b/noncore/apps/oxygen/oxyframe.cpp
index 2ce40e7..5a4dbbe 100644
--- a/noncore/apps/oxygen/oxyframe.cpp
+++ b/noncore/apps/oxygen/oxyframe.cpp
@@ -37,5 +37,5 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name, QString symbol )
37} 37}
38 38
39void OxyFrame::mousePressEvent ( QMouseEvent * e ){ 39void OxyFrame::mousePressEvent ( QMouseEvent* /*e*/ ){
40 emit num( N ); 40 emit num( N );
41}; 41};
diff --git a/noncore/apps/oxygen/oxygen.cpp b/noncore/apps/oxygen/oxygen.cpp
index 22d1833..215cc19 100644
--- a/noncore/apps/oxygen/oxygen.cpp
+++ b/noncore/apps/oxygen/oxygen.cpp
@@ -28,7 +28,8 @@
28Oxygen::Oxygen() : QMainWindow() 28Oxygen::Oxygen() : QMainWindow()
29{ 29{
30 PSEWidget *pse = new PSEWidget(); 30 loadNames();
31 calcDlgUI *CalcDlgUI = new calcDlgUI(); 31 calcDlgUI *CalcDlgUI = new calcDlgUI();
32 dataWidgetUI *DataWidgetUI = new dataWidgetUI(); 32 PSEWidget *pse = new PSEWidget(names);
33 dataWidgetUI *DataWidgetUI = new dataWidgetUI(names);
33 34
34 this->setCaption( tr( "Oxygen" ) ); 35 this->setCaption( tr( "Oxygen" ) );
@@ -41,2 +42,116 @@ Oxygen::Oxygen() : QMainWindow()
41} 42}
42 43
44void Oxygen::loadNames()
45{
46 names.clear();
47 names.append( tr("Hydrogen") );
48 names.append( tr("Helium") );
49 names.append( tr("Lithium") );
50 names.append( tr("Beryllium") );
51 names.append( tr("Boron") );
52 names.append( tr("Carbon") );
53 names.append( tr("Nitrogen") );
54 names.append( tr("Oxygen") );
55 names.append( tr("Fluorine") );
56 names.append( tr("Neon") );
57 names.append( tr("Sodium") );
58 names.append( tr("Magnesium") );
59 names.append( tr("Aluminum") );
60 names.append( tr("Silicon") );
61 names.append( tr("Phosphorus") );
62 names.append( tr("Sulfur") );
63 names.append( tr("Chlorine") );
64 names.append( tr("Argon") );
65 names.append( tr("Potassium") );
66 names.append( tr("Calcium") );
67 names.append( tr("Scandium") );
68 names.append( tr("Titanium") );
69 names.append( tr("Vanadium") );
70 names.append( tr("Chromium") );
71 names.append( tr("Manganese") );
72 names.append( tr("Iron") );
73 names.append( tr("Cobalt") );
74 names.append( tr("Nickel") );
75 names.append( tr("Copper") );
76 names.append( tr("Zinc") );
77 names.append( tr("Gallium") );
78 names.append( tr("Germanium") );
79 names.append( tr("Arsenic") );
80 names.append( tr("Selenium") );
81 names.append( tr("Bromine") );
82 names.append( tr("Krypton") );
83 names.append( tr("Rubidium") );
84 names.append( tr("Strontium") );
85 names.append( tr("Yttrium") );
86 names.append( tr("Zirconium") );
87 names.append( tr("Niobium") );
88 names.append( tr("Molybdenum") );
89 names.append( tr("Technetium") );
90 names.append( tr("Ruthenium") );
91 names.append( tr("Rhodium") );
92 names.append( tr("Palladium") );
93 names.append( tr("Silver") );
94 names.append( tr("Cadmium") );
95 names.append( tr("Indium") );
96 names.append( tr("Tin") );
97 names.append( tr("Antimony") );
98 names.append( tr("Tellurium") );
99 names.append( tr("Iodine") );
100 names.append( tr("Xenon") );
101 names.append( tr("Cesium") );
102 names.append( tr("Barium") );
103 names.append( tr("Lanthanum") );
104 names.append( tr("Cerium") );
105 names.append( tr("Praseodymium") );
106 names.append( tr("Neodymium") );
107 names.append( tr("Promethium") );
108 names.append( tr("Samarium") );
109 names.append( tr("Europium") );
110 names.append( tr("Gadolinium") );
111 names.append( tr("Terbium") );
112 names.append( tr("Dysprosium") );
113 names.append( tr("Holmium") );
114 names.append( tr("Erbium") );
115 names.append( tr("Thulium") );
116 names.append( tr("Ytterbium") );
117 names.append( tr("Lutetium") );
118 names.append( tr("Hafnium") );
119 names.append( tr("Tantalum") );
120 names.append( tr("Tungsten") );
121 names.append( tr("Rhenium") );
122 names.append( tr("Osmium") );
123 names.append( tr("Iridium") );
124 names.append( tr("Platinum") );
125 names.append( tr("Gold") );
126 names.append( tr("Mercury") );
127 names.append( tr("Thallium") );
128 names.append( tr("Lead") );
129 names.append( tr("Bismuth") );
130 names.append( tr("Polonium") );
131 names.append( tr("Astatine") );
132 names.append( tr("Radon") );
133 names.append( tr("Francium") );
134 names.append( tr("Radium") );
135 names.append( tr("Actinium") );
136 names.append( tr("Thorium") );
137 names.append( tr("Protactinium") );
138 names.append( tr("Uranium") );
139 names.append( tr("Neptunium") );
140 names.append( tr("Plutonium") );
141 names.append( tr("Americium") );
142 names.append( tr("Curium") );
143 names.append( tr("Berkelium") );
144 names.append( tr("Californium") );
145 names.append( tr("Einsteinium") );
146 names.append( tr("Fermium") );
147 names.append( tr("Mendelevium") );
148 names.append( tr("Nobelium") );
149 names.append( tr("Lawrencium") );
150 names.append( tr("Rutherfordium") );
151 names.append( tr("Dubnium") );
152 names.append( tr("Seaborgium") );
153 names.append( tr("Bohrium") );
154 names.append( tr("Hassium") );
155 names.append( tr("Meitnerium") );
156}
157
diff --git a/noncore/apps/oxygen/oxygen.h b/noncore/apps/oxygen/oxygen.h
index 36ee9bc..57fe9fe 100644
--- a/noncore/apps/oxygen/oxygen.h
+++ b/noncore/apps/oxygen/oxygen.h
@@ -8,4 +8,6 @@
8 **************************************************************************/ 8 **************************************************************************/
9 9
10class QStringList;
11
10#include <qmainwindow.h> 12#include <qmainwindow.h>
11 13
@@ -19,3 +21,4 @@ class Oxygen : public QMainWindow
19 private: 21 private:
20 void loadNames(); 22 void loadNames();
23 QStringList names;
21}; 24};
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index d8e4086..b396046 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -25,9 +25,10 @@
25 25
26 26
27PSEWidget::PSEWidget() : QWidget() 27PSEWidget::PSEWidget(const QStringList &list) : QWidget()
28{ 28{
29 this->setCaption( tr( "Periodic System" ) ); 29 this->setCaption( tr( "Periodic System" ) );
30 30
31 lastElement=1; 31 lastElement=1;
32 names = list;
32 33
33 QVBoxLayout *vlay = new QVBoxLayout( this ); 34 QVBoxLayout *vlay = new QVBoxLayout( this );
@@ -50,5 +51,5 @@ PSEWidget::PSEWidget() : QWidget()
50 } 51 }
51 52
52 oxyDW = new OxydataWidget(this); 53 oxyDW = new OxydataWidget(this, "PSEWidget_oxyDW", names);
53 oxyDW->setElement( 0 ); 54 oxyDW->setElement( 0 );
54 oxyDW->setLayout(); 55 oxyDW->setLayout();
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h
index ddeab9d..42a2e38 100644
--- a/noncore/apps/oxygen/psewidget.h
+++ b/noncore/apps/oxygen/psewidget.h
@@ -23,4 +23,6 @@
23 23
24class QGridLayout; 24class QGridLayout;
25class QStringList;
26
25class OxydataWidget; 27class OxydataWidget;
26class PSEframe; 28class PSEframe;
@@ -31,5 +33,5 @@ class PSEWidget : public QWidget
31 33
32 public: 34 public:
33 PSEWidget(); 35 PSEWidget(const QStringList &list=0);
34 QGridLayout *bottom_grid; 36 QGridLayout *bottom_grid;
35 OxydataWidget *oxyDW; 37 OxydataWidget *oxyDW;
@@ -44,4 +46,5 @@ class PSEWidget : public QWidget
44 void position( int, int&, int& ); 46 void position( int, int&, int& );
45 QColor PSEColor( QString ); 47 QColor PSEColor( QString );
48 QStringList names;
46 49
47 public slots: 50 public slots: