Page MenuHome

Outliner: ContextMenu for scenes
AbandonedPublic

Authored by Julian Eisel (Severin) on Aug 4 2015, 11:03 PM.

Details

Summary

add context menus for scenes in the outliner (just a single entry atm.: "Delete")

Diff Detail

Event Timeline

Philipp Oeser (lichtwerk) retitled this revision from to Outliner: ContextMenu for scenes.
Philipp Oeser (lichtwerk) updated this object.

this was actually asked for in T45661: Delete scene from Outliner (and I had this done locally already)

Joshua Leung (aligorith) requested changes to this revision.Aug 5 2015, 5:23 AM
Joshua Leung (aligorith) edited edge metadata.
Joshua Leung (aligorith) added inline comments.
source/blender/editors/space_outliner/outliner_tools.c
292

Instead of passing context in as the optional void* arg, it'd be better to have this as the first arg instead.

So, the function signature for this method would look more like:

void scene_cb(bContext* C, eOutliner_PropSceneOps event, TreeElement *te, TreeStoreElem *tselem, void *arg)

or maybe the event arg could even be moved to be just before arg, so

void scene_cb(bContext *C, TreeElement *te, TreeStoreElem *tselem, eOutliner_PropSceneOps event, void *arg)
1666

Have you checked whether the initial checks for objectlevel/datalevel/etc. are still relevant?

This revision now requires changes to proceed.Aug 5 2015, 5:23 AM
Philipp Oeser (lichtwerk) edited edge metadata.

adressing review by @Joshua Leung (aligorith):

  • adjusted function signature (actually got rid of void arg as well -- not needed and can still be added back if we need it for other scene operations)
  • added back checks for mixed selection (this slipped through, sorry)

note: objectlevel is not checking mixed selction either? (but this is for another commit)
note2: still have to track down BKE_report: it is not showing in the banner (is this normal? -- also marked with XXX in previous code...)

Everything working fine for me, logic seems correct, just have some minor suggestions :)

source/blender/editors/space_outliner/outliner_tools.c
305

Think it's better to make this const.

311

Doesn't seem like we need to do a manual undo push here? Just use operator flags OPTYPE_REGISTER | OPTYPE_UNDO below.

312

Would add:

else {
  BLI_assert(0);
  return OPERATOR_CANCELLED;
}

here.

322

Picky, esp since it currently isn't visible in UI: We usually don't use title case in descriptions, also would use a bit more 'fluent' wording, like "Context menu for scene operations" (see OUTLINER_OT_operation).

This revision now requires changes to proceed.Aug 5 2015, 2:18 PM
Philipp Oeser (lichtwerk) edited edge metadata.

adressing review by @Julian Eisel (Severin):
-left in the manual undo push because it is easier to distinguish between the different scene operations (once there are more than just one...) - would that make senses?

Philipp Oeser (lichtwerk) marked 5 inline comments as done.Aug 7 2015, 12:57 PM
Julian Eisel (Severin) requested changes to this revision.Aug 9 2015, 10:32 PM
Julian Eisel (Severin) edited edge metadata.

Don't see why a manual undo push would make that easier? Also I can't think of a scene operation that wouldn't need an undo push. So still think this should be done using ot->flag.

This revision now requires changes to proceed.Aug 9 2015, 10:32 PM

because each individual operation will get it's own named undo push (e.g. inspect the undo history) vs. one generic "Outliner Scene Operation"...
[dont think this is terribly important, but still more clear to be able to distinguish, no?]

vs

see how the other "_operation" OPs do it as well in outliner_tools?
Agree that every operation will have an undo push...

@Julian Eisel (Severin): could you check again if my previous comment makes sense?

Julian Eisel (Severin) edited edge metadata.

Yep, LGTM. Also agree that manual undo push is better here, totally forgot about the undo history.

Julian Eisel (Severin) commandeered this revision.Aug 14 2015, 3:26 PM

Committed rBd94137ee7ddecc6, thx for the patch :)