projects
/
gc-dialer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4ca76c7
)
Applying some feedback from timeless to show counts that the user cares about (for...
author
Ed Page
<eopage@byu.net>
Tue, 23 Nov 2010 00:43:19 +0000
(18:43 -0600)
committer
Ed Page
<eopage@byu.net>
Tue, 23 Nov 2010 00:43:19 +0000
(18:43 -0600)
src/dialogs.py
patch
|
blob
|
history
diff --git
a/src/dialogs.py
b/src/dialogs.py
index
e9bbf5f
..
193408d
100644
(file)
--- a/
src/dialogs.py
+++ b/
src/dialogs.py
@@
-152,6
+152,8
@@
class AccountDialog(object):
class SMSEntryWindow(object):
class SMSEntryWindow(object):
+ MAX_CHAR = 160
+
def __init__(self, parent, app, session, errorLog):
self._session = session
self._session.draft.recipientsChanged.connect(self._on_recipients_changed)
def __init__(self, parent, app, session, errorLog):
self._session = session
self._session.draft.recipientsChanged.connect(self._on_recipients_changed)
@@
-221,7
+223,10
@@
class SMSEntryWindow(object):
def _update_letter_count(self):
count = self._smsEntry.toPlainText().size()
def _update_letter_count(self):
count = self._smsEntry.toPlainText().size()
- self._characterCountLabel.setText("Letters: %s" % count)
+ numTexts, numCharInText = divmod(count, self.MAX_CHAR)
+ numTexts += 1
+ numCharsLeftInText = self.MAX_CHAR - numCharInText
+ self._characterCountLabel.setText("%d (%d)" % (numCharsLeftInText, numTexts))
def _update_button_state(self):
if self._session.draft.get_num_contacts() == 0:
def _update_button_state(self):
if self._session.draft.get_num_contacts() == 0: