3 # A.k.a `Best web-album Of the world, Or your money back, Humerus'.
5 # The acronyn sucks, however this is a tribute to Dragon Ball by
6 # Akira Toriyama, where the last enemy beaten by heroes of Dragon
7 # Ball is named "Boo". But there was already a free software project
8 # called Boo, so this one will be it "Booh". Or whatever.
11 # Copyright (c) 2004 Guillaume Cottenceau <gc3 at bluewin.ch>
13 # This software may be freely redistributed under the terms of the GNU
14 # public license version 2.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 bindtextdomain("booh")
33 def save_undo(name, closure, params)
34 entry = { :name => name, :closure => closure, :params => params }
38 @undo_actions << [ entry ]
44 all_todos = @undo_actions.pop
46 all_todos.reverse.each { |todo|
47 redo_closure = todo[:closure].call(*todo[:params])
49 statusbar.push(0, utf8(_("Undo %s.") % todo[:name]))
50 redos << { :name => todo[:name], :redo => redo_closure, :undo => todo }
52 @redo_actions << redos
53 return !@undo_actions.empty?
57 all_redos = @redo_actions.pop
59 all_redos.reverse.each { |redo_item|
62 statusbar.push(0, utf8(_("Redo %s.") % redo_item[:name]))
63 undos << redo_item[:undo]
65 @undo_actions << undos
66 return !@redo_actions.empty?
76 @undo_actions << @batch