mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-24 10:01:01 +00:00
graphbook: add duplicate node
This commit is contained in:
parent
6c752995b2
commit
8191b081cb
3 changed files with 14 additions and 0 deletions
|
@ -283,6 +283,7 @@ impl GPSApp {
|
|||
application.add_action(&gio::SimpleAction::new("node.request-pad-input", None));
|
||||
application.add_action(&gio::SimpleAction::new("node.request-pad-output", None));
|
||||
application.add_action(&gio::SimpleAction::new("node.properties", None));
|
||||
application.add_action(&gio::SimpleAction::new("node.duplicate", None));
|
||||
}
|
||||
|
||||
pub fn app_pop_menu_at_position(
|
||||
|
|
|
@ -495,6 +495,14 @@ pub fn create_graphtab(app: &GPSApp, id: u32, name: Option<&str>) {
|
|||
let node = current_graphtab(&app).graphview().node(node_id).unwrap();
|
||||
GPSUI::properties::display_plugin_properties(&app, &node.name(), node_id);
|
||||
});
|
||||
let app_weak = app.downgrade();
|
||||
app.connect_app_menu_action("node.duplicate", move |_, _| {
|
||||
let app = upgrade_weak!(app_weak);
|
||||
GPS_DEBUG!("node.d id: {}", node_id);
|
||||
if let Some(node) = current_graphtab(&app).graphview().node(node_id) {
|
||||
app.add_new_element(&node.name());
|
||||
};
|
||||
});
|
||||
}
|
||||
pop_menu.show();
|
||||
None
|
||||
|
|
|
@ -111,6 +111,11 @@
|
|||
<attribute name="action">app.node.add-to-favorite</attribute>
|
||||
<attribute name="accel"><primary>A</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes" comments="Node menu entry add to favorite">_Duplicate</attribute>
|
||||
<attribute name="action">app.node.duplicate</attribute>
|
||||
<attribute name="accel"><primary>A</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<object class="GtkPopoverMenu" id="app_pop_menu">
|
||||
|
|
Loading…
Reference in a new issue