def _on_view_sql_history(self, widget = None, data = None, data2 = None):
import libsqldialog
- sqldiag = libsqldialog.sqlDialog(self._db)
+ sqldiag = libsqldialog.SqlDialog(self._db)
res = sqldiag.run()
sqldiag.hide()
- if res == 444:
+ if res == sqldiag.EXPORT_RESPONSE:
logging.info("exporting sql")
dlg = hildon.FileChooserDialog(parent=self._window, action=gtk.FILE_CHOOSER_ACTION_SAVE)
_ = lambda x: x
-class sqlDialog(gtk.Dialog):
+class SqlDialog(gtk.Dialog):
+
+ EXPORT_RESPONSE = 444
def __init__(self, db):
self.db = db
logging.info("sqldialog, init")
- gtk.Dialog.__init__(self, _("SQL History (the past two days):"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
+ gtk.Dialog.__init__(self, _("SQL History (the past two days):"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT)
- self.add_button("Export", 444)
+ self.add_button(_("Export"), self.EXPORT_RESPONSE)
+ self.add_button(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
self.set_position(gtk.WIN_POS_CENTER)
self.liststore = gtk.ListStore(str, str, str)
# create the TreeView using liststore
self.treeview = gtk.TreeView(self.liststore)
+ self.treeview.set_rules_hint(True)
# create a CellRenderers to render the data
self.cell1 = gtk.CellRendererText()
__build__ = 0
__changelog__ = '''
0.7.7
- * Slight modification to note history dialog to make each note more distinguishable
+ * Slight modifications to the note history and SQL dialogs
* On zoom, also hiding the history status and button
+ * Touched up the note list, making it ellipsize at the end rather than scroll
0.7.6
* Line-wrap