Diffstat (limited to 'noncore/apps/oxygen/psewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 | |||
@@ -15,50 +15,51 @@ | |||
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | 17 | ||
18 | #include <qpe/config.h> | 18 | #include <qpe/config.h> |
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
21 | #include <qlist.h> | 21 | #include <qlist.h> |
22 | #include "dataTable.h" | 22 | #include "dataTable.h" |
23 | #include "psewidget.h" | 23 | #include "psewidget.h" |
24 | #include "oxyframe.h" | 24 | #include "oxyframe.h" |
25 | 25 | ||
26 | 26 | ||
27 | PSEWidget::PSEWidget() : QWidget() | 27 | PSEWidget::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 ); |
36 | int h=0, v=0; | 37 | int h=0, v=0; |
37 | 38 | ||
38 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 39 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
39 | for( int n = 0 ; n < 109 ; n++ ) | 40 | for( int n = 0 ; n < 109 ; n++ ) |
40 | { | 41 | { |
41 | configobj.setGroup( QString::number( n+1 )); | 42 | configobj.setGroup( QString::number( n+1 )); |
42 | 43 | ||
43 | position( n+1,h,v ); | 44 | position( n+1,h,v ); |
44 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); | 45 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); |
45 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); | 46 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); |
46 | PSEframe.current()->setMinimumHeight( 11 ); | 47 | PSEframe.current()->setMinimumHeight( 11 ); |
47 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); | 48 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); |
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 ); |
57 | vlay->addWidget( oxyDW ); | 58 | vlay->addWidget( oxyDW ); |
58 | } | 59 | } |
59 | 60 | ||
60 | QColor PSEWidget::PSEColor( QString block ) | 61 | QColor PSEWidget::PSEColor( QString block ) |
61 | { | 62 | { |
62 | QColor c; | 63 | QColor c; |
63 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); | 64 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); |
64 | else if ( block == "d" ) c.setRgb( 200,230,160 ); | 65 | else if ( block == "d" ) c.setRgb( 200,230,160 ); |