summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/obexdialog.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/obexdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 15973d4..46a0e3d 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -1,86 +1,86 @@
1 1
2#include "obexdialog.h" 2#include "obexdialog.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 <qfileinfo.h> 8#include <qfileinfo.h>
9 9
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12#include <opie/oprocess.h> 12#include <opie/oprocess.h>
13#include <opie/ofiledialog.h> 13#include <opie/ofiledialog.h>
14 14
15using namespace OpieTooth; 15using namespace OpieTooth;
16 16
17ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 17ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
18 : QDialog( parent, name, modal, fl ) { 18 : QDialog( parent, name, modal, fl ) {
19 19
20 if ( !name ) 20 if ( !name )
21 setName( "ObexDialog" ); 21 setName( "ObexDialog" );
22 setCaption( tr( "beam files " ) ) ; 22 setCaption( tr( "beam files " ) ) ;
23 23
24 m_device = device; 24 m_device = device;
25 25
26 layout = new QVBoxLayout( this ); 26 layout = new QVBoxLayout( this );
27 27
28 QLabel* info = new QLabel( this ); 28 QLabel* info = new QLabel( this );
29 info->setText( tr("Which file should be beamed?") ); 29 info->setText( tr("Which file should be beamed?") );
30 30
31 cmdLine = new QLineEdit( this ); 31 cmdLine = new QLineEdit( this );
32 32
33 QPushButton *browserButton; 33 QPushButton *browserButton;
34 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); 34 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
35 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) ); 35 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) );
36 36
37 chNameLine = new QLineEdit( this ); 37 chNameLine = new QLineEdit( this );
38 38
39 sendButton = new QPushButton( this ); 39 sendButton = new QPushButton( this );
40 sendButton->setText( tr( "Send" ) ); 40 sendButton->setText( tr( "Send" ) );
41 41
42 layout->addWidget(info); 42 layout->addWidget(info);
43 layout->addWidget(cmdLine); 43 layout->addWidget(cmdLine);
44 layout->addWidget(browserButton); 44 layout->addWidget(browserButton);
45 layout->addWidget(chNameLine); 45 layout->addWidget(chNameLine);
46 layout->addWidget(sendButton); 46 layout->addWidget(sendButton);
47 47
48 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) ); 48 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) );
49 49
50} 50}
51 51
52ObexDialog::~ObexDialog() { 52ObexDialog::~ObexDialog() {
53} 53}
54 54
55void ObexDialog::browse() { 55void ObexDialog::browse() {
56 56
57 MimeTypes types; 57 MimeTypes types;
58 QStringList all; 58 QStringList all;
59 all << "*/*"; 59 all << "*/*";
60 types.insert("All Files", all ); 60 types.insert("All Files", all );
61 61
62 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); 62 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 );
63 cmdLine->setText( str ); 63 cmdLine->setText( str );
64 64
65} 65}
66 66
67void ObexDialog::sendData() { 67void ObexDialog::sendData() {
68 QString fileURL = cmdLine->text(); 68 QString fileURL = cmdLine->text();
69 QString file = QFileInfo( fileURL ).fileName(); 69 QString file = QFileInfo( fileURL ).fileName();
70 QString modifiedName = chNameLine->text(); 70 QString modifiedName = chNameLine->text();
71 71
72 // vom popupmenu beziehen 72 // vom popupmenu beziehen
73 OProcess* obexSend = new OProcess(); 73 OProcess* obexSend = new OProcess();
74 if ( !modifiedName.isEmpty() ) { 74 if ( !modifiedName.isEmpty() ) {
75 *obexSend << "ussp-push" << m_device << fileURL << modifiedName; 75 *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
76 } else { 76 } else {
77 *obexSend << "ussp-push" << m_device << fileURL << file; 77 *obexSend << "ussp-push" << m_device << fileURL << file;
78 } 78 }
79 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) { 79 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
80 qWarning("could not start"); 80 qWarning("could not start");
81 delete obexSend; 81 delete obexSend;
82 } 82 }
83 83
84 84
85 85
86} 86}