summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/rfcpopup.cpp
blob: d95f14b3d9ae56e84e4778f19d8314e4ccd12a78 (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

#include <qtimer.h>

#include "pppdialog.h"
#include "rfcpopup.h"
#include "rfcommassigndialogimpl.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;
    pppDialog.showMaximized();
    pppDialog.exec();
}


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


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

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

    if ( rfcommAssign.exec() == QDialog::Accepted )  {
        rfcommAssign.saveConfig();
    }
}


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