mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-09-25 13:10:06 +00:00
pipeline: set state to stop when error
Do not display a dialog when an error happens, only a log error is sufficient.
This commit is contained in:
parent
13421b4d5b
commit
5c25417569
2 changed files with 3 additions and 11 deletions
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
use crate::graphmanager::{GraphView, Node, NodeType, PortDirection, PropertyExt};
|
use crate::graphmanager::{GraphView, Node, NodeType, PortDirection, PropertyExt};
|
||||||
use crate::logger;
|
use crate::logger;
|
||||||
use crate::ui::message as GPSMessage;
|
|
||||||
use crate::GPS_INFO;
|
use crate::GPS_INFO;
|
||||||
|
|
||||||
use gst::glib;
|
use gst::glib;
|
||||||
|
@ -157,16 +156,8 @@ impl Pipeline {
|
||||||
err.error(),
|
err.error(),
|
||||||
err.debug()
|
err.debug()
|
||||||
);
|
);
|
||||||
GPSMessage::display_error_dialog(
|
self.set_state(PipelineState::Stopped)
|
||||||
false,
|
.expect("Unable to set state to stopped");
|
||||||
format!(
|
|
||||||
"Error from {:?}: {} ({:?})",
|
|
||||||
err.src().map(|s| s.path_string()),
|
|
||||||
err.error(),
|
|
||||||
err.debug()
|
|
||||||
)
|
|
||||||
.as_str(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
MessageView::Application(msg) => match msg.structure() {
|
MessageView::Application(msg) => match msg.structure() {
|
||||||
// Here we can send ourselves messages from any thread and show them to the user in
|
// Here we can send ourselves messages from any thread and show them to the user in
|
||||||
|
|
|
@ -61,6 +61,7 @@ pub fn display_message_dialog<F: Fn(Application) + 'static>(
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn display_error_dialog(fatal: bool, message: &str) {
|
pub fn display_error_dialog(fatal: bool, message: &str) {
|
||||||
display_message_dialog(message, gtk::MessageType::Error, move |app| {
|
display_message_dialog(message, gtk::MessageType::Error, move |app| {
|
||||||
if fatal {
|
if fatal {
|
||||||
|
|
Loading…
Reference in a new issue