author | korovkin <korovkin> | 2006-04-03 04:12:19 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-03 04:12:19 (UTC) |
commit | 430017b047c885ba4dfd9f4074f4e4ab130d5709 (patch) (unidiff) | |
tree | ed883831f88038163285800ee2d8cc2fbb4faf86 /noncore/net/opietooth | |
parent | 812083469c80a0a07ad1ba41d6795e05f950710b (diff) | |
download | opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.zip opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.tar.gz opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.tar.bz2 |
Added dialog boxes for PAN and DUN connections.
Added message boxes in order to confirm DUN and PAN disconnections.
-rw-r--r-- | noncore/net/opietooth/manager/ReleaseNotes.txt | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/TODO.txt | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/dunpopup.cpp | 31 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/dunpopup.h | 9 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/manager.pro | 5 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.cpp | 14 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.cpp | 4 |
8 files changed, 40 insertions, 29 deletions
diff --git a/noncore/net/opietooth/manager/ReleaseNotes.txt b/noncore/net/opietooth/manager/ReleaseNotes.txt index 9c0fa8c..0b21f85 100644 --- a/noncore/net/opietooth/manager/ReleaseNotes.txt +++ b/noncore/net/opietooth/manager/ReleaseNotes.txt | |||
@@ -1,9 +1,9 @@ | |||
1 | Sun 19 Mar 2006 17:29:28 | 1 | Sun 19 Mar 2006 17:29:28 |
2 | 1. In order to build manager you need to build obexftp >= 0.18 | 2 | 1. In order to build manager you need to build obexftp >= 0.18 |
3 | (http://triq.net/obexftp/) with crosscompiler and put client.h, obexftp.h, | 3 | (http://triq.net/obexftp/) with crosscompiler and put client.h, obexftp.h, |
4 | object.h and uuid.h files to $LIBBLUEZ_INC_DIR/obexftp and libobexftp.a, | 4 | object.h and uuid.h files to $LIBBLUEZ_INC_DIR/obexftp and libobexftp.a, |
5 | libmulticobex.a and libbfb.a to $LIBBLUEZ_LIB_DIR. | 5 | libmulticobex.a and libbfb.a to $LIBBLUEZ_LIB_DIR. |
6 | 2. In "ppp connection" dialog if you press connect with an empty ppp script | 6 | 2. In "ppp connection" dialog if you press connect with an empty ppp script |
7 | name it runs rfcomm connect 0 <device> <port>. | 7 | name it runs rfcomm connect <number of a port selected> <device> <port>. |
8 | 8 | ||
9 | //eof | 9 | //eof |
diff --git a/noncore/net/opietooth/manager/TODO.txt b/noncore/net/opietooth/manager/TODO.txt index 76fae68..1914d8b 100644 --- a/noncore/net/opietooth/manager/TODO.txt +++ b/noncore/net/opietooth/manager/TODO.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | 1. Add an rfcomm port number to the connection dialog. | 1 | 1. Try and run and correct authentification and encoding. |
2 | 2. Collect requirements from others. | 2 | 2. Collect requirements from others. |
3 | 3 | ||
4 | //eof | 4 | //eof |
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp index 10505a9..3017d63 100644 --- a/noncore/net/opietooth/manager/dunpopup.cpp +++ b/noncore/net/opietooth/manager/dunpopup.cpp | |||
@@ -1,65 +1,70 @@ | |||
1 | #include <qpe/qcopenvelope_qws.h> | 1 | #include <qpe/qcopenvelope_qws.h> |
2 | 2 | #include <qmessagebox.h> | |
3 | #include <qtimer.h> | ||
4 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <opie2/oprocess.h> | ||
5 | #include <qpe/qpeapplication.h> | ||
5 | using namespace Opie::Core; | 6 | using namespace Opie::Core; |
6 | 7 | ||
7 | #include "dunpopup.h" | 8 | #include "dunpopup.h" |
9 | #include "dundialog.h" | ||
8 | 10 | ||
9 | using namespace OpieTooth; | 11 | using namespace OpieTooth; |
10 | 12 | ||
11 | /* | 13 | /* |
12 | * c'tor init the QAction | 14 | * c'tor init the QAction |
13 | */ | 15 | */ |
14 | DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | 16 | DunPopup::DunPopup( const Services& service, |
17 | BTDeviceItem* item ) : QPopupMenu(), m_service(service) { | ||
15 | 18 | ||
16 | owarn << "DunPopup c'tor" << oendl; | 19 | owarn << "DunPopup c'tor" << oendl; |
17 | 20 | ||
18 | m_item = item; | 21 | m_item = item; |
19 | QAction *a, *b, *c; | 22 | QAction *a, *b, *c; |
20 | 23 | ||
21 | m_dunconnection = 0l; | ||
22 | /* connect action */ | ||
23 | |||
24 | |||
25 | a = new QAction(); // so it's get deleted | 24 | a = new QAction(); // so it's get deleted |
26 | a->setText( tr("connect") ); | 25 | a->setText( tr("connect") ); |
27 | a->addTo( this ); | 26 | a->addTo( this ); |
28 | connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); | 27 | connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); |
29 | 28 | ||
30 | |||
31 | b = new QAction(); | 29 | b = new QAction(); |
32 | b->setText( tr( "connect+conf" ) ); | 30 | b->setText( tr( "connect+conf" ) ); |
33 | b->addTo( this ); | 31 | b->addTo( this ); |
34 | connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); | 32 | connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); |
35 | 33 | ||
36 | c = new QAction(); | 34 | c = new QAction(); |
37 | c->setText( tr( "disconnect" ) ); | 35 | c->setText( tr( "disconnect" ) ); |
38 | c->addTo( this ); | 36 | c->addTo( this ); |
39 | connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); | 37 | connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); |
40 | 38 | ||
41 | }; | 39 | }; |
42 | 40 | ||
43 | DunPopup::~DunPopup() { | 41 | DunPopup::~DunPopup() { |
44 | 42 | ||
45 | } | 43 | } |
46 | 44 | ||
47 | void DunPopup::slotConnect() { | 45 | void DunPopup::slotConnect() { |
48 | 46 | odebug << "connect" << oendl; | |
49 | m_dunconnection = new StartDunConnection( m_item->mac() ); | 47 | DunDialog dundlg(m_item->mac(), |
50 | m_dunconnection->start(); | 48 | m_service.protocolDescriptorList().last().port()); |
49 | QPEApplication::execDialog( &dundlg ); | ||
51 | } | 50 | } |
52 | 51 | ||
53 | void DunPopup::slotDisconnect() { | 52 | void DunPopup::slotDisconnect() { |
54 | m_dunconnection->stop(); | 53 | OProcess dunDis; |
54 | OProcess pppDis; | ||
55 | dunDis << tr("dund") << tr("--kill") << m_item->mac(); | ||
56 | dunDis.start(OProcess::DontCare, OProcess::NoCommunication); | ||
57 | pppDis << tr("killall") << tr("-q") << tr("pppd"); | ||
58 | pppDis.start(OProcess::DontCare, OProcess::NoCommunication); | ||
59 | sleep(1); | ||
60 | QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected")); | ||
55 | } | 61 | } |
56 | 62 | ||
57 | 63 | ||
58 | void DunPopup::slotConnectAndConfig() { | 64 | void DunPopup::slotConnectAndConfig() { |
59 | slotConnect(); | 65 | slotConnect(); |
60 | 66 | ||
61 | // more intelligence here later like passing the device ( bnepX ) | 67 | // more intelligence here later like passing the device ( bnepX ) |
62 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 68 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
63 | e << QString( "networksettings" ); | 69 | e << QString( "networksettings" ); |
64 | |||
65 | } | 70 | } |
diff --git a/noncore/net/opietooth/manager/dunpopup.h b/noncore/net/opietooth/manager/dunpopup.h index c070c56..6058b20 100644 --- a/noncore/net/opietooth/manager/dunpopup.h +++ b/noncore/net/opietooth/manager/dunpopup.h | |||
@@ -1,33 +1,32 @@ | |||
1 | #ifndef DUNPOPUP_H | 1 | #ifndef DUNPOPUP_H |
2 | #define DUNPOPUP_H | 2 | #define DUNPOPUP_H |
3 | 3 | ||
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qaction.h> | 5 | #include <qaction.h> |
6 | 6 | #include <services.h> | |
7 | #include <startdunconnection.h> | ||
8 | 7 | ||
9 | #include "btdeviceitem.h" | 8 | #include "btdeviceitem.h" |
10 | 9 | ||
11 | 10 | ||
12 | namespace OpieTooth { | 11 | namespace OpieTooth { |
13 | 12 | ||
14 | class DunPopup : public QPopupMenu { | 13 | class DunPopup : public QPopupMenu { |
15 | 14 | ||
16 | Q_OBJECT | 15 | Q_OBJECT |
17 | 16 | ||
18 | public: | 17 | public: |
19 | DunPopup( OpieTooth::BTDeviceItem* ); | 18 | DunPopup(const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); |
20 | ~DunPopup(); | 19 | ~DunPopup(); |
21 | 20 | ||
22 | private: | 21 | private: |
23 | QAction* m_push; | 22 | QAction* m_push; |
24 | OpieTooth::StartDunConnection* m_dunconnection; | 23 | OpieTooth::BTDeviceItem *m_item; //device item |
25 | OpieTooth::BTDeviceItem *m_item; | 24 | Services m_service; //device service (port) |
26 | private slots: | 25 | private slots: |
27 | void slotConnect(); | 26 | void slotConnect(); |
28 | void slotDisconnect(); | 27 | void slotDisconnect(); |
29 | void slotConnectAndConfig(); | 28 | void slotConnectAndConfig(); |
30 | }; | 29 | }; |
31 | }; | 30 | }; |
32 | 31 | ||
33 | #endif | 32 | #endif |
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro index d042c4c..dc43f40 100644 --- a/noncore/net/opietooth/manager/manager.pro +++ b/noncore/net/opietooth/manager/manager.pro | |||
@@ -1,29 +1,30 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = btconnectionitem.h btdeviceitem.h \ | 2 | HEADERS = btconnectionitem.h btdeviceitem.h \ |
3 | btserviceitem.h stdpopups.h \ | 3 | btserviceitem.h stdpopups.h \ |
4 | popuphelper.h bluebase.h \ | 4 | popuphelper.h bluebase.h \ |
5 | scandialog.h btlistitem.h filistitem.h \ | 5 | scandialog.h btlistitem.h filistitem.h \ |
6 | hciconfwrapper.h bticonloader.h \ | 6 | hciconfwrapper.h bticonloader.h \ |
7 | pppdialog.h dundialog.h obexdialog.h obexftpdialog.h \ | 7 | pppdialog.h dundialog.h pandialog.h \ |
8 | obexdialog.h obexftpdialog.h \ | ||
8 | rfcommassigndialogimpl.h rfcommassigndialogitem.h \ | 9 | rfcommassigndialogimpl.h rfcommassigndialogitem.h \ |
9 | devicehandler.h rfcpopup.h obexpopup.h obexftpopup.h \ | 10 | devicehandler.h rfcpopup.h obexpopup.h obexftpopup.h \ |
10 | rfcommhelper.h panpopup.h dunpopup.h rfcommconfhandler.h | 11 | rfcommhelper.h panpopup.h dunpopup.h rfcommconfhandler.h |
11 | 12 | ||
12 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ | 13 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ |
13 | btserviceitem.cpp filelistitem.cpp stdpopups.cpp \ | 14 | btserviceitem.cpp filelistitem.cpp stdpopups.cpp \ |
14 | popuphelper.cpp main.cpp \ | 15 | popuphelper.cpp main.cpp \ |
15 | bluebase.cpp scandialog.cpp \ | 16 | bluebase.cpp scandialog.cpp \ |
16 | btlistitem.cpp hciconfwrapper.cpp \ | 17 | btlistitem.cpp hciconfwrapper.cpp \ |
17 | bticonloader.cpp pppdialog.cpp dundialog.cpp \ | 18 | bticonloader.cpp pppdialog.cpp dundialog.cpp pandialog.cpp \ |
18 | rfcommassigndialogimpl.cpp rfcommassigndialogitem.cpp \ | 19 | rfcommassigndialogimpl.cpp rfcommassigndialogitem.cpp \ |
19 | obexdialog.cpp devicehandler.cpp \ | 20 | obexdialog.cpp devicehandler.cpp \ |
20 | rfcpopup.cpp obexpopup.cpp obexftpopup.cpp obexftpdialog.cpp \ | 21 | rfcpopup.cpp obexpopup.cpp obexftpopup.cpp obexftpdialog.cpp \ |
21 | rfcommhelper.cpp panpopup.cpp dunpopup.cpp rfcommconfhandler.cpp | 22 | rfcommhelper.cpp panpopup.cpp dunpopup.cpp rfcommconfhandler.cpp |
22 | INCLUDEPATH += $(OPIEDIR)/include | 23 | INCLUDEPATH += $(OPIEDIR)/include |
23 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib | 24 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib |
24 | DEPENDPATH += $(OPIEDIR)/include | 25 | DEPENDPATH += $(OPIEDIR)/include |
25 | LIBS += -lqpe -lbluetooth -lopietooth1 -lopiecore2 -lopieui2 -lopenobex | 26 | LIBS += -lqpe -lbluetooth -lopietooth1 -lopiecore2 -lopieui2 -lopenobex |
26 | INTERFACES = bluetoothbase.ui devicedialog.ui rfcommassigndialogbase.ui \ | 27 | INTERFACES = bluetoothbase.ui devicedialog.ui rfcommassigndialogbase.ui \ |
27 | rfcommdialogitembase.ui obexftpdialogbase.ui | 28 | rfcommdialogitembase.ui obexftpdialogbase.ui |
28 | 29 | ||
29 | TARGET = bluetooth-manager | 30 | TARGET = bluetooth-manager |
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp index f02a58c..2fd9eaf 100644 --- a/noncore/net/opietooth/manager/panpopup.cpp +++ b/noncore/net/opietooth/manager/panpopup.cpp | |||
@@ -1,14 +1,18 @@ | |||
1 | #include <qpe/qcopenvelope_qws.h> | 1 | #include <qpe/qcopenvelope_qws.h> |
2 | #include <qmessagebox.h> | ||
2 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <opie2/oprocess.h> | ||
5 | #include <qpe/qpeapplication.h> | ||
6 | #include "pandialog.h" | ||
3 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
4 | 8 | ||
5 | #include <qtimer.h> | 9 | #include <qtimer.h> |
6 | 10 | ||
7 | #include "panpopup.h" | 11 | #include "panpopup.h" |
8 | 12 | ||
9 | using namespace OpieTooth; | 13 | using namespace OpieTooth; |
10 | 14 | ||
11 | /* | 15 | /* |
12 | * c'tor init the QAction | 16 | * c'tor init the QAction |
13 | */ | 17 | */ |
14 | PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | 18 | PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { |
@@ -36,31 +40,33 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | |||
36 | c = new QAction(); | 40 | c = new QAction(); |
37 | c->setText( tr( "disconnect" ) ); | 41 | c->setText( tr( "disconnect" ) ); |
38 | c->addTo( this ); | 42 | c->addTo( this ); |
39 | connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); | 43 | connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); |
40 | 44 | ||
41 | }; | 45 | }; |
42 | 46 | ||
43 | PanPopup::~PanPopup() { | 47 | PanPopup::~PanPopup() { |
44 | 48 | ||
45 | } | 49 | } |
46 | 50 | ||
47 | void PanPopup::slotConnect() { | 51 | void PanPopup::slotConnect() { |
48 | 52 | odebug << "connect" << oendl; | |
49 | m_panconnection = new StartPanConnection( m_item->mac() ); | 53 | PanDialog pandlg(m_item->mac()); |
50 | m_panconnection->start(); | 54 | QPEApplication::execDialog(&pandlg); |
51 | } | 55 | } |
52 | 56 | ||
53 | void PanPopup::slotDisconnect() { | 57 | void PanPopup::slotDisconnect() { |
54 | if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() ); | 58 | if (!m_panconnection) |
59 | m_panconnection = new StartPanConnection( m_item->mac() ); | ||
55 | m_panconnection->stop(); | 60 | m_panconnection->stop(); |
61 | QMessageBox::information(this, tr("Pan Disconnect"), tr("PAN Disconnected")); | ||
56 | } | 62 | } |
57 | 63 | ||
58 | 64 | ||
59 | void PanPopup::slotConnectAndConfig() { | 65 | void PanPopup::slotConnectAndConfig() { |
60 | slotConnect(); | 66 | slotConnect(); |
61 | 67 | ||
62 | // more intelligence here later like passing the device ( bnepX ) | 68 | // more intelligence here later like passing the device ( bnepX ) |
63 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 69 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
64 | e << QString( "networksettings" ); | 70 | e << QString( "networksettings" ); |
65 | 71 | ||
66 | } | 72 | } |
diff --git a/noncore/net/opietooth/manager/panpopup.h b/noncore/net/opietooth/manager/panpopup.h index 1496f3a..3e535e3 100644 --- a/noncore/net/opietooth/manager/panpopup.h +++ b/noncore/net/opietooth/manager/panpopup.h | |||
@@ -18,16 +18,16 @@ namespace OpieTooth { | |||
18 | public: | 18 | public: |
19 | PanPopup( OpieTooth::BTDeviceItem* ); | 19 | PanPopup( OpieTooth::BTDeviceItem* ); |
20 | ~PanPopup(); | 20 | ~PanPopup(); |
21 | 21 | ||
22 | private: | 22 | private: |
23 | QAction* m_push; | 23 | QAction* m_push; |
24 | OpieTooth::StartPanConnection* m_panconnection; | 24 | OpieTooth::StartPanConnection* m_panconnection; |
25 | OpieTooth::BTDeviceItem *m_item; | 25 | OpieTooth::BTDeviceItem *m_item; |
26 | private slots: | 26 | private slots: |
27 | void slotConnect(); | 27 | void slotConnect(); |
28 | void slotDisconnect(); | 28 | void slotDisconnect(); |
29 | void slotConnectAndConfig(); | 29 | void slotConnectAndConfig(); |
30 | }; | 30 | }; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #endif | 33 | #endif |
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp index 68f19c0..f58d3a6 100644 --- a/noncore/net/opietooth/manager/stdpopups.cpp +++ b/noncore/net/opietooth/manager/stdpopups.cpp | |||
@@ -13,17 +13,17 @@ extern "C" { | |||
13 | return new OpieTooth::RfcCommPopup(service, item); // fix spellin RfComm vs. RfcComm and paramaters | 13 | return new OpieTooth::RfcCommPopup(service, item); // fix spellin RfComm vs. RfcComm and paramaters |
14 | } | 14 | } |
15 | QPopupMenu* newObexPushPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) { | 15 | QPopupMenu* newObexPushPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) { |
16 | return new OpieTooth::ObexPopup(service, item); | 16 | return new OpieTooth::ObexPopup(service, item); |
17 | } | 17 | } |
18 | QPopupMenu* newObexFtpPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) { | 18 | QPopupMenu* newObexFtpPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) { |
19 | return new OpieTooth::ObexFtpPopup(service, item); | 19 | return new OpieTooth::ObexFtpPopup(service, item); |
20 | } | 20 | } |
21 | QPopupMenu* newPanPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* item ) { | 21 | QPopupMenu* newPanPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* item ) { |
22 | return new OpieTooth::PanPopup( item ); | 22 | return new OpieTooth::PanPopup( item ); |
23 | } | 23 | } |
24 | 24 | ||
25 | QPopupMenu* newDunPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* item ) { | 25 | QPopupMenu* newDunPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item ) { |
26 | return new OpieTooth::DunPopup( item ); | 26 | return new OpieTooth::DunPopup(service, item); |
27 | } | 27 | } |
28 | } | 28 | } |
29 | 29 | ||