Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2004-11-23 01:41:07 +0300
committerTon Roosendaal <ton@blender.org>2004-11-23 01:41:07 +0300
commitf3c8c47adb6ff3e3ca88418f4c26e9795029613f (patch)
tree9cea62673a5568f6b8add5ef978ca1c0da1c8127
parent0d9fa743489bd9bf9b1c33541dc7506136e030d0 (diff)
Fix for #1839
On large changes of the Lattice resolution button, the undopush crashed. Reason was that the push happened for buttons before the actual event for buttons was executed. Solved by creating new event UNDOPUSH that's being added to the queue by by buttons now. - Made button undo texts for number buttons more clear - Added undo push for missing Add lamp/empty/lattice/camera
-rw-r--r--source/blender/include/BIF_screen.h1
-rw-r--r--source/blender/include/mydevice.h1
-rw-r--r--source/blender/src/editobject.c9
-rw-r--r--source/blender/src/editscreen.c12
-rw-r--r--source/blender/src/interface.c8
5 files changed, 25 insertions, 6 deletions
diff --git a/source/blender/include/BIF_screen.h b/source/blender/include/BIF_screen.h
index b211c333fad..94b5edb4180 100644
--- a/source/blender/include/BIF_screen.h
+++ b/source/blender/include/BIF_screen.h
@@ -98,6 +98,7 @@ void screen_swapbuffers(void);
void set_debug_swapbuffers_ovveride(struct bScreen *sc, int mode);
int is_allowed_to_change_screen(struct bScreen *newp);
void splash(void * data, int datasizei, char * string);
+void screen_delayed_undo_push(char *name);
void screenmain(void);
void getdisplaysize(void);
void setprefsize(int stax, int stay, int sizx, int sizy);
diff --git a/source/blender/include/mydevice.h b/source/blender/include/mydevice.h
index b8832606c6d..18c3784ae08 100644
--- a/source/blender/include/mydevice.h
+++ b/source/blender/include/mydevice.h
@@ -204,6 +204,7 @@
#define RESHAPE 0x4007
#define UI_BUT_EVENT 0x4008
#define AUTOSAVE_FILE 0x4009
+#define UNDOPUSH 0x400A
/* REDRAWVIEW3D has to be the first one (lowest number) for buttons! */
#define REDRAWVIEW3D 0x4010
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c
index c23a31b7eb3..aff43653fb2 100644
--- a/source/blender/src/editobject.c
+++ b/source/blender/src/editobject.c
@@ -187,7 +187,7 @@ float centre[3], centroid[3];
void mirrormenu(void);
-void add_object_draw(int type) /* for toolbox */
+void add_object_draw(int type) /* for toolbox or menus, only non-editmode stuff */
{
Object *ob;
@@ -198,7 +198,12 @@ void add_object_draw(int type) /* for toolbox */
if (G.obedit) exit_editmode(2); // freedata, and undo
ob= add_object(type);
base_init_from_view3d(BASACT, G.vd);
-
+
+ if(type==OB_EMPTY) BIF_undo_push("Add Empty");
+ else if(type==OB_LAMP) BIF_undo_push("Add Lamp");
+ else if(type==OB_LATTICE) BIF_undo_push("Add Lattice");
+ else BIF_undo_push("Add Camera");
+
allqueue(REDRAWVIEW3D, 0);
}
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index 93ea0a6c40c..6539eb8a447 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -1003,6 +1003,15 @@ static ScrArea *screen_find_area_for_pt(bScreen *sc, short *mval)
return NULL;
}
+/* ugly yah, will disappear on better event system */
+/* is called from interface.c after button events */
+static char delayed_undo_name[64];
+void screen_delayed_undo_push(char *name)
+{
+ strncpy(delayed_undo_name, name, 63);
+ mainqenter(UNDOPUSH, 1);
+}
+
void screenmain(void)
{
int has_input= 1;
@@ -1097,6 +1106,9 @@ void screenmain(void)
markdirty_all();
dodrawscreen= 1;
}
+ else if( event==UNDOPUSH) {
+ BIF_undo_push(delayed_undo_name);
+ }
else if (event==AUTOSAVE_FILE) {
BIF_write_autosave();
}
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 84fd6421d2f..873b1baab7d 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -3342,10 +3342,10 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent)
if ELEM4(but->type, BLOCK, BUT, LABEL, PULLDOWN);
else {
/* define which string to use for undo */
- if ELEM(but->type, LINK, INLINK) BIF_undo_push("Add button link");
- else if ELEM(but->type, MENU, ICONTEXTROW) BIF_undo_push(but->drawstr);
- else if(but->str[0]) BIF_undo_push(but->str);
- else BIF_undo_push(but->tip);
+ if ELEM(but->type, LINK, INLINK) screen_delayed_undo_push("Add button link");
+ else if ELEM(but->type, MENU, ICONTEXTROW) screen_delayed_undo_push(but->drawstr);
+ else if(but->drawstr[0]) screen_delayed_undo_push(but->drawstr);
+ else screen_delayed_undo_push(but->tip);
}
}
}