mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-11-15 21:31:03 +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::logger;
|
||||
use crate::ui::message as GPSMessage;
|
||||
use crate::GPS_INFO;
|
||||
|
||||
use gst::glib;
|
||||
|
@ -157,16 +156,8 @@ impl Pipeline {
|
|||
err.error(),
|
||||
err.debug()
|
||||
);
|
||||
GPSMessage::display_error_dialog(
|
||||
false,
|
||||
format!(
|
||||
"Error from {:?}: {} ({:?})",
|
||||
err.src().map(|s| s.path_string()),
|
||||
err.error(),
|
||||
err.debug()
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
self.set_state(PipelineState::Stopped)
|
||||
.expect("Unable to set state to stopped");
|
||||
}
|
||||
MessageView::Application(msg) => match msg.structure() {
|
||||
// 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();
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn display_error_dialog(fatal: bool, message: &str) {
|
||||
display_message_dialog(message, gtk::MessageType::Error, move |app| {
|
||||
if fatal {
|
||||
|
|
Loading…
Reference in a new issue