app: update and fix for gtk4-rs 0.6.1

This commit is contained in:
Stéphane Cerveau 2023-02-13 21:46:23 +01:00
parent 9e6ee57fee
commit 8872dab55b
5 changed files with 8 additions and 9 deletions

View file

@ -43,7 +43,6 @@ impl PadInfo {
gst::PadPresence::Always => PortPresence::Always, gst::PadPresence::Always => PortPresence::Always,
gst::PadPresence::Sometimes => PortPresence::Sometimes, gst::PadPresence::Sometimes => PortPresence::Sometimes,
gst::PadPresence::Request => PortPresence::Sometimes, gst::PadPresence::Request => PortPresence::Sometimes,
_ => PortPresence::Unknown,
} }
} }

View file

@ -10,8 +10,8 @@ use crate::app::GPSApp;
use crate::config; use crate::config;
use crate::gps as GPS; use crate::gps as GPS;
use gettextrs::gettext; use gettextrs::gettext;
use gtk::builders::AboutDialogBuilder;
use gtk::prelude::*; use gtk::prelude::*;
use gtk::AboutDialog;
use gtk::ApplicationWindow; use gtk::ApplicationWindow;
@ -20,11 +20,11 @@ pub fn display_about_dialog(app: &GPSApp) {
.builder .builder
.object("mainwindow") .object("mainwindow")
.expect("Couldn't get window"); .expect("Couldn't get window");
let about_dialog = AboutDialogBuilder::new() let about_dialog = AboutDialog::builder()
.modal(true) .modal(true)
.program_name("GstPipelineStudio") .program_name("GstPipelineStudio")
.version(config::VERSION) .version(config::VERSION)
.comments(&format!( .comments(format!(
"{}\n\n{}", "{}\n\n{}",
&gettext("Draw your own GStreamer pipeline"), &gettext("Draw your own GStreamer pipeline"),
GPS::Player::get_version() GPS::Player::get_version()
@ -32,7 +32,7 @@ pub fn display_about_dialog(app: &GPSApp) {
.website("https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio") .website("https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio")
.authors(vec!["Stéphane Cerveau".to_string()]) .authors(vec!["Stéphane Cerveau".to_string()])
.artists(vec!["Stéphane Cerveau".to_string()]) .artists(vec!["Stéphane Cerveau".to_string()])
.translator_credits(&gettext("translator-credits")) .translator_credits(gettext("translator-credits"))
.logo_icon_name(config::APP_ID) .logo_icon_name(config::APP_ID)
.license_type(gtk::License::Gpl30) .license_type(gtk::License::Gpl30)
.transient_for(&window) .transient_for(&window)

View file

@ -84,7 +84,7 @@ pub fn setup_favorite_list(app: &GPSApp) {
} }
}), }),
); );
favorite_list.add_controller(&gesture); favorite_list.add_controller(gesture);
} }
pub fn add_to_favorite_list(app: &GPSApp, element_name: String) { pub fn add_to_favorite_list(app: &GPSApp, element_name: String) {

View file

@ -56,7 +56,7 @@ pub fn setup_logger_list(app: &GPSApp) {
} }
}), }),
); );
logger_list.add_controller(&gesture); logger_list.add_controller(gesture);
} }
pub fn add_to_logger_list(app: &GPSApp, log_entry: &str) { pub fn add_to_logger_list(app: &GPSApp, log_entry: &str) {

View file

@ -313,7 +313,7 @@ pub fn display_pipeline_details(app: &GPSApp) {
if let Some(elements) = app.player.borrow().pipeline_elements() { if let Some(elements) = app.player.borrow().pipeline_elements() {
let elements_list = elements.join(" "); let elements_list = elements.join(" ");
let label = gtk::Label::builder() let label = gtk::Label::builder()
.label(&format!("{} elements:", elements.len())) .label(format!("{} elements:", elements.len()))
.hexpand(true) .hexpand(true)
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.valign(gtk::Align::Start) .valign(gtk::Align::Start)
@ -321,7 +321,7 @@ pub fn display_pipeline_details(app: &GPSApp) {
.build(); .build();
let value = gtk::Label::builder() let value = gtk::Label::builder()
.label(&elements_list) .label(elements_list)
.hexpand(true) .hexpand(true)
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.margin_start(4) .margin_start(4)