Update dependencies and fix build

This commit is contained in:
Julian Ospald 2018-01-25 22:40:13 +01:00
parent cd0b9bea93
commit c7a200085b
9 changed files with 52 additions and 49 deletions

View File

@ -17,30 +17,30 @@ name = "pnmixer-rs"
path = "src/bin.rs" path = "src/bin.rs"
[dependencies] [dependencies]
alsa = "0.1.10" alsa = "0.2.0"
alsa-sys = "0.1.1" alsa-sys = "0.1.1"
error-chain = "0.11.0" error-chain = "0.11.0"
ffi = "0.0.2" ffi = "0.0.2"
flexi_logger = "0.6.8" flexi_logger = "0.6.11"
gdk-pixbuf = "0.2.0" gdk-pixbuf = "0.3.0"
gdk-pixbuf-sys = "0.4.0" gdk-pixbuf-sys = "0.5.0"
gdk-sys = "0.4.0" gdk-sys = "0.5.0"
getopts = "0.2.15" getopts = "0.2.17"
gio = "0.2.0" gio = "0.3.0"
glib = "0.3.1" glib = "0.4.1"
glib-sys = "0.4.0" glib-sys = "0.5.0"
gobject-sys = "0.4.0" gobject-sys = "0.5.0"
gtk-sys = "0.4.0" gtk-sys = "0.5.0"
lazy_static = "0.2.8" lazy_static = "1.0.0"
libc = "0.2.31" libc = "0.2.36"
libnotify = { version = "^1.0.2", optional = true } libnotify = { version = "1.0.2", optional = true }
log = "0.3.8" log = "0.4.1"
png = "0.10.0" png = "0.11.0"
serde = "1.0.15" serde = "1.0.27"
serde_derive = "1.0.15" serde_derive = "1.0.27"
toml = "0.4.5" toml = "0.4.5"
w_result = "0.1.2" w_result = "0.1.2"
which = "1.0.2" which = "1.0.3"
xdg = "2.1.0" xdg = "2.1.0"
[dependencies.gdk] [dependencies.gdk]
@ -49,7 +49,7 @@ features = [
"v3_12", "v3_12",
"v3_22", "v3_22",
] ]
version = "0.6.0" version = "0.7.0"
[dependencies.gtk] [dependencies.gtk]
features = [ features = [
@ -57,14 +57,14 @@ features = [
"v3_12", "v3_12",
"v3_22", "v3_22",
] ]
version = "0.2.0" version = "0.3.0"
[dependencies.x11] [dependencies.x11]
features = [ features = [
"xlib", "xlib",
"xtst", "xtst",
] ]
version = "2.15.0" version = "2.17.2"
[features] [features]
notify = ["libnotify"] notify = ["libnotify"]

View File

@ -244,6 +244,9 @@ extern "C" fn watch_cb(
error!("GIO error has occurred"); error!("GIO error has occurred");
cb(AlsaEvent::AlsaCardError); cb(AlsaEvent::AlsaCardError);
} }
_ => {
error!("Internal error: unknown status!");
},
} }
return true as glib_sys::gboolean; return true as glib_sys::gboolean;
} }

View File

@ -37,15 +37,15 @@ fn main() {
let log_dir = matches.opt_str("log-to-file"); let log_dir = matches.opt_str("log-to-file");
let log_level = matches.opt_default("log-level", "debug").map(|s| { let log_level = matches.opt_default("log-level", "debug").map(|s| {
match s.to_lowercase().as_str() { match s.to_lowercase().as_str() {
"trace" => flexi_logger::LogLevelFilter::Trace, "trace" => flexi_logger::LevelFilter::Trace,
"debug" => flexi_logger::LogLevelFilter::Debug, "debug" => flexi_logger::LevelFilter::Debug,
"info" => flexi_logger::LogLevelFilter::Info, "info" => flexi_logger::LevelFilter::Info,
"warn" => flexi_logger::LogLevelFilter::Warn, "warn" => flexi_logger::LevelFilter::Warn,
"error" => flexi_logger::LogLevelFilter::Error, "error" => flexi_logger::LevelFilter::Error,
"off" => flexi_logger::LogLevelFilter::Off, "off" => flexi_logger::LevelFilter::Off,
_ => flexi_logger::LogLevelFilter::Debug, _ => flexi_logger::LevelFilter::Debug,
} }
}).unwrap_or(flexi_logger::LogLevelFilter::Off); }).unwrap_or(flexi_logger::LevelFilter::Off);
let mut flogger = flexi_logger::Logger::with( let mut flogger = flexi_logger::Logger::with(
flexi_logger::LogSpecification::default(log_level).build()); flexi_logger::LogSpecification::default(log_level).build());

View File

@ -149,12 +149,12 @@ macro_rules! error_dialog {
($msg:expr, $parent:expr) => { ($msg:expr, $parent:expr) => {
{ {
use gtk::DialogExt; use gtk::DialogExt;
use gtk::prelude::GtkWindowExt;
use gtk::WidgetExt; use gtk::WidgetExt;
use gtk::WindowExt;
let parent: Option<&gtk::Window> = $parent; let parent: Option<&gtk::Window> = $parent;
let dialog = gtk::MessageDialog::new(parent, let dialog = gtk::MessageDialog::new(parent,
gtk::DIALOG_DESTROY_WITH_PARENT, gtk::DialogFlags::DESTROY_WITH_PARENT,
gtk::MessageType::Error, gtk::MessageType::Error,
gtk::ButtonsType::Close, gtk::ButtonsType::Close,
$msg); $msg);

View File

@ -261,7 +261,7 @@ where
let xevent_type = unsafe { (*xevent).type_ }; let xevent_type = unsafe { (*xevent).type_ };
if xevent_type == x11::xlib::KeyPress { if xevent_type == x11::xlib::KeyPress {
return gdk_sys::GdkFilterReturn::Continue; return gdk_sys::GDK_FILTER_CONTINUE;
} }
let xevent_key = unsafe { (*xevent).keycode }; let xevent_key = unsafe { (*xevent).keycode };
@ -297,5 +297,5 @@ where
just_warn!(audio.decrease_vol(AudioUser::Hotkeys, hotkeys.auto_unmute)); just_warn!(audio.decrease_vol(AudioUser::Hotkeys, hotkeys.auto_unmute));
} }
return gdk_sys::GdkFilterReturn::Continue; return gdk_sys::GDK_FILTER_CONTINUE;
} }

View File

@ -4,9 +4,9 @@
use app_state::*; use app_state::*;
use audio::frontend::*; use audio::frontend::*;
use gtk::DialogExt; use gtk::DialogExt;
use gtk::GtkWindowExt;
use gtk::MessageDialogExt; use gtk::MessageDialogExt;
use gtk::WidgetExt; use gtk::WidgetExt;
use gtk::WindowExt;
use gtk; use gtk;
use gtk_sys::GTK_RESPONSE_YES; use gtk_sys::GTK_RESPONSE_YES;
use prefs::*; use prefs::*;
@ -115,7 +115,7 @@ fn run_audio_error_dialog(parent: &gtk::Window) -> i32 {
let dialog = gtk::MessageDialog::new( let dialog = gtk::MessageDialog::new(
Some(parent), Some(parent),
gtk::DIALOG_DESTROY_WITH_PARENT, gtk::DialogFlags::DESTROY_WITH_PARENT,
gtk::MessageType::Error, gtk::MessageType::Error,
gtk::ButtonsType::YesNo, gtk::ButtonsType::YesNo,
"Warning: Connection to sound system failed.", "Warning: Connection to sound system failed.",

View File

@ -10,7 +10,6 @@ use gdk_sys;
use glib::translate::*; use glib::translate::*;
use gtk::prelude::*; use gtk::prelude::*;
use gtk; use gtk;
use gtk_sys;
use libc::c_uint; use libc::c_uint;
use std; use std;
@ -87,7 +86,7 @@ impl HotkeyDialog {
hotkey_dialog.connect_key_release_event(move |w, _| { hotkey_dialog.connect_key_release_event(move |w, _| {
w.response(gtk_sys::GtkResponseType::Ok as i32); w.response(gtk::ResponseType::Ok.into());
return Inhibit(false); return Inhibit(false);
}); });
@ -112,7 +111,7 @@ impl HotkeyDialog {
&window, &window,
gdk::GrabOwnership::Application, gdk::GrabOwnership::Application,
true, true,
gdk::KEY_PRESS_MASK, gdk::EventMask::KEY_PRESS_MASK,
None, None,
gdk_sys::GDK_CURRENT_TIME as u32, gdk_sys::GDK_CURRENT_TIME as u32,
); );

View File

@ -8,9 +8,10 @@ use app_state::*;
use audio::frontend::*; use audio::frontend::*;
use errors::*; use errors::*;
use gdk::DeviceExt; use gdk::DeviceExt;
use gdk::{GrabOwnership, GrabStatus, BUTTON_PRESS_MASK, KEY_PRESS_MASK}; use gdk::{GrabOwnership, GrabStatus};
use gdk; use gdk;
use gdk_sys::{GDK_KEY_Escape, GDK_CURRENT_TIME}; use gdk_sys::{GDK_KEY_Escape, GDK_CURRENT_TIME};
use glib::translate::*;
use glib; use glib;
use gtk::ToggleButtonExt; use gtk::ToggleButtonExt;
use gtk::prelude::*; use gtk::prelude::*;
@ -81,7 +82,8 @@ impl PopupWindow {
{ {
let m_muted = audio.get_mute(); let m_muted = audio.get_mute();
glib::signal_handler_block(&self.mute_check, self.toggle_signal.get()); glib::signal_handler_block(&self.mute_check,
&from_glib(self.toggle_signal.get()));
match m_muted { match m_muted {
Ok(val) => { Ok(val) => {
@ -101,7 +103,7 @@ impl PopupWindow {
glib::signal_handler_unblock( glib::signal_handler_unblock(
&self.mute_check, &self.mute_check,
self.toggle_signal.get(), &from_glib(self.toggle_signal.get()),
); );
} }
@ -159,7 +161,7 @@ where
let toggle_signal = mute_check.connect_toggled(move |_| { let toggle_signal = mute_check.connect_toggled(move |_| {
on_mute_check_toggled(&_appstate) on_mute_check_toggled(&_appstate)
}); });
appstate.gui.popup_window.toggle_signal.set(toggle_signal); appstate.gui.popup_window.toggle_signal.set(toggle_signal.to_glib());
} }
/* popup_window.connect_show */ /* popup_window.connect_show */
@ -177,7 +179,7 @@ where
on_vol_scale_value_changed(&_appstate) on_vol_scale_value_changed(&_appstate)
}); });
appstate.gui.popup_window.changed_signal.set(changed_signal); appstate.gui.popup_window.changed_signal.set(changed_signal.to_glib());
} }
/* popup_window.connect_event */ /* popup_window.connect_event */
@ -212,12 +214,12 @@ where
); );
glib::signal_handler_block( glib::signal_handler_block(
&popup_window.vol_scale_adj, &popup_window.vol_scale_adj,
popup_window.changed_signal.get(), &from_glib(popup_window.changed_signal.get()),
); );
try_w!(appstate.gui.popup_window.update(appstate.audio.as_ref())); try_w!(appstate.gui.popup_window.update(appstate.audio.as_ref()));
glib::signal_handler_unblock( glib::signal_handler_unblock(
&popup_window.vol_scale_adj, &popup_window.vol_scale_adj,
popup_window.changed_signal.get(), &from_glib(popup_window.changed_signal.get()),
); );
popup_window.vol_scale.grab_focus(); popup_window.vol_scale.grab_focus();
try_w!(grab_devices(&appstate.gui.popup_window.popup_window)); try_w!(grab_devices(&appstate.gui.popup_window.popup_window));
@ -302,7 +304,7 @@ fn grab_devices(window: &gtk::Window) -> Result<()> {
&gdk_window, &gdk_window,
GrabOwnership::None, GrabOwnership::None,
true, true,
BUTTON_PRESS_MASK, gdk::EventMask::BUTTON_PRESS_MASK,
None, None,
GDK_CURRENT_TIME as u32, GDK_CURRENT_TIME as u32,
); );
@ -323,7 +325,7 @@ fn grab_devices(window: &gtk::Window) -> Result<()> {
&gdk_window, &gdk_window,
GrabOwnership::None, GrabOwnership::None,
true, true,
KEY_PRESS_MASK, gdk::EventMask::KEY_PRESS_MASK,
None, None,
GDK_CURRENT_TIME as u32, GDK_CURRENT_TIME as u32,
); );

View File

@ -10,7 +10,6 @@ use gtk::ResponseType;
use gtk::prelude::*; use gtk::prelude::*;
use gtk; use gtk;
use prefs::*; use prefs::*;
use std::ascii::AsciiExt;
use std::cell::RefCell; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
use support::audio::*; use support::audio::*;