summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-04-03 04:12:19 (UTC)
committer korovkin <korovkin>2006-04-03 04:12:19 (UTC)
commit430017b047c885ba4dfd9f4074f4e4ab130d5709 (patch) (side-by-side diff)
treeed883831f88038163285800ee2d8cc2fbb4faf86
parent812083469c80a0a07ad1ba41d6795e05f950710b (diff)
downloadopie-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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/ReleaseNotes.txt2
-rw-r--r--noncore/net/opietooth/manager/TODO.txt2
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp31
-rw-r--r--noncore/net/opietooth/manager/dunpopup.h9
-rw-r--r--noncore/net/opietooth/manager/manager.pro5
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp14
-rw-r--r--noncore/net/opietooth/manager/panpopup.h2
-rw-r--r--noncore/net/opietooth/manager/stdpopups.cpp4
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 @@
Sun 19 Mar 2006 17:29:28
1. In order to build manager you need to build obexftp >= 0.18
(http://triq.net/obexftp/) with crosscompiler and put client.h, obexftp.h,
object.h and uuid.h files to $LIBBLUEZ_INC_DIR/obexftp and libobexftp.a,
libmulticobex.a and libbfb.a to $LIBBLUEZ_LIB_DIR.
2. In "ppp connection" dialog if you press connect with an empty ppp script
- name it runs rfcomm connect 0 <device> <port>.
+ name it runs rfcomm connect <number of a port selected> <device> <port>.
//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. Add an rfcomm port number to the connection dialog.
+1. Try and run and correct authentification and encoding.
2. Collect requirements from others.
//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 @@
#include <qpe/qcopenvelope_qws.h>
-
-#include <qtimer.h>
+#include <qmessagebox.h>
#include <opie2/odebug.h>
+#include <opie2/oprocess.h>
+#include <qpe/qpeapplication.h>
using namespace Opie::Core;
#include "dunpopup.h"
+#include "dundialog.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
-DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
+DunPopup::DunPopup( const Services& service,
+ BTDeviceItem* item ) : QPopupMenu(), m_service(service) {
owarn << "DunPopup c'tor" << oendl;
m_item = item;
QAction *a, *b, *c;
- m_dunconnection = 0l;
- /* connect action */
-
-
a = new QAction(); // so it's get deleted
a->setText( tr("connect") );
a->addTo( this );
connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
-
b = new QAction();
b->setText( tr( "connect+conf" ) );
b->addTo( this );
connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
c = new QAction();
c->setText( tr( "disconnect" ) );
c->addTo( this );
connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
};
DunPopup::~DunPopup() {
}
void DunPopup::slotConnect() {
-
- m_dunconnection = new StartDunConnection( m_item->mac() );
- m_dunconnection->start();
+ odebug << "connect" << oendl;
+ DunDialog dundlg(m_item->mac(),
+ m_service.protocolDescriptorList().last().port());
+ QPEApplication::execDialog( &dundlg );
}
void DunPopup::slotDisconnect() {
- m_dunconnection->stop();
+ OProcess dunDis;
+ OProcess pppDis;
+ dunDis << tr("dund") << tr("--kill") << m_item->mac();
+ dunDis.start(OProcess::DontCare, OProcess::NoCommunication);
+ pppDis << tr("killall") << tr("-q") << tr("pppd");
+ pppDis.start(OProcess::DontCare, OProcess::NoCommunication);
+ sleep(1);
+ QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected"));
}
void DunPopup::slotConnectAndConfig() {
slotConnect();
// more intelligence here later like passing the device ( bnepX )
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( "networksettings" );
-
}
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 @@
#ifndef DUNPOPUP_H
#define DUNPOPUP_H
#include <qpopupmenu.h>
#include <qaction.h>
-
-#include <startdunconnection.h>
+#include <services.h>
#include "btdeviceitem.h"
namespace OpieTooth {
class DunPopup : public QPopupMenu {
Q_OBJECT
public:
- DunPopup( OpieTooth::BTDeviceItem* );
+ DunPopup(const OpieTooth::Services&, OpieTooth::BTDeviceItem* );
~DunPopup();
private:
QAction* m_push;
- OpieTooth::StartDunConnection* m_dunconnection;
- OpieTooth::BTDeviceItem *m_item;
+ OpieTooth::BTDeviceItem *m_item; //device item
+ Services m_service; //device service (port)
private slots:
void slotConnect();
void slotDisconnect();
void slotConnectAndConfig();
};
};
#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 @@
CONFIG = qt warn_on quick-app
HEADERS = btconnectionitem.h btdeviceitem.h \
btserviceitem.h stdpopups.h \
popuphelper.h bluebase.h \
scandialog.h btlistitem.h filistitem.h \
hciconfwrapper.h bticonloader.h \
- pppdialog.h dundialog.h obexdialog.h obexftpdialog.h \
+ pppdialog.h dundialog.h pandialog.h \
+ obexdialog.h obexftpdialog.h \
rfcommassigndialogimpl.h rfcommassigndialogitem.h \
devicehandler.h rfcpopup.h obexpopup.h obexftpopup.h \
rfcommhelper.h panpopup.h dunpopup.h rfcommconfhandler.h
SOURCES = btconnectionitem.cpp btdeviceitem.cpp \
btserviceitem.cpp filelistitem.cpp stdpopups.cpp \
popuphelper.cpp main.cpp \
bluebase.cpp scandialog.cpp \
btlistitem.cpp hciconfwrapper.cpp \
- bticonloader.cpp pppdialog.cpp dundialog.cpp \
+ bticonloader.cpp pppdialog.cpp dundialog.cpp pandialog.cpp \
rfcommassigndialogimpl.cpp rfcommassigndialogitem.cpp \
obexdialog.cpp devicehandler.cpp \
rfcpopup.cpp obexpopup.cpp obexftpopup.cpp obexftpdialog.cpp \
rfcommhelper.cpp panpopup.cpp dunpopup.cpp rfcommconfhandler.cpp
INCLUDEPATH += $(OPIEDIR)/include
INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lbluetooth -lopietooth1 -lopiecore2 -lopieui2 -lopenobex
INTERFACES = bluetoothbase.ui devicedialog.ui rfcommassigndialogbase.ui \
rfcommdialogitembase.ui obexftpdialogbase.ui
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 @@
#include <qpe/qcopenvelope_qws.h>
+#include <qmessagebox.h>
#include <opie2/odebug.h>
+#include <opie2/oprocess.h>
+#include <qpe/qpeapplication.h>
+#include "pandialog.h"
using namespace Opie::Core;
#include <qtimer.h>
#include "panpopup.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
@@ -36,31 +40,33 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
c = new QAction();
c->setText( tr( "disconnect" ) );
c->addTo( this );
connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
};
PanPopup::~PanPopup() {
}
void PanPopup::slotConnect() {
-
- m_panconnection = new StartPanConnection( m_item->mac() );
- m_panconnection->start();
+ odebug << "connect" << oendl;
+ PanDialog pandlg(m_item->mac());
+ QPEApplication::execDialog(&pandlg);
}
void PanPopup::slotDisconnect() {
- if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() );
+ if (!m_panconnection)
+ m_panconnection = new StartPanConnection( m_item->mac() );
m_panconnection->stop();
+ QMessageBox::information(this, tr("Pan Disconnect"), tr("PAN Disconnected"));
}
void PanPopup::slotConnectAndConfig() {
slotConnect();
// more intelligence here later like passing the device ( bnepX )
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( "networksettings" );
}
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 {
public:
PanPopup( OpieTooth::BTDeviceItem* );
~PanPopup();
private:
QAction* m_push;
OpieTooth::StartPanConnection* m_panconnection;
OpieTooth::BTDeviceItem *m_item;
private slots:
void slotConnect();
void slotDisconnect();
void slotConnectAndConfig();
- };
+ };
};
#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" {
return new OpieTooth::RfcCommPopup(service, item); // fix spellin RfComm vs. RfcComm and paramaters
}
QPopupMenu* newObexPushPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) {
return new OpieTooth::ObexPopup(service, item);
}
QPopupMenu* newObexFtpPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) {
return new OpieTooth::ObexFtpPopup(service, item);
}
QPopupMenu* newPanPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* item ) {
return new OpieTooth::PanPopup( item );
}
- QPopupMenu* newDunPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* item ) {
- return new OpieTooth::DunPopup( item );
+ QPopupMenu* newDunPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item ) {
+ return new OpieTooth::DunPopup(service, item);
}
}