diff --git a/src/event-log.cpp b/src/event-log.cpp
index d6bc99bea8a34e195cb2c0331413bc0136d5c355..4ee65f3f8417ae9b18c7c295d58b03b4b7b5b04d 100644 (file)
--- a/src/event-log.cpp
+++ b/src/event-log.cpp
* Author:
* Gustav Broberg <broberg@kth.se>
*
- * Copyright (c) 2006 Authors
+ * Copyright (c) 2006, 2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
void
EventLog::notifyUndoCommitEvent(Event* log)
{
- // If we're not at the last event in list then erase the previously undone events
- if ( _last_event != _curr_event ) {
-
- _last_event = _curr_event;
-
- if ( !_last_event->children().empty() ) {
- _last_event = _last_event->children().begin();
- } else {
- ++_last_event;
- }
-
- while ( _last_event != _event_list_store->children().end() ) {
-
- if (_last_event->parent()) {
- while ( _last_event != _last_event->parent()->children().end() ) {
- _last_event = _event_list_store->erase(_last_event);
- }
- _last_event = _last_event->parent();
-
- (*_last_event)[_columns.child_count] = _last_event->children().size() + 1;
-
- ++_last_event;
- } else {
- _last_event = _event_list_store->erase(_last_event);
- }
-
- }
- }
+ _clearRedo();
const unsigned int event_type = log->type;
updateUndoVerbs();
}
+void
+EventLog::notifyClearUndoEvent()
+{
+ _clearUndo();
+ updateUndoVerbs();
+}
+
+void
+EventLog::notifyClearRedoEvent()
+{
+ _clearRedo();
+ updateUndoVerbs();
+}
+
void
EventLog::connectWithDialog(Gtk::TreeView *event_list_view, CallbackMap *callback_connections)
{
return redo_event;
}
+void
+EventLog::_clearUndo()
+{
+ // TODO: Implement when needed
+}
+
+void
+EventLog::_clearRedo()
+{
+ if ( _last_event != _curr_event ) {
+
+ _last_event = _curr_event;
+
+ if ( !_last_event->children().empty() ) {
+ _last_event = _last_event->children().begin();
+ } else {
+ ++_last_event;
+ }
+
+ while ( _last_event != _event_list_store->children().end() ) {
+
+ if (_last_event->parent()) {
+ while ( _last_event != _last_event->parent()->children().end() ) {
+ _last_event = _event_list_store->erase(_last_event);
+ }
+ _last_event = _last_event->parent();
+
+ (*_last_event)[_columns.child_count] = _last_event->children().size() + 1;
+
+ ++_last_event;
+ } else {
+ _last_event = _event_list_store->erase(_last_event);
+ }
+
+ }
+
+ }
}
+} // namespace Inkscape
+
+
/*
Local Variables:
mode:c++