[drwright] Add control centre panel



commit f7ea215edfad2e14eff985ad89fd80c320710fd2
Author: Christian Persch <chpe gnome org>
Date:   Thu Nov 18 22:28:12 2010 +0100

    Add control centre panel

 configure.in                                       |   34 ++-
 po/POTFILES.in                                     |    4 +-
 src/Makefile.am                                    |   54 ++++-
 src/drw-cc-module.c                                |   40 +++
 src/drw-cc-panel.c                                 |  153 +++++++++++
 src/drw-cc-panel.h                                 |   72 ++++++
 src/drwright-panel.glade                           |  270 ++++++++++++++++++++
 src/drwright.c                                     |    3 +-
 src/gnome-typing-break-panel.desktop.in.in         |   14 +
 ...tings-daemon.plugins.TypingBreak.gschema.xml.in |    2 +
 10 files changed, 629 insertions(+), 17 deletions(-)
---
diff --git a/configure.in b/configure.in
index 4f54e62..2d88657 100644
--- a/configure.in
+++ b/configure.in
@@ -34,6 +34,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_HEADER_STDC
 AM_PROG_LIBTOOL
+PKG_PROG_PKG_CONFIG
 
 # ************
 # Requirements
@@ -44,6 +45,7 @@ GIO_REQUIRED=2.26.0
 GTK_REQUIRED=2.91.0
 LIBCANBERRA_REQUIRED=0
 GSD_REQUIRED=2.91.0
+GNOMECC_REQUIRED=2.91.0
 
 # ************
 # Typing Break
@@ -72,9 +74,9 @@ AC_CHECK_FUNC(XScreenSaverQueryInfo, [], [
   LIBS=$save_LIBS])
 AC_SUBST(SCREENSAVER_LIBS)
 
-# **********
-# GSD plugin
-# **********
+# **********************
+# Settings daemon plugin
+# **********************
 
 PKG_CHECK_MODULES([GSD_PLUGIN],[
   gnome-settings-daemon >= $GSD_REQUIRED
@@ -88,14 +90,27 @@ AC_SUBST([gsd_plugindir])
 GSD_INTLTOOL_PLUGIN_RULE='%.gnome-settings-plugin:   %.gnome-settings-plugin.in   $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
 AC_SUBST([GSD_INTLTOOL_PLUGIN_RULE])
 
-GSD_PLUGIN_LDFLAGS="-export_dynamic -module -avoid-version -no-undefined"
-case $host_os in
-  darwin*)
-    GSD_PLUGIN_LDFLAGS="${GSD_PLUGIN_LDFLAGS} -Wl,-bundle_loader,\$(top_builddir)/gnome-settings-daemon/gnome-settings-daemon"
-    ;;
-esac
+GSD_PLUGIN_LDFLAGS="-export_dynamic -module -avoid-version -no-undefined -export-symbols-regex '^register_gnome_settings_plugin'"
 AC_SUBST([GSD_PLUGIN_LDFLAGS])
 
+# ********************
+# Control centre panel
+# ********************
+
+PKG_CHECK_MODULES([CCPANEL],[
+  libgnome-control-center >= $GNOMECC_REQUIRED])
+
+ccpanelsdir=`$PKG_CONFIG --variable=extensiondir libgnome-control-center`
+AC_SUBST([ccpanelsdir])
+
+CCPANEL_LDFLAGS="-export_dynamic -avoid-version -module -no-undefined -export-symbols-regex '^g_io_module_(load|unload)'"
+AC_SUBST([CCPANEL_LDFLAGS])
+
+AC_PATH_PROG([GTK_BUILDER_CONVERT],[gtk-builder-convert-3.0],[false])
+if test "$GTK_BUILDER_CONVERT" = "false"; then
+  AC_MSG_ERROR([gtk-builder-convert-3.0 not found])
+fi
+
 # *********
 # GSettings
 # *********
@@ -136,6 +151,7 @@ IT_PROG_INTLTOOL([0.35.0])
 AC_CONFIG_FILES([
 Makefile
 src/Makefile
+src/gnome-typing-break-panel.desktop.in:src/gnome-typing-break-panel.desktop.in.in
 po/Makefile.in
 ])
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 71e0d17..50d5b2d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,8 @@
+[encoding: UTF-8]
 src/main.c
 src/drwright.c
 src/drw-break-window.c
 src/drw-monitor.c
 src/org.gnome.settings-daemon.plugins.TypingBreak.gschema.xml.in
-
+src/gnome-typing-break-panel.desktop.in.in
+[type: gettext/glade]src/drwright-panel.glade
diff --git a/src/Makefile.am b/src/Makefile.am
index ae94d93..a5a04be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,12 +22,15 @@ gnome_typing_monitor_SOURCES =			\
 gnome_typing_monitor_CPPFLAGS = \
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\""	\
 	-DIMAGEDIR=\"$(pkgdatadir)/pixmaps\"		\
+	-DBINDIR="\"$(bindir)\""			\
 	$(AM_CPPFLAGS)
 gnome_typing_monitor_CFLAGS = \
 	$(TYPING_CFLAGS)	\
 	$(AM_CFLAGS)
-
-gnome_typing_monitor_LDADD = $(TYPING_LIBS) $(SCREENSAVER_LIBS)
+gnome_typing_monitor_LDADD = \
+	$(TYPING_LIBS)		\
+	$(SCREENSAVER_LIBS)	\
+	$(INTLLIBS)
 
 if HAVE_APP_INDICATOR
   gnome_typing_monitor_CFLAGS += -DHAVE_APP_INDICATOR $(APP_INDICATOR_CFLAGS)
@@ -54,7 +57,6 @@ update-icon-cache:
 		echo "***   $(gtk_update_icon_cache)"; \
 	fi
 
-
 # GSD plugin
 
 gsd_plugin_LTLIBRARIES = \
@@ -84,7 +86,7 @@ libtyping_break_la_LDFLAGS = 		\
 
 libtyping_break_la_LIBADD  = 		\
 	$(GSD_PLUGIN_LIBS)	\
-	$(NULL)
+	$(INTLLIBS)
 
 gsd_plugin_in_files = 		\
 	typing-break.gnome-settings-plugin.in	\
@@ -94,6 +96,41 @@ gsd_plugin_DATA = $(gsd_plugin_in_files:.gnome-settings-plugin.in=.gnome-setting
 
 @GSD_INTLTOOL_PLUGIN_RULE@
 
+# Control Centre panel
+
+ccpanels_LTLIBRARIES = libdrwrightccp.la
+
+libdrwrightccp_la_SOURCES = \
+	drw-cc-module.c	\
+	drw-cc-panel.c	\
+	drw-cc-panel.h	\
+	$(NULL)
+libdrwrightccp_la_CPPFLAGS = \
+        -DLOCALEDIR="\"$(datadir)/locale\""	\
+	-DBUILDERDIR="\"$(builderdir)\""	\
+	$(AM_CPPFLAGS)
+libdrwrightccp_la_CFLAGS = \
+	$(CCPANEL_CFLAGS)	\
+	$(AM_CFLAGS)
+libdrwrightccp_la_LIBADD = \
+	$(CCPANEL_LIBS)	\
+	$(INTLLIBS)
+libdrwrightccp_la_LDFLAGS = \
+	$(CCPANEL_LDFLAGS)
+
+builderdir = $(pkgdatadir)
+builder_in_files = drwright-panel.glade
+builder_DATA = $(builder_in_files:.glade=.ui)
+
+desktopdir = $(datadir)/applications
+desktop_in_files = gnome-typing-break-panel.desktop.in
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
+%.ui: %.glade
+	$(AM_V_GEN) $(GTK_BUILDER_CONVERT) $< $@ >/dev/null
+
+ INTLTOOL_DESKTOP_RULE@
+
 # GSettings
 
 gsettings_schemas_in_files = org.gnome-settings-daemon.plugins.TypingBreak.gschema.xml.in
@@ -108,19 +145,24 @@ dist_gsettings_convert_DATA = drwright.convert
 # Clean
 
 EXTRA_DIST = 			\
+	$(builder_in_files)	\
 	$(gsd_plugin_in_files)	\
 	$(gsettings_schemas_in_files) 	\
 	$(NULL)
 
 CLEANFILES = 			\
-	$(gsd_plugin_DATA)	\
+	$(builder_DATA)		\
+	$(desktop_DATA)		\
 	$(gsettings_SCHEMAS)	\
+	$(gsd_plugin_DATA)	\
 	$(NULL)
 
 DISTCLEANFILES =		\
+	$(builder_DATA)		\
+	$(desktop_DATA)		\
 	$(gsd_plugin_DATA)	\
 	$(NULL)
 
 # includes
- 
+
 -include $(top_srcdir)/git.mk
diff --git a/src/drw-cc-module.c b/src/drw-cc-module.c
new file mode 100644
index 0000000..dd53938
--- /dev/null
+++ b/src/drw-cc-module.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Thomas Wood <thomas wood intel com>
+ */
+
+#include <config.h>
+
+#include "drw-cc-panel.h"
+
+#include <glib/gi18n-lib.h>
+
+void
+g_io_module_load (GIOModule *module)
+{
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+
+  /* register the panel */
+  drw_cc_panel_register (module);
+}
+
+void
+g_io_module_unload (GIOModule *module)
+{
+}
diff --git a/src/drw-cc-panel.c b/src/drw-cc-panel.c
new file mode 100644
index 0000000..f39edb5
--- /dev/null
+++ b/src/drw-cc-panel.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2010 Intel, Inc
+ * Copyright © 2010 Christian Persch
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Thomas Wood <thomas wood intel com>
+ *         Christian Persch <chpe gnome org>
+ */
+
+#include <config.h>
+
+#include "drw-cc-panel.h"
+
+#define DRW_SETTINGS_SCHEMA_ID "org.gnome.settings-daemon.plugins.TypingBreak"
+
+G_DEFINE_DYNAMIC_TYPE (DrwCcPanel, drw_cc_panel, CC_TYPE_PANEL)
+
+#if 0
+#define DRW_PANEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DRW_TYPE_CC_PANEL, DrwCcPanelPrivate))
+
+struct _DrwCcPanelPrivate
+{
+  gpointer dummy;
+};
+#endif
+
+static void
+drw_cc_panel_get_property (GObject    *object,
+                               guint       property_id,
+                               GValue     *value,
+                               GParamSpec *pspec)
+{
+  switch (property_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+drw_cc_panel_set_property (GObject      *object,
+                               guint         property_id,
+                               const GValue *value,
+                               GParamSpec   *pspec)
+{
+  switch (property_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+    }
+}
+
+static void
+drw_cc_panel_dispose (GObject *object)
+{
+  G_OBJECT_CLASS (drw_cc_panel_parent_class)->dispose (object);
+}
+
+static void
+drw_cc_panel_finalize (GObject *object)
+{
+  G_OBJECT_CLASS (drw_cc_panel_parent_class)->finalize (object);
+}
+
+static void
+drw_cc_panel_class_init (DrwCcPanelClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  /* g_type_class_add_private (klass, sizeof (DrwCcPanelPrivate)); */
+
+  object_class->get_property = drw_cc_panel_get_property;
+  object_class->set_property = drw_cc_panel_set_property;
+  object_class->dispose = drw_cc_panel_dispose;
+  object_class->finalize = drw_cc_panel_finalize;
+}
+
+static void
+drw_cc_panel_class_finalize (DrwCcPanelClass *klass)
+{
+}
+
+static void
+drw_cc_panel_init (DrwCcPanel *self)
+{
+  GtkBuilder *builder;
+  GError *error = NULL;
+  GtkWidget *widget;
+  GSettings *settings;
+
+  /* priv = self->priv = DRW_CC_PANEL_GET_PRIVATE (self); */
+
+  builder = gtk_builder_new ();
+  gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
+
+  if (!gtk_builder_add_from_file (builder, BUILDERDIR "/drwright-panel.ui", &error))
+    g_error ("%s", error->message);
+
+  widget = (GtkWidget *) gtk_builder_get_object (builder, "typing-break-preferences-box");
+  gtk_widget_reparent (widget, GTK_WIDGET (self));
+
+  widget = (GtkWidget *) gtk_builder_get_object (builder, "toplevel");
+  gtk_widget_destroy (widget);
+
+  /* Now connect the settings */
+  settings = g_settings_new (DRW_SETTINGS_SCHEMA_ID);
+
+  g_settings_bind (settings, "enabled",
+                   gtk_builder_get_object (builder, "break-enabled-checkbutton"),
+                   "active",
+                   G_SETTINGS_BIND_DEFAULT);
+  g_settings_bind (settings, "enabled",
+                   gtk_builder_get_object (builder, "inner-box"),
+                   "sensitive",
+                   G_SETTINGS_BIND_GET);
+  g_settings_bind (settings, "type-time",
+                   gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "work-interval-spinbutton"))),
+                   "value",
+                   G_SETTINGS_BIND_DEFAULT);
+  g_settings_bind (settings, "break-time",
+                   gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "break-interval-spinbutton"))),
+                   "value",
+                   G_SETTINGS_BIND_DEFAULT);
+  g_settings_bind (settings, "allow-postpone",
+                   gtk_builder_get_object (builder, "allow-postpone-checkbutton"),
+                   "active",
+                   G_SETTINGS_BIND_DEFAULT);
+
+  g_object_unref (settings);
+  g_object_unref (builder);
+}
+
+void
+drw_cc_panel_register (GIOModule *module)
+{
+  drw_cc_panel_register_type (G_TYPE_MODULE (module));
+  g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
+                                  DRW_TYPE_CC_PANEL,
+                                  "typing-break", 0);
+}
diff --git a/src/drw-cc-panel.h b/src/drw-cc-panel.h
new file mode 100644
index 0000000..6ddea93
--- /dev/null
+++ b/src/drw-cc-panel.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Intel, Inc
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Thomas Wood <thomas wood intel com>
+ */
+
+#ifndef DRW_CC_PANEL_H
+#define DRW_CC_PANEL_H
+
+#include <libgnome-control-center/cc-panel.h>
+
+G_BEGIN_DECLS
+
+#define DRW_TYPE_CC_PANEL drw_cc_panel_get_type()
+
+#define DRW_CC_PANEL(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+  DRW_TYPE_CC_PANEL, DrwCcPanel))
+
+#define DRW_CC_PANEL_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+  DRW_TYPE_CC_PANEL, DrwCcPanelClass))
+
+#define DRW_IS_CC_PANEL(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+  DRW_TYPE_CC_PANEL))
+
+#define DRW_IS_CC_PANEL_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+  DRW_TYPE_CC_PANEL))
+
+#define DRW_CC_PANEL_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+  DRW_TYPE_CC_PANEL, DrwCcPanelClass))
+
+typedef struct _DrwCcPanel DrwCcPanel;
+typedef struct _DrwCcPanelClass DrwCcPanelClass;
+typedef struct _DrwCcPanelPrivate DrwCcPanelPrivate;
+
+struct _DrwCcPanel
+{
+  CcPanel parent;
+
+  DrwCcPanelPrivate *priv;
+};
+
+struct _DrwCcPanelClass
+{
+  CcPanelClass parent_class;
+};
+
+GType drw_cc_panel_get_type (void) G_GNUC_CONST;
+
+void  drw_cc_panel_register (GIOModule *module);
+
+G_END_DECLS
+
+#endif /* DRW_CC_PANEL_H */
diff --git a/src/drwright-panel.glade b/src/drwright-panel.glade
new file mode 100644
index 0000000..108452f
--- /dev/null
+++ b/src/drwright-panel.glade
@@ -0,0 +1,270 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>
+
+<glade-interface>
+
+<widget class="GtkWindow" id="typing-break-preferences-dialog">
+  <property name="title">window1</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="typing-break-preferences-box">
+      <property name="border_width">6</property>
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child>
+	<widget class="GtkCheckButton" id="break-enabled-checkbutton">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="label" translatable="yes">_Lock screen to enforce typing break</property>
+	  <property name="use_underline">True</property>
+	  <property name="relief">GTK_RELIEF_NORMAL</property>
+	  <property name="focus_on_click">True</property>
+	  <property name="active">False</property>
+	  <property name="inconsistent">False</property>
+	  <property name="draw_indicator">True</property>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkAlignment" id="alignment1">
+	  <property name="visible">True</property>
+	  <property name="xalign">0.5</property>
+	  <property name="yalign">0.5</property>
+	  <property name="xscale">1</property>
+	  <property name="yscale">1</property>
+	  <property name="top_padding">0</property>
+	  <property name="bottom_padding">0</property>
+	  <property name="left_padding">12</property>
+	  <property name="right_padding">0</property>
+
+	  <child>
+	    <widget class="GtkVBox" id="inner-box">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">6</property>
+
+	      <child>
+		<widget class="GtkTable" id="table33">
+		  <property name="visible">True</property>
+		  <property name="n_rows">2</property>
+		  <property name="n_columns">3</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">6</property>
+		  <property name="column_spacing">12</property>
+
+		  <child>
+		    <widget class="GtkLabel" id="break-interval-label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Break interval lasts:</property>
+		      <property name="use_underline">True</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">break-interval-spinbutton</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="work-minutes-label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">minutes</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">2</property>
+		      <property name="right_attach">3</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="break-minutes-label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">minutes</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">2</property>
+		      <property name="right_attach">3</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="work-interval-label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">_Work interval lasts:</property>
+		      <property name="use_underline">True</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="mnemonic_widget">work-interval-spinbutton</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSpinButton" id="work-interval-spinbutton">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="climb_rate">1</property>
+		      <property name="digits">0</property>
+		      <property name="numeric">False</property>
+		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		      <property name="snap_to_ticks">False</property>
+		      <property name="wrap">False</property>
+		      <property name="adjustment">60 5 120 1 5 5</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkSpinButton" id="break-interval-spinbutton">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="climb_rate">1</property>
+		      <property name="digits">0</property>
+		      <property name="numeric">False</property>
+		      <property name="update_policy">GTK_UPDATE_ALWAYS</property>
+		      <property name="snap_to_ticks">False</property>
+		      <property name="wrap">False</property>
+		      <property name="adjustment">3 1 60 1 2 2</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkCheckButton" id="allow-postpone-checkbutton">
+		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Allow postponing of breaks</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">False</property>
+		  <property name="fill">False</property>
+		</packing>
+	      </child>
+	    </widget>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">True</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
diff --git a/src/drwright.c b/src/drwright.c
index 716a5e2..11c49bb 100644
--- a/src/drwright.c
+++ b/src/drwright.c
@@ -595,11 +595,12 @@ popup_preferences_cb (GtkAction *action, DrWright *dr)
 	GdkScreen *screen;
 	GError    *error = NULL;
 	GtkWidget *menu;
+        char *argv[] = { BINDIR"/gnome-control-center", "typing-break", NULL };
 
 	menu = gtk_ui_manager_get_widget (dr->ui_manager, "/Pop");
 	screen = gtk_widget_get_screen (menu);
 
-	if (!gdk_spawn_command_line_on_screen (screen, "gnome-keyboard-properties --typing-break", &error)) {
+	if (!gdk_spawn_on_screen (screen, "/", argv, NULL, 0, NULL, NULL, NULL, &error)) {
 		GtkWidget *error_dialog;
 
 		error_dialog = gtk_message_dialog_new (NULL, 0,
diff --git a/src/gnome-typing-break-panel.desktop.in.in b/src/gnome-typing-break-panel.desktop.in.in
new file mode 100644
index 0000000..c4cd6e7
--- /dev/null
+++ b/src/gnome-typing-break-panel.desktop.in.in
@@ -0,0 +1,14 @@
+[Desktop Entry]
+_Name=Typing Break Preferences
+_Comment=Typing Break preferences panel
+Exec=gnome-control-center typing-break
+Icon=typing-monitor
+Terminal=false
+Type=Application
+StartupNotify=true
+# The X-GNOME-Settings-Panel is necessary to show in the main shell UI
+Categories=GNOME;GTK;Settings;DesktopSettings;X-GNOME-Settings-Panel;
+OnlyShowIn=GNOME;
+X-GNOME-Settings-Panel=typing-break
+# Translators: those are keywords for the example control-center panel
+_X-GNOME-Keywords=Typing;Break;RSI;Workrave;
diff --git a/src/org.gnome-settings-daemon.plugins.TypingBreak.gschema.xml.in b/src/org.gnome-settings-daemon.plugins.TypingBreak.gschema.xml.in
index 55b3117..eddb872 100644
--- a/src/org.gnome-settings-daemon.plugins.TypingBreak.gschema.xml.in
+++ b/src/org.gnome-settings-daemon.plugins.TypingBreak.gschema.xml.in
@@ -33,10 +33,12 @@
       <_summary>Whether the typing break can be postponed</_summary>
     </key>
     <key name="type-time" type="i">
+      <range min="5" max="120" />
       <default>60</default>
       <_summary>Number of minutes of typing time before break mode starts</_summary>
     </key>
     <key name="break-time" type="i">
+      <range min="1" max="60" />
       <default>3</default>
       <_summary>Number of minutes that the typing break should last</_summary>
     </key>



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