X-Git-Url: http://git.maemo.org/git/?p=quicknote;a=blobdiff_plain;f=src%2Fhistory.py;h=c7a7af4c923672a4f17a39b1d0398f1990704643;hp=c897cd9e2bdc36ac7f1d0b34b7c15606e264e72b;hb=f65e95591ddf52734af3102f1db52c903b11590a;hpb=125b4fc6cc659ccd8ea0d83e4d7bc9e408cd35ed diff --git a/src/history.py b/src/history.py index c897cd9..c7a7af4 100644 --- a/src/history.py +++ b/src/history.py @@ -21,17 +21,17 @@ except NameError: _ = lambda x: x -_moduleLogger = logging.getLogger("history") +_moduleLogger = logging.getLogger(__name__) -class Dialog(gtk.Dialog): +class HistorySelectionDialog(gtk.Dialog): def __init__(self, daten = None): - super(Dialog, self).__init__( + super(HistorySelectionDialog, self).__init__( _("History:"), None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, - (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT), + (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT, gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT), ) self.set_position(gtk.WIN_POS_CENTER) @@ -43,26 +43,22 @@ class Dialog(gtk.Dialog): str #param schön ) - # create the TreeView using liststore self._historyView = gtk.TreeView(self.noteHistory) self._historyView.set_rules_hint(True) - # create a CellRenderers to render the data - self._timestampCell = gtk.CellRendererText() - self._noteCell = gtk.CellRendererText() - # create the TreeViewColumns to display the data + self._timestampCell = gtk.CellRendererText() self._timestampColumn = gtk.TreeViewColumn(_('Timestamp')) - self._noteColumn = gtk.TreeViewColumn(_('Note')) - # add columns to treeview - self._historyView.append_column(self._timestampColumn) - self._historyView.append_column(self._noteColumn) - - # add the cells to the columns - 2 in the first self._timestampColumn.pack_start(self._timestampCell, True) - self._noteColumn.pack_start(self._noteCell, True) self._timestampColumn.set_attributes(self._timestampCell, text = 1) #Spalten setzten hier!!!! + + self._noteCell = gtk.CellRendererText() + self._noteColumn = gtk.TreeViewColumn(_('Note')) + self._noteColumn.pack_start(self._noteCell, True) self._noteColumn.set_attributes(self._noteCell, text = 4) + # add columns to treeview + self._historyView.append_column(self._timestampColumn) + self._historyView.append_column(self._noteColumn) self._historyView.set_reorderable(False) scrolled_window = gtk.ScrolledWindow()