-rw-r--r-- | noncore/unsupported/gsmtool/gsmtool.cpp | 47 | ||||
-rw-r--r-- | noncore/unsupported/gsmtool/gsmtoolbase.ui | 16 |
2 files changed, 59 insertions, 4 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 | |||
@@ -4,6 +4,7 @@ | |||
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 | ||
@@ -131,6 +132,52 @@ void GSMTool::timerEvent( QTimerEvent * ) | |||
131 | void GSMTool::doScanButton() | 132 | void 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. |
diff --git a/noncore/unsupported/gsmtool/gsmtoolbase.ui b/noncore/unsupported/gsmtool/gsmtoolbase.ui index 36a3d8e..72c943a 100644 --- a/noncore/unsupported/gsmtool/gsmtoolbase.ui +++ b/noncore/unsupported/gsmtool/gsmtoolbase.ui | |||
@@ -11,8 +11,8 @@ | |||
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>272</width> | 14 | <width>388</width> |
15 | <height>366</height> | 15 | <height>502</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
@@ -552,11 +552,11 @@ | |||
552 | <class>QLabel</class> | 552 | <class>QLabel</class> |
553 | <property stdset="1"> | 553 | <property stdset="1"> |
554 | <name>name</name> | 554 | <name>name</name> |
555 | <cstring>AltNetsLabel</cstring> | 555 | <cstring>AvailNetsLabel</cstring> |
556 | </property> | 556 | </property> |
557 | <property stdset="1"> | 557 | <property stdset="1"> |
558 | <name>text</name> | 558 | <name>text</name> |
559 | <string>Alternative Networks:</string> | 559 | <string>Available Networks:</string> |
560 | </property> | 560 | </property> |
561 | </widget> | 561 | </widget> |
562 | <spacer> | 562 | <spacer> |
@@ -656,6 +656,10 @@ | |||
656 | <cstring>NetworkList</cstring> | 656 | <cstring>NetworkList</cstring> |
657 | </property> | 657 | </property> |
658 | <property stdset="1"> | 658 | <property stdset="1"> |
659 | <name>enabled</name> | ||
660 | <bool>false</bool> | ||
661 | </property> | ||
662 | <property stdset="1"> | ||
659 | <name>sizePolicy</name> | 663 | <name>sizePolicy</name> |
660 | <sizepolicy> | 664 | <sizepolicy> |
661 | <hsizetype>7</hsizetype> | 665 | <hsizetype>7</hsizetype> |
@@ -706,6 +710,10 @@ | |||
706 | <cstring>RegisterButton</cstring> | 710 | <cstring>RegisterButton</cstring> |
707 | </property> | 711 | </property> |
708 | <property stdset="1"> | 712 | <property stdset="1"> |
713 | <name>enabled</name> | ||
714 | <bool>false</bool> | ||
715 | </property> | ||
716 | <property stdset="1"> | ||
709 | <name>sizePolicy</name> | 717 | <name>sizePolicy</name> |
710 | <sizepolicy> | 718 | <sizepolicy> |
711 | <hsizetype>7</hsizetype> | 719 | <hsizetype>7</hsizetype> |