Maemo 4.1 has an older Qt without fromTheme, so let's abstract that away and switch...
[ejpi] / src / qhistory.py
index af164b8..a853173 100644 (file)
@@ -10,6 +10,7 @@ import logging
 from PyQt4 import QtGui
 from PyQt4 import QtCore
 
+import maeqt
 import util.misc as misc_utils
 import history
 import operation
@@ -53,6 +54,7 @@ class QCalcHistory(history.AbstractHistory):
 
                self._rowCount = 0
                self._programmaticUpdate = False
+               self._closeIcon = maeqt.get_theme_icon(("window-close", "general_close", "gtk-close"))
 
        @property
        def toplevel(self):
@@ -65,7 +67,8 @@ class QCalcHistory(history.AbstractHistory):
        def push(self, node):
                simpleNode = node.simplify()
 
-               icon = QtGui.QStandardItem(QtGui.QIcon.fromTheme("gtk-close"), "")
+               closeIcon = self._closeIcon
+               icon = QtGui.QStandardItem(closeIcon, "")
                icon.setEditable(False)
                icon.setCheckable(False)
                equation = QtGui.QStandardItem(operation.render_operation(self._prettyRenderer, node))
@@ -110,6 +113,8 @@ class QCalcHistory(history.AbstractHistory):
                if index.column() == self._CLOSE_COLUMN:
                        self._historyStore.removeRow(index.row(), index.parent())
                        self._rowCount -= 1
+               elif index.column() == self._EQ_COLUMN:
+                       self._duplicate_row(index)
                elif index.column() == self._RESULT_COLUMN:
                        self._duplicate_row(index)
                else: