FROM_IDX = 1
MAX_IDX = 2
- HISTORY_ITEM_TYPES = ["Received", "Missed", "Placed", "All"]
+ HISTORY_RECEIVED = "Received"
+ HISTORY_MISSED = "Missed"
+ HISTORY_PLACED = "Placed"
+ HISTORY_ALL = "All"
+
+ HISTORY_ITEM_TYPES = [HISTORY_RECEIVED, HISTORY_MISSED, HISTORY_PLACED, HISTORY_ALL]
HISTORY_COLUMNS = ["Details", "From"]
assert len(HISTORY_COLUMNS) == MAX_IDX
def refresh(self, force=True):
self._itemView.setFocus(QtCore.Qt.OtherFocusReason)
- self._session.update_history(force)
+
+ if self._selectedFilter == self.HISTORY_RECEIVED:
+ self._session.update_history(self._session.HISTORY_RECEIVED, force)
+ elif self._selectedFilter == self.HISTORY_MISSED:
+ self._session.update_history(self._session.HISTORY_MISSED, force)
+ elif self._selectedFilter == self.HISTORY_PLACED:
+ self._session.update_history(self._session.HISTORY_PLACED, force)
+ elif self._selectedFilter == self.HISTORY_ALL:
+ self._session.update_history(self._session.HISTORY_ALL, force)
+ else:
+ assert False, "How did we get here?"
+
if self._app.notifyOnMissed and self._app.alarmHandler.alarmType == self._app.alarmHandler.ALARM_BACKGROUND:
self._app.ledHandler.off()
MESSAGE_VOICEMAILS = "Voicemail"
MESSAGE_ALL = "All"
+ HISTORY_RECEIVED = "Received"
+ HISTORY_MISSED = "Missed"
+ HISTORY_PLACED = "Placed"
+ HISTORY_ALL = "All"
+
_OLDEST_COMPATIBLE_FORMAT_VERSION = misc_utils.parse_version("1.3.0")
_LOGGEDOUT_TIME = -1
def get_when_messages_updated(self):
return self._messageUpdateTime
- def update_history(self, force = True):
+ def update_history(self, historyType, force = True):
if not force and self._history:
return
- le = concurrent.AsyncLinearExecution(self._pool, self._update_history), (), {}
+ le = concurrent.AsyncLinearExecution(self._pool, self._update_history), (historyType, ), {}
self._perform_op_while_loggedin(le)
def get_history(self):
self.messagesUpdated.emit()
self._alert_on_messages(self._messages)
- def _update_history(self):
+ def _update_history(self, historyType):
try:
assert self.state == self.LOGGEDIN_STATE, "History requires being logged in (currently %s" % self.state
with qui_utils.notify_busy(self._errorLog, "Updating History"):
self._history = yield (
self._backend[0].get_call_history,
- (self._backend[0].HISTORY_ALL, ),
+ (historyType, ),
{},
)
except Exception, e: