-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 13954c5..58f97fa 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -23,24 +23,28 @@ | |||
23 | #include "rfcommassigndialogimpl.h" | 23 | #include "rfcommassigndialogimpl.h" |
24 | #include "forwarder.h" | 24 | #include "forwarder.h" |
25 | #include "servicesdialog.h" | 25 | #include "servicesdialog.h" |
26 | #include <termios.h> | 26 | #include <termios.h> |
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | 29 | ||
30 | /* OPIE */ | 30 | /* OPIE */ |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | #ifdef Q_WS_QWS | ||
36 | #include <qpe/qcopenvelope_qws.h> | ||
37 | #endif | ||
38 | |||
35 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
36 | 40 | ||
37 | /* QT */ | 41 | /* QT */ |
38 | #include <qframe.h> | 42 | #include <qframe.h> |
39 | #include <qlabel.h> | 43 | #include <qlabel.h> |
40 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
41 | #include <qlayout.h> | 45 | #include <qlayout.h> |
42 | #include <qvariant.h> | 46 | #include <qvariant.h> |
43 | #include <qimage.h> | 47 | #include <qimage.h> |
44 | #include <qpixmap.h> | 48 | #include <qpixmap.h> |
45 | #include <qtabwidget.h> | 49 | #include <qtabwidget.h> |
46 | #include <qscrollview.h> | 50 | #include <qscrollview.h> |
@@ -679,24 +683,32 @@ void BlueBase::startScan() | |||
679 | void BlueBase::setInfo() | 683 | void BlueBase::setInfo() |
680 | { | 684 | { |
681 | StatusLabel->setText( status() ); | 685 | StatusLabel->setText( status() ); |
682 | } | 686 | } |
683 | 687 | ||
684 | 688 | ||
685 | /** | 689 | /** |
686 | * Decontructor | 690 | * Decontructor |
687 | */ | 691 | */ |
688 | BlueBase::~BlueBase() | 692 | BlueBase::~BlueBase() |
689 | { | 693 | { |
690 | writeSavedDevices(); | 694 | writeSavedDevices(); |
695 | if (forwarder) { | ||
696 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
697 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | ||
698 | << QPEApplication::Enable; | ||
699 | #endif | ||
700 | delete forwarder; | ||
701 | forwarder = NULL; | ||
702 | } | ||
691 | delete m_iconLoader; | 703 | delete m_iconLoader; |
692 | } | 704 | } |
693 | 705 | ||
694 | 706 | ||
695 | /** | 707 | /** |
696 | * find searches the ListView for a BTDeviceItem containig | 708 | * find searches the ListView for a BTDeviceItem containig |
697 | * the same Device if found return true else false | 709 | * the same Device if found return true else false |
698 | * @param dev RemoteDevice to find | 710 | * @param dev RemoteDevice to find |
699 | * @return returns true if found | 711 | * @return returns true if found |
700 | */ | 712 | */ |
701 | bool BlueBase::find( const RemoteDevice& rem ) | 713 | bool BlueBase::find( const RemoteDevice& rem ) |
702 | { | 714 | { |
@@ -729,31 +741,39 @@ void BlueBase::doForward() | |||
729 | return; | 741 | return; |
730 | } | 742 | } |
731 | QString str = serDevName->text(); | 743 | QString str = serDevName->text(); |
732 | forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); | 744 | forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); |
733 | connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), | 745 | connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), |
734 | this, SLOT(forwardExited(Opie::Core::OProcess*))); | 746 | this, SLOT(forwardExited(Opie::Core::OProcess*))); |
735 | if (forwarder->start(OProcess::NotifyOnExit) < 0) { | 747 | if (forwarder->start(OProcess::NotifyOnExit) < 0) { |
736 | QMessageBox::critical(this, tr("Forwarder Error"), | 748 | QMessageBox::critical(this, tr("Forwarder Error"), |
737 | tr("Forwarder start error:") + tr(strerror(errno))); | 749 | tr("Forwarder start error:") + tr(strerror(errno))); |
738 | return; | 750 | return; |
739 | } | 751 | } |
740 | runButton->setText("stop gateway"); | 752 | runButton->setText("stop gateway"); |
753 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
754 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)") | ||
755 | << QPEApplication::DisableSuspend; | ||
756 | #endif | ||
741 | } | 757 | } |
742 | 758 | ||
743 | /** | 759 | /** |
744 | * React on the process end | 760 | * React on the process end |
745 | */ | 761 | */ |
746 | void BlueBase::forwardExit(Opie::Core::OProcess* proc) | 762 | void BlueBase::forwardExit(Opie::Core::OProcess* proc) |
747 | { | 763 | { |
764 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | ||
765 | QCopEnvelope("QPE/System", "setScreenSaverMode(int)" ) | ||
766 | << QPEApplication::Enable; | ||
767 | #endif | ||
748 | if (proc->exitStatus() != 0) | 768 | if (proc->exitStatus() != 0) |
749 | QMessageBox::critical(this, tr("Forwarder Error"), | 769 | QMessageBox::critical(this, tr("Forwarder Error"), |
750 | tr("Forwarder start error")); | 770 | tr("Forwarder start error")); |
751 | delete proc; | 771 | delete proc; |
752 | forwarder = NULL; | 772 | forwarder = NULL; |
753 | runButton->setText("start gateway"); | 773 | runButton->setText("start gateway"); |
754 | } | 774 | } |
755 | 775 | ||
756 | /** | 776 | /** |
757 | * Encrypt entered passkey | 777 | * Encrypt entered passkey |
758 | * doit - do encryption of the key | 778 | * doit - do encryption of the key |
759 | */ | 779 | */ |