summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-12-27 12:31:35 (UTC)
committer cniehaus <cniehaus>2002-12-27 12:31:35 (UTC)
commitc432e5eaca0ada1ede2b2966ae86be045e8c3f9b (patch) (unidiff)
tree621dd6cf0b3f2a69cb1693963f5f92e69d4cb7ea
parent36c8b8ffff2c8a7a454aa1b8afbe96bd9b1535f9 (diff)
downloadopie-c432e5eaca0ada1ede2b2966ae86be045e8c3f9b.zip
opie-c432e5eaca0ada1ede2b2966ae86be045e8c3f9b.tar.gz
opie-c432e5eaca0ada1ede2b2966ae86be045e8c3f9b.tar.bz2
juhu, this should be fully translatable now :)
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
@@ -25,13 +25,11 @@
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
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" ));
36 QGridLayout *qgrid = new QGridLayout( this, 2,1 ); 34 QGridLayout *qgrid = new QGridLayout( this, 2,1 );
37 35
@@ -42,9 +40,8 @@ dataWidgetUI::dataWidgetUI() : QWidget()
42 for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++) 40 for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++)
43 { 41 {
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) ) );
49 oxyDW->setElement( 0 ); 46 oxyDW->setElement( 0 );
50 oxyDW->setLayout(); 47 oxyDW->setLayout();
@@ -52,118 +49,5 @@ dataWidgetUI::dataWidgetUI() : QWidget()
52 qgrid->addWidget( dataCombo, 0,0); 49 qgrid->addWidget( dataCombo, 0,0);
53 qgrid->addWidget( oxyDW , 1,0 ); 50 qgrid->addWidget( oxyDW , 1,0 );
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
@@ -32,15 +32,13 @@ class dataWidgetUI : public QWidget
32{ 32{
33 Q_OBJECT 33 Q_OBJECT
34 34
35 public: 35 public:
36 dataWidgetUI(); 36 dataWidgetUI(const QStringList &list=0);
37 QStringList names;
38 37
39 private: 38 private:
40 OxydataTable *DataTable; 39 OxydataTable *DataTable;
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
@@ -35,7 +35,7 @@ OxyFrame::OxyFrame(QWidget *parent, const char *name, QString symbol )
35 setFont( font ); 35 setFont( font );
36 setText( symbol ); 36 setText( 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
@@ -26,11 +26,12 @@
26 26
27 27
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" ) );
35 36
36 QTabWidget *tabw = new QTabWidget( this , "qtab" ); 37 QTabWidget *tabw = new QTabWidget( this , "qtab" );
@@ -39,4 +40,118 @@ Oxygen::Oxygen() : QMainWindow()
39 tabw->addTab( CalcDlgUI, tr( "Calculations" ) ); 40 tabw->addTab( CalcDlgUI, tr( "Calculations" ) );
40 setCentralWidget( tabw ); 41 setCentralWidget( tabw );
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
@@ -6,8 +6,10 @@
6 * ( at your option ) any later version. * 6 * ( at your option ) any later version. *
7 * * 7 * *
8 **************************************************************************/ 8 **************************************************************************/
9 9
10class QStringList;
11
10#include <qmainwindow.h> 12#include <qmainwindow.h>
11 13
12class Oxygen : public QMainWindow 14class Oxygen : public QMainWindow
13{ 15{
@@ -17,5 +19,6 @@ class Oxygen : public QMainWindow
17 Oxygen(); 19 Oxygen();
18 20
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
@@ -23,13 +23,14 @@
23#include "psewidget.h" 23#include "psewidget.h"
24#include "oxyframe.h" 24#include "oxyframe.h"
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 );
34 35
35 QGridLayout *grid = new QGridLayout( 18,10 ); 36 QGridLayout *grid = new QGridLayout( 18,10 );
@@ -48,9 +49,9 @@ PSEWidget::PSEWidget() : QWidget()
48 connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); 49 connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) ));
49 connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( inverseColor(QString) )); 50 connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( inverseColor(QString) ));
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();
55 56
56 vlay->addLayout( grid ); 57 vlay->addLayout( grid );
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
@@ -21,17 +21,19 @@
21#include <qlist.h> 21#include <qlist.h>
22#include "oxyframe.h" 22#include "oxyframe.h"
23 23
24class QGridLayout; 24class QGridLayout;
25class QStringList;
26
25class OxydataWidget; 27class OxydataWidget;
26class PSEframe; 28class PSEframe;
27 29
28class PSEWidget : public QWidget 30class PSEWidget : public QWidget
29{ 31{
30 Q_OBJECT 32 Q_OBJECT
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;
36 38
37 QList<OxyFrame> PSEframe; 39 QList<OxyFrame> PSEframe;
@@ -42,8 +44,9 @@ class PSEWidget : public QWidget
42 QGridLayout *maingrid; 44 QGridLayout *maingrid;
43 45
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:
48 void slotShowElement(QString); 51 void slotShowElement(QString);
49 void inverseColor( QString ); 52 void inverseColor( QString );