Commit c668542f authored by Felix Häcker's avatar Felix Häcker

Update gtk-rs stack + other deps

parent ac39257f
Pipeline #99156 passed with stages
in 46 minutes and 3 seconds
This diff is collapsed.
......@@ -6,29 +6,31 @@ build = "build.rs"
edition = "2018"
[dependencies]
gtk = { version="0.6.0", features=["v3_22"] }
libhandy = { git = "https://gitlab.gnome.org/haecker-felix/libhandy-rs", branch = "libhandy_0.0.10", features=["v0_0_10"]}
glib = { version="0.7.0", features=["subclassing"] }
gio = { version="0.6.0", features=["v2_46"] }
gdk = "0.10.0"
gstreamer = "0.13.0"
gstreamer-pbutils = "0.13.0"
mpris-player = "0.3.0"
log = "0.4"
gtk = { version = "0.7.0", features = ["v3_22"] }
libhandy = "0.4.0"
glib = { version = "0.8.1", features = ["subclassing"] }
gobject-sys = "0.9.0"
glib-sys = "0.9.0"
gio = { version = "0.7.0", features = ["v2_46"] }
gdk = "0.11.0"
gstreamer = "0.14.3"
gstreamer-pbutils = "0.14.0"
mpris-player = "0.4.0"
log = "0.4.7"
pretty_env_logger = "0.3.0"
rusqlite = "0.13"
rusqlite = "0.19.0"
quick-error = "1.2.2"
restson = "0.4"
uuid = { version = "0.7", features = ["v4"] }
chrono = "0.4.6"
restson = "0.5.4"
uuid = { version = "0.7.4", features = ["v4"] }
chrono = "0.4.7"
rust_cast = "0.14.0"
mdns = "0.3.1"
serde = "1.0.89"
serde_json = "1.0.39"
serde_derive = "1.0.89"
serde = "1.0.97"
serde_json = "1.0.40"
serde_derive = "1.0.97"
lazy_static = "1.3.0"
matches = "0.1.8"
open = "1.2.2"
open = "1.2.3"
serde_urlencoded = "0.5.5"
url = "1.7.2"
url = "2.0.0"
soup = { git="https://gitlab.gnome.org/haecker-felix/soup-rs" }
{
"app-id" : "de.haeckerfelix.ShortwaveDevel",
"runtime" : "org.gnome.Platform",
"runtime-version" : "3.32",
"runtime-version" : "master",
"sdk" : "org.gnome.Sdk",
"sdk-extensions" : [
"org.freedesktop.Sdk.Extension.rust-stable"
......
......@@ -51,7 +51,7 @@ impl App {
gtk::CssProvider::load_from_resource(&p, "/de/haeckerfelix/Shortwave/gtk/style.css");
gtk::StyleContext::add_provider_for_screen(&gdk::Screen::get_default().unwrap(), &p, 500);
let gtk_app = gtk::Application::new(config::APP_ID, gio::ApplicationFlags::FLAGS_NONE).unwrap();
let gtk_app = gtk::Application::new(Some(config::APP_ID), gio::ApplicationFlags::FLAGS_NONE).unwrap();
let (sender, r) = glib::MainContext::channel(glib::PRIORITY_DEFAULT);
let receiver = RefCell::new(Some(r));
......@@ -65,8 +65,8 @@ impl App {
window.discover_box.add(&storefront.widget);
window.set_view(View::Library);
window.discover_header_switcher.set_stack(&storefront.discover_stack);
window.discover_bottom_switcher.set_stack(&storefront.discover_stack);
window.discover_header_switcher.set_stack(Some(&storefront.discover_stack));
window.discover_bottom_switcher.set_stack(Some(&storefront.discover_stack));
// Help overlay
let builder = gtk::Builder::new_from_resource("/de/haeckerfelix/Shortwave/gtk/shortcuts.ui");
......@@ -139,11 +139,11 @@ impl App {
// Sort / Order menu
let sort_variant = "name".to_variant();
let sorting_action = gio::SimpleAction::new_stateful("sorting", sort_variant.type_(), &sort_variant);
let sorting_action = gio::SimpleAction::new_stateful("sorting", Some(sort_variant.type_()), &sort_variant);
self.gtk_app.add_action(&sorting_action);
let order_variant = "ascending".to_variant();
let order_action = gio::SimpleAction::new_stateful("order", order_variant.type_(), &order_variant);
let order_action = gio::SimpleAction::new_stateful("order", Some(order_variant.type_()), &order_variant);
self.gtk_app.add_action(&order_action);
let sa = sorting_action.clone();
......@@ -186,7 +186,7 @@ impl App {
fn add_gaction<F>(&self, name: &str, action: F)
where
for<'r, 's> F: Fn(&'r gio::SimpleAction, &'s Option<glib::Variant>) + 'static,
for<'r, 's> F: Fn(&'r gio::SimpleAction, Option<&'s glib::Variant>) + 'static,
{
let simple_action = gio::SimpleAction::new(name, None);
simple_action.connect_activate(action);
......@@ -223,12 +223,12 @@ impl App {
fn show_about_dialog(window: gtk::ApplicationWindow) {
let dialog = gtk::AboutDialog::new();
dialog.set_program_name(config::NAME);
dialog.set_logo_icon_name(config::APP_ID);
dialog.set_comments("A web radio client");
dialog.set_copyright("© 2019 Felix Häcker");
dialog.set_logo_icon_name(Some(config::APP_ID));
dialog.set_comments(Some("A web radio client"));
dialog.set_copyright(Some("© 2019 Felix Häcker"));
dialog.set_license_type(gtk::License::Gpl30);
dialog.set_version(format!("{}{}", config::VERSION, config::NAME_SUFFIX).as_str());
dialog.set_transient_for(&window);
dialog.set_version(Some(format!("{}{}", config::VERSION, config::NAME_SUFFIX).as_str()));
dialog.set_transient_for(Some(&window));
dialog.set_modal(true);
dialog.set_authors(&["Felix Häcker"]);
......@@ -239,7 +239,13 @@ impl App {
}
fn import_stations(&self) {
let import_dialog = gtk::FileChooserNative::new("Select database to import", &self.window.widget, gtk::FileChooserAction::Open, "Import", "Cancel");
let import_dialog = gtk::FileChooserNative::new(
Some("Select database to import"),
Some(&self.window.widget),
gtk::FileChooserAction::Open,
Some("Import"),
Some("Cancel"),
);
let filter = gtk::FileFilter::new();
import_dialog.set_filter(&filter);
filter.add_mime_type("application/json"); // Shortwave library format
......@@ -265,7 +271,7 @@ impl App {
}
fn export_stations(&self) {
let export_dialog = gtk::FileChooserNative::new("Export database", &self.window.widget, gtk::FileChooserAction::Save, "Export", "Cancel");
let export_dialog = gtk::FileChooserNative::new(Some("Export database"), Some(&self.window.widget), gtk::FileChooserAction::Save, Some("Export"), Some("Cancel"));
export_dialog.set_current_name("library.json");
if gtk::ResponseType::from(export_dialog.run()) == gtk::ResponseType::Accept {
let path = export_dialog.get_file().unwrap().get_path().unwrap();
......
......@@ -59,16 +59,16 @@ pub struct GstreamerBackend {
impl GstreamerBackend {
pub fn new(sender: Sender<GstreamerMessage>) -> Self {
// create gstreamer pipeline
let pipeline = Pipeline::new("recorder_pipeline");
let pipeline = Pipeline::new(Some("recorder_pipeline"));
// create pipeline elements
let uridecodebin = ElementFactory::make("uridecodebin", "uridecodebin").unwrap();
let audioconvert = ElementFactory::make("audioconvert", "audioconvert").unwrap();
let tee = ElementFactory::make("tee", "tee").unwrap();
let audio_queue = ElementFactory::make("queue", "audio_queue").unwrap();
let volume = ElementFactory::make("volume", "volume").unwrap();
let autoaudiosink = ElementFactory::make("autoaudiosink", "autoaudiosink").unwrap();
let file_queue = ElementFactory::make("queue", "file_queue").unwrap();
let uridecodebin = ElementFactory::make("uridecodebin", Some("uridecodebin")).unwrap();
let audioconvert = ElementFactory::make("audioconvert", Some("audioconvert")).unwrap();
let tee = ElementFactory::make("tee", Some("tee")).unwrap();
let audio_queue = ElementFactory::make("queue", Some("audio_queue")).unwrap();
let volume = ElementFactory::make("volume", Some("volume")).unwrap();
let autoaudiosink = ElementFactory::make("autoaudiosink", Some("autoaudiosink")).unwrap();
let file_queue = ElementFactory::make("queue", Some("file_queue")).unwrap();
let file_srcpad = file_queue.get_static_pad("src").unwrap();
// link pipeline elements
......@@ -313,13 +313,13 @@ struct RecorderBin {
impl RecorderBin {
pub fn new(song_title: String, song_path: PathBuf, pipeline: Pipeline, srcpad: &Pad) -> Self {
// Create elements
let vorbisenc = ElementFactory::make("vorbisenc", "vorbisenc").unwrap();
let oggmux = ElementFactory::make("oggmux", "oggmux").unwrap();
let filesink = ElementFactory::make("filesink", "filesink").unwrap();
let vorbisenc = ElementFactory::make("vorbisenc", Some("vorbisenc")).unwrap();
let oggmux = ElementFactory::make("oggmux", Some("oggmux")).unwrap();
let filesink = ElementFactory::make("filesink", Some("filesink")).unwrap();
filesink.set_property("location", &song_path.to_str().unwrap()).unwrap();
// Create bin itself
let bin = Bin::new("bin");
let bin = Bin::new(Some("bin"));
bin.set_property("message-forward", &true).unwrap();
// Add elements to bin and link them
......@@ -333,7 +333,7 @@ impl RecorderBin {
// Link file_srcpad with vorbisenc sinkpad using a ghostpad
let vorbisenc_sinkpad = vorbisenc.get_static_pad("sink").unwrap();
let ghostpad = gstreamer::GhostPad::new("sink", &vorbisenc_sinkpad).unwrap();
let ghostpad = gstreamer::GhostPad::new(Some("sink"), &vorbisenc_sinkpad).unwrap();
bin.add_pad(&ghostpad).unwrap();
bin.sync_state_with_parent().unwrap();
srcpad.link(&ghostpad).expect("Queue src pad cannot linked to vorbisenc sinkpad");
......
use glib::Sender;
use gtk::prelude::*;
use libhandy::{SqueezerExt, ViewSwitcherBarExt};
use url::Url;
use crate::api::{Client, StationRequest};
......
use gio::prelude::*;
use glib::Sender;
use gtk::prelude::*;
use rusqlite::Connection;
use url::Url;
use std::cell::RefCell;
use std::fs;
......@@ -10,7 +8,7 @@ use std::io;
use std::path::PathBuf;
use std::result::Result;
use crate::api::{Client, Station};
use crate::api::Station;
use crate::app::Action;
use crate::config;
use crate::model::ObjectWrapper;
......
......@@ -25,7 +25,7 @@ impl SongListBox {
pub fn bind_model(&self, model: &SongModel) {
let sender = self.sender.clone();
self.listbox.bind_model(&model.model, move |song| {
self.listbox.bind_model(Some(&model.model), move |song| {
let row = SongRow::new(sender.clone(), song.downcast_ref::<ObjectWrapper>().unwrap().deserialize());
row.widget.upcast::<gtk::Widget>()
});
......
......@@ -41,7 +41,7 @@ impl StationDialog {
library_action_stack.set_visible_child_name("library-add");
}
widget.set_transient_for(window);
widget.set_transient_for(Some(window));
let dialog = Self {
widget,
......
use gio::prelude::*;
use glib::Sender;
use gtk::prelude::*;
use crate::api::Station;
use crate::app::Action;
use crate::model::ObjectWrapper;
use crate::model::StationModel;
......@@ -39,9 +37,8 @@ impl StationFlowBox {
pub fn bind_model(&self, model: &StationModel) {
let sender = self.sender.clone();
let widget = self.widget.clone();
self.widget.bind_model(&model.model, move |station| {
self.widget.bind_model(Some(&model.model), move |station| {
let row = StationRow::new(sender.clone(), station.downcast_ref::<ObjectWrapper>().unwrap().deserialize());
row.widget.upcast::<gtk::Widget>()
});
......
use glib::Sender;
use gtk::prelude::*;
use libhandy::{HeaderBarExt, LeafletExt, ViewSwitcherBarExt};
use libhandy::LeafletExt;
use crate::app::Action;
use crate::config;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment