Switching to make rotation more configurable4
[gc-dialer] / src / dialogs.py
index f9f8226..0e1a92e 100644 (file)
@@ -344,7 +344,7 @@ class AccountDialog(object):
        @property
        def selectedCallback(self):
                index = self._callbackSelector.currentIndex()
-               data = str(self._callbackSelector.itemData(index).toPyObject())
+               data = str(self._callbackSelector.itemData(index))
                return data
 
        def set_callbacks(self, choices, default):
@@ -869,7 +869,7 @@ class SMSEntryWindow(qwrappers.WindowWrapper):
                self._update_letter_count()
                self._update_target_fields()
                self.set_fullscreen(self._app.fullscreenAction.isChecked())
-               self.set_orientation(self._app.orientationAction.isChecked())
+               self.update_orientation(self._app.orientation)
 
        def close(self):
                if self._window is None:
@@ -908,12 +908,12 @@ class SMSEntryWindow(qwrappers.WindowWrapper):
                except RuntimeError:
                        _moduleLogger.exception("Oh well")
 
-       def set_orientation(self, isPortrait):
-               qwrappers.WindowWrapper.set_orientation(self, isPortrait)
+       def update_orientation(self, orientation):
+               qwrappers.WindowWrapper.update_orientation(self, orientation)
                self._scroll_to_bottom()
 
        def _update_letter_count(self):
-               count = self._smsEntry.toPlainText().size()
+               count = len(self._smsEntry.toPlainText())
                numTexts, numCharInText = divmod(count, self.MAX_CHAR)
                numTexts += 1
                numCharsLeftInText = self.MAX_CHAR - numCharInText
@@ -925,7 +925,7 @@ class SMSEntryWindow(qwrappers.WindowWrapper):
                        self._dialButton.setEnabled(False)
                        self._smsButton.setEnabled(False)
                elif self._session.draft.get_num_contacts() == 1:
-                       count = self._smsEntry.toPlainText().size()
+                       count = len(self._smsEntry.toPlainText())
                        if count == 0:
                                self._dialButton.setEnabled(True)
                                self._smsButton.setEnabled(False)
@@ -934,7 +934,7 @@ class SMSEntryWindow(qwrappers.WindowWrapper):
                                self._smsButton.setEnabled(True)
                else:
                        self._dialButton.setEnabled(False)
-                       count = self._smsEntry.toPlainText().size()
+                       count = len(self._smsEntry.toPlainText())
                        if count == 0:
                                self._smsButton.setEnabled(False)
                        else:
@@ -1117,7 +1117,7 @@ class SMSEntryWindow(qwrappers.WindowWrapper):
 
        @qt_compat.Slot()
        @misc_utils.log_exception(_moduleLogger)
-       def _on_window_resized(self, checked = True):
+       def _on_window_resized(self):
                with qui_utils.notify_error(self._app.errorLog):
                        self._scroll_to_bottom()