1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2008 Red Hat, Inc.
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29
#include <glib/gi18n-lib.h>
32
#include <pulse/pulseaudio.h>
34
#include "cc-sound-panel.h"
35
#include "gvc-mixer-dialog.h"
37
G_DEFINE_DYNAMIC_TYPE (CcSoundPanel, cc_sound_panel, CC_TYPE_PANEL)
39
static void cc_sound_panel_finalize (GObject *object);
42
cc_sound_panel_class_init (CcSoundPanelClass *klass)
44
GObjectClass *object_class = G_OBJECT_CLASS (klass);
46
object_class->finalize = cc_sound_panel_finalize;
50
cc_sound_panel_class_finalize (CcSoundPanelClass *klass)
55
cc_sound_panel_finalize (GObject *object)
57
CcSoundPanel *panel = CC_SOUND_PANEL (object);
59
if (panel->dialog != NULL)
61
if (panel->connecting_label != NULL)
62
panel->connecting_label = NULL;
63
if (panel->control != NULL) {
64
g_object_unref (panel->control);
65
panel->control = NULL;
68
G_OBJECT_CLASS (cc_sound_panel_parent_class)->finalize (object);
72
cc_sound_panel_init (CcSoundPanel *self)
74
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
76
gtk_window_set_default_icon_name ("multimedia-volume-control");
78
self->control = gvc_mixer_control_new ("GNOME Volume Control Dialog");
79
gvc_mixer_control_open (self->control);
80
self->dialog = gvc_mixer_dialog_new (self->control);
81
gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->dialog));
82
gtk_widget_show (GTK_WIDGET (self->dialog));
86
cc_sound_panel_register (GIOModule *module)
88
cc_sound_panel_register_type (G_TYPE_MODULE (module));
89
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
94
/* GIO extension stuff */
96
g_io_module_load (GIOModule *module)
98
bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
99
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
101
/* register the panel */
102
cc_sound_panel_register (module);
106
g_io_module_unload (GIOModule *module)