author | wimpie <wimpie> | 2005-01-05 02:28:57 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-05 02:28:57 (UTC) |
commit | 2f343aab63dd30e97a893e3691501cdd55114e82 (patch) (unidiff) | |
tree | 819ec07fa02e9a422a9ba834663b18bc34bbb208 | |
parent | 46a75181b493c25304f06cbd9f757f4165ac2b5e (diff) | |
download | opie-2f343aab63dd30e97a893e3691501cdd55114e82.zip opie-2f343aab63dd30e97a893e3691501cdd55114e82.tar.gz opie-2f343aab63dd30e97a893e3691501cdd55114e82.tar.bz2 |
Networksettings2 also uses ledboxes -> hence added namespaces
-rw-r--r-- | noncore/settings/networksettings2/networksettings.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/networksettings.h | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp index a0d4c7c..dca6631 100644 --- a/noncore/settings/networksettings2/networksettings.cpp +++ b/noncore/settings/networksettings2/networksettings.cpp | |||
@@ -1,99 +1,99 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <unistd.h> | 2 | #include <unistd.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | 4 | ||
5 | #include <opie2/odebug.h> | 5 | #include <opie2/odebug.h> |
6 | #include <opie2/oledbox.h> | 6 | #include <opie2/oledbox.h> |
7 | 7 | ||
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qlistbox.h> | 9 | #include <qlistbox.h> |
10 | #include <qlayout.h> | 10 | #include <qlayout.h> |
11 | #include <qgroupbox.h> | 11 | #include <qgroupbox.h> |
12 | #include <qtimer.h> | 12 | #include <qtimer.h> |
13 | #include <qlistbox.h> | 13 | #include <qlistbox.h> |
14 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qiconview.h> | 16 | #include <qiconview.h> |
17 | #include <qtimer.h> | 17 | #include <qtimer.h> |
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <qtoolbutton.h> | 19 | #include <qtoolbutton.h> |
20 | #include <qevent.h> | 20 | #include <qevent.h> |
21 | 21 | ||
22 | #include "networksettings.h" | 22 | #include "networksettings.h" |
23 | #include "netnode.h" | 23 | #include "netnode.h" |
24 | #include "editconnection.h" | 24 | #include "editconnection.h" |
25 | 25 | ||
26 | NetworkSettings::NetworkSettings( QWidget *parent, | 26 | NetworkSettings::NetworkSettings( QWidget *parent, |
27 | const char *name, | 27 | const char *name, |
28 | WFlags fl ) : NetworkSettingsGUI(parent,name,fl), | 28 | WFlags fl ) : NetworkSettingsGUI(parent,name,fl), |
29 | NSD() { | 29 | NSD() { |
30 | 30 | ||
31 | UpdateTimer = new QTimer( this ); | 31 | UpdateTimer = new QTimer( this ); |
32 | 32 | ||
33 | // set pixmaps | 33 | // set pixmaps |
34 | Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); | 34 | Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); |
35 | Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) ); | 35 | Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) ); |
36 | CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) ); | 36 | CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) ); |
37 | GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) ); | 37 | GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) ); |
38 | 38 | ||
39 | Disable_TB->setPixmap( NSResources->getPixmap( "disabled" ) ); | 39 | Disable_TB->setPixmap( NSResources->getPixmap( "disabled" ) ); |
40 | Up_TB->setPixmap( NSResources->getPixmap( "more" ) ); | 40 | Up_TB->setPixmap( NSResources->getPixmap( "more" ) ); |
41 | Down_TB->setPixmap( NSResources->getPixmap( "less" ) ); | 41 | Down_TB->setPixmap( NSResources->getPixmap( "less" ) ); |
42 | 42 | ||
43 | QVBoxLayout* V = new QVBoxLayout( LED_Frm ); | 43 | QVBoxLayout* V = new QVBoxLayout( LED_Frm ); |
44 | QHBoxLayout * H = new QHBoxLayout( 0 ); | 44 | QHBoxLayout * H = new QHBoxLayout( 0 ); |
45 | V->addStretch(1); | 45 | V->addStretch(1); |
46 | V->addLayout( H ); | 46 | V->addLayout( H ); |
47 | Leds[0] = new OLedBox( red, LED_Frm ); | 47 | Leds[0] = new Opie::Ui::OLedBox( red, LED_Frm ); |
48 | H->addWidget( Leds[0], 0, Qt::AlignVCenter ); | 48 | H->addWidget( Leds[0], 0, Qt::AlignVCenter ); |
49 | Leds[1] = new OLedBox( red, LED_Frm ); | 49 | Leds[1] = new Opie::Ui::OLedBox( red, LED_Frm ); |
50 | H->addWidget( Leds[1], 0, Qt::AlignVCenter ); | 50 | H->addWidget( Leds[1], 0, Qt::AlignVCenter ); |
51 | Leds[2] = new OLedBox( red, LED_Frm ); | 51 | Leds[2] = new Opie::Ui::OLedBox( red, LED_Frm ); |
52 | H->addWidget( Leds[2], 0, Qt::AlignVCenter ); | 52 | H->addWidget( Leds[2], 0, Qt::AlignVCenter ); |
53 | V->addStretch(1); | 53 | V->addStretch(1); |
54 | 54 | ||
55 | 55 | ||
56 | SLOT_ToProfile(); | 56 | SLOT_ToProfile(); |
57 | 57 | ||
58 | // populate main Listbox | 58 | // populate main Listbox |
59 | Profiles_LB->clear(); | 59 | Profiles_LB->clear(); |
60 | QPEApplication::setStylusOperation( | 60 | QPEApplication::setStylusOperation( |
61 | Profiles_LB->viewport(), QPEApplication::RightOnHold ); | 61 | Profiles_LB->viewport(), QPEApplication::RightOnHold ); |
62 | 62 | ||
63 | connect( Profiles_LB, | 63 | connect( Profiles_LB, |
64 | SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), | 64 | SIGNAL(rightButtonPressed(QListBoxItem*,const QPoint&)), |
65 | this, SLOT(SLOT_EditNode(QListBoxItem*)) ); | 65 | this, SLOT(SLOT_EditNode(QListBoxItem*)) ); |
66 | 66 | ||
67 | { Name2Connection_t & M = NSResources->connections(); | 67 | { Name2Connection_t & M = NSResources->connections(); |
68 | NodeCollection * NC; | 68 | NodeCollection * NC; |
69 | // for all connections | 69 | // for all connections |
70 | for( QDictIterator<NodeCollection> it(M); | 70 | for( QDictIterator<NodeCollection> it(M); |
71 | it.current(); | 71 | it.current(); |
72 | ++it ) { | 72 | ++it ) { |
73 | NC = it.current(); | 73 | NC = it.current(); |
74 | Profiles_LB->insertItem( NC->devicePixmap(), | 74 | Profiles_LB->insertItem( NC->devicePixmap(), |
75 | NC->name() ); | 75 | NC->name() ); |
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | if( Profiles_LB->count() ) { | 79 | if( Profiles_LB->count() ) { |
80 | Profiles_LB->setSelected( 0, TRUE ); | 80 | Profiles_LB->setSelected( 0, TRUE ); |
81 | } | 81 | } |
82 | 82 | ||
83 | // if no profiles -> auto popup editing | 83 | // if no profiles -> auto popup editing |
84 | if( NSResources->connections().count() == 0 ) { | 84 | if( NSResources->connections().count() == 0 ) { |
85 | QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); | 85 | QTimer::singleShot( 100, this, SLOT(SLOT_AddNode() ) ); |
86 | } | 86 | } |
87 | 87 | ||
88 | connect( &(NSResources->system()), | 88 | connect( &(NSResources->system()), |
89 | SIGNAL( stdoutLine(const QString &) ), | 89 | SIGNAL( stdoutLine(const QString &) ), |
90 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); | 90 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); |
91 | 91 | ||
92 | connect( &(NSResources->system()), | 92 | connect( &(NSResources->system()), |
93 | SIGNAL( stderrLine(const QString &) ), | 93 | SIGNAL( stderrLine(const QString &) ), |
94 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); | 94 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); |
95 | 95 | ||
96 | connect( &(NSResources->system()), | 96 | connect( &(NSResources->system()), |
97 | SIGNAL( processEvent(const QString &) ), | 97 | SIGNAL( processEvent(const QString &) ), |
98 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); | 98 | this, SLOT( SLOT_CmdMessage(const QString &) ) ); |
99 | 99 | ||
diff --git a/noncore/settings/networksettings2/networksettings.h b/noncore/settings/networksettings2/networksettings.h index 987e311..e1c2b80 100644 --- a/noncore/settings/networksettings2/networksettings.h +++ b/noncore/settings/networksettings2/networksettings.h | |||
@@ -1,59 +1,68 @@ | |||
1 | #include "nsdata.h" | 1 | #include "nsdata.h" |
2 | #include "networksettingsGUI.h" | 2 | #include "networksettingsGUI.h" |
3 | #include "resources.h" | 3 | #include "resources.h" |
4 | 4 | ||
5 | class ANetNode; | 5 | class ANetNode; |
6 | class ANetNodeInstance; | 6 | class ANetNodeInstance; |
7 | class QTimer; | 7 | class QTimer; |
8 | class QListBoxItem; | 8 | class QListBoxItem; |
9 | class QEvent; | 9 | class QEvent; |
10 | class OLedBox; | 10 | |
11 | namespace Opie { | ||
12 | |||
13 | namespace Ui { | ||
14 | |||
15 | class OLedBox; | ||
16 | |||
17 | }; | ||
18 | |||
19 | }; | ||
11 | 20 | ||
12 | class NetworkSettings : public NetworkSettingsGUI { | 21 | class NetworkSettings : public NetworkSettingsGUI { |
13 | 22 | ||
14 | Q_OBJECT | 23 | Q_OBJECT |
15 | 24 | ||
16 | public : | 25 | public : |
17 | 26 | ||
18 | NetworkSettings( QWidget *parent=0, | 27 | NetworkSettings( QWidget *parent=0, |
19 | const char *name=0, | 28 | const char *name=0, |
20 | WFlags fl = 0 ); | 29 | WFlags fl = 0 ); |
21 | virtual ~NetworkSettings( void ); | 30 | virtual ~NetworkSettings( void ); |
22 | 31 | ||
23 | static QString appName( void ) | 32 | static QString appName( void ) |
24 | { return QString::fromLatin1("networksettings"); } | 33 | { return QString::fromLatin1("networksettings"); } |
25 | 34 | ||
26 | public slots : | 35 | public slots : |
27 | 36 | ||
28 | void SLOT_AddNode( void ); | 37 | void SLOT_AddNode( void ); |
29 | void SLOT_DeleteNode( void ); | 38 | void SLOT_DeleteNode( void ); |
30 | void SLOT_ShowNode( QListBoxItem * ); | 39 | void SLOT_ShowNode( QListBoxItem * ); |
31 | void SLOT_EditNode( QListBoxItem * ); | 40 | void SLOT_EditNode( QListBoxItem * ); |
32 | void SLOT_CheckState( void ); | 41 | void SLOT_CheckState( void ); |
33 | 42 | ||
34 | void SLOT_Up( void ); | 43 | void SLOT_Up( void ); |
35 | void SLOT_Down( void ); | 44 | void SLOT_Down( void ); |
36 | void SLOT_Disable( bool ); | 45 | void SLOT_Disable( bool ); |
37 | 46 | ||
38 | void SLOT_GenerateConfig( void ); | 47 | void SLOT_GenerateConfig( void ); |
39 | void SLOT_RefreshStates( void ); | 48 | void SLOT_RefreshStates( void ); |
40 | void SLOT_QCopMessage( const QCString&,const QByteArray& ); | 49 | void SLOT_QCopMessage( const QCString&,const QByteArray& ); |
41 | void SLOT_ToProfile( void ); | 50 | void SLOT_ToProfile( void ); |
42 | void SLOT_ToMessages( void ); | 51 | void SLOT_ToMessages( void ); |
43 | void SLOT_CmdMessage( const QString & S ); | 52 | void SLOT_CmdMessage( const QString & S ); |
44 | 53 | ||
45 | private : | 54 | private : |
46 | 55 | ||
47 | void updateProfileState( QListBoxItem * it ); | 56 | void updateProfileState( QListBoxItem * it ); |
48 | QTimer * UpdateTimer; | 57 | QTimer * UpdateTimer; |
49 | NetworkSettingsData NSD; | 58 | NetworkSettingsData NSD; |
50 | /* | 59 | /* |
51 | 60 | ||
52 | no leds : not present, unknown, unchecked or disabled | 61 | no leds : not present, unknown, unchecked or disabled |
53 | (1) down : hardware present but inactive | 62 | (1) down : hardware present but inactive |
54 | (2) available : hardware present and active | 63 | (2) available : hardware present and active |
55 | (3) up : present active and connected | 64 | (3) up : present active and connected |
56 | 65 | ||
57 | */ | 66 | */ |
58 | OLedBox * Leds[3]; | 67 | Opie::Ui::OLedBox * Leds[3]; |
59 | }; | 68 | }; |