From: Enrico Zini Date: Sun, 28 Mar 2010 12:24:16 +0000 (+0100) Subject: New notification infrastructure X-Git-Url: https://git.toastfreeware.priv.at/gregoa/zavai.git/commitdiff_plain/351500dcc7f5e1344f20f9b8f52591f5c0f17061?ds=sidebyside New notification infrastructure --- diff --git a/src/app_notify.vala b/src/app_notify.vala new file mode 100644 index 0000000..8759bb3 --- /dev/null +++ b/src/app_notify.vala @@ -0,0 +1,53 @@ +/* + * app_notify - zavai notification system + * + * Copyright (C) 2010 Enrico Zini + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +using GLib; + +namespace zavai { +namespace ui { +namespace notify { + +public abstract class Notifier : Gtk.Dialog +{ + public string name { get; construct; } + + public int run() + { + ui.power.backlight.request(name); + // TODO: Save aux state + // TODO: Save vibrator state + // TODO: Save ringtone state + // TODO: set our state + int res = base.run(); + // TODO: Restore ringtone state + // TODO: Restore vibrator state + // TODO: Restore aux state + ui.power.backlight.release(name); + return res; + } +} + +public void init() +{ +} + +} +} +} diff --git a/src/zavai.vala b/src/zavai.vala index f9838c5..b99d551 100644 --- a/src/zavai.vala +++ b/src/zavai.vala @@ -218,6 +218,7 @@ static int main (string[] args) { // User interface zavai.ui.music.init(); zavai.ui.main.init(); + zavai.ui.notify.init(); zavai.ui.gps.init(); zavai.ui.gsm.init(); zavai.config.find_and_run_script("display", "init");