[gnome-applets/wip/muktupavels/brightness] brightness: port to libgnome-panel



commit eec7af27f362376effd8f523e5d2a991e2ea9d4e
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Mar 26 02:56:07 2020 +0200

    brightness: port to libgnome-panel

 Makefile.am                                        |   2 -
 brightness/Makefile.am                             |  32 -----
 brightness/brightness-applet-menu.xml              |   6 -
 .../org.gnome.BrightnessApplet.panel-applet.in.in  |  15 --
 configure.ac                                       |   4 +-
 gnome-applets/Makefile.am                          |   2 +
 .../src => gnome-applets/brightness}/Makefile.am   |  16 +--
 .../brightness/brightness-applet-menu.xml          |  10 ++
 .../brightness}/brightness-applet.c                | 156 +++++++--------------
 gnome-applets/brightness/brightness-applet.h       |  31 ++++
 .../org.gnome.SettingsDaemon.Power.Screen.xml      |   0
 gnome-applets/ga-module.c                          |  15 +-
 po/POTFILES.in                                     |   5 +-
 po/POTFILES.skip                                   |   1 -
 14 files changed, 115 insertions(+), 180 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 2b8a712d9..951e03596 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,6 @@ endif
 always_built_SUBDIRS =  \
        charpick        \
        battstat \
-       brightness      \
        command         \
        drivemount      \
        inhibit         \
@@ -60,7 +59,6 @@ DIST_SUBDIRS = \
        window-buttons  \
        window-title    \
        inhibit         \
-       brightness      \
        tracker-search-bar \
        command         \
        $(NULL)
diff --git a/configure.ac b/configure.ac
index 849acce6a..ddf6eb335 100644
--- a/configure.ac
+++ b/configure.ac
@@ -336,6 +336,7 @@ AC_CONFIG_FILES([
   data/schemas/Makefile
 
   gnome-applets/Makefile
+  gnome-applets/brightness/Makefile
   gnome-applets/timer/Makefile
   gnome-applets/trash/Makefile
   gnome-applets/window-picker/Makefile
@@ -363,9 +364,6 @@ AC_CONFIG_FILES([
   battstat/Makefile
   battstat/src/Makefile
 
-  brightness/Makefile
-  brightness/src/Makefile
-
   charpick/Makefile
   charpick/src/Makefile
 
diff --git a/gnome-applets/Makefile.am b/gnome-applets/Makefile.am
index da0f21187..8971c4654 100644
--- a/gnome-applets/Makefile.am
+++ b/gnome-applets/Makefile.am
@@ -1,6 +1,7 @@
 NULL =
 
 SUBDIRS = \
+       brightness \
        timer \
        trash \
        window-picker \
@@ -26,6 +27,7 @@ org_gnome_gnome_applets_la_SOURCES = \
        $(NULL)
 
 org_gnome_gnome_applets_la_LIBADD = \
+       $(top_builddir)/gnome-applets/brightness/libbrightness-applet.la \
        $(top_builddir)/gnome-applets/timer/libtimer-applet.la \
        $(top_builddir)/gnome-applets/trash/libtrash-applet.la \
        $(top_builddir)/gnome-applets/window-picker/libwindow-picker-applet.la \
diff --git a/brightness/src/Makefile.am b/gnome-applets/brightness/Makefile.am
similarity index 81%
rename from brightness/src/Makefile.am
rename to gnome-applets/brightness/Makefile.am
index 56bcd3a55..24d3f8565 100644
--- a/brightness/src/Makefile.am
+++ b/gnome-applets/brightness/Makefile.am
@@ -1,40 +1,39 @@
 NULL =
 
-uidir   = $(pkgdatadir)/ui
+uidir = $(pkgdatadir)/ui
+ui_DATA = brightness-applet-menu.xml
 
-brightness_applet_libdir = $(pkglibdir)
-brightness_applet_lib_LTLIBRARIES = libbrightness-applet.la
+noinst_LTLIBRARIES = libbrightness-applet.la
 
 libbrightness_applet_la_CPPFLAGS = \
        -I. \
        -I$(srcdir) \
        -DBRIGHTNESS_MENU_UI_DIR=\""$(uidir)"\" \
-       -DGNOMELOCALEDIR=\""$(localedir)"\" \
        -DPKG_DATA_DIR=\""$(pkgdatadir)"\" \
        -DG_LOG_DOMAIN=\"org.gnome.gnome-applets.brightness\" \
        -DG_LOG_USE_STRUCTURED=1 \
        $(NULL)
 
 libbrightness_applet_la_CFLAGS = \
-       $(GNOME_APPLETS_CFLAGS) \
+       $(GNOME_PANEL_CFLAGS) \
        $(GIO_UNIX_CFLAGS) \
        $(WARN_CFLAGS) \
        $(AM_CFLAGS) \
        $(NULL)
 
 libbrightness_applet_la_SOURCES = \
-       $(BUILT_SOURCES) \
        brightness-applet.c \
+       brightness-applet.h \
+       $(BUILT_SOURCES) \
        $(NULL)
 
 libbrightness_applet_la_LDFLAGS = \
-       -avoid-version \
        $(WARN_LDFLAGS) \
        $(AM_LDFLAGS) \
        $(NULL)
 
 libbrightness_applet_la_LIBADD = \
-       $(GNOME_APPLETS_LIBS) \
+       $(GNOME_PANEL_LIBS) \
        $(GIO_UNIX_LIBS) \
        $(NULL)
 
@@ -57,6 +56,7 @@ CLEANFILES = \
 
 EXTRA_DIST = \
        org.gnome.SettingsDaemon.Power.Screen.xml \
+       $(ui_DATA) \
        $(NULL)
 
 -include $(top_srcdir)/git.mk
diff --git a/gnome-applets/brightness/brightness-applet-menu.xml 
b/gnome-applets/brightness/brightness-applet-menu.xml
new file mode 100644
index 000000000..f27d8e2f6
--- /dev/null
+++ b/gnome-applets/brightness/brightness-applet-menu.xml
@@ -0,0 +1,10 @@
+<interface>
+  <menu id="brightness-menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_About</attribute>
+        <attribute name="action">brightness.about</attribute>
+      </item>
+    </section>
+  </menu>
+</interface>
diff --git a/brightness/src/brightness-applet.c b/gnome-applets/brightness/brightness-applet.c
similarity index 82%
rename from brightness/src/brightness-applet.c
rename to gnome-applets/brightness/brightness-applet.c
index 5970a9420..1c41f6311 100644
--- a/brightness/src/brightness-applet.c
+++ b/gnome-applets/brightness/brightness-applet.c
@@ -1,5 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
+/*
  * Brightness Applet
  * Copyright (C) 2006 Benjamin Canou <bookeldor gmail com>
  * Copyright (C) 2007 Richard Hughes <richard hughsie com>
@@ -21,14 +20,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "config.h"
+#include "brightness-applet.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <panel-applet.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <gdk/gdkkeysyms.h>
@@ -36,15 +33,9 @@
 
 #include "dbus-brightness.h"
 
-#define GPM_TYPE_BRIGHTNESS_APPLET             (gpm_brightness_applet_get_type ())
-#define GPM_BRIGHTNESS_APPLET(o)               (G_TYPE_CHECK_INSTANCE_CAST ((o), GPM_TYPE_BRIGHTNESS_APPLET, 
GpmBrightnessApplet))
-#define GPM_BRIGHTNESS_APPLET_CLASS(k)         (G_TYPE_CHECK_CLASS_CAST((k), GPM_TYPE_BRIGHTNESS_APPLET, 
GpmBrightnessAppletClass))
-#define GPM_IS_BRIGHTNESS_APPLET(o)            (G_TYPE_CHECK_INSTANCE_TYPE ((o), GPM_TYPE_BRIGHTNESS_APPLET))
-#define GPM_IS_BRIGHTNESS_APPLET_CLASS(k)      (G_TYPE_CHECK_CLASS_TYPE ((k), GPM_TYPE_BRIGHTNESS_APPLET))
-#define GPM_BRIGHTNESS_APPLET_GET_CLASS(o)     (G_TYPE_INSTANCE_GET_CLASS ((o), GPM_TYPE_BRIGHTNESS_APPLET, 
GpmBrightnessAppletClass))
-
-typedef struct{
-       PanelApplet parent;
+struct _GpmBrightnessApplet
+{
+       GpApplet parent;
        /* applet state */
        gboolean popped; /* the popup is shown */
        /* the popup and its widgets */
@@ -55,44 +46,21 @@ typedef struct{
        DBusSettingsDaemonPowerScreen *proxy;
        guint bus_watch_id;
        gint level;
-} GpmBrightnessApplet;
-
-typedef struct{
-       PanelAppletClass        parent_class;
-} GpmBrightnessAppletClass;
-
-GType                gpm_brightness_applet_get_type  (void);
+};
 
 #define GSD_DBUS_SERVICE       "org.gnome.SettingsDaemon.Power"
 #define GSD_DBUS_PATH_POWER    "/org/gnome/SettingsDaemon/Power"
 
-G_DEFINE_TYPE (GpmBrightnessApplet, gpm_brightness_applet, PANEL_TYPE_APPLET)
+G_DEFINE_TYPE (GpmBrightnessApplet, gpm_brightness_applet, GP_TYPE_APPLET)
 
-static void      gpm_applet_update_icon           (GpmBrightnessApplet *applet);
-static void      gpm_applet_size_allocate_cb      (GtkWidget *widget, GdkRectangle *allocation);
-static gboolean  gpm_applet_destroy_popup_cb      (GpmBrightnessApplet *applet);
 static void      gpm_applet_update_tooltip        (GpmBrightnessApplet *applet);
-static void      gpm_applet_update_popup_level    (GpmBrightnessApplet *applet);
-static gboolean  gpm_applet_plus_cb               (GtkWidget *w, GpmBrightnessApplet *applet);
-static gboolean  gpm_applet_minus_cb              (GtkWidget *w, GpmBrightnessApplet *applet);
-static gboolean  gpm_applet_key_press_cb          (GtkWidget *popup, GdkEventKey *event, GpmBrightnessApplet 
*applet);
-static gboolean  gpm_applet_scroll_cb             (GpmBrightnessApplet *applet, GdkEventScroll *event);
-static gboolean  gpm_applet_slide_cb              (GtkWidget *w, GpmBrightnessApplet *applet);
-static void      gpm_applet_create_popup          (GpmBrightnessApplet *applet);
-static gboolean  gpm_applet_popup_cb              (GpmBrightnessApplet *applet, GdkEventButton *event);
-static void      gpm_applet_dialog_about_cb       (GSimpleAction *action, GVariant *parameter, gpointer 
data);
-static void      gpm_applet_destroy_cb            (GtkWidget *widget);
-
-#define GPM_BRIGHTNESS_APPLET_ID               "BrightnessApplet"
-#define GPM_BRIGHTNESS_APPLET_FACTORY_ID       "BrightnessAppletFactory"
+
 #define GPM_BRIGHTNESS_APPLET_ICON             "gnome-brightness-applet"
 #define GPM_BRIGHTNESS_APPLET_ICON_BRIGHTNESS  "gpm-brightness-lcd"
 #define GPM_BRIGHTNESS_APPLET_ICON_DISABLED    "gpm-brightness-lcd-disabled"
 #define GPM_BRIGHTNESS_APPLET_ICON_INVALID     "gpm-brightness-lcd-invalid"
 #define GPM_BRIGHTNESS_APPLET_NAME             _("Brightness Applet")
 #define GPM_BRIGHTNESS_APPLET_DESC             _("Adjusts laptop panel brightness.")
-#define PANEL_APPLET_VERTICAL(p)                                       \
-        (((p) == PANEL_APPLET_ORIENT_LEFT) || ((p) == PANEL_APPLET_ORIENT_RIGHT))
 
 /**
  * gpm_applet_get_brightness:
@@ -149,14 +117,12 @@ gpm_applet_size_allocate_cb (GtkWidget    *widget,
        GpmBrightnessApplet *applet = GPM_BRIGHTNESS_APPLET (widget);
        int               size = NULL;
 
-       switch (panel_applet_get_orient (PANEL_APPLET (applet))) {
-               case PANEL_APPLET_ORIENT_LEFT:
-               case PANEL_APPLET_ORIENT_RIGHT:
+       switch (gp_applet_get_orientation (GP_APPLET (applet))) {
+               case GTK_ORIENTATION_VERTICAL:
                        size = allocation->width;
                        break;
 
-               case PANEL_APPLET_ORIENT_UP:
-               case PANEL_APPLET_ORIENT_DOWN:
+               case GTK_ORIENTATION_HORIZONTAL:
                        size = allocation->height;
                        break;
        }
@@ -183,7 +149,7 @@ gpm_applet_size_allocate_cb (GtkWidget    *widget,
  *
  * destroys the popup (called if orientation has changed)
  **/
-static gboolean
+static void
 gpm_applet_destroy_popup_cb (GpmBrightnessApplet *applet)
 {
        if (applet->popup != NULL) {
@@ -192,7 +158,14 @@ gpm_applet_destroy_popup_cb (GpmBrightnessApplet *applet)
                applet->popped = FALSE;
                gpm_applet_update_tooltip (applet);
        }
-       return TRUE;
+}
+
+static void
+placement_changed_cb (GpApplet            *applet,
+                      GtkPositionType      position,
+                      GpmBrightnessApplet *self)
+{
+  gpm_applet_destroy_popup_cb (self);
 }
 
 /**
@@ -464,12 +437,12 @@ static void
 gpm_applet_create_popup (GpmBrightnessApplet *applet)
 {
        static GtkWidget *box, *frame;
-       gint orientation = panel_applet_get_orient (PANEL_APPLET (PANEL_APPLET (applet)));
+       GtkOrientation orientation = gp_applet_get_orientation (GP_APPLET (applet));
 
        gpm_applet_destroy_popup_cb (applet);
 
        /* slider */
-       if (PANEL_APPLET_VERTICAL(orientation)) {
+       if (orientation == GTK_ORIENTATION_VERTICAL) {
                applet->slider = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, 100, 1);
                gtk_widget_set_size_request (applet->slider, 100, -1);
        } else {
@@ -494,7 +467,7 @@ gpm_applet_create_popup (GpmBrightnessApplet *applet)
        g_signal_connect (G_OBJECT(applet->btn_plus), "pressed", G_CALLBACK(gpm_applet_plus_cb), applet);
 
        /* box */
-       if (PANEL_APPLET_VERTICAL(orientation)) {
+       if (orientation == GTK_ORIENTATION_VERTICAL) {
                box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
        } else {
                box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 1);
@@ -531,7 +504,8 @@ static gboolean
 gpm_applet_popup_cb (GpmBrightnessApplet *applet, GdkEventButton *event)
 {
        GtkAllocation allocation, popup_allocation;
-       gint orientation, x, y;
+       GtkPositionType position;
+       gint x, y;
        GdkWindow *window;
        GdkDisplay *display;
        GdkDeviceManager *device_manager;
@@ -570,29 +544,29 @@ gpm_applet_popup_cb (GpmBrightnessApplet *applet, GdkEventButton *event)
        gtk_widget_show_all (applet->popup);
 
        /* retrieve geometry parameters and move window appropriately */
-       orientation = panel_applet_get_orient (PANEL_APPLET (PANEL_APPLET (applet)));
+       position = gp_applet_get_position (GP_APPLET (applet));
        gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET(applet)), &x, &y);
 
        gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation);
        gtk_widget_get_allocation (GTK_WIDGET (applet->popup), &popup_allocation);
-       switch (orientation) {
-       case PANEL_APPLET_ORIENT_DOWN:
+       switch (position) {
+       case GTK_POS_TOP:
                x += allocation.x + allocation.width/2;
                y += allocation.y + allocation.height;
                x -= popup_allocation.width/2;
                break;
-       case PANEL_APPLET_ORIENT_UP:
+       case GTK_POS_BOTTOM:
                x += allocation.x + allocation.width/2;
                y += allocation.y;
                x -= popup_allocation.width/2;
                y -= popup_allocation.height;
                break;
-       case PANEL_APPLET_ORIENT_RIGHT:
+       case GTK_POS_LEFT:
                y += allocation.y + allocation.height/2;
                x += allocation.x + allocation.width;
                y -= popup_allocation.height/2;
                break;
-       case PANEL_APPLET_ORIENT_LEFT:
+       case GTK_POS_RIGHT:
                y += allocation.y + allocation.height/2;
                x += allocation.x;
                x -= popup_allocation.width;
@@ -682,6 +656,12 @@ gpm_applet_dialog_about_cb (GSimpleAction *action, GVariant *parameter, gpointer
        g_object_unref (logo);
 }
 
+static const GActionEntry menu_actions [] =
+{
+       { "about", gpm_applet_dialog_about_cb, NULL, NULL, NULL },
+       { NULL }
+};
+
 /**
  * gpm_applet_destroy_cb:
  * @widget: Class instance to destroy
@@ -790,6 +770,8 @@ gpm_brightness_applet_name_vanished_cb (GDBusConnection *connection, const gchar
 static void
 gpm_brightness_applet_init (GpmBrightnessApplet *applet)
 {
+       gchar *ui_path;
+
        /* initialize fields */
        applet->popped = FALSE;
        applet->popup = NULL;
@@ -811,11 +793,16 @@ gpm_brightness_applet_init (GpmBrightnessApplet *applet)
                                  applet, NULL);
 
        /* prepare */
-       panel_applet_set_flags (PANEL_APPLET (applet), PANEL_APPLET_EXPAND_MINOR);
+       gp_applet_set_flags (GP_APPLET (applet), GP_APPLET_FLAGS_EXPAND_MINOR);
        gtk_widget_set_events (GTK_WIDGET (applet), GDK_SCROLL_MASK);
        applet->image = gtk_image_new();
        gtk_container_add (GTK_CONTAINER (applet), applet->image);
 
+       /* menu */
+       ui_path = g_build_filename (BRIGHTNESS_MENU_UI_DIR, "brightness-applet-menu.xml", NULL);
+       gp_applet_setup_menu_from_file (GP_APPLET (applet), ui_path, menu_actions);
+       g_free (ui_path);
+
        /* show */
        gtk_widget_show_all (GTK_WIDGET(applet));
 
@@ -826,8 +813,8 @@ gpm_brightness_applet_init (GpmBrightnessApplet *applet)
        g_signal_connect (G_OBJECT(applet), "scroll-event",
                          G_CALLBACK(gpm_applet_scroll_cb), NULL);
 
-       g_signal_connect (G_OBJECT(applet), "change-orient",
-                         G_CALLBACK(gpm_applet_destroy_popup_cb), NULL);
+       g_signal_connect (G_OBJECT(applet), "placement-changed",
+                         G_CALLBACK(placement_changed_cb), applet);
 
        g_signal_connect (G_OBJECT(applet), "size-allocate",
                          G_CALLBACK(gpm_applet_size_allocate_cb), NULL);
@@ -835,50 +822,3 @@ gpm_brightness_applet_init (GpmBrightnessApplet *applet)
        g_signal_connect (G_OBJECT(applet), "destroy",
                          G_CALLBACK(gpm_applet_destroy_cb), NULL);
 }
-
-/**
- * gpm_applet_cb:
- * @_applet: GpmBrightnessApplet instance created by the applet factory
- * @iid: Applet id
- *
- * the function called by libpanel-applet factory after creation
- **/
-static gboolean
-gpm_applet_cb (PanelApplet *_applet, const gchar *iid, gpointer data)
-{
-       GpmBrightnessApplet *applet = GPM_BRIGHTNESS_APPLET(_applet);
-       GSimpleActionGroup *action_group;
-       gchar *ui_path;
-
-       static const GActionEntry menu_actions [] = {
-               { "about", gpm_applet_dialog_about_cb, NULL, NULL, NULL },
-       };
-
-       if (strcmp (iid, GPM_BRIGHTNESS_APPLET_ID) != 0) {
-               return FALSE;
-       }
-
-       action_group = g_simple_action_group_new ();
-       g_action_map_add_action_entries (G_ACTION_MAP (action_group),
-                                        menu_actions,
-                                        G_N_ELEMENTS (menu_actions),
-                                        applet);
-       ui_path = g_build_filename (BRIGHTNESS_MENU_UI_DIR, "brightness-applet-menu.xml", NULL);
-       panel_applet_setup_menu_from_file (PANEL_APPLET (applet), ui_path, action_group, GETTEXT_PACKAGE);
-       g_free (ui_path);
-
-       gtk_widget_insert_action_group (GTK_WIDGET (applet), "brightness",
-                                       G_ACTION_GROUP (action_group));
-
-       g_object_unref (action_group);
-
-       return TRUE;
-}
-
-/**
- * this generates a main with a applet factory
- **/
-PANEL_APPLET_IN_PROCESS_FACTORY (GPM_BRIGHTNESS_APPLET_FACTORY_ID,
-                                 GPM_TYPE_BRIGHTNESS_APPLET,
-                                 gpm_applet_cb,
-                                 NULL);
diff --git a/gnome-applets/brightness/brightness-applet.h b/gnome-applets/brightness/brightness-applet.h
new file mode 100644
index 000000000..358c92f1a
--- /dev/null
+++ b/gnome-applets/brightness/brightness-applet.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 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 2 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 BRIGHTNESS_APPLET_H
+#define BRIGHTNESS_APPLET_H
+
+#include <libgnome-panel/gp-applet.h>
+
+G_BEGIN_DECLS
+
+#define GPM_TYPE_BRIGHTNESS_APPLET (gpm_brightness_applet_get_type ())
+G_DECLARE_FINAL_TYPE (GpmBrightnessApplet, gpm_brightness_applet,
+                      GPM, BRIGHTNESS_APPLET, GpApplet)
+
+G_END_DECLS
+
+#endif
diff --git a/brightness/src/org.gnome.SettingsDaemon.Power.Screen.xml 
b/gnome-applets/brightness/org.gnome.SettingsDaemon.Power.Screen.xml
similarity index 100%
rename from brightness/src/org.gnome.SettingsDaemon.Power.Screen.xml
rename to gnome-applets/brightness/org.gnome.SettingsDaemon.Power.Screen.xml
diff --git a/gnome-applets/ga-module.c b/gnome-applets/ga-module.c
index 75e8567ef..099fae5d4 100644
--- a/gnome-applets/ga-module.c
+++ b/gnome-applets/ga-module.c
@@ -21,6 +21,7 @@
 #include <glib/gi18n-lib.h>
 #include <libgnome-panel/gp-module.h>
 
+#include "brightness/brightness-applet.h"
 #include "timer/timer-applet.h"
 #include "trash/trash-applet.h"
 #include "window-picker/wp-applet.h"
@@ -34,7 +35,14 @@ ga_get_applet_info (const char *id)
   const char *icon_name;
   GpAppletInfo *info;
 
-  if (g_strcmp0 (id, "timer") == 0)
+  if (g_strcmp0 (id, "brightness") == 0)
+    {
+      type_func = gpm_brightness_applet_get_type;
+      name = _("Brightness Applet");
+      description = _("Adjusts Laptop panel brightness");
+      icon_name = "gnome-brightness-applet";
+    }
+  else if (g_strcmp0 (id, "timer") == 0)
     {
       type_func = timer_applet_get_type;
       name = _("Timer");
@@ -69,7 +77,9 @@ ga_get_applet_info (const char *id)
 static const char *
 ga_get_applet_id_from_iid (const char *iid)
 {
-  if (g_strcmp0 (iid, "TimerAppletFactory::TimerApplet") == 0)
+  if (g_strcmp0 (iid, "BrightnessAppletFactory::BrightnessApplet") == 0)
+    return "brightness";
+  else if (g_strcmp0 (iid, "TimerAppletFactory::TimerApplet") == 0)
     return "timer";
   else if (g_strcmp0 (iid, "WindowPickerFactory::WindowPicker") == 0 ||
            g_strcmp0 (iid, "org.gnome.gnome-applets.window-picker::window-picker") == 0)
@@ -93,6 +103,7 @@ gp_module_load (GpModule *module)
   gp_module_set_version (module, PACKAGE_VERSION);
 
   gp_module_set_applet_ids (module,
+                            "brightness",
                             "timer",
                             "trash",
                             "window-picker",
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c94d9b0a0..10f0ce978 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -10,9 +10,6 @@ accessx-status/src/applet.c
 [type: gettext/ini]battstat/org.gnome.applets.BattstatApplet.panel-applet.in.in
 battstat/src/battstat_applet.c
 battstat/src/properties.c
-[type: gettext/glade]brightness/brightness-applet-menu.xml
-[type: gettext/ini]brightness/org.gnome.BrightnessApplet.panel-applet.in.in
-brightness/src/brightness-applet.c
 [type: gettext/glade]charpick/charpick-applet-menu.xml
 [type: gettext/ini]charpick/org.gnome.applets.CharpickerApplet.panel-applet.in.in
 charpick/src/charpick.c
@@ -48,6 +45,8 @@ drivemount/src/drivemount.c
 [type: gettext/ini]geyes/org.gnome.applets.GeyesApplet.panel-applet.in.in
 geyes/src/geyes.c
 geyes/src/themes.c
+[type: gettext/glade]gnome-applets/brightness/brightness-applet-menu.xml
+gnome-applets/brightness/brightness-applet.c
 gnome-applets/ga-module.c
 gnome-applets/timer/timer-applet.c
 gnome-applets/trash/trash-applet.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index a2176a6da..82224d480 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -5,7 +5,6 @@
 #
 accessx-status/org.gnome.applets.AccessxStatusApplet.panel-applet.in
 battstat/org.gnome.applets.BattstatApplet.panel-applet.in
-brightness/org.gnome.BrightnessApplet.panel-applet.in
 charpick/org.gnome.applets.CharpickerApplet.panel-applet.in
 command/org.gnome.applets.CommandApplet.panel-applet.in
 cpufreq/org.gnome.applets.CPUFreqApplet.panel-applet.in


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]