summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/activateprofile.cpp
blob: fe98fc44ed749b096a2a6e17997d92a8a53a215a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <qlistbox.h>
#include <qlabel.h>
#include "activateprofile.h"

ActivateProfile::ActivateProfile( const char * Interface ) :
        ActivateProfileGUI( 0, 0, TRUE ), NSD() {

    Possible = NSD.collectPossible( Interface );

    DeviceName_LBL->setText( Interface );
    Profiles_LB->clear();
    for( NetworkSetup * NC = Possible.first();
         NC;
         NC = Possible.next() ) {
      Profiles_LB->insertItem( NC->devicePixmap(), 
                               NC->name() );
    }
}

ActivateProfile::~ActivateProfile( void ) {
}

long ActivateProfile::selectedProfile( void ) {
    for( unsigned int i = 0 ; i < Profiles_LB->count(); i ++ ) {
      if( Profiles_LB->isSelected(i) ) {
        return Possible.at(i)->number();

      }
    }
    return -1;
}