2 * Copyright © 2009 Keith Packard <keithp@keithp.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 #define NUM_CHANNEL 10
23 static GtkRadioMenuItem *channel_item[NUM_CHANNEL];
26 aoview_channel_current(void)
30 for (c = 0; c < NUM_CHANNEL; c++)
31 if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(channel_item[c])))
37 aoview_channel_notify(int channel)
39 if (0 <= channel && channel < NUM_CHANNEL)
40 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(channel_item[channel]), TRUE);
43 #define ALTOS_CHANNEL_PATH "/apps/aoview/channel"
46 aoview_channel_change(GtkWidget *widget, gpointer data)
48 gboolean enabled = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
50 GConfClient *gconf_client;
54 aoview_monitor_set_channel(c);
55 gconf_client = gconf_client_get_default();
56 gconf_client_set_int(gconf_client, ALTOS_CHANNEL_PATH, c, &error);
61 aoview_channel_init(GladeXML *xml)
64 GConfClient *gconf_client;
66 for (c = 0; c < NUM_CHANNEL; c++) {
69 sprintf(name, "channel_%d", c);
70 channel_item[c] = GTK_RADIO_MENU_ITEM(glade_xml_get_widget(xml, name));
71 assert(channel_item[c]);
72 g_signal_connect(G_OBJECT(channel_item[c]), "toggled",
73 G_CALLBACK(aoview_channel_change),
76 gconf_client = gconf_client_get_default();
83 c = gconf_client_get_int(gconf_client,
89 aoview_channel_notify(c);