summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2002-12-27 11:41:02 (UTC)
committer cniehaus <cniehaus>2002-12-27 11:41:02 (UTC)
commit497a1cbad9b685ba7e08720d4337589dc6b9fbd2 (patch) (unidiff)
tree4010d09dfce1c17d2902b8e2bb99d000e2db98b5
parent3e797c54cfe1573ae80c8f60ea981685333643e3 (diff)
downloadopie-497a1cbad9b685ba7e08720d4337589dc6b9fbd2.zip
opie-497a1cbad9b685ba7e08720d4337589dc6b9fbd2.tar.gz
opie-497a1cbad9b685ba7e08720d4337589dc6b9fbd2.tar.bz2
finally found that stupid bug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/dataTable.cpp8
-rw-r--r--noncore/apps/oxygen/datawidgetui.cpp3
2 files changed, 4 insertions, 7 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 951788b..46eaeba 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -14,63 +14,59 @@
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
30OxydataWidget::OxydataWidget(QWidget *parent, const char *name, const QStringList &list ) : QWidget( parent,name ) 30OxydataWidget::OxydataWidget(QWidget *parent, const char *name, const QStringList &list ) : QWidget( parent,name ), names( list )
31{ 31{
32 names = list;
33 QStringList::ConstIterator it = names.at(10);
34 qDebug( *it );
35 QGridLayout *qgrid = new QGridLayout( this, 2,1 ); 32 QGridLayout *qgrid = new QGridLayout( this, 2,1 );
36 33
37 QHBox *hbox = new QHBox( this ); 34 QHBox *hbox = new QHBox( this );
38 left = new QLabel( hbox ); 35 left = new QLabel( hbox );
39 middle = new QLabel( hbox ); 36 middle = new QLabel( hbox );
40 right = new QLabel( hbox ); 37 right = new QLabel( hbox );
41 38
42 right->setAlignment( AlignRight ); 39 right->setAlignment( AlignRight );
43 middle->setAlignment( AlignHCenter ); 40 middle->setAlignment( AlignHCenter );
44 41
45 QFont bf; 42 QFont bf;
46 bf.setBold( true ); 43 bf.setBold( true );
47 bf.setPointSize( bf.pointSize()+2 ); 44 bf.setPointSize( bf.pointSize()+2 );
48 middle->setFont( bf ); 45 middle->setFont( bf );
49 46
50 DataTable = new OxydataTable( 9,2, this ); 47 DataTable = new OxydataTable( 9,2, this );
51 setTable(); 48 setTable();
52 49
53 qgrid->addWidget( hbox,0,0 ); 50 qgrid->addWidget( hbox,0,0 );
54 qgrid->addWidget( DataTable,1,0 ); 51 qgrid->addWidget( DataTable,1,0 );
55} 52}
56 53
57void OxydataWidget::setElement( int el ) 54void OxydataWidget::setElement( int el )
58{ 55{
59 QStringList::ConstIterator it = names.at(el+1); 56 QStringList::ConstIterator it = names.at(el);
60 qDebug( *it );
61 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); 57 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
62 58
63 configobj.setGroup( QString::number( el+1 )); 59 configobj.setGroup( QString::number( el+1 ));
64 60
65 left->setText( configobj.readEntry( "Symbol" ) ); 61 left->setText( configobj.readEntry( "Symbol" ) );
66 middle->setText( *it ); 62 middle->setText( *it );
67 right->setText( QString::number( el+1 ) ); 63 right->setText( QString::number( el+1 ) );
68 64
69 65
70 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); 66 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) );
71 DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); 67 DataTable->setText( 1,1,configobj.readEntry( "Block" ) );
72 DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); 68 DataTable->setText( 2,1,configobj.readEntry( "Group" ) );
73 DataTable->setText( 3,1,configobj.readEntry( "EN" ) ); 69 DataTable->setText( 3,1,configobj.readEntry( "EN" ) );
74 DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ; 70 DataTable->setText( 4,1,tr( "%1 pm" ).arg( configobj.readEntry( "AR" ) ) ) ;
75 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); 71 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) );
76 DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) ); 72 DataTable->setText( 6,1,tr( "%1 g/cm^3" ).arg( configobj.readEntry( "Density" ) ) );
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp
index e28ee4d..91d669f 100644
--- a/noncore/apps/oxygen/datawidgetui.cpp
+++ b/noncore/apps/oxygen/datawidgetui.cpp
@@ -30,44 +30,45 @@ dataWidgetUI::dataWidgetUI() : QWidget()
30{ 30{
31 31
32 names = 0; 32 names = 0;
33 loadNames(); 33 loadNames();
34 34
35 this->setCaption( tr( "Chemical Data" )); 35 this->setCaption( tr( "Chemical Data" ));
36 QGridLayout *qgrid = new QGridLayout( this, 2,1 ); 36 QGridLayout *qgrid = new QGridLayout( this, 2,1 );
37 37
38 dataCombo = new QComboBox( this ); 38 dataCombo = new QComboBox( this );
39 39
40 //read in all names of the 118 elements 40 //read in all names of the 118 elements
41 int i = 0; 41 int i = 0;
42 for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++) 42 for ( QStringList::ConstIterator it = names.begin() ; it != names.end() ; ++it,i++)
43 { 43 {
44 dataCombo->insertItem( QString::number( i+1 )+" - "+*it ); 44 dataCombo->insertItem( QString::number( i+1 )+" - "+*it );
45 } 45 }
46 46 QStringList::ConstIterator it = names.begin();
47 OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names); 47 OxydataWidget *oxyDW = new OxydataWidget(this, "OxydataWidget_oxyDW", names);
48 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); 48 connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) );
49 oxyDW->setElement( 0 ); 49 oxyDW->setElement( 0 );
50 oxyDW->setLayout(); 50 oxyDW->setLayout();
51 51
52 qgrid->addWidget( dataCombo, 0,0); 52 qgrid->addWidget( dataCombo, 0,0);
53 qgrid->addWidget( oxyDW , 1,0 ); 53 qgrid->addWidget( oxyDW , 1,0 );
54} 54}
55 55
56void dataWidgetUI::loadNames() 56void dataWidgetUI::loadNames()
57{ 57{
58 names.clear();
58 names.append( tr("Hydrogen") ); 59 names.append( tr("Hydrogen") );
59 names.append( tr("Helium") ); 60 names.append( tr("Helium") );
60 names.append( tr("Lithium") ); 61 names.append( tr("Lithium") );
61 names.append( tr("Beryllium") ); 62 names.append( tr("Beryllium") );
62 names.append( tr("Boron") ); 63 names.append( tr("Boron") );
63 names.append( tr("Carbon") ); 64 names.append( tr("Carbon") );
64 names.append( tr("Nitrogen") ); 65 names.append( tr("Nitrogen") );
65 names.append( tr("Oxygen") ); 66 names.append( tr("Oxygen") );
66 names.append( tr("Fluorine") ); 67 names.append( tr("Fluorine") );
67 names.append( tr("Neon") ); 68 names.append( tr("Neon") );
68 names.append( tr("Sodium") ); 69 names.append( tr("Sodium") );
69 names.append( tr("Magnesium") ); 70 names.append( tr("Magnesium") );
70 names.append( tr("Aluminum") ); 71 names.append( tr("Aluminum") );
71 names.append( tr("Silicon") ); 72 names.append( tr("Silicon") );
72 names.append( tr("Phosphorus") ); 73 names.append( tr("Phosphorus") );
73 names.append( tr("Sulfur") ); 74 names.append( tr("Sulfur") );