Send commitlog mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r1272 -
trunk/src/target/OM-2007/applications/openmoko-today/src
([EMAIL PROTECTED])
2. r1273 - trunk/src/target/kernel/patches
([EMAIL PROTECTED])
3. r1274 -
trunk/src/target/OM-2007/applications/openmoko-today/src
([EMAIL PROTECTED])
4. r1275 - in
trunk/src/target/OM-2007/applications/openmoko-today: . src
([EMAIL PROTECTED])
5. r1276 - in trunk/oe/packages/openmoko-pim: . files
([EMAIL PROTECTED])
--- Begin Message ---
Author: thomas
Date: 2007-03-08 13:08:37 +0100 (Thu, 08 Mar 2007)
New Revision: 1272
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/src/Makefile.am
Log:
* Use OpenMoko recommended CFLAGS in openmoko-today
Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/Makefile.am
2007-03-08 11:41:12 UTC (rev 1271)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/Makefile.am
2007-03-08 12:08:37 UTC (rev 1272)
@@ -4,7 +4,7 @@
AM_CPPFLAGS=-DPKGDATADIR=\"$(pkgdatadir)\" \
-DDATADIR=\""$(datadir)"\"
-AM_CFLAGS = -Wall -export-dynamic $(CFLAGS)
+AM_CFLAGS = -Wall -pedantic -std=c99 $(CFLAGS)
bin_PROGRAMS = today
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 14:36:05 +0100 (Thu, 08 Mar 2007)
New Revision: 1273
Modified:
trunk/src/target/kernel/patches/gta01-core.patch
trunk/src/target/kernel/patches/gta01-inputdevice.patch
Log:
* Rename 911 GPIO/IRQ to AUX GPIO/IRQ
* Give interrupts of gta01kbd driver better description
* Add headphone jack switch support to gta01kbd
* Fix input key reporting of gta01kbd (no keybits were set)
Modified: trunk/src/target/kernel/patches/gta01-core.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-core.patch 2007-03-08 12:08:37 UTC
(rev 1272)
+++ trunk/src/target/kernel/patches/gta01-core.patch 2007-03-08 13:36:05 UTC
(rev 1273)
@@ -3,8 +3,8 @@
Index: linux-2.6.20.1/arch/arm/mach-s3c2410/Kconfig
===================================================================
---- linux-2.6.20.1.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-02
18:23:34.000000000 +0100
-+++ linux-2.6.20.1/arch/arm/mach-s3c2410/Kconfig 2007-03-02
18:39:51.000000000 +0100
+--- linux-2.6.20.1.orig/arch/arm/mach-s3c2410/Kconfig 2007-03-08
13:36:44.000000000 +0100
++++ linux-2.6.20.1/arch/arm/mach-s3c2410/Kconfig 2007-03-08
13:37:56.000000000 +0100
@@ -86,6 +86,14 @@
help
Say Y here if you are using the Armzone QT2410
@@ -22,8 +22,8 @@
select CPU_S3C2440
Index: linux-2.6.20.1/arch/arm/mach-s3c2410/Makefile
===================================================================
---- linux-2.6.20.1.orig/arch/arm/mach-s3c2410/Makefile 2007-03-02
18:23:34.000000000 +0100
-+++ linux-2.6.20.1/arch/arm/mach-s3c2410/Makefile 2007-03-02
18:39:51.000000000 +0100
+--- linux-2.6.20.1.orig/arch/arm/mach-s3c2410/Makefile 2007-03-08
13:36:44.000000000 +0100
++++ linux-2.6.20.1/arch/arm/mach-s3c2410/Makefile 2007-03-08
13:36:44.000000000 +0100
@@ -89,5 +89,6 @@
obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
@@ -34,7 +34,7 @@
Index: linux-2.6.20.1/arch/arm/mach-s3c2410/mach-gta01.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-02
18:40:31.000000000 +0100
++++ linux-2.6.20.1/arch/arm/mach-s3c2410/mach-gta01.c 2007-03-08
13:38:24.000000000 +0100
@@ -0,0 +1,506 @@
+/*
+ * linux/arch/arm/mach-s3c2410/mach-gta01.c
@@ -454,8 +454,8 @@
+
+static struct resource gta01_button_resources[] = {
+ [0] = {
-+ .start = GTA01_GPIO_911_KEY,
-+ .end = GTA01_GPIO_911_KEY,
++ .start = GTA01_GPIO_AUX_KEY,
++ .end = GTA01_GPIO_AUX_KEY,
+ },
+ [1] = {
+ .start = GTA01_GPIO_HOLD_KEY,
@@ -545,7 +545,7 @@
Index: linux-2.6.20.1/include/asm-arm/arch-s3c2410/gta01.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20.1/include/asm-arm/arch-s3c2410/gta01.h 2007-03-02
18:39:51.000000000 +0100
++++ linux-2.6.20.1/include/asm-arm/arch-s3c2410/gta01.h 2007-03-08
13:38:38.000000000 +0100
@@ -0,0 +1,60 @@
+#ifndef _GTA01_H
+#define _GTA01_H
@@ -575,13 +575,13 @@
+#define GTA01_GPIO_LCD_RESET S3C2410_GPC6
+#define GTA01_GPIO_JACK_INSERT S3C2410_GPF4
+#define GTA01_GPIO_nSD_DETECT S3C2410_GPF5
-+#define GTA01_GPIO_911_KEY S3C2410_GPF6
++#define GTA01_GPIO_AUX_KEY S3C2410_GPF6
+#define GTA01_GPIO_HOLD_KEY S3C2410_GPF7
+#define GTA01_GPIO_VIBRATOR_ON S3C2410_GPG11
+
+#define GTA01_IRQ_JACK_INSERT IRQ_EINT4
+#define GTA01_IRQ_nSD_DETECT IRQ_EINT5
-+#define GTA01_IRQ_911_KEY IRQ_EINT6
++#define GTA01_IRQ_AUX_KEY IRQ_EINT6
+#define GTA01_IRQ_PCF50606 IRQ_EINT16
+
+/* GTA01v3 */
Modified: trunk/src/target/kernel/patches/gta01-inputdevice.patch
===================================================================
--- trunk/src/target/kernel/patches/gta01-inputdevice.patch 2007-03-08
12:08:37 UTC (rev 1272)
+++ trunk/src/target/kernel/patches/gta01-inputdevice.patch 2007-03-08
13:36:05 UTC (rev 1273)
@@ -1,9 +1,9 @@
This provides support for the GTA01 keyboard
-Index: linux-2.6.20/drivers/input/keyboard/Kconfig
+Index: linux-2.6.20.1/drivers/input/keyboard/Kconfig
===================================================================
---- linux-2.6.20.orig/drivers/input/keyboard/Kconfig 2007-02-20
18:56:10.000000000 +0100
-+++ linux-2.6.20/drivers/input/keyboard/Kconfig 2007-02-20
18:58:03.000000000 +0100
+--- linux-2.6.20.1.orig/drivers/input/keyboard/Kconfig 2007-03-08
13:37:56.000000000 +0100
++++ linux-2.6.20.1/drivers/input/keyboard/Kconfig 2007-03-08
14:03:22.000000000 +0100
@@ -214,4 +214,16 @@
To compile this driver as a module, choose M here: the
module will be called aaed2000_kbd.
@@ -21,10 +21,10 @@
+
+
endif
-Index: linux-2.6.20/drivers/input/keyboard/Makefile
+Index: linux-2.6.20.1/drivers/input/keyboard/Makefile
===================================================================
---- linux-2.6.20.orig/drivers/input/keyboard/Makefile 2007-02-20
18:56:10.000000000 +0100
-+++ linux-2.6.20/drivers/input/keyboard/Makefile 2007-02-20
18:58:03.000000000 +0100
+--- linux-2.6.20.1.orig/drivers/input/keyboard/Makefile 2007-03-08
13:37:56.000000000 +0100
++++ linux-2.6.20.1/drivers/input/keyboard/Makefile 2007-03-08
14:03:22.000000000 +0100
@@ -13,6 +13,7 @@
obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o
obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o
@@ -33,11 +33,11 @@
obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
-Index: linux-2.6.20/drivers/input/keyboard/gta01kbd.c
+Index: linux-2.6.20.1/drivers/input/keyboard/gta01kbd.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.20/drivers/input/keyboard/gta01kbd.c 2007-02-20
19:48:56.000000000 +0100
-@@ -0,0 +1,234 @@
++++ linux-2.6.20.1/drivers/input/keyboard/gta01kbd.c 2007-03-08
14:01:38.000000000 +0100
+@@ -0,0 +1,249 @@
+/*
+ * Keyboard driver for FIC GTA01 (Neo1973) GSM phone
+ *
@@ -69,16 +69,26 @@
+ unsigned long suspend_jiffies;
+};
+
-+static irqreturn_t gta01kbd_interrupt(int irq, void *dev_id)
++static irqreturn_t gta01kbd_aux_irq(int irq, void *dev_id)
+{
+ struct gta01kbd *gta01kbd_data = dev_id;
+
+ /* FIXME: use GPIO from platform_dev resources */
-+ if (s3c2410_gpio_getpin(GTA01_GPIO_911_KEY))
++ if (s3c2410_gpio_getpin(GTA01_GPIO_AUX_KEY))
+ input_report_key(gta01kbd_data->input, KEY_PHONE, 1);
+ else
+ input_report_key(gta01kbd_data->input, KEY_PHONE, 0);
+
++ input_sync(gta01kbd_data->input);
++
++ return IRQ_HANDLED;
++}
++
++static irqreturn_t gta01kbd_hold_irq(int irq, void *dev_id)
++{
++ struct gta01kbd *gta01kbd_data = dev_id;
++
++ /* FIXME: use GPIO from platform_dev resources */
+ if (s3c2410_gpio_getpin(GTA01_GPIO_HOLD_KEY))
+ input_report_key(gta01kbd_data->input, KEY_PAUSE, 1);
+ else
@@ -89,11 +99,24 @@
+ return IRQ_HANDLED;
+}
+
++static irqreturn_t gta01kbd_headphone_irq(int irq, void *dev_id)
++{
++ struct gta01kbd *gta01kbd_data = dev_id;
+
++ /* FIXME: use GPIO from platform_dev resources */
++ if (s3c2410_gpio_getpin(GTA01_GPIO_JACK_INSERT))
++ input_report_switch(gta01kbd_data->input, SW_HEADPHONE_INSERT,
1);
++ else
++ input_report_switch(gta01kbd_data->input, SW_HEADPHONE_INSERT,
0);
++
++ input_sync(gta01kbd_data->input);
++
++ return IRQ_HANDLED;
++}
++
+#ifdef CONFIG_PM
+static int gta01kbd_suspend(struct platform_device *dev, pm_message_t state)
+{
-+ int i;
+ struct gta01kbd *gta01kbd = platform_get_drvdata(dev);
+
+ gta01kbd->suspended = 1;
@@ -103,7 +126,6 @@
+
+static int gta01kbd_resume(struct platform_device *dev)
+{
-+ int i;
+ struct gta01kbd *gta01kbd = platform_get_drvdata(dev);
+
+ gta01kbd->suspended = 0;
@@ -119,7 +141,7 @@
+{
+ struct gta01kbd *gta01kbd;
+ struct input_dev *input_dev;
-+ int irq_911, irq_hold;
++ int irq_aux, irq_hold, irq_jack;
+
+ gta01kbd = kzalloc(sizeof(struct gta01kbd), GFP_KERNEL);
+ input_dev = input_allocate_device();
@@ -132,14 +154,18 @@
+ if (pdev->resource[0].flags != 0)
+ return -EINVAL;
+
-+ irq_911 = s3c2410_gpio_getirq(pdev->resource[0].start);
-+ if (irq_911 < 0)
++ irq_aux = s3c2410_gpio_getirq(pdev->resource[0].start);
++ if (irq_aux < 0)
+ return -EINVAL;
+
+ irq_hold = s3c2410_gpio_getirq(pdev->resource[1].start);
+ if (irq_hold < 0)
+ return -EINVAL;
+
++ irq_jack = s3c2410_gpio_getirq(pdev->resource[2].start);
++ if (irq_jack < 0)
++ return -EINVAL;
++
+ platform_set_drvdata(pdev, gta01kbd);
+
+ gta01kbd->input = input_dev;
@@ -157,11 +183,9 @@
+ corgikbd->htimer.data = (unsigned long) corgikbd;
+
+ corgikbd->suspend_jiffies=jiffies;
-+
-+ memcpy(corgikbd->keycode, corgikbd_keycode, sizeof(corgikbd->keycode));
+#endif
+
-+ input_dev->name = "GTA01 Buttons";
++ input_dev->name = "Neo1973 Buttons";
+ input_dev->phys = "gta01kbd/input0";
+ input_dev->id.bustype = BUS_HOST;
+ input_dev->id.vendor = 0x0001;
@@ -170,77 +194,68 @@
+ input_dev->cdev.dev = &pdev->dev;
+ input_dev->private = gta01kbd;
+
-+ input_dev->evbit[0] = BIT(EV_KEY);
++ input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_SW);
+ set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
-+#if 0
-+ input_dev->keycode = gta01kbd->keycode;
-+ input_dev->keycodesize = sizeof(unsigned char);
-+ input_dev->keycodemax = ARRAY_SIZE(corgikbd_keycode);
++ set_bit(KEY_PHONE, input_dev->keybit);
++ set_bit(KEY_PAUSE, input_dev->keybit);
+
-+ for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++)
-+ set_bit(corgikbd->keycode[i], input_dev->keybit);
-+ clear_bit(0, input_dev->keybit);
-+ set_bit(SW_LID, input_dev->swbit);
-+ set_bit(SW_TABLET_MODE, input_dev->swbit);
-+ set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
-+#endif
-+
+ input_register_device(gta01kbd->input);
+
-+ if (request_irq(irq_911, gta01kbd_interrupt,
++ if (request_irq(irq_aux, gta01kbd_aux_irq,
+ SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
-+ "gta01kbd_911", gta01kbd))
-+ printk(KERN_WARNING "gta01kbd: Can't get IRQ\n");
-+ enable_irq_wake(irq_911);
++ "Neo1973 AUX button", gta01kbd)) {
++ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_aux);
++ goto out_aux;
++ }
++ enable_irq_wake(irq_aux);
+
-+ if (request_irq(irq_hold, gta01kbd_interrupt,
++ if (request_irq(irq_hold, gta01kbd_hold_irq,
+ SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
-+ "gta01kbd_hold", gta01kbd))
-+ printk(KERN_WARNING "gta01kbd: Can't get IRQ\n");
++ "Neo1973 HOLD button", gta01kbd)) {
++ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_hold);
++ goto out_hold;
++ }
+ enable_irq_wake(irq_hold);
+
-+ /* FIXME: headphone insert */
-+
++ if (request_irq(irq_jack, gta01kbd_headphone_irq,
++ SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
++ "Neo1973 Headphone Jack", gta01kbd)) {
++ dev_err(&pdev->dev, "Can't get IRQ %u\n", irq_jack);
++ goto out_jack;
++ }
++ enable_irq_wake(irq_jack);
+#if 0
+ mod_timer(&corgikbd->htimer, jiffies +
msecs_to_jiffies(HINGE_SCAN_INTERVAL));
++#endif
++ return 0;
+
-+ /* Setup sense interrupts - RisingEdge Detect, sense lines as inputs */
-+ for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) {
-+ pxa_gpio_mode(CORGI_GPIO_KEY_SENSE(i) | GPIO_IN);
-+ if (request_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd_interrupt,
-+ SA_INTERRUPT | SA_TRIGGER_RISING,
-+ "corgikbd", corgikbd))
-+ printk(KERN_WARNING "corgikbd: Can't get IRQ: %d!\n",
i);
-+ }
++out_jack:
++ free_irq(irq_hold, gta01kbd);
++out_hold:
++ free_irq(irq_aux, gta01kbd);
++out_aux:
++ input_unregister_device(gta01kbd->input);
++ input_free_device(gta01kbd->input);
++ platform_set_drvdata(pdev, NULL);
++ kfree(gta01kbd);
+
-+ /* Set Strobe lines as outputs - set high */
-+ for (i = 0; i < CORGI_KEY_STROBE_NUM; i++)
-+ pxa_gpio_mode(CORGI_GPIO_KEY_STROBE(i) | GPIO_OUT |
GPIO_DFLT_HIGH);
-+
-+ /* Setup the headphone jack as an input */
-+ pxa_gpio_mode(CORGI_GPIO_AK_INT | GPIO_IN);
-+#endif
-+
-+ return 0;
++ return -ENODEV;
+}
+
+static int gta01kbd_remove(struct platform_device *pdev)
+{
+ struct gta01kbd *gta01kbd = platform_get_drvdata(pdev);
+
++ free_irq(s3c2410_gpio_getirq(pdev->resource[2].start), gta01kbd);
++ free_irq(s3c2410_gpio_getirq(pdev->resource[1].start), gta01kbd);
+ free_irq(s3c2410_gpio_getirq(pdev->resource[0].start), gta01kbd);
-+ free_irq(s3c2410_gpio_getirq(pdev->resource[1].start), gta01kbd);
+#if 0
-+ int i;
-+
-+ for (i = 0; i < CORGI_KEY_SENSE_NUM; i++)
-+ free_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd);
-+
+ del_timer_sync(&corgikbd->htimer);
+ del_timer_sync(&corgikbd->timer);
+#endif
+ input_unregister_device(gta01kbd->input);
-+
++ input_free_device(gta01kbd->input);
++ platform_set_drvdata(pdev, NULL);
+ kfree(gta01kbd);
+
+ return 0;
@@ -270,5 +285,5 @@
+module_exit(gta01kbd_exit);
+
+MODULE_AUTHOR("Harald Welte <[EMAIL PROTECTED]>");
-+MODULE_DESCRIPTION("FIC GTA01 (Neo1973) Buttons Driver");
++MODULE_DESCRIPTION("FIC Neo1973 (GTA01) Buttons Driver");
+MODULE_LICENSE("GPL");
--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-03-08 15:34:25 +0100 (Thu, 08 Mar 2007)
New Revision: 1274
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* Retrieve todays events from libecal (based on patch from Dodji Seketeli)
* Update indenting
Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
2007-03-08 13:36:05 UTC (rev 1273)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
2007-03-08 14:34:25 UTC (rev 1274)
@@ -24,12 +24,18 @@
#include <string.h>
#include <glib.h>
#include <glib/gprintf.h>
+#include <libecal/e-cal.h>
#include <gtk/gtk.h>
-
#include <libmokoui/moko-window.h>
+#define LOG_ERROR \
+g_warning ("Got error '%s', code '%d'", \
+ error->message, error->code);
+
+#define FREE_ERROR g_error_free (error) ; error = NULL ;
+
static void
-today_update_date (GtkLabel *label)
+today_update_date (GtkLabel * label)
{
time_t t;
struct tm *tmp;
@@ -38,7 +44,8 @@
t = time (NULL);
tmp = localtime (&t);
- if (tmp == NULL) {
+ if (tmp == NULL)
+ {
// error = could not get localtime
return;
}
@@ -50,7 +57,7 @@
}
static void
-today_update_time (GtkLabel *label)
+today_update_time (GtkLabel * label)
{
time_t t;
struct tm *tmp;
@@ -59,7 +66,8 @@
t = time (NULL);
tmp = localtime (&t);
- if (tmp == NULL) {
+ if (tmp == NULL)
+ {
// error = could not get localtime
return;
}
@@ -69,6 +77,109 @@
gtk_label_set_markup (label, time_str);
}
+void
+e_cal_component_list_free (GList * list)
+{
+ GList *cur = NULL;
+
+ for (cur = list; cur; cur = cur->next)
+ {
+ /*if an element of the list is not of type ECalComponent, leak it */
+ if (cur->data && E_IS_CAL_COMPONENT (cur->data))
+ {
+ g_object_unref (G_OBJECT (cur->data));
+ cur->data = NULL;
+ }
+ else
+ {
+ g_warning ("cur->data is not of type ECalComponent !");
+ }
+ }
+ g_list_free (list);
+}
+
+/**
+ * returns a list of ECalComponents, of type VEVENT
+ * it must freed it with e_cal_free_object_list()
+ */
+static GList *
+get_today_events ()
+{
+ GList *result = NULL;
+ GList *ical_comps = NULL;
+ GList *ecal_comps = NULL;
+ GList *cur = NULL;
+ ECal *ecal = NULL;
+ GError *error = NULL;
+ gchar *query = NULL;
+
+ ecal = e_cal_new_system_calendar ();
+ g_return_val_if_fail (ecal, NULL);
+
+ if (!e_cal_open (ecal, FALSE, &error))
+ {
+ g_warning ("failed to open the calendar");
+ }
+
+ if (error)
+ {
+ LOG_ERROR;
+ goto out;
+ }
+
+ query = g_strdup_printf ("(occur-in-time-range? "
+ "(time-day-begin (time-now)) "
+ "(time-day-end (time-now))" ")");
+ e_cal_get_object_list (ecal, query, &ical_comps, &error);
+ if (error)
+ {
+ LOG_ERROR;
+ goto out;
+ }
+
+ /*
+ * build a list of ECalComponent, out of the list of icalcomponents
+ * when an icalcomponent is set to an ECalComponent, the later
+ * becomes responsible of freeing the former's memory
+ */
+ for (cur = ical_comps; cur; cur = cur->next)
+ {
+ ECalComponent *c = NULL;
+ if (!cur->data)
+ continue;
+
+ c = e_cal_component_new ();
+ if (!e_cal_component_set_icalcomponent (c, cur->data))
+ {
+ icalcomponent_free (cur->data);
+ cur->data = NULL;
+ continue;
+ }
+
+ ecal_comps = g_list_prepend (ecal_comps, c);
+ cur->data = NULL;
+ }
+ result = ecal_comps;
+ ecal_comps = NULL;
+
+out:
+ if (ical_comps)
+ e_cal_free_object_list (ical_comps);
+
+ if (ecal_comps)
+ e_cal_component_list_free (ecal_comps);
+ ecal_comps = NULL;
+
+ g_object_unref (G_OBJECT (ecal));
+
+ if (error)
+ g_error_free (error);
+
+ g_free (query);
+
+ return result;
+}
+
static GtkWidget *
today_infoline_new (gchar * stock_id, gchar * message)
{
@@ -92,21 +203,67 @@
}
static GtkWidget *
-today_launcher_button_new (gchar *icon, gchar *exec)
+today_launcher_button_new (gchar * icon, gchar * exec)
{
GtkWidget *button = gtk_button_new ();
+
gtk_container_add (GTK_CONTAINER (button),
- gtk_image_new_from_stock (GTK_STOCK_EXECUTE, GTK_ICON_SIZE_BUTTON));
+ gtk_image_new_from_stock (icon, GTK_ICON_SIZE_BUTTON));
+
gtk_widget_set_name (button, "today-launcher-button");
return button;
}
+GtkWidget *
+get_today_events_infoline ()
+{
+ GtkWidget *infoline = NULL;
+ GList *events = NULL;
+ GList *cur = NULL;
+ GString *lines = NULL;
+
+ events = get_today_events ();
+ lines = g_string_new (NULL);
+ for (cur = events; cur; cur = cur->next)
+ {
+ ECalComponentText text;
+ if (!E_IS_CAL_COMPONENT (cur->data))
+ {
+ g_warning ("cur->data is not of type ECalComponent!");
+ continue;
+ }
+ if (e_cal_component_get_vtype (cur->data) != E_CAL_COMPONENT_EVENT)
+ {
+ g_warning ("Event type is not 'EVENT', but rather %d",
+ e_cal_component_get_vtype (cur->data));
+ continue;
+ }
+ e_cal_component_get_summary (cur->data, &text);
+ g_string_append_printf (lines, "%s\n", text.value);
+ }
+
+ if (lines->len)
+ infoline = today_infoline_new (GTK_STOCK_NO, lines->str);
+ else
+ infoline = today_infoline_new (GTK_STOCK_NO, "No events for today");
+
+ if (events)
+ e_cal_component_list_free (events);
+
+ if (lines)
+ {
+ g_string_free (lines, TRUE);
+ lines = NULL;
+ }
+ return infoline;
+}
+
static void
create_ui ()
{
GtkWidget *window, *vbox;
- GtkWidget *date, *time;
+ GtkWidget *date, *time_label;
GtkWidget *message;
GtkWidget *alignment;
@@ -127,17 +284,17 @@
gtk_container_add (GTK_CONTAINER (alignment), date);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
today_update_date (GTK_LABEL (date));
- g_timeout_add (60*60*1000, (GSourceFunc)today_update_date, date);
+ g_timeout_add (60 * 60 * 1000, (GSourceFunc) today_update_date, date);
/* time */
alignment = gtk_alignment_new (1, 0, 0, 0);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 0, 0, 12);
- time = gtk_label_new (NULL);
- gtk_label_set_markup (GTK_LABEL (time), "<big>10:30am</big>");
- gtk_container_add (GTK_CONTAINER (alignment), time);
+ time_label = gtk_label_new (NULL);
+ gtk_label_set_markup (GTK_LABEL (time_label), "<big>10:30am</big>");
+ gtk_container_add (GTK_CONTAINER (alignment), time_label);
gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0);
- today_update_time (GTK_LABEL (time));
- g_timeout_add (60*1000, (GSourceFunc)today_update_time, time);
+ today_update_time (GTK_LABEL (time_label));
+ g_timeout_add (60 * 1000, (GSourceFunc) today_update_time, time_label);
/* main message */
alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
@@ -157,12 +314,7 @@
gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0);
/* upcoming events */
- infoline = today_infoline_new (GTK_STOCK_NO,
- "Carrie's Birthday 16/Jan\n"
- "Taxi to Airport 13:00\n"
- "Meeting with client 17:00\n"
- "Call Sean 19:30\n"
- "Dinner with John 20:00\n");
+ infoline = get_today_events_infoline ();
gtk_box_pack_start (GTK_BOX (vbox), infoline, FALSE, FALSE, 0);
/* shurtcut buttons */
@@ -172,15 +324,15 @@
gtk_box_pack_start (GTK_BOX (vbox), button_box, FALSE, FALSE, 0);
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
gtk_container_add (GTK_CONTAINER (button_box),
- today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
+ today_launcher_button_new (GTK_STOCK_EXECUTE, ""));
/* signals */
g_signal_connect (G_OBJECT (window), "delete-event",
--- End Message ---
--- Begin Message ---
Author: thomas
Date: 2007-03-08 15:58:00 +0100 (Thu, 08 Mar 2007)
New Revision: 1275
Modified:
trunk/src/target/OM-2007/applications/openmoko-today/configure.ac
trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
Log:
* openmoko-today/configure.ac: Check for libebook and libecal
* openmoko-today/src/today-main.c: Use %I rather than %l in strftime to prevent
an ISO C warning.
Modified: trunk/src/target/OM-2007/applications/openmoko-today/configure.ac
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/configure.ac
2007-03-08 14:34:25 UTC (rev 1274)
+++ trunk/src/target/OM-2007/applications/openmoko-today/configure.ac
2007-03-08 14:58:00 UTC (rev 1275)
@@ -4,6 +4,9 @@
AC_CONFIG_SRCDIR(src/today-main.c)
AM_MAINTAINER_MODE
+LIBEBOOK_VERSION=1.4.2
+LIBECAL_VERSION=1.4.2
+
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
@@ -17,7 +20,10 @@
ALL_LINGUAS=""
AM_GLIB_GNU_GETTEXT
-PKG_CHECK_MODULES(TODAY, openmoko-libs)
+PKG_CHECK_MODULES(TODAY,
+ openmoko-libs
+ libebook-1.2 >= $LIBEBOOK_VERSION
+ libecal-1.2 >= $LIBEBOOK_VERSION)
CFLAGS=$TODAY_CFLAGS
LIBS=$TODAY_LIBS
Modified: trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
2007-03-08 14:34:25 UTC (rev 1274)
+++ trunk/src/target/OM-2007/applications/openmoko-today/src/today-main.c
2007-03-08 14:58:00 UTC (rev 1275)
@@ -73,7 +73,7 @@
}
/* TODO: make 12/24 hr optional */
- strftime (time_str, sizeof (time_str), "<big>%l:%M</big> %p", tmp);
+ strftime (time_str, sizeof (time_str), "<big>%I:%M</big> %p", tmp);
gtk_label_set_markup (label, time_str);
}
--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-03-08 16:22:07 +0100 (Thu, 08 Mar 2007)
New Revision: 1276
Removed:
trunk/oe/packages/openmoko-pim/files/openmoko-dates-r333-linguas_pl.patch
trunk/oe/packages/openmoko-pim/openmoko-dates_svn.bb
Log:
upstream now compiles fine again, get rid of our pl.po kludge
Deleted:
trunk/oe/packages/openmoko-pim/files/openmoko-dates-r333-linguas_pl.patch
===================================================================
--- trunk/oe/packages/openmoko-pim/files/openmoko-dates-r333-linguas_pl.patch
2007-03-08 14:58:00 UTC (rev 1275)
+++ trunk/oe/packages/openmoko-pim/files/openmoko-dates-r333-linguas_pl.patch
2007-03-08 15:22:07 UTC (rev 1276)
@@ -1,10 +0,0 @@
-Index: openmoko-dates/po/LINGUAS
-===================================================================
---- openmoko-dates/po/LINGUAS (revision 335)
-+++ openmoko-dates/po/LINGUAS (working copy)
-@@ -1,5 +1,4 @@
- et
- fr
- nl
--pl
- ru
Deleted: trunk/oe/packages/openmoko-pim/openmoko-dates_svn.bb
===================================================================
--- trunk/oe/packages/openmoko-pim/openmoko-dates_svn.bb 2007-03-08
14:58:00 UTC (rev 1275)
+++ trunk/oe/packages/openmoko-pim/openmoko-dates_svn.bb 2007-03-08
15:22:07 UTC (rev 1276)
@@ -1,27 +0,0 @@
-DESCRIPTION = "Dates is a calendar application."
-SECTION = "openmoko/pim"
-LICENSE = "GPL"
-DEPENDS = "glib-2.0 gtk+ libglade eds-dbus openmoko-libs"
-PV = "0.1+svn${SRCDATE}"
-PR = "r5"
-
-FILESDIR = "[EMAIL PROTECTED](bb.data.getVar('FILE',d,1))}/files"
-
-inherit gnome autotools pkgconfig gtk-icon-cache
-
-SRC_URI =
"svn://svn.o-hand.com/repos/dates/branches/;module=openmoko;proto=http \
- file://openmoko-dates-r333-linguas_pl.patch;patch=1 \
- "
-
-S = "${WORKDIR}/openmoko"
-
-EXTRA_OECONF = "--enable-omoko"
-
-do_install_append () {
- install -d ${D}/${datadir}/pixmaps
- install -m 0644 ${D}/${datadir}/icons/hicolor/48x48/apps/dates.png
${D}/${datadir}/pixmaps/
-}
-
-FILES_${PN} += "${datadir}/pixmaps/dates.png \
- ${datadir}/dates/"
-
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog