From 3cc732f558737acd0004efb013993515845e67d7 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 1 Aug 2013 01:34:47 -0500 Subject: add per-profile icons and initial menus w/settings section --- src/phone.vala | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/phone.vala (limited to 'src/phone.vala') diff --git a/src/phone.vala b/src/phone.vala new file mode 100644 index 0000000..2abcf11 --- /dev/null +++ b/src/phone.vala @@ -0,0 +1,76 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * 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; version 3. + * + * 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Authors: + * Charles Kerr + */ + +class PhoneMenu: BluetoothMenu +{ + private Action[] actions; + + public override void add_actions_to_group (SimpleActionGroup group) + { + base.add_actions_to_group (group); + + for (var i=0; i { + try { + Process.spawn_command_line_async ("system-settings bluetooth"); + } catch (Error e) { + warning ("unable to launch settings: %s", e.message); + } + }); + + return action; + } + + protected Variant action_state_for_root () + { + var label = "Hello World"; // FIXME + var a11y = "Hello World"; // FIXME + var visible = true; // FIXME + + string icon_name = "bluetooth"; // FIXME: enabled, disabled, connected, etc. + var icon = new ThemedIcon.with_default_fallbacks (icon_name); + + var builder = new VariantBuilder (new VariantType ("a{sv}")); + builder.add ("{sv}", "visible", new Variant ("b", visible)); + builder.add ("{sv}", "label", new Variant ("s", label)); + builder.add ("{sv}", "accessible-desc", new Variant ("s", a11y)); + builder.add ("{sv}", "icon", icon.serialize()); + return builder.end (); + } +} -- cgit v1.2.3