2 * app_wifi - zavai Wifi ui functions
4 * Copyright (C) 2010 Enrico Zini <enrico@enricozini.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 public class WifiIcon : Gtk.StatusIcon
29 bool requested = false;
33 activate += on_activate;
37 private void on_activate()
39 requested = !requested;
43 //zavai.wifi.wifi.start();
44 stderr.printf("wifi should be started here\n");
45 stderr.printf("wifi status: %d\n", (int) zavai.wifi.wifi.started);
49 //zavai.wifi.wifi.stop();
50 stderr.printf("wifi should be stopped here\n");
51 stderr.printf("wifi status: %d\n", (int) zavai.wifi.wifi.started);
55 protected void update_icon()
57 string name = zavai.config.icondir + "/";
58 name += (active() ? "wifi_1.png" : "wifi_0.png");
59 stderr.printf("load icon from %s\n", name);
65 return zavai.wifi.wifi.started;
74 zavai.menu_misc.add_service_toggle(zavai.wifi.wifi, "Start Wifi", "Stop Wifi");
76 icon = new WifiIcon();
77 icon.set_visible(true);