summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/obexdialog.cpp
authorharlekin <harlekin>2002-07-13 14:02:59 (UTC)
committer harlekin <harlekin>2002-07-13 14:02:59 (UTC)
commit9a97566ac38b51e27707342556171af63f6a75b4 (patch) (side-by-side diff)
treeaf9b6a746090f6ca243af5c250e688f07c7ea708 /noncore/net/opietooth/manager/obexdialog.cpp
parentc86efeae9e7f7f63dca633f630b571019a5c71b6 (diff)
downloadopie-9a97566ac38b51e27707342556171af63f6a75b4.zip
opie-9a97566ac38b51e27707342556171af63f6a75b4.tar.gz
opie-9a97566ac38b51e27707342556171af63f6a75b4.tar.bz2
obex dialog added and fixes to ppp dialog
Diffstat (limited to 'noncore/net/opietooth/manager/obexdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp84
1 files changed, 84 insertions, 0 deletions
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 @@
+
+#include "obexdialog.h"
+#include <qpushbutton.h>
+#include <qmultilineedit.h>
+#include <qlineedit.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qfileinfo.h>
+
+#include <qpe/resource.h>
+
+#include <opie/oprocess.h>
+#include <opie/ofiledialog.h>
+
+ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
+ : QDialog( parent, name, modal, fl ) {
+
+ if ( !name )
+ setName( "ObexDialog" );
+ setCaption( tr( "beam files " ) ) ;
+
+ m_device = device;
+
+ layout = new QVBoxLayout( this );
+
+ QLabel* info = new QLabel( this );
+ info->setText( tr("Which file should be beamed?") );
+
+ cmdLine = new QLineEdit( this );
+
+ QPushButton *browserButton;
+ browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
+ connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) );
+
+ chNameLine = new QLineEdit( this );
+
+ sendButton = new QPushButton( this );
+ sendButton->setText( tr( "Send" ) );
+
+ layout->addWidget(info);
+ layout->addWidget(cmdLine);
+ layout->addWidget(browserButton);
+ layout->addWidget(chNameLine);
+ layout->addWidget(sendButton);
+
+ connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) );
+
+}
+
+ObexDialog::~ObexDialog() {
+}
+
+void ObexDialog::browse() {
+
+ MimeTypes types;
+ QStringList all;
+ all << "*/*";
+ types.insert("All Files", all );
+
+ QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 );
+ cmdLine->setText( str );
+
+}
+
+void ObexDialog::sendData() {
+ QString fileURL = cmdLine->text();
+ QString file = QFileInfo( fileURL ).fileName();
+ QString modifiedName = chNameLine->text();
+
+ // vom popupmenu beziehen
+ OProcess* obexSend = new OProcess();
+ if ( !modifiedName.isEmpty() ) {
+ *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
+ } else {
+ *obexSend << "ussp-push" << m_device << fileURL << file;
+ }
+ if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
+ qWarning("could not start");
+ delete obexSend;
+ }
+
+
+
+}