author | korovkin <korovkin> | 2006-04-04 18:53:07 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-04 18:53:07 (UTC) |
commit | 31ea6e9f697d72a31ce319f7f42254fe90e48a36 (patch) (unidiff) | |
tree | 694ad373b6ac80ebdf93137029b0b6c5d335d3f6 | |
parent | 76276b77e99897ae264aa5b171191521edada420 (diff) | |
download | opie-31ea6e9f697d72a31ce319f7f42254fe90e48a36.zip opie-31ea6e9f697d72a31ce319f7f42254fe90e48a36.tar.gz opie-31ea6e9f697d72a31ce319f7f42254fe90e48a36.tar.bz2 |
Added persist mode for dund.
-rw-r--r-- | noncore/net/opietooth/manager/TODO.txt | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/dundialog.cpp | 8 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/dundialog.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/dunpopup.cpp | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/noncore/net/opietooth/manager/TODO.txt b/noncore/net/opietooth/manager/TODO.txt index 1914d8b..ed512cd 100644 --- a/noncore/net/opietooth/manager/TODO.txt +++ b/noncore/net/opietooth/manager/TODO.txt | |||
@@ -1,4 +1,4 @@ | |||
1 | 1. Try and run and correct authentification and encoding. | 1 | 1. Improve hcid.conf parsing algorithm. |
2 | 2. Collect requirements from others. | 2 | 2. Collect requirements from others. |
3 | 3 | ||
4 | //eof | 4 | //eof |
diff --git a/noncore/net/opietooth/manager/dundialog.cpp b/noncore/net/opietooth/manager/dundialog.cpp index 7aac271..c6d8619 100644 --- a/noncore/net/opietooth/manager/dundialog.cpp +++ b/noncore/net/opietooth/manager/dundialog.cpp | |||
@@ -49,46 +49,54 @@ DunDialog::DunDialog( const QString& device, int port, QWidget* parent, | |||
49 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); | 49 | outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); |
50 | 50 | ||
51 | connectButton = new QPushButton( this ); | 51 | connectButton = new QPushButton( this ); |
52 | connectButton->setText( tr( "Connect" ) ); | 52 | connectButton->setText( tr( "Connect" ) ); |
53 | 53 | ||
54 | doEncryption = new QCheckBox(this, "encrypt"); | 54 | doEncryption = new QCheckBox(this, "encrypt"); |
55 | doEncryption->setText( tr( "encrypt" ) ); | 55 | doEncryption->setText( tr( "encrypt" ) ); |
56 | 56 | ||
57 | persist = new QCheckBox(this, "persist"); | ||
58 | persist->setText( tr( "persist" ) ); | ||
59 | |||
57 | layout->addWidget(info); | 60 | layout->addWidget(info); |
58 | layout->addWidget(cmdLine); | 61 | layout->addWidget(cmdLine); |
59 | layout->addWidget(doEncryption); | 62 | layout->addWidget(doEncryption); |
63 | layout->addWidget(persist); | ||
60 | layout->addWidget(outPut); | 64 | layout->addWidget(outPut); |
61 | layout->addWidget(connectButton); | 65 | layout->addWidget(connectButton); |
62 | 66 | ||
63 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); | 67 | connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); |
64 | } | 68 | } |
65 | 69 | ||
66 | DunDialog::~DunDialog() { | 70 | DunDialog::~DunDialog() { |
67 | } | 71 | } |
68 | 72 | ||
69 | void DunDialog::connectToDevice() { | 73 | void DunDialog::connectToDevice() { |
70 | bool doEnc = doEncryption->isChecked(); | 74 | bool doEnc = doEncryption->isChecked(); |
75 | bool doPersist = persist->isChecked(); | ||
76 | |||
71 | if (cmdLine->text() == "") | 77 | if (cmdLine->text() == "") |
72 | return; | 78 | return; |
73 | if (m_dunConnect) { | 79 | if (m_dunConnect) { |
74 | outPut->append(tr("Work in progress")); | 80 | outPut->append(tr("Work in progress")); |
75 | return; | 81 | return; |
76 | } | 82 | } |
77 | m_dunConnect = new OProcess(); | 83 | m_dunConnect = new OProcess(); |
78 | outPut->clear(); | 84 | outPut->clear(); |
79 | 85 | ||
80 | // Fill process command line | 86 | // Fill process command line |
81 | *m_dunConnect << tr("dund") | 87 | *m_dunConnect << tr("dund") |
82 | << tr("--connect") << m_device | 88 | << tr("--connect") << m_device |
83 | << tr("--channel") << QString::number(m_port) | 89 | << tr("--channel") << QString::number(m_port) |
84 | << tr("--nodetach"); | 90 | << tr("--nodetach"); |
85 | if (doEnc) | 91 | if (doEnc) |
86 | *m_dunConnect << tr("--encrypt"); | 92 | *m_dunConnect << tr("--encrypt"); |
93 | if (doPersist) | ||
94 | *m_dunConnect << tr("--persist"); | ||
87 | *m_dunConnect << tr("call") | 95 | *m_dunConnect << tr("call") |
88 | << cmdLine->text(); | 96 | << cmdLine->text(); |
89 | if (!m_dunConnect->start(OProcess::NotifyOnExit, | 97 | if (!m_dunConnect->start(OProcess::NotifyOnExit, |
90 | OProcess::All)) { | 98 | OProcess::All)) { |
91 | outPut->append(tr("Couldn't start")); | 99 | outPut->append(tr("Couldn't start")); |
92 | delete m_dunConnect; | 100 | delete m_dunConnect; |
93 | m_dunConnect = NULL; | 101 | m_dunConnect = NULL; |
94 | } | 102 | } |
diff --git a/noncore/net/opietooth/manager/dundialog.h b/noncore/net/opietooth/manager/dundialog.h index 9e219cd..a0d16ad 100644 --- a/noncore/net/opietooth/manager/dundialog.h +++ b/noncore/net/opietooth/manager/dundialog.h | |||
@@ -37,16 +37,17 @@ namespace OpieTooth { | |||
37 | void slotProcessExited(Opie::Core::OProcess* proc); | 37 | void slotProcessExited(Opie::Core::OProcess* proc); |
38 | void closeEvent(QCloseEvent* e); | 38 | void closeEvent(QCloseEvent* e); |
39 | protected: | 39 | protected: |
40 | QVBoxLayout* layout; | 40 | QVBoxLayout* layout; |
41 | QLineEdit* cmdLine; | 41 | QLineEdit* cmdLine; |
42 | QPushButton* connectButton; | 42 | QPushButton* connectButton; |
43 | QMultiLineEdit* outPut; | 43 | QMultiLineEdit* outPut; |
44 | QCheckBox* doEncryption; | 44 | QCheckBox* doEncryption; |
45 | QCheckBox* persist; | ||
45 | 46 | ||
46 | private: | 47 | private: |
47 | QString m_device; //device BT address | 48 | QString m_device; //device BT address |
48 | int m_port; //device process | 49 | int m_port; //device process |
49 | Opie::Core::OProcess* m_dunConnect; //DUN process | 50 | Opie::Core::OProcess* m_dunConnect; //DUN process |
50 | }; | 51 | }; |
51 | } | 52 | } |
52 | #endif | 53 | #endif |
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp index c304b2d..6844988 100644 --- a/noncore/net/opietooth/manager/dunpopup.cpp +++ b/noncore/net/opietooth/manager/dunpopup.cpp | |||
@@ -57,18 +57,21 @@ void DunPopup::slotConnect() { | |||
57 | DunDialog dundlg(m_item->mac(), | 57 | DunDialog dundlg(m_item->mac(), |
58 | m_service.protocolDescriptorList().last().port()); | 58 | m_service.protocolDescriptorList().last().port()); |
59 | QPEApplication::execDialog( &dundlg ); | 59 | QPEApplication::execDialog( &dundlg ); |
60 | } | 60 | } |
61 | 61 | ||
62 | void DunPopup::slotDisconnect() { | 62 | void DunPopup::slotDisconnect() { |
63 | OProcess dunDis; | 63 | OProcess dunDis; |
64 | OProcess pppDis; | 64 | OProcess pppDis; |
65 | OProcess dunKill; | ||
65 | dunDis << tr("dund") << tr("--kill") << m_item->mac(); | 66 | dunDis << tr("dund") << tr("--kill") << m_item->mac(); |
66 | dunDis.start(OProcess::DontCare, OProcess::NoCommunication); | 67 | dunDis.start(OProcess::DontCare, OProcess::NoCommunication); |
68 | dunKill << tr("killall") << tr("-q") << tr("dund"); | ||
69 | dunKill.start(OProcess::DontCare, OProcess::NoCommunication); | ||
67 | pppDis << tr("killall") << tr("-q") << tr("pppd"); | 70 | pppDis << tr("killall") << tr("-q") << tr("pppd"); |
68 | pppDis.start(OProcess::DontCare, OProcess::NoCommunication); | 71 | pppDis.start(OProcess::DontCare, OProcess::NoCommunication); |
69 | sleep(1); | 72 | sleep(1); |
70 | QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected")); | 73 | QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected")); |
71 | } | 74 | } |
72 | 75 | ||
73 | 76 | ||
74 | void DunPopup::slotConnectAndConfig() { | 77 | void DunPopup::slotConnectAndConfig() { |