summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/TODO6
-rw-r--r--noncore/apps/oxygen/dataTable.cpp4
2 files changed, 4 insertions, 6 deletions
diff --git a/noncore/apps/oxygen/TODO b/noncore/apps/oxygen/TODO
index c81fc26..32acfcd 100644
--- a/noncore/apps/oxygen/TODO
+++ b/noncore/apps/oxygen/TODO
@@ -1,18 +1,16 @@
1TODO: 1TODO:
2 2
3small things: 3small things:
4* there are bug in the layouting of the table 4* there are bug in the layouting of the table
5* Elementar symbols should be small enough to fit the boxes 5* Elementar symbols should be small enough to fit the boxes
6 (font problem?) 6 (font problem?)
7 7
8
9big things: 8big things:
10* backport the conversions from Kalzium (http://edu.kde.org/kalzium) 9* backport the conversions from Kalzium (http://edu.kde.org/kalzium)
11* backport more dataset from Kalzium 10* backport more dataset from Kalzium
12* make the colors confiurable 11* make the colors configurable
13* graphical analysation (KalziumGraph.cpp/h)
14* make elements sortable by their attributes (e.g. density) 12* make elements sortable by their attributes (e.g. density)
15* graph of attribute (e.g. ionisationenergie) vs atomnumber? 13* graph of attribute (e.g. ionisationenergie) vs atomnumber?
16 14
17wishes: 15wishes:
18* add radio active decay \ No newline at end of file 16* add radio active decay
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp
index 82b425e..16aa462 100644
--- a/noncore/apps/oxygen/dataTable.cpp
+++ b/noncore/apps/oxygen/dataTable.cpp
@@ -45,98 +45,98 @@ OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent)
45 DataTable = new OxydataTable( 9,2, this ); 45 DataTable = new OxydataTable( 9,2, this );
46 setTable(); 46 setTable();
47 47
48 qgrid->addWidget( hbox,0,0 ); 48 qgrid->addWidget( hbox,0,0 );
49 qgrid->addWidget( DataTable,1,0 ); 49 qgrid->addWidget( DataTable,1,0 );
50} 50}
51 51
52void OxydataWidget::setElement( int el ) 52void OxydataWidget::setElement( int el )
53{ 53{
54 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); 54 Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File );
55 55
56 configobj.setGroup( QString::number( el+1 )); 56 configobj.setGroup( QString::number( el+1 ));
57 57
58 left->setText( configobj.readEntry( "Symbol" ) ); 58 left->setText( configobj.readEntry( "Symbol" ) );
59 middle->setText( configobj.readEntry( "Name" ) ); 59 middle->setText( configobj.readEntry( "Name" ) );
60 right->setText( QString::number( el+1 ) ); 60 right->setText( QString::number( el+1 ) );
61 61
62 62
63 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) ); 63 DataTable->setText( 0,1,tr( "%1 u" ).arg( configobj.readEntry( "Weight" ) ) );
64 DataTable->setText( 1,1,configobj.readEntry( "Block" ) ); 64 DataTable->setText( 1,1,configobj.readEntry( "Block" ) );
65 DataTable->setText( 2,1,configobj.readEntry( "Group" ) ); 65 DataTable->setText( 2,1,configobj.readEntry( "Group" ) );
66 DataTable->setText( 3,1,tr( "%1 J").arg( configobj.readEntry( "EN" ) ) ); 66 DataTable->setText( 3,1,tr( "%1 J").arg( configobj.readEntry( "EN" ) ) );
67 DataTable->setText( 4,1,tr( "%1 nm" ).arg( configobj.readEntry( "AR" ) ) ) ; 67 DataTable->setText( 4,1,tr( "%1 nm" ).arg( configobj.readEntry( "AR" ) ) ) ;
68 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) ); 68 DataTable->setText( 5,1,tr( "%1 J" ).arg( configobj.readEntry( "IE" ) ) );
69 DataTable->setText( 6,1,configobj.readEntry( "Density" ) ); 69 DataTable->setText( 6,1,configobj.readEntry( "Density" ) );
70 DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) ); 70 DataTable->setText( 7,1,tr( "%1 K" ).arg( configobj.readEntry( "BP" ) ) );
71 DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) ); 71 DataTable->setText( 8,1,tr( "%1 K" ).arg( configobj.readEntry( "MP" ) ) );
72} 72}
73 73
74void OxydataWidget::setTable() const 74void OxydataWidget::setTable() const
75{ 75{
76 DataTable->setText( 0,0, tr( "Weight:" ) ); 76 DataTable->setText( 0,0, tr( "Weight:" ) );
77 DataTable->setText( 1,0, tr( "Block" )) ; 77 DataTable->setText( 1,0, tr( "Block" )) ;
78 DataTable->setText( 2,0, tr( "Group" )) ; 78 DataTable->setText( 2,0, tr( "Group" )) ;
79 DataTable->setText( 3,0, tr( "Electronegativity" )) ; 79 DataTable->setText( 3,0, tr( "Electronegativity" )) ;
80 DataTable->setText( 4,0, tr( "Atomic radius" )) ; 80 DataTable->setText( 4,0, tr( "Atomic radius" )) ;
81 DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; 81 DataTable->setText( 5,0, tr( "Ionizationenergie" )) ;
82 DataTable->setText( 6,0, tr( "Density" )) ; 82 DataTable->setText( 6,0, tr( "Density" )) ;
83 DataTable->setText( 7,0, tr( "Boilingpoint" ) ); 83 DataTable->setText( 7,0, tr( "Boilingpoint" ) );
84 DataTable->setText( 8,0, tr( "Meltingpoint" ) ); 84 DataTable->setText( 8,0, tr( "Meltingpoint" ) );
85} 85}
86 86
87void OxydataWidget::setLayout() 87void OxydataWidget::setLayout()
88{ 88{
89#warning this is not working and I have no idea why! 89#warning this is not working and I have no idea why!
90// DataTable->setColumnWidth ( 0 , this->width()/2 ); 90// DataTable->setColumnWidth ( 0 , this->width()/2 );
91// DataTable->setColumnWidth ( 1 , this->width()/2 ); 91// DataTable->setColumnWidth ( 1 , this->width()/2 );
92 92
93 DataTable->setColumnWidth ( 0 , 110 ); 93//X DataTable->setColumnWidth ( 0 , 110 );
94 DataTable->setColumnWidth ( 1 , 110 ); 94//X DataTable->setColumnWidth ( 1 , 110 );
95} 95}
96 96
97OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, 97OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent,
98 const char *name) : QTable(numRows, numCols,parent, name) 98 const char *name) : QTable(numRows, numCols,parent, name)
99{ 99{
100 100
101 for (int zeile = 0; zeile < numRows; zeile++) 101 for (int zeile = 0; zeile < numRows; zeile++)
102 for ( int spalte = 0; spalte < numCols; spalte++ ) 102 for ( int spalte = 0; spalte < numCols; spalte++ )
103 { 103 {
104 OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); 104 OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" );
105 setItem(zeile, spalte, (QTableItem*)testus); 105 setItem(zeile, spalte, (QTableItem*)testus);
106 } 106 }
107 107
108 108
109 this->setShowGrid( false ); 109 this->setShowGrid( false );
110 this->setHScrollBarMode(QScrollView::AlwaysOff); 110 this->setHScrollBarMode(QScrollView::AlwaysOff);
111 this->horizontalHeader()->hide(); 111 this->horizontalHeader()->hide();
112 this->verticalHeader()->hide(); 112 this->verticalHeader()->hide();
113 this->setTopMargin( 0 ); 113 this->setTopMargin( 0 );
114 this->setLeftMargin( 0 ); 114 this->setLeftMargin( 0 );
115} 115}
116 116
117void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) 117void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected)
118{ 118{
119 if ( cr.width() == 0 || cr.height() == 0 ) 119 if ( cr.width() == 0 || cr.height() == 0 )
120 return; 120 return;
121 selected = FALSE; 121 selected = FALSE;
122 122
123 QTableItem *itm = item( row, col ); 123 QTableItem *itm = item( row, col );
124 QColorGroup colgrp = colorGroup(); 124 QColorGroup colgrp = colorGroup();
125 if ( itm ) 125 if ( itm )
126 { 126 {
127 if ( row%2 ) 127 if ( row%2 )
128 colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) ); 128 colgrp.setColor( QColorGroup::Base, QColor( 180,200,210 ) );
129 else 129 else
130 colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) ); 130 colgrp.setColor( QColorGroup::Base, QColor( 230,235,235 ) );
131 p->save(); 131 p->save();
132 itm->paint( p, colgrp, cr, selected ); 132 itm->paint( p, colgrp, cr, selected );
133 p->restore(); 133 p->restore();
134 } 134 }
135} 135}
136 136
137OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text ) 137OxydataQTI::OxydataQTI(QTable * table, EditType et, const QString & text )
138 : QTableItem ( table, et, text ) 138 : QTableItem ( table, et, text )
139{ 139{
140} 140}
141 141
142int OxydataQTI::alignment() const 142int OxydataQTI::alignment() const