summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/networksettings.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/networksettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index 3ddcbde..b36c7a0 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -14,35 +14,39 @@
#include <asdevice.h>
#include "networksettings.h"
#include "netnode.h"
#include "editconnection.h"
NetworkSettings::NetworkSettings( QWidget *parent,
const char *name,
WFlags fl ) : NetworkSettingsGUI(parent,name,fl),
NSD() {
UpdateTimer = new QTimer( this );
+
// set pixmaps
Add_TB->setPixmap( NSResources->getPixmap( "add" ) );
Delete_TB->setPixmap( NSResources->getPixmap( "remove" ) );
CheckState_TB->setPixmap( NSResources->getPixmap( "check" ) );
Enable_TB->setPixmap( NSResources->getPixmap( "disabled" ) );
GenConfig_TB->setPixmap( NSResources->getPixmap( "configure" ) );
Connect_TB->setPixmap( NSResources->getPixmap( "connected" ) );
+ Disconnect_TB->setPixmap( NSResources->getPixmap( "disconnected" ) );
On_TB->setPixmap( NSResources->getPixmap( "off" ) );
+ SLOT_ToProfile();
+
// populate main Listbox
Profiles_LB->clear();
{ Name2Connection_t & M = NSResources->connections();
NodeCollection * NC;
// for all connections
for( QDictIterator<NodeCollection> it(M);
it.current();
++it ) {
NC = it.current();
Profiles_LB->insertItem( NC->devicePixmap(),
NC->name() );
}
@@ -267,25 +271,25 @@ void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
Connect_TB->setEnabled( ConnectPossible );
Enable_TB->setOn( DisabledOn );
On_TB->setOn( OnOn );
Connect_TB->setOn( ConnectOn );
if( NC->description().isEmpty() ) {
Description_LBL->setText( tr( "No description" ) );
} else {
Description_LBL->setText( NC->description() );
}
- CurProfile_GB->setTitle( LBI->text() );
+ Profile_GB->setTitle( LBI->text() );
State_LBL->setText( NC->stateName() );
}
void NetworkSettings::SLOT_CheckState( void ) {
QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
if ( ! LBI )
return;
updateProfileState( LBI );
}
void NetworkSettings::updateProfileState( QListBoxItem * LBI ) {
if( LBI == Profiles_LB->item( Profiles_LB->currentItem() ) ) {
@@ -400,24 +404,46 @@ void NetworkSettings::SLOT_Connect( void ) {
}
if( ! rv ) {
QMessageBox::warning(
0,
tr( "Activating profile" ),
tr( "Cannot enable profile" ) );
}
// we do not update the GUI but wait for the REAL upping of the device
}
+void NetworkSettings::SLOT_Disconnect( void ) {
+ QListBoxItem * LBI = Profiles_LB->item( Profiles_LB->currentItem() );
+
+ if ( ! LBI )
+ return;
+
+ NodeCollection * NC =
+ NSResources->findConnection( LBI->text() );
+
+ NC->setState( Down, 1 );
+}
+
+void NetworkSettings::SLOT_ToMessages( void ) {
+ Profile_GB->hide();
+ Messages_GB->show();
+}
+
+void NetworkSettings::SLOT_ToProfile( void ) {
+ Profile_GB->show();
+ Messages_GB->hide();
+}
+
void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) {
QDataStream stream( data, IO_ReadOnly );
if( msg == "raise" ) {
raise();
return;
} /* if ( msg == "someMessage(int,int,int)" ) {
int a,b,c;
stream >> a >> b >> c;
...
} */
}