author | cniehaus <cniehaus> | 2002-12-30 19:33:56 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-12-30 19:33:56 (UTC) |
commit | e34eef8e2f2a36797ef980d505a99948f88a5df2 (patch) (unidiff) | |
tree | 8cd79691b4b059688ca99af3158c3b62ceed649f | |
parent | 74fae7e68acd91e61bdff6f7703021246a0c1fbc (diff) | |
download | opie-e34eef8e2f2a36797ef980d505a99948f88a5df2.zip opie-e34eef8e2f2a36797ef980d505a99948f88a5df2.tar.gz opie-e34eef8e2f2a36797ef980d505a99948f88a5df2.tar.bz2 |
add a const
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index b396046..4f990b0 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp | |||
@@ -37,49 +37,49 @@ PSEWidget::PSEWidget(const QStringList &list) : QWidget() | |||
37 | int h=0, v=0; | 37 | int h=0, v=0; |
38 | 38 | ||
39 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 39 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
40 | for( int n = 0 ; n < 109 ; n++ ) | 40 | for( int n = 0 ; n < 109 ; n++ ) |
41 | { | 41 | { |
42 | configobj.setGroup( QString::number( n+1 )); | 42 | configobj.setGroup( QString::number( n+1 )); |
43 | 43 | ||
44 | position( n+1,h,v ); | 44 | position( n+1,h,v ); |
45 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); | 45 | PSEframe.append( new OxyFrame( this , QString::number(n), configobj.readEntry( "Symbol" ) ) ); |
46 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); | 46 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); |
47 | PSEframe.current()->setMinimumHeight( 11 ); | 47 | PSEframe.current()->setMinimumHeight( 11 ); |
48 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); | 48 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); |
49 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); | 49 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); |
50 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( inverseColor(QString) )); | 50 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( inverseColor(QString) )); |
51 | } | 51 | } |
52 | 52 | ||
53 | oxyDW = new OxydataWidget(this, "PSEWidget_oxyDW", names); | 53 | oxyDW = new OxydataWidget(this, "PSEWidget_oxyDW", names); |
54 | oxyDW->setElement( 0 ); | 54 | oxyDW->setElement( 0 ); |
55 | oxyDW->setLayout(); | 55 | oxyDW->setLayout(); |
56 | 56 | ||
57 | vlay->addLayout( grid ); | 57 | vlay->addLayout( grid ); |
58 | vlay->addWidget( oxyDW ); | 58 | vlay->addWidget( oxyDW ); |
59 | } | 59 | } |
60 | 60 | ||
61 | QColor PSEWidget::PSEColor( QString block ) | 61 | QColor PSEWidget::PSEColor( QString block ) const |
62 | { | 62 | { |
63 | QColor c; | 63 | QColor c; |
64 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); | 64 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); |
65 | else if ( block == "d" ) c.setRgb( 200,230,160 ); | 65 | else if ( block == "d" ) c.setRgb( 200,230,160 ); |
66 | else if ( block == "p" ) c.setRgb( 238,146,138 ); | 66 | else if ( block == "p" ) c.setRgb( 238,146,138 ); |
67 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); | 67 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); |
68 | return c; | 68 | return c; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | void PSEWidget::inverseColor( QString number) | 71 | void PSEWidget::inverseColor( QString number) |
72 | { | 72 | { |
73 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 73 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
74 | configobj.setGroup( number ); | 74 | configobj.setGroup( number ); |
75 | QString block = configobj.readEntry( "Block" ); | 75 | QString block = configobj.readEntry( "Block" ); |
76 | QColor c, d; | 76 | QColor c, d; |
77 | c = PSEColor( block ); | 77 | c = PSEColor( block ); |
78 | d = c.dark(); | 78 | d = c.dark(); |
79 | 79 | ||
80 | PSEframe.at( number.toUInt() )->setPalette( QPalette( d ) ); | 80 | PSEframe.at( number.toUInt() )->setPalette( QPalette( d ) ); |
81 | 81 | ||
82 | configobj.setGroup( QString::number( lastElement+1 ) ); | 82 | configobj.setGroup( QString::number( lastElement+1 ) ); |
83 | block = configobj.readEntry( "Block" ); | 83 | block = configobj.readEntry( "Block" ); |
84 | c = PSEColor( block ); | 84 | c = PSEColor( block ); |
85 | PSEframe.at( lastElement )->setPalette( QPalette( c ) ); | 85 | PSEframe.at( lastElement )->setPalette( QPalette( c ) ); |
diff --git a/noncore/apps/oxygen/psewidget.h b/noncore/apps/oxygen/psewidget.h index 42a2e38..ad40cf1 100644 --- a/noncore/apps/oxygen/psewidget.h +++ b/noncore/apps/oxygen/psewidget.h | |||
@@ -23,34 +23,34 @@ | |||
23 | 23 | ||
24 | class QGridLayout; | 24 | class QGridLayout; |
25 | class QStringList; | 25 | class QStringList; |
26 | 26 | ||
27 | class OxydataWidget; | 27 | class OxydataWidget; |
28 | class PSEframe; | 28 | class PSEframe; |
29 | 29 | ||
30 | class PSEWidget : public QWidget | 30 | class PSEWidget : public QWidget |
31 | { | 31 | { |
32 | Q_OBJECT | 32 | Q_OBJECT |
33 | 33 | ||
34 | public: | 34 | public: |
35 | PSEWidget(const QStringList &list=0); | 35 | PSEWidget(const QStringList &list=0); |
36 | QGridLayout *bottom_grid; | 36 | QGridLayout *bottom_grid; |
37 | OxydataWidget *oxyDW; | 37 | OxydataWidget *oxyDW; |
38 | 38 | ||
39 | QList<OxyFrame> PSEframe; | 39 | QList<OxyFrame> PSEframe; |
40 | 40 | ||
41 | int lastElement; | 41 | int lastElement; |
42 | 42 | ||
43 | private: | 43 | private: |
44 | QGridLayout *maingrid; | 44 | QGridLayout *maingrid; |
45 | 45 | ||
46 | void position( int, int&, int& ); | 46 | void position( int, int&, int& ); |
47 | QColor PSEColor( QString ); | 47 | QColor PSEColor( QString ) const; |
48 | QStringList names; | 48 | QStringList names; |
49 | 49 | ||
50 | public slots: | 50 | public slots: |
51 | void slotShowElement(QString); | 51 | void slotShowElement(QString); |
52 | void inverseColor( QString ); | 52 | void inverseColor( QString ); |
53 | 53 | ||
54 | }; | 54 | }; |
55 | 55 | ||
56 | #endif | 56 | #endif |