Attachment 'gjots2-undo-support.patch'

Download

   1 === modified file 'gjots2-2.3.8/lib/gui.py'
   2 --- gjots2-2.3.8/lib/gui.py	2009-06-21 14:39:07 +0000
   3 +++ gjots2-2.3.8/lib/gui.py	2009-06-21 15:28:30 +0000
   4 @@ -2305,7 +2305,14 @@ class gjots_gui:
   5  			for name, file in self.icons.iteritems():
   6  				self.icons[name] = "./pixmaps/" + self.icons[name]
   7  
   8 -		self.xml = gtk.glade.XML(self.gui_filename, "gjots", domain="gjots2")
   9 +		override = {}
  10 +		try:
  11 +			import gtksourceview
  12 +			override["GtkTextView"] = gtksourceview.SourceView
  13 +			override["GtkTextBuffer"] = gtksourceview.SourceBuffer
  14 +		except:
  15 +			pass
  16 +		self.xml = gtk.glade.XML(self.gui_filename, "gjots", "gjots2", override)
  17  		self.xml.signal_autoconnect(callbacks)
  18  		self.treestore = None
  19  		self.gjots = self.xml.get_widget("gjots")
  20 @@ -2335,7 +2342,16 @@ class gjots_gui:
  21  		# do this with signals ...
  22  		self.current_dirty = 0
  23  		
  24 -		self.textBuffer = gtk.TextBuffer()
  25 +		try:
  26 +			import gtksourceview
  27 +			self.textBuffer = gtksourceview.SourceBuffer()
  28 +			self.textBuffer.set_text = lambda *args: not not (
  29 +				self.textBuffer.begin_not_undoable_action(),
  30 +				apply(gtksourceview.SourceBuffer.set_text, [self.textBuffer] + list(args)),
  31 +				self.textBuffer.end_not_undoable_action(),
  32 +			)
  33 +		except:
  34 +			self.textBuffer = gtk.TextBuffer()
  35  		self.textView.set_buffer(self.textBuffer)
  36  		self.textBuffer.set_text("", 0)
  37  		self.textBuffer_changed_handler = self.textBuffer.connect("changed", self.on_textBuffer_changed)

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2021-05-11 08:52:12, 1.4 KB) [[attachment:gjots2-undo-support.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.