with this, undo and redo are greyed out unless they are applicable.

dc

Daniel Cohn, InterNAP
Index: app/diagram.c
===================================================================
RCS file: /cvs/gnome/dia/app/diagram.c,v
retrieving revision 1.23
diff -c -r1.23 diagram.c
*** app/diagram.c       1999/08/23 21:47:45     1.23
--- app/diagram.c       1999/10/28 16:31:40
***************
*** 31,36 ****
--- 31,37 ----
  #include "properties.h"
  #include "cut_n_paste.h"
  #include "layer_dialog.h"
+ #include "undo.h"
  
  GList *open_diagrams = NULL;
  
***************
*** 108,113 ****
--- 109,116 ----
  #ifndef GNOME
    static GtkWidget *delete;
  #endif
+   static GtkWidget *undo;
+   static GtkWidget *redo;
  
    static GtkWidget *send_to_back;
    static GtkWidget *bring_to_front;
***************
*** 142,147 ****
--- 145,154 ----
      g_string_append (g_string_assign(path, display),_("/Edit/Delete"));
      delete = menus_get_item_from_path(path->str);
  #   endif
+     g_string_append (g_string_assign(path, display),_("/Edit/Undo"));
+     undo = menus_get_item_from_path(path->str);
+       g_string_append (g_string_assign(path, display),_("/Edit/Redo"));
+       redo = menus_get_item_from_path(path->str);
  
      g_string_append (g_string_assign(path, display),_("/Objects/Send to Back"));
      send_to_back = menus_get_item_from_path(path->str);
***************
*** 180,185 ****
--- 187,194 ----
  #ifndef GNOME
    gtk_widget_set_sensitive(delete, dia->data->selected_count > 0);
  #endif
+   gtk_widget_set_sensitive(undo, dia->undo->depth > 0);
+   gtk_widget_set_sensitive(redo, dia->undo->current_change->next != NULL);
  
    gtk_widget_set_sensitive(send_to_back, dia->data->selected_count > 0);
    gtk_widget_set_sensitive(bring_to_front, dia->data->selected_count > 0);

Reply via email to