)
self.set_default_credentials(*creds)
self._app.fullscreenAction.setChecked(isFullscreen)
- self.update_orientation(orientation)
+ self._app.set_orientation(orientation)
self.set_current_tab(tabIndex)
backendId = 2 # For backwards compatibility
if not accountNumberToDisplay:
accountNumberToDisplay = "Not Available (%s)" % self._session.state
self._accountDialog.set_account_number(accountNumberToDisplay)
+ self._accountDialog.orientation = self._app.orientation
+
response = self._accountDialog.run(self.window)
if response == QtGui.QDialog.Accepted:
if self._accountDialog.doClear:
self._app.notifyOnMissed = self._accountDialog.notifyOnMissed
self._app.notifyOnVoicemail = self._accountDialog.notifyOnVoicemail
self._app.notifyOnSms = self._accountDialog.notifyOnSms
+ self._app.set_orientation(self._accountDialog.orientation)
self._app.save_settings()
elif response == QtGui.QDialog.Rejected:
_moduleLogger.info("Cancelled")
self._callbackSelector = QtGui.QComboBox()
#self._callbackSelector.setEditable(True)
self._callbackSelector.setInsertPolicy(QtGui.QComboBox.InsertAtTop)
+ self._orientationSelector = QtGui.QComboBox()
+ for orientationMode in [
+ self._app.DEFAULT_ORIENTATION,
+ self._app.AUTO_ORIENTATION,
+ self._app.LANDSCAPE_ORIENTATION,
+ self._app.PORTRAIT_ORIENTATION,
+ ]:
+ self._orientationSelector.addItem(orientationMode)
self._update_notification_state()
self._credLayout.addWidget(self._smsNotificationButton, 5, 1)
self._credLayout.addWidget(QtGui.QLabel("Other"), 6, 0)
self._credLayout.addWidget(self._voicemailOnMissedButton, 6, 1)
+ self._credLayout.addWidget(QtGui.QLabel("Orientation"), 7, 0)
+ self._credLayout.addWidget(self._orientationSelector, 7, 1)
+ self._credLayout.addWidget(QtGui.QLabel(""), 8, 0)
+ self._credLayout.addWidget(QtGui.QLabel(""), 9, 0)
+ self._credLayout.addWidget(self._clearButton, 9, 1)
- self._credLayout.addWidget(QtGui.QLabel(""), 7, 0)
- self._credLayout.addWidget(self._clearButton, 7, 1)
self._credWidget = QtGui.QWidget()
self._credWidget.setLayout(self._credLayout)
self._credWidget.setContentsMargins(0, 0, 0, 0)
def set_account_number(self, num):
self._accountNumberLabel.setText(num)
+ orientation = property(
+ lambda self: str(self._orientationSelector.currentText()),
+ lambda self, mode: qui_utils.set_current_index(self._orientationSelector, mode),
+ )
+
def _set_voicemail_on_missed(self, status):
if status == self.VOICEMAIL_CHECK_NOT_SUPPORTED:
self._voicemailOnMissedButton.setChecked(False)
updateVMOnMissedCall = property(_get_voicemail_on_missed, _set_voicemail_on_missed)
- def _set_notifications(self, enabled):
- for i in xrange(self._notificationSelecter.count()):
- if self._notificationSelecter.itemText(i) == enabled:
- self._notificationSelecter.setCurrentIndex(i)
- break
- else:
- self._notificationSelecter.setCurrentIndex(0)
-
notifications = property(
lambda self: str(self._notificationSelecter.currentText()),
- _set_notifications,
+ lambda self, enabled: qui_utils.set_current_index(self._notificationSelecter, enabled),
)
notifyOnMissed = property(
def quitAction(self):
return self._quitAction
+ def set_orientation(self, orientation):
+ self._orientation = orientation
+ self._mainWindow.update_orientation(self._orientation)
+
@classmethod
def _next_orientation(cls, current):
return {
@misc_utils.log_exception(_moduleLogger)
def _on_next_orientation(self, checked = False):
with qui_utils.notify_error(self._errorLog):
- self._orientation = self._next_orientation(self._orientation)
- self._mainWindow.update_orientation(self._orientation)
+ self.set_orientation(self._next_orientation(self._orientation))
@misc_utils.log_exception(_moduleLogger)
def _on_about(self, checked = True):