Diffstat (limited to 'noncore/unsupported/gsmtool/gsmtool.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/gsmtool/gsmtool.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/unsupported/gsmtool/gsmtool.cpp b/noncore/unsupported/gsmtool/gsmtool.cpp index e6122ad..5940b0e 100644 --- a/noncore/unsupported/gsmtool/gsmtool.cpp +++ b/noncore/unsupported/gsmtool/gsmtool.cpp | |||
@@ -29,97 +29,98 @@ GSMTool::GSMTool( QWidget* parent, const char* name, WFlags fl ) | |||
29 | me = NULL; | 29 | me = NULL; |
30 | sms_store = NULL; | 30 | sms_store = NULL; |
31 | setConnected(FALSE); | 31 | setConnected(FALSE); |
32 | /* FIXME: Persistent settings for device/baudrate */ | 32 | /* FIXME: Persistent settings for device/baudrate */ |
33 | connect(ConnectButton, SIGNAL(clicked()), this, SLOT(doConnectButton())); | 33 | connect(ConnectButton, SIGNAL(clicked()), this, SLOT(doConnectButton())); |
34 | connect(SMSDeleteButton, SIGNAL(clicked()), this, SLOT(doSMSDeleteButton())); | 34 | connect(SMSDeleteButton, SIGNAL(clicked()), this, SLOT(doSMSDeleteButton())); |
35 | connect(SMSSendButton, SIGNAL(clicked()), this, SLOT(doSMSSendButton())); | 35 | connect(SMSSendButton, SIGNAL(clicked()), this, SLOT(doSMSSendButton())); |
36 | connect(NewSMSClearButton, SIGNAL(clicked()), this, SLOT(doNewSMSClearButton())); | 36 | connect(NewSMSClearButton, SIGNAL(clicked()), this, SLOT(doNewSMSClearButton())); |
37 | connect(NewSMSSaveButton, SIGNAL(clicked()), this, SLOT(doNewSMSSaveButton())); | 37 | connect(NewSMSSaveButton, SIGNAL(clicked()), this, SLOT(doNewSMSSaveButton())); |
38 | connect(NewSMSSendButton, SIGNAL(clicked()), this, SLOT(doNewSMSSendButton())); | 38 | connect(NewSMSSendButton, SIGNAL(clicked()), this, SLOT(doNewSMSSendButton())); |
39 | connect(ScanButton, SIGNAL(clicked()), this, SLOT(doScanButton())); | 39 | connect(ScanButton, SIGNAL(clicked()), this, SLOT(doScanButton())); |
40 | connect(TabWidget2, SIGNAL(currentChanged(QWidget *)), this, SLOT(doTabChanged())); | 40 | connect(TabWidget2, SIGNAL(currentChanged(QWidget *)), this, SLOT(doTabChanged())); |
41 | connect(SMSStoreList, SIGNAL(activated(int)), this, SLOT(doSMSStoreChanged())); | 41 | connect(SMSStoreList, SIGNAL(activated(int)), this, SLOT(doSMSStoreChanged())); |
42 | connect(SMSViewType, SIGNAL(activated(int)), this, SLOT(doSMSTypeChanged())); | 42 | connect(SMSViewType, SIGNAL(activated(int)), this, SLOT(doSMSTypeChanged())); |
43 | connect(SMSList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(doSelectedSMSChanged(QListViewItem *))); | 43 | connect(SMSList, SIGNAL(selectionChanged(QListViewItem *)), this, SLOT(doSelectedSMSChanged(QListViewItem *))); |
44 | timerid = -1; // Is this not possible normally? | 44 | timerid = -1; // Is this not possible normally? |
45 | } | 45 | } |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * Destroys the object and frees any allocated resources | 48 | * Destroys the object and frees any allocated resources |
49 | */ | 49 | */ |
50 | GSMTool::~GSMTool() | 50 | GSMTool::~GSMTool() |
51 | { | 51 | { |
52 | // no need to delete child widgets, Qt does it all for us | 52 | // no need to delete child widgets, Qt does it all for us |
53 | if (devicelocked) | 53 | if (devicelocked) |
54 | unlockDevice(); | 54 | unlockDevice(); |
55 | } | 55 | } |
56 | const speed_t GSMTool::baudrates[12] = { | 56 | const speed_t GSMTool::baudrates[12] = { |
57 | B300, B600, B1200, B2400, B4800, B9600, B19200, | 57 | B300, B600, B1200, B2400, B4800, B9600, B19200, |
58 | B38400, B57600, B115200, B230400, B460800 | 58 | B38400, B57600, B115200, B230400, B460800 |
59 | }; | 59 | }; |
60 | 60 | ||
61 | int GSMTool::lockDevice( ) | 61 | int GSMTool::lockDevice( ) |
62 | { | 62 | { |
63 | devicelocked = 1; | 63 | devicelocked = 1; |
64 | /* FIXME */ | 64 | /* FIXME */ |
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | void GSMTool::unlockDevice( ) | 68 | void GSMTool::unlockDevice( ) |
69 | { | 69 | { |
70 | devicelocked = 0; | 70 | devicelocked = 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | void GSMTool::setConnected( bool conn ) | 73 | void GSMTool::setConnected( bool conn ) |
74 | { | 74 | { |
75 | TabWidget2->setTabEnabled(tab_2, conn); | 75 | TabWidget2->setTabEnabled(tab_2, conn); |
76 | TabWidget2->setTabEnabled(tab_3, conn); | 76 | TabWidget2->setTabEnabled(tab_3, conn); |
77 | TabWidget2->setTabEnabled(tab_4, conn); | 77 | //TabWidget2->setTabEnabled(tab_4, conn); |
78 | NewSMSSendButton->setEnabled(conn); | ||
78 | MfrLabel->setEnabled(conn); | 79 | MfrLabel->setEnabled(conn); |
79 | MfrText->setEnabled(conn); | 80 | MfrText->setEnabled(conn); |
80 | ModelLabel->setEnabled(conn); | 81 | ModelLabel->setEnabled(conn); |
81 | ModelText->setEnabled(conn); | 82 | ModelText->setEnabled(conn); |
82 | RevisionLabel->setEnabled(conn); | 83 | RevisionLabel->setEnabled(conn); |
83 | RevisionText->setEnabled(conn); | 84 | RevisionText->setEnabled(conn); |
84 | SerialLabel->setEnabled(conn); | 85 | SerialLabel->setEnabled(conn); |
85 | SerialText->setEnabled(conn); | 86 | SerialText->setEnabled(conn); |
86 | 87 | ||
87 | } | 88 | } |
88 | void GSMTool::doTabChanged() | 89 | void GSMTool::doTabChanged() |
89 | { | 90 | { |
90 | int index = TabWidget2->currentPageIndex(); | 91 | int index = TabWidget2->currentPageIndex(); |
91 | qDebug("tab changed to %d", index); | 92 | qDebug("tab changed to %d", index); |
92 | 93 | ||
93 | if (index == 1) { | 94 | if (index == 1) { |
94 | timerid = startTimer(5000); | 95 | timerid = startTimer(5000); |
95 | timerEvent(NULL); | 96 | timerEvent(NULL); |
96 | } else if (timerid != -1) { | 97 | } else if (timerid != -1) { |
97 | killTimer(timerid); | 98 | killTimer(timerid); |
98 | timerid = -1; | 99 | timerid = -1; |
99 | } | 100 | } |
100 | } | 101 | } |
101 | 102 | ||
102 | void GSMTool::timerEvent( QTimerEvent * ) | 103 | void GSMTool::timerEvent( QTimerEvent * ) |
103 | { | 104 | { |
104 | OPInfo opi; | 105 | OPInfo opi; |
105 | 106 | ||
106 | opi = me->getCurrentOPInfo(); | 107 | opi = me->getCurrentOPInfo(); |
107 | 108 | ||
108 | if (opi._numericName == NOT_SET) { | 109 | if (opi._numericName == NOT_SET) { |
109 | NetStatText->setText("No network"); | 110 | NetStatText->setText("No network"); |
110 | NetworkLabel->setEnabled(FALSE); | 111 | NetworkLabel->setEnabled(FALSE); |
111 | NetworkText->setEnabled(FALSE); | 112 | NetworkText->setEnabled(FALSE); |
112 | NetworkText->setText(""); | 113 | NetworkText->setText(""); |
113 | SigStrText->setEnabled(FALSE); | 114 | SigStrText->setEnabled(FALSE); |
114 | SigStrText->setText(""); | 115 | SigStrText->setText(""); |
115 | dB->setEnabled(FALSE); | 116 | dB->setEnabled(FALSE); |
116 | SigStrLabel->setEnabled(FALSE); | 117 | SigStrLabel->setEnabled(FALSE); |
117 | } else { | 118 | } else { |
118 | // FIXME: Add 'roaming' info from AT+CFUN | 119 | // FIXME: Add 'roaming' info from AT+CFUN |
119 | qDebug("network"); | 120 | qDebug("network"); |
120 | NetStatText->setText("Registered"); | 121 | NetStatText->setText("Registered"); |
121 | NetworkLabel->setEnabled(TRUE); | 122 | NetworkLabel->setEnabled(TRUE); |
122 | NetworkText->setEnabled(TRUE); | 123 | NetworkText->setEnabled(TRUE); |
123 | NetworkText->setText(opi._longName.c_str()); | 124 | NetworkText->setText(opi._longName.c_str()); |
124 | SigStrText->setEnabled(TRUE); | 125 | SigStrText->setEnabled(TRUE); |
125 | 126 | ||