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:
authorCampbell Barton <ideasman42@gmail.com>2014-09-05 04:16:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-05 04:16:11 +0400
commita7f87cfc0d87b8ebbcdef6ec2aa665fd56bcd2cf (patch)
treef0c5aee6acff4b80dfc899e581f62bd482c940ea
parentb2de885b4ed508cfde94bdd592a307c40e56066d (diff)
Cleanup: de-duplicate link/append props
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c3
-rw-r--r--source/blender/editors/space_file/filesel.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c44
3 files changed, 23 insertions, 26 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 59a85b299ef..8f189b49aa6 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -396,8 +396,7 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
copy_v2_v2(stroke->last_mouse_position, mouse_in);
stroke->last_pressure = pressure;
- if (paint_stroke_use_jitter(mode, brush, stroke->stroke_mode == BRUSH_STROKE_INVERT))
- {
+ if (paint_stroke_use_jitter(mode, brush, stroke->stroke_mode == BRUSH_STROKE_INVERT)) {
float delta[2];
float factor = stroke->zoom_2d;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 3e210af5d50..afe3f29e9bc 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -288,7 +288,7 @@ int ED_fileselect_layout_numfiles(FileLayout *layout, ARegion *ar)
* - *_over: extra pixels, to take into account, when the fit isnt exact
* (needed since you may see the end of the previous column and the beginning of the next).
*
- * Could be more clever and take scorlling into account,
+ * Could be more clever and take scrolling into account,
* but for now don't bother.
*/
if (layout->flag & FILE_LAYOUT_HOR) {
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 57dcd2eea1a..1fef23e98f7 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2601,10 +2601,28 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-static void WM_OT_link(wmOperatorType *ot)
+static void wm_link_append_properties_common(wmOperatorType *ot, bool is_link)
{
PropertyRNA *prop;
+ /* better not save _any_ settings for this operator */
+ /* properties */
+ prop = RNA_def_boolean(ot->srna, "link", is_link,
+ "Link", "Link the objects or datablocks rather than appending");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
+ prop = RNA_def_boolean(ot->srna, "autoselect", true,
+ "Select", "Select new objects");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "active_layer", true,
+ "Active Layer", "Put new objects on the active layer");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ prop = RNA_def_boolean(ot->srna, "instance_groups", is_link,
+ "Instance Groups", "Create Dupli-Group instances for each group");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+}
+
+static void WM_OT_link(wmOperatorType *ot)
+{
ot->name = "Link from Library";
ot->idname = "WM_OT_link";
ot->description = "Link from a Library .blend file";
@@ -2620,22 +2638,11 @@ static void WM_OT_link(wmOperatorType *ot)
WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_RELPATH | WM_FILESEL_FILES,
FILE_DEFAULTDISPLAY);
- /* better not save _any_ settings for this operator */
- /* properties */
- prop = RNA_def_boolean(ot->srna, "link", 1, "Link", "Link the objects or datablocks rather than appending");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
- prop = RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the linked objects");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(ot->srna, "active_layer", 1, "Active Layer", "Put the linked objects on the active layer");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(ot->srna, "instance_groups", 1, "Instance Groups", "Create instances for each group as a DupliGroup");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ wm_link_append_properties_common(ot, true);
}
static void WM_OT_append(wmOperatorType *ot)
{
- PropertyRNA *prop;
-
ot->name = "Append from Library";
ot->idname = "WM_OT_append";
ot->description = "Append from a Library .blend file";
@@ -2651,16 +2658,7 @@ static void WM_OT_append(wmOperatorType *ot)
WM_FILESEL_FILEPATH | WM_FILESEL_DIRECTORY | WM_FILESEL_FILENAME | WM_FILESEL_FILES,
FILE_DEFAULTDISPLAY);
- /* better not save _any_ settings for this operator */
- /* properties */
- prop = RNA_def_boolean(ot->srna, "link", 0, "Link", "Link the objects or datablocks rather than appending");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN);
- prop = RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the appended objects");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(ot->srna, "active_layer", 1, "Active Layer", "Put the appended objects on the active layer");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
- prop = RNA_def_boolean(ot->srna, "instance_groups", 0, "Instance Groups", "Create instances for each group as a DupliGroup");
- RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+ wm_link_append_properties_common(ot, false);
}
/* *************** recover last session **************** */