Add skeleton settings applet, in its own binary package
authorAlex Badea <vamposdecampos@gmail.com>
Thu, 17 Jun 2010 19:08:20 +0000 (22:08 +0300)
committerAlex Badea <vamposdecampos@gmail.com>
Thu, 17 Jun 2010 19:08:20 +0000 (22:08 +0300)
autogen.sh
configure.ac
data/Makefile.am
data/espeaktime-cp.desktop [new file with mode: 0644]
debian/control
debian/espeaktime-ui.install [new file with mode: 0644]
src/Makefile.am
src/applet.c [new file with mode: 0644]

index bdebfcb..14f457a 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 cd $(dirname $0)
+libtoolize
 aclocal
 automake -ac
 autoconf
index 57fb79b..d33b1ee 100644 (file)
@@ -3,6 +3,7 @@ AM_INIT_AUTOMAKE
 
 AC_PROG_CC
 AC_PROG_INSTALL
+AC_PROG_LIBTOOL
 AC_HEADER_STDC
 
 PKG_CHECK_MODULES(GLIB, [glib-2.0])
@@ -21,6 +22,14 @@ PKG_CHECK_MODULES(HAL, [hal])
 AC_SUBST(HAL_CFLAGS)
 AC_SUBST(HAL_LIBS)
 
+PKG_CHECK_MODULES(OSSO, libosso >= 1)
+AC_SUBST(OSSO_LIBS)
+AC_SUBST(OSSO_CFLAGS)
+
+PKG_CHECK_MODULES(HILDON, libhildondesktop-1)
+AC_SUBST(HILDON_LIBS)
+AC_SUBST(HILDON_CFLAGS)
+
 AC_OUTPUT([
        Makefile
        src/Makefile
index 6f46a9f..8a1f702 100644 (file)
@@ -1,3 +1,6 @@
 install-data-local: 
        $(INSTALL_DATA) -D $(srcdir)/espeaktime $(DESTDIR)/etc/event.d/espeaktime
 
+controlpaneldir = $(datadir)/applications/hildon-control-panel
+controlpanel_DATA = espeaktime-cp.desktop
+
diff --git a/data/espeaktime-cp.desktop b/data/espeaktime-cp.desktop
new file mode 100644 (file)
index 0000000..6d79bfa
--- /dev/null
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=eSpeakTime
+Type=HildonControlPanelPlugin
+Icon=espeaktime
+X-control-panel-plugin=libespeaktime-cp.so
index c8efdfa..4e6fe75 100644 (file)
@@ -3,7 +3,8 @@ Section: user/multimedia
 Priority: extra
 Maintainer: Alex Badea <vamposdecampos@gmail.com>
 Build-Depends: debhelper (>= 5),
- libglib2.0-dev, libdbus-glib-1-dev, libhal-dev, mce-dev (>= 1.8.10)
+ libglib2.0-dev, libdbus-glib-1-dev, libhal-dev, mce-dev (>= 1.8.10),
+ libgtk2.0-dev, libhildondesktop1-dev, hildon-control-panel-dev, libosso-dev (>= 1)
 Standards-Version: 3.7.2
 
 Package: espeaktime-daemon
@@ -18,3 +19,14 @@ Description: Talking clock based on eSpeak
 XB-Maemo-Display-Name: eSpeakTime
 XSBC-Bugtracker: mailto:vamposdecampos@gmail.com
 
+Package: espeaktime-ui
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Talking clock based on eSpeak (UI)
+ This is a simple talking clock daemon.  Activate it by double-pressing
+ the power button while the display is locked.
+ .
+ This package provides the settings UI.
+XB-Maemo-Display-Name: eSpeakTime UI
+XSBC-Bugtracker: mailto:vamposdecampos@gmail.com
+
diff --git a/debian/espeaktime-ui.install b/debian/espeaktime-ui.install
new file mode 100644 (file)
index 0000000..53f3f76
--- /dev/null
@@ -0,0 +1,2 @@
+usr/lib/hildon-control-panel/*.so
+usr/share/applications/hildon-control-panel/*.desktop
index 86908a2..599f5f3 100644 (file)
@@ -4,3 +4,10 @@ espeaktimed_SOURCES = daemon.c
 espeaktimed_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(MCE_CFLAGS) $(HAL_CFLAGS)
 espeaktimed_LDADD = $(GLIB_LIBS) $(DBUS_LIBS) $(MCE_LIBS) $(HAL_LIBS)
 
+libcpdir = $(libdir)/hildon-control-panel
+libcp_LTLIBRARIES = libespeaktime-cp.la
+libespeaktime_cp_la_SOURCES = applet.c
+libespeaktime_cp_la_CFLAGS = $(HILDON_CFLAGS) $(OSSO_CFLAGS)
+libespeaktime_cp_la_LDFLAGS = -module -avoid-version
+libespeaktime_cp_la_LIBADD = $(HILDON_LIBS)
+
diff --git a/src/applet.c b/src/applet.c
new file mode 100644 (file)
index 0000000..72e47f1
--- /dev/null
@@ -0,0 +1,29 @@
+#include <gtk/gtk.h>
+#include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
+
+osso_return_t execute(osso_context_t *osso, gpointer data, gboolean user_activated)
+{
+       GtkWidget *dialog;
+
+       dialog = gtk_dialog_new_with_buttons(
+               "eSpeakTime Settings",
+               GTK_WINDOW(data),
+               GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR,
+               GTK_STOCK_SAVE,
+               GTK_RESPONSE_OK,
+               GTK_STOCK_CANCEL,
+               GTK_RESPONSE_CANCEL,
+               NULL);
+
+       gtk_widget_show_all(dialog);
+       gtk_dialog_run(GTK_DIALOG(dialog));
+       gtk_widget_destroy(GTK_WIDGET(dialog));
+
+       return OSSO_OK;
+}
+
+osso_return_t save_state(osso_context_t *osso, gpointer data)
+{
+       return OSSO_OK;
+}
+