summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/activateprofile.cpp
blob: ba726bb6eaa9c98b0f141732a900421fcb84d776 (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
#include <qlistbox.h>
#include "activateprofile.h"

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

    Possible = NSD.collectPossible( Interface );

    Profiles_LB->clear();
    for( NodeCollection * 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;
}