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

View File

@ -244,6 +244,9 @@ extern "C" fn watch_cb(
error!("GIO error has occurred");
cb(AlsaEvent::AlsaCardError);
}
_ => {
error!("Internal error: unknown status!");
},
}
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_level = matches.opt_default("log-level", "debug").map(|s| {
match s.to_lowercase().as_str() {
"trace" => flexi_logger::LogLevelFilter::Trace,
"debug" => flexi_logger::LogLevelFilter::Debug,
"info" => flexi_logger::LogLevelFilter::Info,
"warn" => flexi_logger::LogLevelFilter::Warn,
"error" => flexi_logger::LogLevelFilter::Error,
"off" => flexi_logger::LogLevelFilter::Off,
_ => flexi_logger::LogLevelFilter::Debug,
"trace" => flexi_logger::LevelFilter::Trace,
"debug" => flexi_logger::LevelFilter::Debug,
"info" => flexi_logger::LevelFilter::Info,
"warn" => flexi_logger::LevelFilter::Warn,
"error" => flexi_logger::LevelFilter::Error,
"off" => flexi_logger::LevelFilter::Off,
_ => flexi_logger::LevelFilter::Debug,
}
}).unwrap_or(flexi_logger::LogLevelFilter::Off);
}).unwrap_or(flexi_logger::LevelFilter::Off);
let mut flogger = flexi_logger::Logger::with(
flexi_logger::LogSpecification::default(log_level).build());

View File

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

View File

@ -261,7 +261,7 @@ where
let xevent_type = unsafe { (*xevent).type_ };
if xevent_type == x11::xlib::KeyPress {
return gdk_sys::GdkFilterReturn::Continue;
return gdk_sys::GDK_FILTER_CONTINUE;
}
let xevent_key = unsafe { (*xevent).keycode };
@ -297,5 +297,5 @@ where
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 audio::frontend::*;
use gtk::DialogExt;
use gtk::GtkWindowExt;
use gtk::MessageDialogExt;
use gtk::WidgetExt;
use gtk::WindowExt;
use gtk;
use gtk_sys::GTK_RESPONSE_YES;
use prefs::*;
@ -115,7 +115,7 @@ fn run_audio_error_dialog(parent: &gtk::Window) -> i32 {
let dialog = gtk::MessageDialog::new(
Some(parent),
gtk::DIALOG_DESTROY_WITH_PARENT,
gtk::DialogFlags::DESTROY_WITH_PARENT,
gtk::MessageType::Error,
gtk::ButtonsType::YesNo,
"Warning: Connection to sound system failed.",

View File

@ -10,7 +10,6 @@ use gdk_sys;
use glib::translate::*;
use gtk::prelude::*;
use gtk;
use gtk_sys;
use libc::c_uint;
use std;
@ -87,7 +86,7 @@ impl HotkeyDialog {
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);
});
@ -112,7 +111,7 @@ impl HotkeyDialog {
&window,
gdk::GrabOwnership::Application,
true,
gdk::KEY_PRESS_MASK,
gdk::EventMask::KEY_PRESS_MASK,
None,
gdk_sys::GDK_CURRENT_TIME as u32,
);

View File

@ -8,9 +8,10 @@ use app_state::*;
use audio::frontend::*;
use errors::*;
use gdk::DeviceExt;
use gdk::{GrabOwnership, GrabStatus, BUTTON_PRESS_MASK, KEY_PRESS_MASK};
use gdk::{GrabOwnership, GrabStatus};
use gdk;
use gdk_sys::{GDK_KEY_Escape, GDK_CURRENT_TIME};
use glib::translate::*;
use glib;
use gtk::ToggleButtonExt;
use gtk::prelude::*;
@ -81,7 +82,8 @@ impl PopupWindow {
{
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 {
Ok(val) => {
@ -101,7 +103,7 @@ impl PopupWindow {
glib::signal_handler_unblock(
&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 |_| {
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 */
@ -177,7 +179,7 @@ where
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 */
@ -212,12 +214,12 @@ where
);
glib::signal_handler_block(
&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()));
glib::signal_handler_unblock(
&popup_window.vol_scale_adj,
popup_window.changed_signal.get(),
&from_glib(popup_window.changed_signal.get()),
);
popup_window.vol_scale.grab_focus();
try_w!(grab_devices(&appstate.gui.popup_window.popup_window));
@ -302,7 +304,7 @@ fn grab_devices(window: &gtk::Window) -> Result<()> {
&gdk_window,
GrabOwnership::None,
true,
BUTTON_PRESS_MASK,
gdk::EventMask::BUTTON_PRESS_MASK,
None,
GDK_CURRENT_TIME as u32,
);
@ -323,7 +325,7 @@ fn grab_devices(window: &gtk::Window) -> Result<()> {
&gdk_window,
GrabOwnership::None,
true,
KEY_PRESS_MASK,
gdk::EventMask::KEY_PRESS_MASK,
None,
GDK_CURRENT_TIME as u32,
);

View File

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