summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/manager.pro4
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp84
-rw-r--r--noncore/net/opietooth/manager/obexdialog.h36
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp9
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h4
5 files changed, 130 insertions, 7 deletions
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index 2d8ebe3..0bdd6b9 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -1,27 +1,27 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on debug 2CONFIG = qt warn_on debug
3#CONFIG = qt warn_on release 3#CONFIG = qt warn_on release
4HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h pppdialog.h 4HEADERS = btconnectionitem.h btdeviceitem.h btserviceitem.h stdpopups.h popuphelper.h bluebase.h scandialog.h btlistitem.h hciconfwrapper.h bticonloader.h pppdialog.h obexdialog.h
5SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp pppdialog.cpp 5SOURCES = btconnectionitem.cpp btdeviceitem.cpp btserviceitem.h stdpopups.cpp popuphelper.cpp main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp bticonloader.cpp pppdialog.cpp obexdialog.cpp
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib 7INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopietooth -lopie 9LIBS += -lqpe -lopietooth -lopie
10INTERFACES = bluetoothbase.ui devicedialog.ui 10INTERFACES = bluetoothbase.ui devicedialog.ui
11DESTDIR = $(OPIEDIR)/bin 11DESTDIR = $(OPIEDIR)/bin
12TARGET = bluetooth-manager 12TARGET = bluetooth-manager
13 13
14TRANSLATIONS = ../../../../i18n/de/bluetooth-manager.ts \ 14TRANSLATIONS = ../../../../i18n/de/bluetooth-manager.ts \
15 ../../../../i18n/en/bluetooth-manager.ts \ 15 ../../../../i18n/en/bluetooth-manager.ts \
16 ../../../../i18n/es/bluetooth-manager.ts \ 16 ../../../../i18n/es/bluetooth-manager.ts \
17 ../../../../i18n/fr/bluetooth-manager.ts \ 17 ../../../../i18n/fr/bluetooth-manager.ts \
18 ../../../../i18n/hu/bluetooth-manager.ts \ 18 ../../../../i18n/hu/bluetooth-manager.ts \
19 ../../../../i18n/ja/bluetooth-manager.ts \ 19 ../../../../i18n/ja/bluetooth-manager.ts \
20 ../../../../i18n/ko/bluetooth-manager.ts \ 20 ../../../../i18n/ko/bluetooth-manager.ts \
21 ../../../../i18n/no/bluetooth-manager.ts \ 21 ../../../../i18n/no/bluetooth-manager.ts \
22 ../../../../i18n/pl/bluetooth-manager.ts \ 22 ../../../../i18n/pl/bluetooth-manager.ts \
23 ../../../../i18n/pt/bluetooth-manager.ts \ 23 ../../../../i18n/pt/bluetooth-manager.ts \
24 ../../../../i18n/pt_BR/bluetooth-manager.ts \ 24 ../../../../i18n/pt_BR/bluetooth-manager.ts \
25 ../../../../i18n/sl/bluetooth-manager.ts \ 25 ../../../../i18n/sl/bluetooth-manager.ts \
26 ../../../../i18n/zh_CN/bluetooth-manager.ts \ 26 ../../../../i18n/zh_CN/bluetooth-manager.ts \
27 ../../../../i18n/zh_TW/bluetooth-manager.ts 27 ../../../../i18n/zh_TW/bluetooth-manager.ts
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
new file mode 100644
index 0000000..cb142eb
--- a/dev/null
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -0,0 +1,84 @@
1
2#include "obexdialog.h"
3#include <qpushbutton.h>
4#include <qmultilineedit.h>
5#include <qlineedit.h>
6#include <qlayout.h>
7#include <qlabel.h>
8#include <qfileinfo.h>
9
10#include <qpe/resource.h>
11
12#include <opie/oprocess.h>
13#include <opie/ofiledialog.h>
14
15ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
16 : QDialog( parent, name, modal, fl ) {
17
18 if ( !name )
19 setName( "ObexDialog" );
20 setCaption( tr( "beam files " ) ) ;
21
22 m_device = device;
23
24 layout = new QVBoxLayout( this );
25
26 QLabel* info = new QLabel( this );
27 info->setText( tr("Which file should be beamed?") );
28
29 cmdLine = new QLineEdit( this );
30
31 QPushButton *browserButton;
32 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
33 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) );
34
35 chNameLine = new QLineEdit( this );
36
37 sendButton = new QPushButton( this );
38 sendButton->setText( tr( "Send" ) );
39
40 layout->addWidget(info);
41 layout->addWidget(cmdLine);
42 layout->addWidget(browserButton);
43 layout->addWidget(chNameLine);
44 layout->addWidget(sendButton);
45
46 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) );
47
48}
49
50ObexDialog::~ObexDialog() {
51}
52
53void ObexDialog::browse() {
54
55 MimeTypes types;
56 QStringList all;
57 all << "*/*";
58 types.insert("All Files", all );
59
60 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 );
61 cmdLine->setText( str );
62
63}
64
65void ObexDialog::sendData() {
66 QString fileURL = cmdLine->text();
67 QString file = QFileInfo( fileURL ).fileName();
68 QString modifiedName = chNameLine->text();
69
70 // vom popupmenu beziehen
71 OProcess* obexSend = new OProcess();
72 if ( !modifiedName.isEmpty() ) {
73 *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
74 } else {
75 *obexSend << "ussp-push" << m_device << fileURL << file;
76 }
77 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
78 qWarning("could not start");
79 delete obexSend;
80 }
81
82
83
84}
diff --git a/noncore/net/opietooth/manager/obexdialog.h b/noncore/net/opietooth/manager/obexdialog.h
new file mode 100644
index 0000000..1a73b57
--- a/dev/null
+++ b/noncore/net/opietooth/manager/obexdialog.h
@@ -0,0 +1,36 @@
1#ifndef OBEXDIALOG_H
2#define OBEXDIALOG_H
3
4
5#include <qdialog.h>
6#include <opie/oprocess.h>
7
8class QVBoxLayout;
9class QPushButton;
10class QMultiLineEdit;
11class QLineEdit;
12
13class ObexDialog : public QDialog {
14
15 Q_OBJECT
16
17public:
18 ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
19 ~ObexDialog();
20
21
22private slots:
23 void browse();
24 void sendData();
25
26protected:
27 QVBoxLayout* layout;
28 QLineEdit* cmdLine;
29 QLineEdit* chNameLine;
30 QPushButton* sendButton;
31private:
32 // Device that is used
33 QString m_device;
34};
35
36#endif
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 472da73..4d926a5 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -1,65 +1,66 @@
1 1
2#include "pppdialog.h" 2#include "pppdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <opie/oprocess.h> 8#include <opie/oprocess.h>
9 9
10PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 10PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
11 : QDialog( parent, name, modal, fl ) { 11 : QDialog( parent, name, modal, fl ) {
12 12
13 if ( !name ) 13 if ( !name )
14 setName( "PPPDialog" ); 14 setName( "PPPDialog" );
15 setCaption( tr( "ppp connection " ) ) ; 15 setCaption( tr( "ppp connection " ) ) ;
16 16
17 m_device = device;
18
17 layout = new QVBoxLayout( this ); 19 layout = new QVBoxLayout( this );
18 20
19 QLabel* info = new QLabel( this ); 21 QLabel* info = new QLabel( this );
20 info->setText( "Enter an ppp script name:" ); 22 info->setText( tr("Enter an ppp script name:") );
21 23
22 cmdLine = new QLineEdit( this ); 24 cmdLine = new QLineEdit( this );
23 25
24 outPut = new QMultiLineEdit( this ); 26 outPut = new QMultiLineEdit( this );
25 QFont outPut_font( outPut->font() ); 27 QFont outPut_font( outPut->font() );
26 outPut_font.setPointSize( 8 ); 28 outPut_font.setPointSize( 8 );
27 outPut->setFont( outPut_font ); 29 outPut->setFont( outPut_font );
28 outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); 30 outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
29 31
30 connectButton = new QPushButton( this ); 32 connectButton = new QPushButton( this );
31 connectButton->setText( tr( "Connect" ) ); 33 connectButton->setText( tr( "Connect" ) );
32 34
33 layout->addWidget(info); 35 layout->addWidget(info);
34 layout->addWidget(cmdLine); 36 layout->addWidget(cmdLine);
35 layout->addWidget(outPut); 37 layout->addWidget(outPut);
36 layout->addWidget(connectButton); 38 layout->addWidget(connectButton);
37 39
38 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); 40 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
39 41
40} 42}
41 43
42PPPDialog::~PPPDialog() { 44PPPDialog::~PPPDialog() {
43} 45}
44 46
45void PPPDialog::connectToDevice() { 47void PPPDialog::connectToDevice() {
46 outPut->clear(); 48 outPut->clear();
47 // vom popupmenu beziehen 49 // vom popupmenu beziehen
48 QString devName = "/dev/ttyU0";
49 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 50 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
50 OProcess* pppDial = new OProcess(); 51 OProcess* pppDial = new OProcess();
51 *pppDial << "pppd" << devName << "call" << connectScript; 52 *pppDial << "pppd" << m_device << "call" << connectScript;
52 connect( pppDial, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 53 connect( pppDial, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
53 this, SLOT(fillOutPut(OProcess*, char*, int ) ) ); 54 this, SLOT(fillOutPut(OProcess*, char*, int ) ) );
54 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 55 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
55 qWarning("could not start"); 56 qWarning("could not start");
56 delete pppDial; 57 delete pppDial;
57 } 58 }
58} 59}
59 60
60void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 61void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
61 QCString str(cha, len ); 62 QCString str(cha, len );
62 outPut->insertLine( str ); 63 outPut->insertLine( str );
63 delete pppDial; 64 delete pppDial;
64} 65}
65 66
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
index 2baecca..b80b73d 100644
--- a/noncore/net/opietooth/manager/pppdialog.h
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -1,32 +1,34 @@
1#ifndef PPPDIALOG_H 1#ifndef PPPDIALOG_H
2#define PPPDIALOG_H 2#define PPPDIALOG_H
3 3
4 4
5#include <qdialog.h> 5#include <qdialog.h>
6#include <opie/oprocess.h> 6#include <opie/oprocess.h>
7 7
8class QVBoxLayout; 8class QVBoxLayout;
9class QPushButton; 9class QPushButton;
10class QMultiLineEdit; 10class QMultiLineEdit;
11class QLineEdit; 11class QLineEdit;
12 12
13class PPPDialog : public QDialog { 13class PPPDialog : public QDialog {
14 14
15 Q_OBJECT 15 Q_OBJECT
16 16
17public: 17public:
18 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0); 18 PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
19 ~PPPDialog(); 19 ~PPPDialog();
20 20
21 21
22private slots: 22private slots:
23 void connectToDevice(); 23 void connectToDevice();
24 void fillOutPut( OProcess* pppDial, char* cha, int len ); 24 void fillOutPut( OProcess* pppDial, char* cha, int len );
25protected: 25protected:
26 QVBoxLayout* layout; 26 QVBoxLayout* layout;
27 QLineEdit* cmdLine; 27 QLineEdit* cmdLine;
28 QPushButton* connectButton; 28 QPushButton* connectButton;
29 QMultiLineEdit* outPut; 29 QMultiLineEdit* outPut;
30 30
31private:
32 QString m_device;
31}; 33};
32#endif 34#endif