self._characterCountLabel = QtGui.QLabel("Letters: %s" % 0)
self._singleNumberSelector = QtGui.QComboBox()
self._smsButton = QtGui.QPushButton("SMS")
+ self._smsButton.clicked.connect(self._on_sms_clicked)
self._dialButton = QtGui.QPushButton("Dial")
+ self._dialButton.clicked.connect(self._on_call_clicked)
self._buttonLayout = QtGui.QHBoxLayout()
self._buttonLayout.addWidget(self._characterCountLabel)
self._on_change_number,
cid
)
- callback.__name__ = "b"
+ callback.__name__ = "thanks partials for not having names and pyqt for requiring them"
selector.currentIndexChanged.connect(
QtCore.pyqtSlot(int)(callback)
)
def _scroll_to_bottom(self):
self._scrollEntry.ensureWidgetVisible(self._smsEntry)
+ @QtCore.pyqtSlot()
+ @misc_utils.log_exception(_moduleLogger)
+ def _on_sms_clicked(self):
+ message = str(self._smsEntry.toPlainText())
+ self._session.draft.send(message)
+ self._smsEntry.setPlainText("")
+
+ @QtCore.pyqtSlot()
+ @misc_utils.log_exception(_moduleLogger)
+ def _on_call_clicked(self):
+ self._session.draft.call()
+ self._smsEntry.setPlainText("")
+
@misc_utils.log_exception(_moduleLogger)
def _on_remove_contact(self, cid):
self._session.draft.remove_contact(cid)
def send(self, text):
assert 0 < len(self._contacts)
+ numbers = [contact.selectedNumber for contact in self._contacts.itervalues()]
le = concurrent.AsyncLinearExecution(self._pool, self._send)
- le.start(text)
+ le.start(numbers, text)
def call(self):
assert len(self._contacts) == 1
+ (contact, ) = self._contacts.itervalues()
le = concurrent.AsyncLinearExecution(self._pool, self._call)
- le.start()
+ le.start(contact.selectedNumber)
def cancel(self):
le = concurrent.AsyncLinearExecution(self._pool, self._cancel)
if oldContacts:
self.recipientsChanged.emit()
- def _send(self, text):
+ def _send(self, numbers, text):
self.sendingMessage.emit()
try:
self.error.emit("Not Implemented")
except Exception, e:
self.error.emit(str(e))
- def _call(self):
+ def _call(self, number):
self.calling.emit()
try:
self.error.emit("Not Implemented")