mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-22 00:50:59 +00:00
graphview: add a format version to graphview
This commit is contained in:
parent
2f60471f8b
commit
6cc908c109
1 changed files with 11 additions and 2 deletions
|
@ -37,6 +37,7 @@ use std::cell::RefMut;
|
|||
use std::{cmp::Ordering, collections::HashMap};
|
||||
|
||||
static GRAPHVIEW_STYLE: &str = include_str!("graphview.css");
|
||||
pub static GRAPHVIEW_XML_VERSION: &str = "0.1";
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
@ -830,8 +831,11 @@ impl GraphView {
|
|||
.perform_indent(true)
|
||||
.create_writer(&mut buffer);
|
||||
|
||||
writer
|
||||
.write(XMLWEvent::start_element("Graph").attr("id", &private.id.get().to_string()))?;
|
||||
writer.write(
|
||||
XMLWEvent::start_element("Graph")
|
||||
.attr("id", &private.id.get().to_string())
|
||||
.attr("version", GRAPHVIEW_XML_VERSION),
|
||||
)?;
|
||||
|
||||
//Get the nodes
|
||||
let nodes = self.all_nodes(NodeType::All);
|
||||
|
@ -920,6 +924,11 @@ impl GraphView {
|
|||
if let Some(id) = attrs.get::<String>(&String::from("id")) {
|
||||
self.set_id(id.parse::<u32>().expect("id should be an u32"));
|
||||
}
|
||||
if let Some(version) = attrs.get::<String>(&"version".to_string()) {
|
||||
info!("Found file format version: {}", version);
|
||||
} else {
|
||||
warn!("No file format version found");
|
||||
}
|
||||
}
|
||||
"Node" => {
|
||||
let id = attrs
|
||||
|
|
Loading…
Reference in a new issue