projects
/
gc-dialer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1164a44
)
Undoing removal of caching
author
Ed Page
<eopage@byu.net>
Wed, 19 Jan 2011 00:49:08 +0000
(18:49 -0600)
committer
Ed Page
<eopage@byu.net>
Wed, 19 Jan 2011 00:49:08 +0000
(18:49 -0600)
src/dialogs.py
patch
|
blob
|
history
src/session.py
patch
|
blob
|
history
diff --git
a/src/dialogs.py
b/src/dialogs.py
index
4fafc78
..
d197436
100644
(file)
--- a/
src/dialogs.py
+++ b/
src/dialogs.py
@@
-456,13
+456,11
@@
class SMSEntryWindow(object):
self._scrollTimer.timeout.connect(self._on_delayed_scroll_to_bottom)
self._window.show()
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._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")
self._window.destroy()
except RuntimeError:
_moduleLogger.exception("Oh well")
@@
-626,14
+624,11
@@
class SMSEntryWindow(object):
def _on_sms_clicked(self, arg):
with qui_utils.notify_error(self._app.errorLog):
message = unicode(self._smsEntry.toPlainText())
def _on_sms_clicked(self, arg):
with qui_utils.notify_error(self._app.errorLog):
message = unicode(self._smsEntry.toPlainText())
- self._session.draft = message
- self._session.draft.send()
+ self._session.draft.send(message)
@misc_utils.log_exception(_moduleLogger)
def _on_call_clicked(self, arg):
with qui_utils.notify_error(self._app.errorLog):
@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()
self._session.draft.call()
@QtCore.pyqtSlot()
@@
-731,7
+726,7
@@
class SMSEntryWindow(object):
@misc_utils.log_exception(_moduleLogger)
def _on_close_window(self, checked = True):
with qui_utils.notify_error(self._app.errorLog):
@misc_utils.log_exception(_moduleLogger)
def _on_close_window(self, checked = True):
with qui_utils.notify_error(self._app.errorLog):
- self._window.close()
+ self._window.hide()
def _get_contact_numbers(session, contactId, numberDescription):
def _get_contact_numbers(session, contactId, numberDescription):
diff --git
a/src/session.py
b/src/session.py
index
c002945
..
345fdc5
100644
(file)
--- a/
src/session.py
+++ b/
src/session.py
@@
-53,18
+53,15
@@
class Draft(QtCore.QObject):
self._pool = pool
self._backend = backend
self._busyReason = None
self._pool = pool
self._backend = backend
self._busyReason = None
- self._message = ""
- def send(self):
+ def send(self, text):
assert 0 < len(self._contacts), "No contacts selected"
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)
numbers = [misc_utils.make_ugly(contact.selectedNumber) for contact in self._contacts.itervalues()]
le = concurrent.AsyncLinearExecution(self._pool, self._send)
- le.start(numbers, self._message)
+ le.start(numbers, text)
def call(self):
assert len(self._contacts) == 1, "Must select 1 and only 1 contact"
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)
(contact, ) = self._contacts.itervalues()
number = misc_utils.make_ugly(contact.selectedNumber)
le = concurrent.AsyncLinearExecution(self._pool, self._call)
@@
-74,16
+71,6
@@
class Draft(QtCore.QObject):
le = concurrent.AsyncLinearExecution(self._pool, self._cancel)
le.start()
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 add_contact(self, contactId, title, description, numbersWithDescriptions):
if self._busyReason is not None:
raise RuntimeError("Please wait for %r" % self._busyReason)
@@
-135,7
+122,6
@@
class Draft(QtCore.QObject):
def _clear(self):
oldContacts = self._contacts
self._contacts = {}
def _clear(self):
oldContacts = self._contacts
self._contacts = {}
- self._message = ""
if oldContacts:
self.recipientsChanged.emit()
if oldContacts:
self.recipientsChanged.emit()