def __init__(self, parent, app):
qwrappers.WindowWrapper.__init__(self, parent, app)
+ self._window.setWindowTitle("%s" % constants.__pretty_app_name__)
self._historyView = qhistory.QCalcHistory(self._app.errorLog)
self._userEntry = QValueEntry()
self._history = history.RpnCalcHistory(
self._historyView,
- self._userEntry, self._errorDisplay,
+ self._userEntry, self._app.errorLog,
self._constantPlugins.constants, self._operatorPlugins.operators
)
self._load_history()
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Computer"))
self.enable_plugin(self._keyboardPlugins.lookup_plugin("Alphabet"))
+ self._scrollTimer = QtCore.QTimer()
+ self._scrollTimer.setInterval(0)
+ self._scrollTimer.setSingleShot(True)
+ self._scrollTimer.timeout.connect(self._on_delayed_scroll_to_bottom)
+ self._scrollTimer.start()
+
self.set_fullscreen(self._app.fullscreenAction.isChecked())
self.set_orientation(self._app.orientationAction.isChecked())
qwrappers.WindowWrapper.set_orientation(self, isPortrait)
if isPortrait:
defaultLayoutOrientation = QtGui.QBoxLayout.TopToBottom
- tabPosition = QtGui.QTabWidget.South
+ #tabPosition = QtGui.QTabWidget.South
+ tabPosition = QtGui.QTabWidget.West
else:
defaultLayoutOrientation = QtGui.QBoxLayout.LeftToRight
tabPosition = QtGui.QTabWidget.North
f.write("%s\n" % line)
@misc_utils.log_exception(_moduleLogger)
+ def _on_delayed_scroll_to_bottom(self):
+ with qui_utils.notify_error(self._app.errorLog):
+ self._historyView.scroll_to_bottom()
+
+ @misc_utils.log_exception(_moduleLogger)
def _on_child_close(self, something = None):
- self._child = None
+ with qui_utils.notify_error(self._app.errorLog):
+ self._child = None
@misc_utils.log_exception(_moduleLogger)
def _on_copy(self, *args):
- eqNode = self._historyView.peek()
- resultNode = eqNode.simplify()
- self._app._clipboard.setText(str(resultNode))
+ with qui_utils.notify_error(self._app.errorLog):
+ eqNode = self._historyView.peek()
+ resultNode = eqNode.simplify()
+ self._app._clipboard.setText(str(resultNode))
@misc_utils.log_exception(_moduleLogger)
def _on_paste(self, *args):
- result = str(self._app._clipboard.text())
- self._userEntry.append(result)
+ with qui_utils.notify_error(self._app.errorLog):
+ result = str(self._app._clipboard.text())
+ self._userEntry.append(result)
@misc_utils.log_exception(_moduleLogger)
def _on_entry_direct(self, keys, modifiers):
- if "shift" in modifiers:
- keys = keys.upper()
- self._userEntry.append(keys)
+ with qui_utils.notify_error(self._app.errorLog):
+ if "shift" in modifiers:
+ keys = keys.upper()
+ self._userEntry.append(keys)
@misc_utils.log_exception(_moduleLogger)
def _on_push(self, *args):
- self._history.push_entry()
+ with qui_utils.notify_error(self._app.errorLog):
+ self._history.push_entry()
@misc_utils.log_exception(_moduleLogger)
def _on_unpush(self, *args):
- self._historyView.unpush()
+ with qui_utils.notify_error(self._app.errorLog):
+ self._historyView.unpush()
@misc_utils.log_exception(_moduleLogger)
def _on_entry_backspace(self, *args):
- self._userEntry.pop()
+ with qui_utils.notify_error(self._app.errorLog):
+ self._userEntry.pop()
@misc_utils.log_exception(_moduleLogger)
def _on_entry_clear(self, *args):
- self._userEntry.clear()
+ with qui_utils.notify_error(self._app.errorLog):
+ self._userEntry.clear()
@misc_utils.log_exception(_moduleLogger)
def _on_clear_all(self, *args):
- self._history.clear()
+ with qui_utils.notify_error(self._app.errorLog):
+ self._history.clear()
def run():