Commit 6ae370c7 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

system-indicators: add bluetooth indicator

parent 607e8cda
......@@ -329,6 +329,8 @@ AS_IF([test "x$with_system_indicators" != "xno"], [
AC_SUBST([GNOME_PANEL_MODULES_DIR], [$GNOME_PANEL_MODULES_DIR])
PKG_CHECK_MODULES([SYSTEM_INDICATORS], [
gio-unix-2.0 >= $GLIB_REQUIRED
gnome-bluetooth-1.0
libgnome-panel
])
], [
......
......@@ -44,5 +44,6 @@ gnome-flashback/libsound-applet/gf-sound-applet.c
gnome-flashback/libsound-applet/gvc-channel-bar.c
gnome-flashback/libsound-applet/gvc/gvc-mixer-control.c
gnome-flashback/libsound-applet/gvc-stream-status-icon.c
system-indicators/si-bluetooth.c
system-indicators/si-input-source.c
system-indicators/si-module.c
......@@ -21,6 +21,8 @@ system_indicators_la_CFLAGS = \
system_indicators_la_SOURCES = \
si-applet.c \
si-applet.h \
si-bluetooth.c \
si-bluetooth.h \
si-indicator.c \
si-indicator.h \
si-input-source.c \
......
......@@ -18,6 +18,7 @@
#include "config.h"
#include "si-applet.h"
#include "si-bluetooth.h"
#include "si-input-source.h"
#include "si-menu-bar.h"
......@@ -27,16 +28,37 @@ struct _SiApplet
GtkWidget *menu_bar;
SiIndicator *bluetooth;
SiIndicator *input_source;
};
G_DEFINE_TYPE (SiApplet, si_applet, GP_TYPE_APPLET)
static void
setup_applet (SiApplet *self)
append_bluetooth (SiApplet *self)
{
GtkWidget *item;
self->bluetooth = si_bluetooth_new (GP_APPLET (self));
item = si_indicator_get_menu_item (self->bluetooth);
gtk_menu_shell_append (GTK_MENU_SHELL (self->menu_bar), item);
}
static void
append_input_source (SiApplet *self)
{
GtkWidget *item;
self->input_source = si_input_source_new (GP_APPLET (self));
item = si_indicator_get_menu_item (self->input_source);
gtk_menu_shell_append (GTK_MENU_SHELL (self->menu_bar), item);
}
static void
setup_applet (SiApplet *self)
{
self->menu_bar = si_menu_bar_new ();
gtk_container_add (GTK_CONTAINER (self), self->menu_bar);
gtk_widget_show (self->menu_bar);
......@@ -55,10 +77,8 @@ setup_applet (SiApplet *self)
G_BINDING_DEFAULT |
G_BINDING_SYNC_CREATE);
self->input_source = si_input_source_new (GP_APPLET (self));
item = si_indicator_get_menu_item (self->input_source);
gtk_menu_shell_append (GTK_MENU_SHELL (self->menu_bar), item);
append_input_source (self);
append_bluetooth (self);
}
static void
......@@ -75,6 +95,7 @@ si_applet_dispose (GObject *object)
self = SI_APPLET (object);
g_clear_object (&self->bluetooth);
g_clear_object (&self->input_source);
G_OBJECT_CLASS (si_applet_parent_class)->dispose (object);
......
This diff is collapsed.
/*
* Copyright (C) 2019 Alberts Muktupāvels
*
* 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, either version 3 of the License, or
* (at your option) any later version.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SI_BLUETOOTH_H
#define SI_BLUETOOTH_H
#include <libgnome-panel/gp-applet.h>
#include "si-indicator.h"
G_BEGIN_DECLS
#define SI_TYPE_BLUETOOTH (si_bluetooth_get_type ())
G_DECLARE_FINAL_TYPE (SiBluetooth, si_bluetooth, SI, BLUETOOTH, SiIndicator)
SiIndicator *si_bluetooth_new (GpApplet *applet);
G_END_DECLS
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment