__pretty_app_name__ = "DialCentral"
__app_name__ = "dialcentral"
-__version__ = "1.2.18"
+__version__ = "1.2.19"
__build__ = 0
__app_magic__ = 0xdeadbeef
_data_path_ = os.path.join(os.path.expanduser("~"), ".%s" % __app_name__)
self._scrollTimer.timeout.connect(self._on_delayed_scroll_to_bottom)
self._window.show()
+ self._smsEntry.setPlainText(self._session.draft.message)
self._update_letter_count()
self._update_target_fields()
def close(self):
try:
+ self._session.draft = unicode(self._smsEntry.toPlainText())
self._window.destroy()
except RuntimeError:
_moduleLogger.exception("Oh well")
def _on_sms_clicked(self, arg):
with qui_utils.notify_error(self._app.errorLog):
message = unicode(self._smsEntry.toPlainText())
- self._session.draft.send(message)
+ self._session.draft = message
+ self._session.draft.send()
@misc_utils.log_exception(_moduleLogger)
def _on_call_clicked(self, arg):
with qui_utils.notify_error(self._app.errorLog):
+ message = unicode(self._smsEntry.toPlainText())
+ self._session.draft = message
self._session.draft.call()
@QtCore.pyqtSlot()
@misc_utils.log_exception(_moduleLogger)
def _on_close_window(self, checked = True):
with qui_utils.notify_error(self._app.errorLog):
- self._window.hide()
+ self._window.close()
def _get_contact_numbers(session, contactId, numberDescription):
self._pool = pool
self._backend = backend
self._busyReason = None
+ self._message = ""
- def send(self, text):
+ def send(self):
assert 0 < len(self._contacts), "No contacts selected"
+ assert 0 < len(self._message), "No message to send"
numbers = [misc_utils.make_ugly(contact.selectedNumber) for contact in self._contacts.itervalues()]
le = concurrent.AsyncLinearExecution(self._pool, self._send)
- le.start(numbers, text)
+ le.start(numbers, self._message)
def call(self):
assert len(self._contacts) == 1, "Must select 1 and only 1 contact"
+ assert len(self._message) == 0, "Cannot send message with call"
(contact, ) = self._contacts.itervalues()
number = misc_utils.make_ugly(contact.selectedNumber)
le = concurrent.AsyncLinearExecution(self._pool, self._call)
le = concurrent.AsyncLinearExecution(self._pool, self._cancel)
le.start()
+ def _get_message(self):
+ return self._message
+
+ def _set_message(self, message):
+ if self._busyReason is not None:
+ raise RuntimeError("Please wait for %r" % self._busyReason)
+ self._message = message
+
+ message = property(_get_message, _set_message)
+
def add_contact(self, contactId, title, description, numbersWithDescriptions):
if self._busyReason is not None:
raise RuntimeError("Please wait for %r" % self._busyReason)
def _clear(self):
oldContacts = self._contacts
self._contacts = {}
+ self._message = ""
if oldContacts:
self.recipientsChanged.emit()
__version__ = constants.__version__
__build__ = constants.__build__
__changelog__ = """
-* Temporarilly removing the spurious redraw change until bugs get fixed
+* Doing something I dislike, stop caching the SMS window, to work around Maemo 5 Qt redraw issues with hidden stacked windows
""".strip()