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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 #define NUM_CHANNEL 10
24 static GtkRadioMenuItem *channel_item[NUM_CHANNEL];
27 aoview_channel_current(void)
31 for (c = 0; c < NUM_CHANNEL; c++)
32 if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(channel_item[c])))
38 aoview_channel_notify(int channel)
40 if (0 <= channel && channel < NUM_CHANNEL)
41 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(channel_item[channel]), TRUE);
44 #define ALTOS_CHANNEL_PATH "/apps/aoview/channel"
47 aoview_channel_change(GtkWidget *widget, gpointer data)
49 gboolean enabled = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
51 GConfClient *gconf_client;
55 aoview_monitor_set_channel(c);
56 gconf_client = gconf_client_get_default();
57 gconf_client_set_int(gconf_client, ALTOS_CHANNEL_PATH, c, &error);
62 aoview_channel_init(GladeXML *xml)
65 GConfClient *gconf_client;
67 for (c = 0; c < NUM_CHANNEL; c++) {
70 sprintf(name, "channel_%d", c);
71 channel_item[c] = GTK_RADIO_MENU_ITEM(glade_xml_get_widget(xml, name));
72 assert(channel_item[c]);
73 g_signal_connect(G_OBJECT(channel_item[c]), "toggled",
74 G_CALLBACK(aoview_channel_change),
77 gconf_client = gconf_client_get_default();
84 c = gconf_client_get_int(gconf_client,
90 aoview_channel_notify(c);