summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp4
-rw-r--r--noncore/apps/oxygen/dataTable.h3
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp128
-rw-r--r--noncore/apps/oxygen/datawidgetui.h5
-rw-r--r--noncore/apps/oxygen/oxygen.cpp115
-rw-r--r--noncore/apps/oxygen/oxygen.h3
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
@@ -1,149 +1,151 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen 2 application: : Oxygen
3 3
4 begin : September 2002 4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus 5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17 17
18#include <qpe/config.h> 18#include <qpe/config.h>
19 19
20#include "dataTable.h" 20#include "dataTable.h"
21#include <qwidget.h> 21#include <qwidget.h>
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
28OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) 28#include <qstringlist.h>
29
30OxydataWidget::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 );
35 right = new QLabel( hbox ); 37 right = new QLabel( hbox );
36 38
37 right->setAlignment( AlignRight ); 39 right->setAlignment( AlignRight );
38 middle->setAlignment( AlignHCenter ); 40 middle->setAlignment( AlignHCenter );
39 41
40 QFont bf; 42 QFont bf;
41 bf.setBold( true ); 43 bf.setBold( true );
42 bf.setPointSize( bf.pointSize()+2 ); 44 bf.setPointSize( bf.pointSize()+2 );
43 middle->setFont( bf ); 45 middle->setFont( bf );
44 46
45 DataTable = new OxydataTable( 9,2, this ); 47 DataTable = new OxydataTable( 9,2, this );
46 setTable(); 48 setTable();
47 49
48 qgrid->addWidget( hbox,0,0 ); 50 qgrid->addWidget( hbox,0,0 );
49 qgrid->addWidget( DataTable,1,0 ); 51 qgrid->addWidget( DataTable,1,0 );
50} 52}
51 53
52void OxydataWidget::setElement( int el ) 54void OxydataWidget::setElement( int el )
53{ 55{
54 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); 56 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
55 57
56 configobj.setGroup( QString::number( el+1 )); 58 configobj.setGroup( QString::number( el+1 ));
57 59
58 left->setText( configobj.readEntry( "Symbol" ) ); 60 left->setText( configobj.readEntry( "Symbol" ) );
59 middle->setText( configobj.readEntry( "Name" ) ); 61 middle->setText( configobj.readEntry( "Name" ) );
60 right->setText( QString::number( el+1 ) ); 62 right->setText( QString::number( el+1 ) );
61 63
62 64
63 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); 65 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) );
64 DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); 66 DataTable->setText( 1,1,configobj.readEntry( "Block" ) );
65 DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); 67 DataTable->setText( 2,1,configobj.readEntry( "Group" ) );
66 DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); 68 DataTable->setText( 3,1,configobj.readEntry( "EN" ) );
67 DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ; 69 DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ;
68 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); 70 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) );
69 DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) ); 71 DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) );
70 DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) ); 72 DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) );
71 DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) ); 73 DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) );
72} 74}
73 75
74void OxydataWidget::setTable() const 76void OxydataWidget::setTable() const
75{ 77{
76 DataTable->setText( 0,0, tr( "Weight:" ) ); 78 DataTable->setText( 0,0, tr( "Weight:" ) );
77 DataTable->setText( 1,0, tr( "Block" )) ; 79 DataTable->setText( 1,0, tr( "Block" )) ;
78 DataTable->setText( 2,0, tr( "Group" )) ; 80 DataTable->setText( 2,0, tr( "Group" )) ;
79 DataTable->setText( 3,0, tr( "Electronegativity" )) ; 81 DataTable->setText( 3,0, tr( "Electronegativity" )) ;
80 DataTable->setText( 4,0, tr( "Atomic radius" )) ; 82 DataTable->setText( 4,0, tr( "Atomic radius" )) ;
81 DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; 83 DataTable->setText( 5,0, tr( "Ionizationenergie" )) ;
82 DataTable->setText( 6,0, tr( "Density" )) ; 84 DataTable->setText( 6,0, tr( "Density" )) ;
83 DataTable->setText( 7,0, tr( "Boilingpoint" ) ); 85 DataTable->setText( 7,0, tr( "Boilingpoint" ) );
84 DataTable->setText( 8,0, tr( "Meltingpoint" ) ); 86 DataTable->setText( 8,0, tr( "Meltingpoint" ) );
85} 87}
86 88
87void OxydataWidget::setLayout() 89void OxydataWidget::setLayout()
88{ 90{
89#warning this is not working and I have no idea why! 91#warning this is not working and I have no idea why!
90// DataTable->setColumnWidth ( 0 , this->width()/2 ); 92// DataTable->setColumnWidth ( 0 , this->width()/2 );
91// DataTable->setColumnWidth ( 1 , this->width()/2 ); 93// DataTable->setColumnWidth ( 1 , this->width()/2 );
92 94
93//X DataTable->setColumnWidth ( 0 , 110 ); 95//X DataTable->setColumnWidth ( 0 , 110 );
94//X DataTable->setColumnWidth ( 1 , 110 ); 96//X DataTable->setColumnWidth ( 1 , 110 );
95} 97}
96 98
97OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, 99OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
98 const char *name) : QTable(numRows, numCols,parent, name) 100 const char *name) : QTable(numRows, numCols,parent, name)
99{ 101{
100 102
101 for (int zeile = 0; zeile < numRows; zeile++) 103 for (int zeile = 0; zeile < numRows; zeile++)
102 for ( int spalte = 0; spalte < numCols; spalte++ ) 104 for ( int spalte = 0; spalte < numCols; spalte++ )
103 { 105 {
104 OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); 106 OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" );
105 setItem(zeile, spalte, (QTableItem*)testus); 107 setItem(zeile, spalte, (QTableItem*)testus);
106 } 108 }
107 109
108 110
109 this->setShowGrid( false ); 111 this->setShowGrid( false );
110 this->setHScrollBarMode(QScrollView::AlwaysOff); 112 this->setHScrollBarMode(QScrollView::AlwaysOff);
111 this->horizontalHeader()->hide(); 113 this->horizontalHeader()->hide();
112 this->verticalHeader()->hide(); 114 this->verticalHeader()->hide();
113 this->setTopMargin( 0 ); 115 this->setTopMargin( 0 );
114 this->setLeftMargin( 0 ); 116 this->setLeftMargin( 0 );
115} 117}
116 118
117void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) 119void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
118{ 120{
119 if ( cr.width() == 0 || cr.height() == 0 ) 121 if ( cr.width() == 0 || cr.height() == 0 )
120 return; 122 return;
121 selected = FALSE; 123 selected = FALSE;
122 124
123 QTableItem *itm = item( row, col ); 125 QTableItem *itm = item( row, col );
124 QColorGroup colgrp = colorGroup(); 126 QColorGroup colgrp = colorGroup();
125 if ( itm ) 127 if ( itm )
126 { 128 {
127 if ( row%2 ) 129 if ( row%2 )
128 colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) ); 130 colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) );
129 else 131 else
130 colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) ); 132 colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) );
131 p->save(); 133 p->save();
132 itm->paint( p, colgrp, cr, selected ); 134 itm->paint( p, colgrp, cr, selected );
133 p->restore(); 135 p->restore();
134 } 136 }
135} 137}
136 138
137OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) 139OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text )
138 : QTableItem ( table, et, text ) 140 : QTableItem ( table, et, text )
139{ 141{
140} 142}
141 143
142int OxydataQTI::alignment() const 144int OxydataQTI::alignment() const
143{ 145{
144 if ( col()%2 ) 146 if ( col()%2 )
145 { 147 {
146 return AlignRight | AlignVCenter; 148 return AlignRight | AlignVCenter;
147 }else return AlignLeft | AlignVCenter; 149 }else return AlignLeft | AlignVCenter;
148}; 150};
149 151
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
@@ -1,85 +1,86 @@
1 1
2/*************************************************************************** 2/***************************************************************************
3 * * 3 * *
4 * This program is free software; you can redistribute it and/or modify * 4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by * 5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or * 6 * the Free Software Foundation; either version 2 of the License, or *
7 * ( at your option ) any later version. * 7 * ( at your option ) any later version. *
8 * * 8 * *
9 **************************************************************************/ 9 **************************************************************************/
10 10
11#ifndef _DATATABLE_H 11#ifndef _DATATABLE_H
12#define _DATATABLE_H 12#define _DATATABLE_H
13 13
14#include <qwidget.h> 14#include <qwidget.h>
15#include <qtable.h> 15#include <qtable.h>
16 16
17class QLabel; 17class QLabel;
18class OxydataTable; 18class 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.
25 * 26 *
26 * Author: Carsten Niehaus <cniehaus@handhelds.org> 27 * Author: Carsten Niehaus <cniehaus@handhelds.org>
27 */ 28 */
28 29
29class OxydataWidget : public QWidget 30class 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;
41 OxydataTable *DataTable; 42 OxydataTable *DataTable;
42 43
43 public slots: 44 public slots:
44 void setElement( int ); 45 void setElement( int );
45}; 46};
46 47
47/* 48/*
48 * A OxydataTable is derived from QTable. I recoded the paintCell to have 49 * A OxydataTable is derived from QTable. I recoded the paintCell to have
49 * different colors in the backgound. Furthermore this widget never has a 50 * different colors in the backgound. Furthermore this widget never has a
50 * grid, thus I removed that code in paintCell. 51 * grid, thus I removed that code in paintCell.
51 * 52 *
52 * Author: Carsten Niehaus <cniehaus@handhelds.org> 53 * Author: Carsten Niehaus <cniehaus@handhelds.org>
53 */ 54 */
54 55
55class OxydataTable : public QTable 56class OxydataTable : public QTable
56{ 57{
57 Q_OBJECT 58 Q_OBJECT
58 59
59 public: 60 public:
60 OxydataTable( int numRows, int numCols, 61 OxydataTable( int numRows, int numCols,
61 QWidget *parent = 0, const char *name = 0 ); 62 QWidget *parent = 0, const char *name = 0 );
62 63
63 protected: 64 protected:
64 /* 65 /*
65 * This method is reimplemented form QTable. It implements the colourisation 66 * This method is reimplemented form QTable. It implements the colourisation
66 * of every second row. 67 * of every second row.
67 */ 68 */
68 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); 69 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected );
69}; 70};
70/* 71/*
71 * A OxydataQTI is a QTableItem which has the ability to set an alignment. 72 * A OxydataQTI is a QTableItem which has the ability to set an alignment.
72 * In Oxygen we only have two colums so I can use the simple col()%2. 73 * In Oxygen we only have two colums so I can use the simple col()%2.
73 * 74 *
74 * Author: Robert Gogolok <robertgogolok@gmx.de> 75 * Author: Robert Gogolok <robertgogolok@gmx.de>
75 */ 76 */
76 77
77class OxydataQTI : public QTableItem 78class OxydataQTI : public QTableItem
78{ 79{
79 public: 80 public:
80 OxydataQTI(QTable * table, EditType et, const QString & text ); 81 OxydataQTI(QTable * table, EditType et, const QString & text );
81 82
82 virtual int alignment() const; 83 virtual int alignment() const;
83}; 84};
84 85
85#endif 86#endif
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
@@ -1,53 +1,167 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen 2 application: : Oxygen
3 3
4 begin : September 2002 4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus 5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
15 * * 15 * *
16 **************************************************************************/ 16 **************************************************************************/
17 17
18#include "datawidgetui.h" 18#include "datawidgetui.h"
19#include "dataTable.h" 19#include "dataTable.h"
20 20
21#include <qpe/config.h> 21#include <qpe/config.h>
22#include <qstring.h> 22#include <qstring.h>
23#include <qcombobox.h> 23#include <qcombobox.h>
24#include <qlayout.h> 24#include <qlayout.h>
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() : 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
55void 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
@@ -1,41 +1,46 @@
1#ifndef DATAWIDGETUI_H 1#ifndef DATAWIDGETUI_H
2#define DATAWIDGETUI_H 2#define DATAWIDGETUI_H
3 3
4 4
5/*************************************************************************** 5/***************************************************************************
6 application: : Oxygen 6 application: : Oxygen
7 7
8 begin : September 2002 8 begin : September 2002
9 copyright : ( C ) 2002 by Carsten Niehaus 9 copyright : ( C ) 2002 by Carsten Niehaus
10 email : cniehaus@handhelds.org 10 email : cniehaus@handhelds.org
11 **************************************************************************/ 11 **************************************************************************/
12 12
13/*************************************************************************** 13/***************************************************************************
14 * * 14 * *
15 * This program is free software; you can redistribute it and/or modify * 15 * This program is free software; you can redistribute it and/or modify *
16 * it under the terms of the GNU General Public License as published by * 16 * it under the terms of the GNU General Public License as published by *
17 * the Free Software Foundation; either version 2 of the License, or * 17 * the Free Software Foundation; either version 2 of the License, or *
18 * ( at your option ) any later version. * 18 * ( at your option ) any later version. *
19 * * 19 * *
20 **************************************************************************/ 20 **************************************************************************/
21 21
22 22
23class OxydataWidget; 23class OxydataWidget;
24class OxydataTable; 24class OxydataTable;
25 25
26class QComboBox; 26class QComboBox;
27class QStringList;
28
27#include <qwidget.h> 29#include <qwidget.h>
28 30
29class dataWidgetUI : public QWidget 31class 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
@@ -1,157 +1,42 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen 2 application: : Oxygen
3 3
4 begin : September 2002 4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus 5 copyright : ( C ) 2002 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * ( at your option ) any later version. * 14 * ( at your option ) any later version. *
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
28 27
29Oxygen::Oxygen() : QMainWindow() 28Oxygen::Oxygen() : QMainWindow()
30{ 29{
31 PSEWidget *pse = new PSEWidget(); 30 PSEWidget *pse = new PSEWidget();
32 calcDlgUI *CalcDlgUI = new calcDlgUI(); 31 calcDlgUI *CalcDlgUI = new calcDlgUI();
33 dataWidgetUI *DataWidgetUI = new dataWidgetUI(); 32 dataWidgetUI *DataWidgetUI = new dataWidgetUI();
34 33
35 this->setCaption( tr( "Oxygen" ) ); 34 this->setCaption( tr( "Oxygen" ) );
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
46void 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
@@ -1,24 +1,21 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 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 * 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 * 5 * the Free Software Foundation; either version 2 of the License, or *
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
12class QStringList;
13
14class Oxygen : public QMainWindow 12class 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};