summaryrefslogtreecommitdiff
path: root/noncore/unsupported/gsmtool/gsmtool.cpp
authordwmw2 <dwmw2>2002-04-03 12:35:47 (UTC)
committer dwmw2 <dwmw2>2002-04-03 12:35:47 (UTC)
commit65ffe04c08cae587dda25381065f986ae20490d3 (patch) (unidiff)
tree7d9e32c86c056b7d1bb67665ab5d06bfd1ab6ac1 /noncore/unsupported/gsmtool/gsmtool.cpp
parentbaf2c30815ade433d18d1b6c8a7924c050344d23 (diff)
downloadopie-65ffe04c08cae587dda25381065f986ae20490d3.zip
opie-65ffe04c08cae587dda25381065f986ae20490d3.tar.gz
opie-65ffe04c08cae587dda25381065f986ae20490d3.tar.bz2
Network list working...
Diffstat (limited to 'noncore/unsupported/gsmtool/gsmtool.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/gsmtool/gsmtool.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp
index 38c8c59..38baf45 100644
--- a/noncore/unsupported/gsmtool/gsmtool.cpp
+++ b/noncore/unsupported/gsmtool/gsmtool.cpp
@@ -1,12 +1,13 @@
1#include "gsmtool.h" 1#include "gsmtool.h"
2#include <qpushbutton.h> 2#include <qpushbutton.h>
3#include <qcombobox.h> 3#include <qcombobox.h>
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qtabwidget.h> 6#include <qtabwidget.h>
7#include <qlistview.h>
7 8
8#include <termios.h> 9#include <termios.h>
9 10
10#include <gsmlib/gsm_me_ta.h> 11#include <gsmlib/gsm_me_ta.h>
11#include <gsmlib/gsm_unix_serial.h> 12#include <gsmlib/gsm_unix_serial.h>
12 13
@@ -128,12 +129,58 @@ void GSMTool::timerEvent( QTimerEvent * )
128 } 129 }
129} 130}
130 131
131void GSMTool::doScanButton() 132void GSMTool::doScanButton()
132{ 133{
133 qDebug("ScanButton"); 134 qDebug("ScanButton");
135
136 NetworkList->setEnabled(FALSE);
137 AvailNetsLabel->setEnabled(FALSE);
138 NetworkList->clear();
139 new QListViewItem(NetworkList, "Scanning...");
140
141 vector<OPInfo> opis;
142
143 try {
144 opis = me->getAvailableOPInfo();
145 } catch (GsmException) {
146 NetworkList->clear();
147 new QListViewItem(NetworkList, "Scan failed...");
148 return;
149 }
150
151 NetworkList->clear();
152 for (vector<OPInfo>::iterator i = opis.begin(); i != opis.end(); ++i) {
153 char *statustext;
154 switch (i->_status) {
155
156 case UnknownOPStatus:
157 statustext = "unknown";
158 break;
159
160 case CurrentOPStatus:
161 statustext = "current";
162 break;
163
164 case AvailableOPStatus:
165 statustext = "available";
166 break;
167
168 case ForbiddenOPStatus:
169 statustext = "forbidden";
170 break;
171
172 default:
173 statustext = "(ERROR)";
174 }
175 char num[7];
176 snprintf(num, 6, "%d", i->_numericName);
177 new QListViewItem(NetworkList, i->_longName.c_str(), statustext, num, i->_shortName.c_str());
178 }
179 NetworkList->setEnabled(TRUE);
180 AvailNetsLabel->setEnabled(TRUE);
134} 181}
135/* 182/*
136 * A simple slot... not very interesting. 183 * A simple slot... not very interesting.
137 */ 184 */
138void GSMTool::doConnectButton() 185void GSMTool::doConnectButton()
139{ 186{