This commit is contained in:
Julian Ospald 2017-07-10 21:32:49 +02:00
parent c04a975edf
commit 932fd7180e
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
3 changed files with 17 additions and 26 deletions

View File

@ -9,12 +9,9 @@ use ui_entry::Gui;
#[cfg(feature = "notify")] #[cfg(feature = "notify")]
use notif::*; use notif::*;
// TODO: notify popups
// TODO: destructors // TODO: destructors
// TODO: glade stuff, config, alsacard
pub struct AppS { pub struct AppS {
_cant_construct: (), _cant_construct: (),
pub gui: Gui, pub gui: Gui,

View File

@ -1,28 +1,28 @@
use app_state::*; use app_state::*;
use audio::*; use audio::*;
use errors::*;
use glib::Variant;
use glib::prelude::*;
use gtk::DialogExt; use gtk::DialogExt;
use gtk::MessageDialogExt; use gtk::MessageDialogExt;
use gtk::WidgetExt; use gtk::WidgetExt;
use gtk::WindowExt; use gtk::WindowExt;
use gtk; use gtk;
use gtk_sys::{GTK_DIALOG_DESTROY_WITH_PARENT, GTK_RESPONSE_YES}; use gtk_sys::{GTK_DIALOG_DESTROY_WITH_PARENT, GTK_RESPONSE_YES};
use libnotify;
use prefs::*; use prefs::*;
use std::cell::Cell; use std::cell::Cell;
use std::cell::RefCell; use std::cell::RefCell;
use std::rc::Rc; use std::rc::Rc;
use std::thread;
use std::time::Duration;
use support_audio::*; use support_audio::*;
use support_ui::*; use support_ui::*;
use ui_popup_menu::*; use ui_popup_menu::*;
use ui_popup_window::*; use ui_popup_window::*;
use ui_prefs_dialog::*; use ui_prefs_dialog::*;
use ui_tray_icon::*; use ui_tray_icon::*;
use errors::*;
use libnotify;
use std::thread;
use std::time::Duration;
use glib::Variant;
use glib::prelude::*;
pub struct Notif { pub struct Notif {
@ -136,6 +136,7 @@ pub fn init_notify(appstate: Rc<AppS>) {
(notif.from_popup.get(), (notif.from_popup.get(),
notif.from_tray.get(), notif.from_tray.get(),
notif.from_external.get())) { notif.from_external.get())) {
// TODO
(AudioSignal::CardDisconnected, _, _) => (), (AudioSignal::CardDisconnected, _, _) => (),
(AudioSignal::CardError, _, _) => (), (AudioSignal::CardError, _, _) => (),
(AudioSignal::ValuesChanged, (AudioSignal::ValuesChanged,

View File

@ -8,11 +8,6 @@ use gtk;
use prefs::*; use prefs::*;
use std::rc::Rc; use std::rc::Rc;
use support_alsa::*; use support_alsa::*;
use support_audio::*;
// TODO: reference count leak
@ -153,19 +148,17 @@ impl PrefsDialog {
/* NotifyPrefs */ /* NotifyPrefs */
#[cfg(feature = "notify")] #[cfg(feature = "notify")]
{
self.noti_enable_check self.noti_enable_check
.set_active(prefs.notify_prefs.enable_notifications); .set_active(prefs.notify_prefs.enable_notifications);
#[cfg(feature = "notify")]
self.noti_timeout_spin self.noti_timeout_spin
.set_value(prefs.notify_prefs.notifcation_timeout as f64); .set_value(prefs.notify_prefs.notifcation_timeout as f64);
#[cfg(feature = "notify")]
self.noti_mouse_check self.noti_mouse_check
.set_active(prefs.notify_prefs.notify_mouse_scroll); .set_active(prefs.notify_prefs.notify_mouse_scroll);
#[cfg(feature = "notify")]
self.noti_popup_check.set_active(prefs.notify_prefs.notify_popup); self.noti_popup_check.set_active(prefs.notify_prefs.notify_popup);
#[cfg(feature = "notify")]
self.noti_ext_check.set_active(prefs.notify_prefs.notify_external); self.noti_ext_check.set_active(prefs.notify_prefs.notify_external);
} }
}
fn to_prefs(&self) -> Prefs { fn to_prefs(&self) -> Prefs {