-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.h | 5 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 225 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.h | 2 |
4 files changed, 124 insertions, 117 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index 661eb5a..951788b 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp | |||
@@ -1,151 +1,156 @@ | |||
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 | ||
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | 29 | ||
30 | OxydataWidget::OxydataWidget(QWidget *parent, const char *name, QStringList *list ) : QWidget( parent,name ) | 30 | OxydataWidget::OxydataWidget(QWidget *parent, const char *name, const QStringList &list ) : QWidget( parent,name ) |
31 | { | 31 | { |
32 | names = list; | ||
33 | QStringList::ConstIterator it = names.at(10); | ||
34 | qDebug( *it ); | ||
32 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); | 35 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); |
33 | 36 | ||
34 | QHBox *hbox = new QHBox( this ); | 37 | QHBox *hbox = new QHBox( this ); |
35 | left = new QLabel( hbox ); | 38 | left = new QLabel( hbox ); |
36 | middle = new QLabel( hbox ); | 39 | middle = new QLabel( hbox ); |
37 | right = new QLabel( hbox ); | 40 | right = new QLabel( hbox ); |
38 | 41 | ||
39 | right->setAlignment( AlignRight ); | 42 | right->setAlignment( AlignRight ); |
40 | middle->setAlignment( AlignHCenter ); | 43 | middle->setAlignment( AlignHCenter ); |
41 | 44 | ||
42 | QFont bf; | 45 | QFont bf; |
43 | bf.setBold( true ); | 46 | bf.setBold( true ); |
44 | bf.setPointSize( bf.pointSize()+2 ); | 47 | bf.setPointSize( bf.pointSize()+2 ); |
45 | middle->setFont( bf ); | 48 | middle->setFont( bf ); |
46 | 49 | ||
47 | DataTable = new OxydataTable( 9,2, this ); | 50 | DataTable = new OxydataTable( 9,2, this ); |
48 | setTable(); | 51 | setTable(); |
49 | 52 | ||
50 | qgrid->addWidget( hbox,0,0 ); | 53 | qgrid->addWidget( hbox,0,0 ); |
51 | qgrid->addWidget( DataTable,1,0 ); | 54 | qgrid->addWidget( DataTable,1,0 ); |
52 | } | 55 | } |
53 | 56 | ||
54 | void OxydataWidget::setElement( int el ) | 57 | void OxydataWidget::setElement( int el ) |
55 | { | 58 | { |
59 | QStringList::ConstIterator it = names.at(el+1); | ||
60 | qDebug( *it ); | ||
56 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 61 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
57 | 62 | ||
58 | configobj.setGroup( QString::number( el+1 )); | 63 | configobj.setGroup( QString::number( el+1 )); |
59 | 64 | ||
60 | left->setText( configobj.readEntry( "Symbol" ) ); | 65 | left->setText( configobj.readEntry( "Symbol" ) ); |
61 | middle->setText( configobj.readEntry( "Name" ) ); | 66 | middle->setText( *it ); |
62 | right->setText( QString::number( el+1 ) ); | 67 | right->setText( QString::number( el+1 ) ); |
63 | 68 | ||
64 | 69 | ||
65 | DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); | 70 | DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); |
66 | DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); | 71 | DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); |
67 | DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); | 72 | DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); |
68 | DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); | 73 | DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); |
69 | DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ; | 74 | DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ; |
70 | DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); | 75 | DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); |
71 | DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) ); | 76 | DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) ); |
72 | DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) ); | 77 | DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) ); |
73 | DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) ); | 78 | DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) ); |
74 | } | 79 | } |
75 | 80 | ||
76 | void OxydataWidget::setTable() const | 81 | void OxydataWidget::setTable() const |
77 | { | 82 | { |
78 | DataTable->setText( 0,0, tr( "Weight:" ) ); | 83 | DataTable->setText( 0,0, tr( "Weight:" ) ); |
79 | DataTable->setText( 1,0, tr( "Block" )) ; | 84 | DataTable->setText( 1,0, tr( "Block" )) ; |
80 | DataTable->setText( 2,0, tr( "Group" )) ; | 85 | DataTable->setText( 2,0, tr( "Group" )) ; |
81 | DataTable->setText( 3,0, tr( "Electronegativity" )) ; | 86 | DataTable->setText( 3,0, tr( "Electronegativity" )) ; |
82 | DataTable->setText( 4,0, tr( "Atomic radius" )) ; | 87 | DataTable->setText( 4,0, tr( "Atomic radius" )) ; |
83 | DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; | 88 | DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; |
84 | DataTable->setText( 6,0, tr( "Density" )) ; | 89 | DataTable->setText( 6,0, tr( "Density" )) ; |
85 | DataTable->setText( 7,0, tr( "Boilingpoint" ) ); | 90 | DataTable->setText( 7,0, tr( "Boilingpoint" ) ); |
86 | DataTable->setText( 8,0, tr( "Meltingpoint" ) ); | 91 | DataTable->setText( 8,0, tr( "Meltingpoint" ) ); |
87 | } | 92 | } |
88 | 93 | ||
89 | void OxydataWidget::setLayout() | 94 | void OxydataWidget::setLayout() |
90 | { | 95 | { |
91 | #warning this is not working and I have no idea why! | 96 | #warning this is not working and I have no idea why! |
92 | // DataTable->setColumnWidth ( 0 , this->width()/2 ); | 97 | // DataTable->setColumnWidth ( 0 , this->width()/2 ); |
93 | // DataTable->setColumnWidth ( 1 , this->width()/2 ); | 98 | // DataTable->setColumnWidth ( 1 , this->width()/2 ); |
94 | 99 | ||
95 | //X DataTable->setColumnWidth ( 0 , 110 ); | 100 | //X DataTable->setColumnWidth ( 0 , 110 ); |
96 | //X DataTable->setColumnWidth ( 1 , 110 ); | 101 | //X DataTable->setColumnWidth ( 1 , 110 ); |
97 | } | 102 | } |
98 | 103 | ||
99 | OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, | 104 | OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, |
100 | const char *name) : QTable(numRows, numCols,parent, name) | 105 | const char *name) : QTable(numRows, numCols,parent, name) |
101 | { | 106 | { |
102 | 107 | ||
103 | for (int zeile = 0; zeile < numRows; zeile++) | 108 | for (int zeile = 0; zeile < numRows; zeile++) |
104 | for ( int spalte = 0; spalte < numCols; spalte++ ) | 109 | for ( int spalte = 0; spalte < numCols; spalte++ ) |
105 | { | 110 | { |
106 | OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); | 111 | OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); |
107 | setItem(zeile, spalte, (QTableItem*)testus); | 112 | setItem(zeile, spalte, (QTableItem*)testus); |
108 | } | 113 | } |
109 | 114 | ||
110 | 115 | ||
111 | this->setShowGrid( false ); | 116 | this->setShowGrid( false ); |
112 | this->setHScrollBarMode(QScrollView::AlwaysOff); | 117 | this->setHScrollBarMode(QScrollView::AlwaysOff); |
113 | this->horizontalHeader()->hide(); | 118 | this->horizontalHeader()->hide(); |
114 | this->verticalHeader()->hide(); | 119 | this->verticalHeader()->hide(); |
115 | this->setTopMargin( 0 ); | 120 | this->setTopMargin( 0 ); |
116 | this->setLeftMargin( 0 ); | 121 | this->setLeftMargin( 0 ); |
117 | } | 122 | } |
118 | 123 | ||
119 | void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) | 124 | void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) |
120 | { | 125 | { |
121 | if ( cr.width() == 0 || cr.height() == 0 ) | 126 | if ( cr.width() == 0 || cr.height() == 0 ) |
122 | return; | 127 | return; |
123 | selected = FALSE; | 128 | selected = FALSE; |
124 | 129 | ||
125 | QTableItem *itm = item( row, col ); | 130 | QTableItem *itm = item( row, col ); |
126 | QColorGroup colgrp = colorGroup(); | 131 | QColorGroup colgrp = colorGroup(); |
127 | if ( itm ) | 132 | if ( itm ) |
128 | { | 133 | { |
129 | if ( row%2 ) | 134 | if ( row%2 ) |
130 | colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) ); | 135 | colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) ); |
131 | else | 136 | else |
132 | colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) ); | 137 | colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) ); |
133 | p->save(); | 138 | p->save(); |
134 | itm->paint( p, colgrp, cr, selected ); | 139 | itm->paint( p, colgrp, cr, selected ); |
135 | p->restore(); | 140 | p->restore(); |
136 | } | 141 | } |
137 | } | 142 | } |
138 | 143 | ||
139 | OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) | 144 | OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) |
140 | : QTableItem ( table, et, text ) | 145 | : QTableItem ( table, et, text ) |
141 | { | 146 | { |
142 | } | 147 | } |
143 | 148 | ||
144 | int OxydataQTI::alignment() const | 149 | int OxydataQTI::alignment() const |
145 | { | 150 | { |
146 | if ( col()%2 ) | 151 | if ( col()%2 ) |
147 | { | 152 | { |
148 | return AlignRight | AlignVCenter; | 153 | return AlignRight | AlignVCenter; |
149 | }else return AlignLeft | AlignVCenter; | 154 | }else return AlignLeft | AlignVCenter; |
150 | }; | 155 | }; |
151 | 156 | ||
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h index a8c9b6e..8be78a9 100644 --- a/noncore/apps/oxygen/dataTable.h +++ b/noncore/apps/oxygen/dataTable.h | |||
@@ -1,86 +1,87 @@ | |||
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 | ||
17 | class QLabel; | 17 | class QLabel; |
18 | class OxydataTable; | 18 | class OxydataTable; |
19 | //class QStringList; | 19 | class QStringList; |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * A OxydataWidget shows all known data of an element. It can | 22 | * A OxydataWidget shows all known data of an element. It can |
23 | * 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 |
24 | * a simple QHBox with 2 QStrings in it plus a OxydataTable | 24 | * a simple QHBox with 2 QStrings in it plus a OxydataTable |
25 | * which contains the rest of the data. | 25 | * which contains the rest of the data. |
26 | * | 26 | * |
27 | * Author: Carsten Niehaus <cniehaus@handhelds.org> | 27 | * Author: Carsten Niehaus <cniehaus@handhelds.org> |
28 | */ | 28 | */ |
29 | 29 | ||
30 | class OxydataWidget : public QWidget | 30 | class OxydataWidget : public QWidget |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | 33 | ||
34 | public: | 34 | public: |
35 | OxydataWidget(QWidget *parent=0, const char *name=0, QStringList *list =0 ); | 35 | OxydataWidget(QWidget *parent=0, const char *name=0, const QStringList &list =0 ); |
36 | 36 | ||
37 | QLabel *left, *middle, *right; | 37 | QLabel *left, *middle, *right; |
38 | void setLayout(); | 38 | void setLayout(); |
39 | QStringList names; | ||
39 | 40 | ||
40 | private: | 41 | private: |
41 | void setTable() const; | 42 | void setTable() const; |
42 | OxydataTable *DataTable; | 43 | OxydataTable *DataTable; |
43 | 44 | ||
44 | public slots: | 45 | public slots: |
45 | void setElement( int ); | 46 | void setElement( int ); |
46 | }; | 47 | }; |
47 | 48 | ||
48 | /* | 49 | /* |
49 | * A OxydataTable is derived from QTable. I recoded the paintCell to have | 50 | * A OxydataTable is derived from QTable. I recoded the paintCell to have |
50 | * different colors in the backgound. Furthermore this widget never has a | 51 | * different colors in the backgound. Furthermore this widget never has a |
51 | * grid, thus I removed that code in paintCell. | 52 | * grid, thus I removed that code in paintCell. |
52 | * | 53 | * |
53 | * Author: Carsten Niehaus <cniehaus@handhelds.org> | 54 | * Author: Carsten Niehaus <cniehaus@handhelds.org> |
54 | */ | 55 | */ |
55 | 56 | ||
56 | class OxydataTable : public QTable | 57 | class OxydataTable : public QTable |
57 | { | 58 | { |
58 | Q_OBJECT | 59 | Q_OBJECT |
59 | 60 | ||
60 | public: | 61 | public: |
61 | OxydataTable( int numRows, int numCols, | 62 | OxydataTable( int numRows, int numCols, |
62 | QWidget *parent = 0, const char *name = 0 ); | 63 | QWidget *parent = 0, const char *name = 0 ); |
63 | 64 | ||
64 | protected: | 65 | protected: |
65 | /* | 66 | /* |
66 | * This method is reimplemented form QTable. It implements the colourisation | 67 | * This method is reimplemented form QTable. It implements the colourisation |
67 | * of every second row. | 68 | * of every second row. |
68 | */ | 69 | */ |
69 | virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); | 70 | virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected ); |
70 | }; | 71 | }; |
71 | /* | 72 | /* |
72 | * A OxydataQTI is a QTableItem which has the ability to set an alignment. | 73 | * A OxydataQTI is a QTableItem which has the ability to set an alignment. |
73 | * In Oxygen we only have two colums so I can use the simple col()%2. | 74 | * In Oxygen we only have two colums so I can use the simple col()%2. |
74 | * | 75 | * |
75 | * Author: Robert Gogolok <robertgogolok@gmx.de> | 76 | * Author: Robert Gogolok <robertgogolok@gmx.de> |
76 | */ | 77 | */ |
77 | 78 | ||
78 | class OxydataQTI : public QTableItem | 79 | class OxydataQTI : public QTableItem |
79 | { | 80 | { |
80 | public: | 81 | public: |
81 | OxydataQTI(QTable * table, EditType et, const QString & text ); | 82 | OxydataQTI(QTable * table, EditType et, const QString & text ); |
82 | 83 | ||
83 | virtual int alignment() const; | 84 | virtual int alignment() const; |
84 | }; | 85 | }; |
85 | 86 | ||
86 | #endif | 87 | #endif |
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index 68c025f..e28ee4d 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp | |||
@@ -1,167 +1,168 @@ | |||
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 | ||
29 | dataWidgetUI::dataWidgetUI() : QWidget() | 29 | dataWidgetUI::dataWidgetUI() : QWidget() |
30 | { | 30 | { |
31 | names = newQStringList(); | 31 | |
32 | names = 0; | ||
32 | loadNames(); | 33 | loadNames(); |
33 | 34 | ||
34 | this->setCaption( tr( "Chemical Data" )); | 35 | this->setCaption( tr( "Chemical Data" )); |
35 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); | 36 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); |
36 | 37 | ||
37 | dataCombo = new QComboBox( this ); | 38 | dataCombo = new QComboBox( this ); |
38 | 39 | ||
39 | //read in all names of the 118 elements | 40 | //read in all names of the 118 elements |
40 | int i = 0; | 41 | int i = 0; |
41 | for ( QStringList::Iterator it = names->begin() ; it != names->end() ; ++it,i++) | 42 | for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++) |
42 | { | 43 | { |
43 | dataCombo->insertItem( QString::number( i+1 )+" - "+*it ); | 44 | dataCombo->insertItem( QString::number( i+1 )+" - "+*it ); |
44 | } | 45 | } |
45 | 46 | ||
46 | OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names); | 47 | OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names); |
47 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); | 48 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); |
48 | oxyDW->setElement( 0 ); | 49 | oxyDW->setElement( 0 ); |
49 | oxyDW->setLayout(); | 50 | oxyDW->setLayout(); |
50 | 51 | ||
51 | qgrid->addWidget( dataCombo, 0,0); | 52 | qgrid->addWidget( dataCombo, 0,0); |
52 | qgrid->addWidget( oxyDW , 1,0 ); | 53 | qgrid->addWidget( oxyDW , 1,0 ); |
53 | } | 54 | } |
54 | 55 | ||
55 | void dataWidgetUI::loadNames() | 56 | void dataWidgetUI::loadNames() |
56 | { | 57 | { |
57 | names->append( tr("Hydrogen") ); | 58 | names.append( tr("Hydrogen") ); |
58 | names->append( tr("Helium") ); | 59 | names.append( tr("Helium") ); |
59 | names->append( tr("Lithium") ); | 60 | names.append( tr("Lithium") ); |
60 | names->append( tr("Beryllium") ); | 61 | names.append( tr("Beryllium") ); |
61 | names->append( tr("Boron") ); | 62 | names.append( tr("Boron") ); |
62 | names->append( tr("Carbon") ); | 63 | names.append( tr("Carbon") ); |
63 | names->append( tr("Nitrogen") ); | 64 | names.append( tr("Nitrogen") ); |
64 | names->append( tr("Oxygen") ); | 65 | names.append( tr("Oxygen") ); |
65 | names->append( tr("Fluorine") ); | 66 | names.append( tr("Fluorine") ); |
66 | names->append( tr("Neon") ); | 67 | names.append( tr("Neon") ); |
67 | names->append( tr("Sodium") ); | 68 | names.append( tr("Sodium") ); |
68 | names->append( tr("Magnesium") ); | 69 | names.append( tr("Magnesium") ); |
69 | names->append( tr("Aluminum") ); | 70 | names.append( tr("Aluminum") ); |
70 | names->append( tr("Silicon") ); | 71 | names.append( tr("Silicon") ); |
71 | names->append( tr("Phosphorus") ); | 72 | names.append( tr("Phosphorus") ); |
72 | names->append( tr("Sulfur") ); | 73 | names.append( tr("Sulfur") ); |
73 | names->append( tr("Chlorine") ); | 74 | names.append( tr("Chlorine") ); |
74 | names->append( tr("Argon") ); | 75 | names.append( tr("Argon") ); |
75 | names->append( tr("Potassium") ); | 76 | names.append( tr("Potassium") ); |
76 | names->append( tr("Calcium") ); | 77 | names.append( tr("Calcium") ); |
77 | names->append( tr("Scandium") ); | 78 | names.append( tr("Scandium") ); |
78 | names->append( tr("Titanium") ); | 79 | names.append( tr("Titanium") ); |
79 | names->append( tr("Vanadium") ); | 80 | names.append( tr("Vanadium") ); |
80 | names->append( tr("Chromium") ); | 81 | names.append( tr("Chromium") ); |
81 | names->append( tr("Manganese") ); | 82 | names.append( tr("Manganese") ); |
82 | names->append( tr("Iron") ); | 83 | names.append( tr("Iron") ); |
83 | names->append( tr("Cobalt") ); | 84 | names.append( tr("Cobalt") ); |
84 | names->append( tr("Nickel") ); | 85 | names.append( tr("Nickel") ); |
85 | names->append( tr("Copper") ); | 86 | names.append( tr("Copper") ); |
86 | names->append( tr("Zinc") ); | 87 | names.append( tr("Zinc") ); |
87 | names->append( tr("Gallium") ); | 88 | names.append( tr("Gallium") ); |
88 | names->append( tr("Germanium") ); | 89 | names.append( tr("Germanium") ); |
89 | names->append( tr("Arsenic") ); | 90 | names.append( tr("Arsenic") ); |
90 | names->append( tr("Selenium") ); | 91 | names.append( tr("Selenium") ); |
91 | names->append( tr("Bromine") ); | 92 | names.append( tr("Bromine") ); |
92 | names->append( tr("Krypton") ); | 93 | names.append( tr("Krypton") ); |
93 | names->append( tr("Rubidium") ); | 94 | names.append( tr("Rubidium") ); |
94 | names->append( tr("Strontium") ); | 95 | names.append( tr("Strontium") ); |
95 | names->append( tr("Yttrium") ); | 96 | names.append( tr("Yttrium") ); |
96 | names->append( tr("Zirconium") ); | 97 | names.append( tr("Zirconium") ); |
97 | names->append( tr("Niobium") ); | 98 | names.append( tr("Niobium") ); |
98 | names->append( tr("Molybdenum") ); | 99 | names.append( tr("Molybdenum") ); |
99 | names->append( tr("Technetium") ); | 100 | names.append( tr("Technetium") ); |
100 | names->append( tr("Ruthenium") ); | 101 | names.append( tr("Ruthenium") ); |
101 | names->append( tr("Rhodium") ); | 102 | names.append( tr("Rhodium") ); |
102 | names->append( tr("Palladium") ); | 103 | names.append( tr("Palladium") ); |
103 | names->append( tr("Silver") ); | 104 | names.append( tr("Silver") ); |
104 | names->append( tr("Cadmium") ); | 105 | names.append( tr("Cadmium") ); |
105 | names->append( tr("Indium") ); | 106 | names.append( tr("Indium") ); |
106 | names->append( tr("Tin") ); | 107 | names.append( tr("Tin") ); |
107 | names->append( tr("Antimony") ); | 108 | names.append( tr("Antimony") ); |
108 | names->append( tr("Tellurium") ); | 109 | names.append( tr("Tellurium") ); |
109 | names->append( tr("Iodine") ); | 110 | names.append( tr("Iodine") ); |
110 | names->append( tr("Xenon") ); | 111 | names.append( tr("Xenon") ); |
111 | names->append( tr("Cesium") ); | 112 | names.append( tr("Cesium") ); |
112 | names->append( tr("Barium") ); | 113 | names.append( tr("Barium") ); |
113 | names->append( tr("Lanthanum") ); | 114 | names.append( tr("Lanthanum") ); |
114 | names->append( tr("Cerium") ); | 115 | names.append( tr("Cerium") ); |
115 | names->append( tr("Praseodymium") ); | 116 | names.append( tr("Praseodymium") ); |
116 | names->append( tr("Neodymium") ); | 117 | names.append( tr("Neodymium") ); |
117 | names->append( tr("Promethium") ); | 118 | names.append( tr("Promethium") ); |
118 | names->append( tr("Samarium") ); | 119 | names.append( tr("Samarium") ); |
119 | names->append( tr("Europium") ); | 120 | names.append( tr("Europium") ); |
120 | names->append( tr("Gadolinium") ); | 121 | names.append( tr("Gadolinium") ); |
121 | names->append( tr("Terbium") ); | 122 | names.append( tr("Terbium") ); |
122 | names->append( tr("Dysprosium") ); | 123 | names.append( tr("Dysprosium") ); |
123 | names->append( tr("Holmium") ); | 124 | names.append( tr("Holmium") ); |
124 | names->append( tr("Erbium") ); | 125 | names.append( tr("Erbium") ); |
125 | names->append( tr("Thulium") ); | 126 | names.append( tr("Thulium") ); |
126 | names->append( tr("Ytterbium") ); | 127 | names.append( tr("Ytterbium") ); |
127 | names->append( tr("Lutetium") ); | 128 | names.append( tr("Lutetium") ); |
128 | names->append( tr("Hafnium") ); | 129 | names.append( tr("Hafnium") ); |
129 | names->append( tr("Tantalum") ); | 130 | names.append( tr("Tantalum") ); |
130 | names->append( tr("Tungsten") ); | 131 | names.append( tr("Tungsten") ); |
131 | names->append( tr("Rhenium") ); | 132 | names.append( tr("Rhenium") ); |
132 | names->append( tr("Osmium") ); | 133 | names.append( tr("Osmium") ); |
133 | names->append( tr("Iridium") ); | 134 | names.append( tr("Iridium") ); |
134 | names->append( tr("Platinum") ); | 135 | names.append( tr("Platinum") ); |
135 | names->append( tr("Gold") ); | 136 | names.append( tr("Gold") ); |
136 | names->append( tr("Mercury") ); | 137 | names.append( tr("Mercury") ); |
137 | names->append( tr("Thallium") ); | 138 | names.append( tr("Thallium") ); |
138 | names->append( tr("Lead") ); | 139 | names.append( tr("Lead") ); |
139 | names->append( tr("Bismuth") ); | 140 | names.append( tr("Bismuth") ); |
140 | names->append( tr("Polonium") ); | 141 | names.append( tr("Polonium") ); |
141 | names->append( tr("Astatine") ); | 142 | names.append( tr("Astatine") ); |
142 | names->append( tr("Radon") ); | 143 | names.append( tr("Radon") ); |
143 | names->append( tr("Francium") ); | 144 | names.append( tr("Francium") ); |
144 | names->append( tr("Radium") ); | 145 | names.append( tr("Radium") ); |
145 | names->append( tr("Actinium") ); | 146 | names.append( tr("Actinium") ); |
146 | names->append( tr("Thorium") ); | 147 | names.append( tr("Thorium") ); |
147 | names->append( tr("Protactinium") ); | 148 | names.append( tr("Protactinium") ); |
148 | names->append( tr("Uranium") ); | 149 | names.append( tr("Uranium") ); |
149 | names->append( tr("Neptunium") ); | 150 | names.append( tr("Neptunium") ); |
150 | names->append( tr("Plutonium") ); | 151 | names.append( tr("Plutonium") ); |
151 | names->append( tr("Americium") ); | 152 | names.append( tr("Americium") ); |
152 | names->append( tr("Curium") ); | 153 | names.append( tr("Curium") ); |
153 | names->append( tr("Berkelium") ); | 154 | names.append( tr("Berkelium") ); |
154 | names->append( tr("Californium") ); | 155 | names.append( tr("Californium") ); |
155 | names->append( tr("Einsteinium") ); | 156 | names.append( tr("Einsteinium") ); |
156 | names->append( tr("Fermium") ); | 157 | names.append( tr("Fermium") ); |
157 | names->append( tr("Mendelevium") ); | 158 | names.append( tr("Mendelevium") ); |
158 | names->append( tr("Nobelium") ); | 159 | names.append( tr("Nobelium") ); |
159 | names->append( tr("Lawrencium") ); | 160 | names.append( tr("Lawrencium") ); |
160 | names->append( tr("Rutherfordium") ); | 161 | names.append( tr("Rutherfordium") ); |
161 | names->append( tr("Dubnium") ); | 162 | names.append( tr("Dubnium") ); |
162 | names->append( tr("Seaborgium") ); | 163 | names.append( tr("Seaborgium") ); |
163 | names->append( tr("Bohrium") ); | 164 | names.append( tr("Bohrium") ); |
164 | names->append( tr("Hassium") ); | 165 | names.append( tr("Hassium") ); |
165 | names->append( tr("Meitnerium") ); | 166 | names.append( tr("Meitnerium") ); |
166 | } | 167 | } |
167 | 168 | ||
diff --git a/noncore/apps/oxygen/datawidgetui.h b/noncore/apps/oxygen/datawidgetui.h index 154f4be..a2b48fa 100644 --- a/noncore/apps/oxygen/datawidgetui.h +++ b/noncore/apps/oxygen/datawidgetui.h | |||
@@ -1,46 +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 | ||
23 | class OxydataWidget; | 23 | class OxydataWidget; |
24 | class OxydataTable; | 24 | class OxydataTable; |
25 | 25 | ||
26 | class QComboBox; | 26 | class QComboBox; |
27 | class QStringList; | 27 | class QStringList; |
28 | 28 | ||
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | 30 | ||
31 | class dataWidgetUI : public QWidget | 31 | class dataWidgetUI : public QWidget |
32 | { | 32 | { |
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | 34 | ||
35 | public: | 35 | public: |
36 | dataWidgetUI(); | 36 | dataWidgetUI(); |
37 | QStringList *names; | 37 | QStringList names; |
38 | 38 | ||
39 | private: | 39 | private: |
40 | OxydataTable *DataTable; | 40 | OxydataTable *DataTable; |
41 | QComboBox *dataCombo; | 41 | QComboBox *dataCombo; |
42 | OxydataWidget *oxyDW; | 42 | OxydataWidget *oxyDW; |
43 | 43 | ||
44 | void loadNames(); | 44 | void loadNames(); |
45 | }; | 45 | }; |
46 | #endif | 46 | #endif |