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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-11-14 06:01:02 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-11-14 06:01:02 +0400
commit6cee7bb2b77bc7b577a3067c30dc56e22b4752ce (patch)
treeab504ed0ffa59eb68ed1b57f2208dd949cf40fda /source/blender/windowmanager
parent872af481831650f2399c85df2ed059d58c5210be (diff)
parentde5d0d649da9b73de96cbee9015b838e3c0389c1 (diff)
Merged changes in the trunk up to revision 52191.
Conflicts resolved: source/blender/makesdna/DNA_scene_types.h
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c30
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
3 files changed, 31 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 7aa2b403897..024b6017699 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -545,7 +545,7 @@ static wmKeyMap *wm_keymap_patch_update(ListBase *lb, wmKeyMap *defaultmap, wmKe
/* copy new keymap from an existing one */
if (usermap && !(usermap->flag & KEYMAP_DIFF)) {
- /* for compatibiltiy with old user preferences with non-diff
+ /* for compatibility with old user preferences with non-diff
* keymaps we override the original entirely */
wmKeyMapItem *kmi, *orig_kmi;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 054e48f0bfb..126d497e08e 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -624,7 +624,7 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
/** set all props to their default,
* \param do_update Only update un-initialized props.
*
- * \note, theres nothing spesific to operators here.
+ * \note, theres nothing specific to operators here.
* this could be made a general function.
*/
int WM_operator_properties_default(PointerRNA *ptr, const int do_update)
@@ -1186,6 +1186,8 @@ static void wm_operator_ui_popup_ok(struct bContext *C, void *arg, int retval)
if (op && retval > 0)
WM_operator_call(C, op);
+
+ MEM_freeN(data);
}
int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height)
@@ -1280,6 +1282,31 @@ static void WM_OT_debug_menu(wmOperatorType *ot)
RNA_def_int(ot->srna, "debug_value", 0, SHRT_MIN, SHRT_MAX, "Debug Value", "", -10000, 10000);
}
+/* ***************** Operator defaults ************************* */
+static int wm_operator_defaults_exec(bContext *C, wmOperator *op)
+{
+ PointerRNA ptr = CTX_data_pointer_get_type(C, "active_operator", &RNA_Operator);
+
+ if (!ptr.data) {
+ BKE_report(op->reports, RPT_ERROR, "No operator in context");
+ return OPERATOR_CANCELLED;
+ }
+
+ WM_operator_properties_reset((wmOperator *)ptr.data);
+ return OPERATOR_FINISHED;
+}
+
+/* used by operator preset menu. pre-2.65 this was a 'Reset' button */
+static void WM_OT_operator_defaults(wmOperatorType *ot)
+{
+ ot->name = "Restore Defaults";
+ ot->idname = "WM_OT_operator_defaults";
+ ot->description = "Set the active operator to its default values";
+
+ ot->exec = wm_operator_defaults_exec;
+
+ ot->flag = OPTYPE_INTERNAL;
+}
/* ***************** Splash Screen ************************* */
@@ -3748,6 +3775,7 @@ void wm_operatortype_init(void)
WM_operatortype_append(WM_OT_memory_statistics);
WM_operatortype_append(WM_OT_dependency_relations);
WM_operatortype_append(WM_OT_debug_menu);
+ WM_operatortype_append(WM_OT_operator_defaults);
WM_operatortype_append(WM_OT_splash);
WM_operatortype_append(WM_OT_search_menu);
WM_operatortype_append(WM_OT_call_menu);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index a965cbf82d6..fbb3466032d 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -351,7 +351,7 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
(GHOST_TWindowState)win->windowstate,
GHOST_kDrawingContextTypeOpenGL,
0 /* no stereo */,
- multisamples /* AA */);
+ multisamples /* AA */);
if (ghostwin) {
/* needed so we can detect the graphics card below */