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:
authorchristian brinkmann <>2016-10-20 01:27:14 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2016-10-20 01:31:08 +0300
commit2cd6a89d07e031901291ab95b9a5d6cdeb372bbe (patch)
tree3295b028566c0817e5503bd31616227ea8447bce /source/blender/editors/interface/interface_handlers.c
parent789ea7397fd80dc5ab63d86719880f355bb440ae (diff)
Python API: add full_path parameter for bpy.ops.ui.copy_data_path_button.
Also use the operator as part of the UI keymap now, to deduplicate code and let users configure a custom shortcut. Reviewed By: brecht Differential Revision: https://developer.blender.org/D2303
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 369eba66f32..863f5e3852c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2218,32 +2218,6 @@ static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleB
/* ******************* copy and paste ******************** */
-static void ui_but_copy_data_path(uiBut *but, const bool full_path)
-{
- char *id_path;
-
- if (but->rnapoin.id.data == NULL) {
- return;
- }
-
- if (full_path) {
- if (but->rnaprop) {
- id_path = RNA_path_full_property_py_ex(&but->rnapoin, but->rnaprop, but->rnaindex, true);
- }
- else {
- id_path = RNA_path_full_struct_py(&but->rnapoin);
- }
- }
- else {
- id_path = RNA_path_from_ID_to_property(&but->rnapoin, but->rnaprop);
- }
-
- if (id_path) {
- WM_clipboard_text_set(id_path, false);
- MEM_freeN(id_path);
- }
-}
-
/* c = copy, v = paste */
static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data, char mode)
{
@@ -6985,7 +6959,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
if ((data->state == BUTTON_STATE_HIGHLIGHT) || (event->type == EVT_DROP)) {
/* handle copy-paste */
if (ELEM(event->type, CKEY, VKEY) && event->val == KM_PRESS &&
- IS_EVENT_MOD(event, ctrl, oskey))
+ IS_EVENT_MOD(event, ctrl, oskey) && !event->shift && !event->alt)
{
/* Specific handling for listrows, we try to find their overlapping tex button. */
if (but->type == UI_BTYPE_LISTROW) {
@@ -6995,13 +6969,6 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent *
data = but->active;
}
}
-
- /* special case, copy-data-path */
- if ((event->type == CKEY) && event->shift) {
- ui_but_copy_data_path(but, event->alt != 0);
- return WM_UI_HANDLER_BREAK;
- }
-
ui_but_copy_paste(C, but, data, (event->type == CKEY) ? 'c' : 'v');
return WM_UI_HANDLER_BREAK;
}