-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 39 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexftpdialog.cpp | 2 |
2 files changed, 29 insertions, 12 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 58f97fa..85385d8 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -649,153 +649,170 @@ void BlueBase::deviceActive( const QString& device, bool connected ) if( it == m_deviceList.end() ) return; BTDeviceItem* deviceItem = it.data(); if ( connected ) { deviceItem->setPixmap( 1, m_onPix ); } else { deviceItem->setPixmap( 1, m_offPix ); } m_deviceList.remove( it ); } /** * Open the "scan for devices" dialog */ void BlueBase::startScan() { ScanDialog *scan = new ScanDialog( this, "ScanDialog", true, WDestructiveClose ); QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); QPEApplication::showDialog( scan ); } /** * Set the informations about the local device in information Tab */ void BlueBase::setInfo() { StatusLabel->setText( status() ); } /** * Decontructor */ BlueBase::~BlueBase() { writeSavedDevices(); if (forwarder) { #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) - << QPEApplication::Enable; + { + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } #endif delete forwarder; forwarder = NULL; } delete m_iconLoader; } /** * find searches the ListView for a BTDeviceItem containig * the same Device if found return true else false * @param dev RemoteDevice to find * @return returns true if found */ bool BlueBase::find( const RemoteDevice& rem ) { QListViewItemIterator it( devicesView ); BTListItem* item; BTDeviceItem* device; for (; it.current(); ++it ) { item = (BTListItem*) it.current(); if ( item->typeId() != BTListItem::Device ) continue; device = (BTDeviceItem*)item; if ( rem.equals( device->remoteDevice() ) ) return true; } return false; // not found } /** * Start process of the cell phone forwarding */ void BlueBase::doForward() { if (forwarder && forwarder->isRunning()) { runButton->setText("start gateway"); forwarder->stop(); delete forwarder; forwarder = NULL; +#if defined(Q_WS_QWS) && !defined(QT_NO_COP) + { + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } +#endif return; } QString str = serDevName->text(); forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); - connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), - this, SLOT(forwardExited(Opie::Core::OProcess*))); if (forwarder->start(OProcess::NotifyOnExit) < 0) { QMessageBox::critical(this, tr("Forwarder Error"), tr("Forwarder start error:") + tr(strerror(errno))); return; } + connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), + this, SLOT(forwardExited(Opie::Core::OProcess*))); runButton->setText("stop gateway"); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)") - << QPEApplication::DisableSuspend; + { + odebug << "SUSP: Disable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)"); + e << QPEApplication::DisableSuspend; + } #endif } /** * React on the process end */ void BlueBase::forwardExit(Opie::Core::OProcess* proc) { + odebug << "Process exited" << oendl; #if defined(Q_WS_QWS) && !defined(QT_NO_COP) - QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) - << QPEApplication::Enable; + if (forwarder) { + delete forwarder; + forwarder = NULL; + runButton->setText("start gateway"); + odebug << "SUSP: Enable suspend mode" << oendl; + QCopEnvelope e("QPE/System", "setScreenSaverMode(int)" ); + e << QPEApplication::Enable; + } #endif if (proc->exitStatus() != 0) QMessageBox::critical(this, tr("Forwarder Error"), tr("Forwarder start error")); - delete proc; - forwarder = NULL; - runButton->setText("start gateway"); } /** * Encrypt entered passkey * doit - do encryption of the key */ void BlueBase::doEncrypt(bool doit) { passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal); } /** * Start services edit dialog */ void BlueBase::editServices() { QString conf = "/etc/default/bluetooth"; //// Use for debugging purposes //// QString conf = "/mnt/net/opie/bin/bluetooth"; ServicesDialog svcEdit(conf, this, "ServicesDialog", true, WStyle_ContextHelp); if (QPEApplication::execDialog(&svcEdit) == QDialog::Accepted) { } } //eof diff --git a/noncore/net/opietooth/manager/obexftpdialog.cpp b/noncore/net/opietooth/manager/obexftpdialog.cpp index fd2015e..2f04ecf 100644 --- a/noncore/net/opietooth/manager/obexftpdialog.cpp +++ b/noncore/net/opietooth/manager/obexftpdialog.cpp @@ -233,97 +233,97 @@ void ObexFtpDialog::slotCd(QListViewItem* item) curdir = ""; } else { if (curdir != "" && curdir.right(1) != "/") curdir += "/"; curdir += file->text(0); } odebug << "Browse " << curdir << oendl; if (obexftp_setpath(client, curdir, 0) < 0) log(tr("CD failed: ") + tr(strerror(errno))); slotBrowse(); } } /* * Copy file from a remote device to the local device */ void ObexFtpDialog::getFile() { FileListItem* file = (FileListItem*)fileList->selectedItem(); int result; if (file == NULL) return; file2get = "/"; local = localCurdir; if (local == "") { errBox("Select a destination first"); return; } if (local.right(1) != "/") local += "/"; if (file->gettype() == IS_FILE) { if (client == NULL) { errBox("No connection established"); return; } file2get += curdir; if (curdir != "" && curdir.right(1) != "/") file2get += "/"; file2get += file->text(0); local += file->text(0); odebug << "Copy " << file2get << " to " << local << oendl; progressStatus = 0; fileProgress->setTotalSteps(file->getsize() / 1024); fileProgress->reset(); status(tr("Receiving file ") + file2get); result = obexftp_get(client, local, file2get); if (result < 0) { - log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); + log(file2get + QString(" receive ERROR:\n") + tr(strerror(errno))); errBox(file2get + QString(" receive ERROR")); status(file2get + QString(" receive ERROR")); } else { log(file2get + QString(" received")); status(file2get + QString(" received")); destFile->reread(); } } } /* * Copy file from the local device to a remote device */ void ObexFtpDialog::putFile() { int result; //OPeration result int idx; //Index of a symbol in the string struct stat localFStat; //Local file information if (client == NULL) { errBox("No connection established"); return; } local = destFile->selectedName(); if (local == "") { errBox("No file slected"); return; } result = stat(local, &localFStat); if (result < 0) { errBox(tr("Wrong file selected ") + local + tr(" ") + tr(strerror(errno))); return; } idx = local.findRev('/'); if (idx > 0) { file2get = local.right(local.length() - idx - 1); } else file2get = local; odebug << "Copy " << local << " to " << file2get << oendl; progressStatus = 0; fileProgress->setTotalSteps(localFStat.st_size / 1024); fileProgress->reset(); status(tr("Sending file ") + local); result = obexftp_put_file(client, local, file2get); |