summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/rfcpopup.cpp
blob: 04bfe48a63ef2e5a1aff097a828d158f2b613cad (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

#include "pppdialog.h"
#include "rfcpopup.h"
#include "rfcommassigndialogimpl.h"

/* OPIE */
#include <qpe/qpeapplication.h>

/* QT */
#include <qtimer.h>

using namespace OpieTooth;

/*
 * c'tor init the QAction
 */
RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item  )
        : QPopupMenu()
{
    qWarning("RfcCommPopup c'tor");

    QAction* a;


    m_item = item;

    /* connect action */
    a = new QAction(  ); // so it's get deleted
    a->setText("Connect");
    a->addTo( this );
    connect( a,  SIGNAL( activated() ),
             this, SLOT( slotConnect() ) );


    /* disconnect action */
    a = new QAction(  );
    a->setText("Disconnect");
    a->addTo( this );
    connect( a, SIGNAL( activated() ) ,
             this, SLOT( slotDisconnect() ) );


    /* foo action */
    a = new QAction(  );
    a->setText("Bind table");
    a->addTo( this );
    connect( a, SIGNAL( activated() ),
             this, SLOT( slotBind() ) );


    /* bar action */
    a = new QAction(  );
    a->setText( "Bar" );
    a->addTo( this );
    connect( a, SIGNAL( activated() ),
             this, SLOT( slotBar() ) );

};


RfcCommPopup::~RfcCommPopup()
{
    /*  delete m_con;
        delete m_dis;
        delete m_foo;
        delete m_bar; */
}


void RfcCommPopup::slotConnect()
{

    qWarning("connect");

    PPPDialog pppDialog;
    QPEApplication::execDialog( &pppDialog );
}


void RfcCommPopup::slotDisconnect()
{
    qWarning("slot disconnected");
}


void RfcCommPopup::slotBind()
{
    RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp  );

    rfcommAssign.newDevice( m_item->mac() );

    if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
    {
        rfcommAssign.saveConfig();
    }
}


void RfcCommPopup::slotBar()
{
    qWarning("slotBar");
};