From 8aefc0ecd7a76bc4d72d22651ee7dc2f57789822 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 22 Nov 2010 18:43:19 -0600 Subject: [PATCH 1/1] Applying some feedback from timeless to show counts that the user cares about (for once more like Nokia and less like Google) --- src/dialogs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dialogs.py b/src/dialogs.py index e9bbf5f..193408d 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -152,6 +152,8 @@ class AccountDialog(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) @@ -221,7 +223,10 @@ class SMSEntryWindow(object): 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: -- 1.7.9.5