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. r1608 - in trunk/oe: conf/distro/include packages
packages/fbgrab packages/fbgrab/fbgrab ([EMAIL PROTECTED])
2. r1609 - in trunk/oe/packages: . memedit ([EMAIL PROTECTED])
3. r1610 -
trunk/src/target/OM-2007/applications/openmoko-rssreader/src
([EMAIL PROTECTED])
4. r1611 -
trunk/src/target/OM-2007/applications/openmoko-messages/src
([EMAIL PROTECTED])
5. r1612 - trunk/oe/conf ([EMAIL PROTECTED])
6. r1613 - trunk/oe/conf ([EMAIL PROTECTED])
7. r1614 -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src
([EMAIL PROTECTED])
8. r1615 -
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src
([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-04-01 23:22:35 +0200 (Sun, 01 Apr 2007)
New Revision: 1608
Added:
trunk/oe/packages/fbgrab/
trunk/oe/packages/fbgrab/fbgrab-viewer-native_1.0.bb
trunk/oe/packages/fbgrab/fbgrab/
trunk/oe/packages/fbgrab/fbgrab/makefile.patch
trunk/oe/packages/fbgrab/fbgrab_1.0.bb
Modified:
trunk/oe/conf/distro/include/preferred-openmoko-versions.inc
Log:
oe: add fbgrab-viewer-native courtesy Stefan Schmidt. closes #140
Modified: trunk/oe/conf/distro/include/preferred-openmoko-versions.inc
===================================================================
--- trunk/oe/conf/distro/include/preferred-openmoko-versions.inc
2007-04-01 18:00:57 UTC (rev 1607)
+++ trunk/oe/conf/distro/include/preferred-openmoko-versions.inc
2007-04-01 21:22:35 UTC (rev 1608)
@@ -16,6 +16,7 @@
SRCDATE_sjf2410-linux-native = "now"
SRCDATE_dfu-util = "now"
SRCDATE_dfu-util-native = "now"
+SRCDATE_fbgrab-viewer-native = "now"
SRCDATE_libgsmd = "now"
SRCDATE_openmoko-session = "now"
Added: trunk/oe/packages/fbgrab/fbgrab/makefile.patch
===================================================================
--- trunk/oe/packages/fbgrab/fbgrab/makefile.patch 2007-04-01 18:00:57 UTC
(rev 1607)
+++ trunk/oe/packages/fbgrab/fbgrab/makefile.patch 2007-04-01 21:22:35 UTC
(rev 1608)
@@ -0,0 +1,21 @@
+--- fbgrab-1.0/Makefile.orig 2002-03-20 20:49:06.000000000 +0100
++++ fbgrab-1.0/Makefile 2004-06-11 18:02:56.000000000 +0200
+@@ -4,13 +4,12 @@
+ ###
+
+ fbgrab: fbgrab.c
+- splint +posixlib fbgrab.c
+- gcc -g -Wall fbgrab.c -lpng -lz -o fbgrab
++ ${CC} ${CFLAGS} ${LDFLAGS} fbgrab.c -lpng -lm -lz -o fbgrab
+
+ install:
+ strip fbgrab
+- install fbgrab /usr/bin/fbgrab
+- install fbgrab.1.man /usr/man/man1/fbgrab.1
++ install fbgrab ${DESTDIR}/usr/bin/fbgrab
++ install fbgrab.1.man ${DESTDIR}/usr/share/man/man1/fbgrab.1
+
+ clean:
+- rm -f fbgrab *~ \#*\#
+\ No newline at end of file
++ rm -f fbgrab *~ \#*\#
Added: trunk/oe/packages/fbgrab/fbgrab-viewer-native_1.0.bb
===================================================================
--- trunk/oe/packages/fbgrab/fbgrab-viewer-native_1.0.bb 2007-04-01
18:00:57 UTC (rev 1607)
+++ trunk/oe/packages/fbgrab/fbgrab-viewer-native_1.0.bb 2007-04-01
21:22:35 UTC (rev 1608)
@@ -0,0 +1,31 @@
+DESCRIPTION = "Viewer for a network enabled fbgrab"
+HOMEPAGE = "http://svn.openezx.org/trunk/src/userspace/fbgrab/"
+LICENSE = "GPL"
+SECTION = "console/network"
+DEPENDS = "libpng-native"
+PV = "0.0+svn${SRCDATE}"
+PR = "r30"
+
+SRC_URI = "svn://svn.openezx.org/trunk/src/userspace;module=fbgrab;proto=http"
+S = "${WORKDIR}/fbgrab"
+
+inherit native
+
+do_compile() {
+ ${CC} ${CFLAGS} ${LDFLAGS} -g -Wall -lpng -lX11 -o fbgrab-viewer
fbgrab-viewer.c
+}
+
+do_deploy() {
+ install -d ${DEPLOY_DIR_IMAGE}
+ install -m 0755 fbgrab-viewer ${DEPLOY_DIR_IMAGE}/fbgrab-viewer
+}
+
+do_stage() {
+ :
+}
+
+do_install() {
+ :
+}
+
+addtask deploy before do_install after do_compile
Added: trunk/oe/packages/fbgrab/fbgrab_1.0.bb
===================================================================
--- trunk/oe/packages/fbgrab/fbgrab_1.0.bb 2007-04-01 18:00:57 UTC (rev
1607)
+++ trunk/oe/packages/fbgrab/fbgrab_1.0.bb 2007-04-01 21:22:35 UTC (rev
1608)
@@ -0,0 +1,18 @@
+SECTION = "console/network"
+DESCRIPTION = "framebuffer screenshot program"
+LICENSE = "GPL"
+
+PR = "r1"
+
+DEPENDS = " zlib libpng "
+
+SRC_URI = "http://hem.bredband.net/gmogmo/fbgrab/fbgrab-${PV}.tar.gz \
+ file://makefile.patch;patch=1 \
+ http://people.openezx.org/ao2/fbgrab_network_mode.diff;patch=1 \
+ "
+
+do_install() {
+ install -d ${D}${bindir} ${D}${mandir}/man1/
+ install -m 0755 fbgrab ${D}${bindir}
+ install -m 0644 fbgrab.1.man ${D}${mandir}/man1/fbgrab.1
+}
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-01 23:26:01 +0200 (Sun, 01 Apr 2007)
New Revision: 1609
Added:
trunk/oe/packages/memedit/
trunk/oe/packages/memedit/memedit_0.7.bb
Log:
oe: add memedit courtesy Stefan Schmidt.
Added: trunk/oe/packages/memedit/memedit_0.7.bb
===================================================================
--- trunk/oe/packages/memedit/memedit_0.7.bb 2007-04-01 21:22:35 UTC (rev
1608)
+++ trunk/oe/packages/memedit/memedit_0.7.bb 2007-04-01 21:26:01 UTC (rev
1609)
@@ -0,0 +1,11 @@
+DESCRIPTION = "Display and change memory content for testing purpose"
+HOMEPAGE = "http://www.pengutronix.de/software/memedit/downloads/"
+LICENSE = "GPLv2"
+SECTION = "devel"
+DEPENDS = "readline"
+
+PR = "r0"
+
+SRC_URI =
"http://www.pengutronix.de/software/memedit/downloads/memedit-${PV}.tar.gz"
+
+inherit autotools
--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-02 00:53:41 +0200 (Mon, 02 Apr 2007)
New Revision: 1610
Added:
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
Modified:
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
Log:
RSS Reader: start creating a GObject to store the RSS Date
The RSS Date is from RFC822 and glib lacks something
like QDateTime. This class creates something similiar. It
will be used inside the GtkTreeModelSort to allow fast
sorting by date.
Using a custom cell renderer we can then exchange the
date to "today", "yesterday".
But this commit only adds the GObject skeleton...
Modified:
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
2007-04-01 21:26:01 UTC (rev 1609)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
2007-04-01 22:53:41 UTC (rev 1610)
@@ -7,8 +7,8 @@
bin_PROGRAMS = openmoko-rssreader
-EXTRA_DIST = application-data.h callbacks.h
+EXTRA_DIST = application-data.h callbacks.h rfcdate.h
-openmoko_rssreader_SOURCES = main.c callbacks.c
+openmoko_rssreader_SOURCES = main.c callbacks.c rfcdate.c
openmoko_rssreader_LDADD = @OPENMOKO_LIBS@ @MRSS_LIBS@ @GTHREAD_LIBS@
Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
2007-04-01 21:26:01 UTC (rev 1609)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
2007-04-01 22:53:41 UTC (rev 1610)
@@ -0,0 +1,100 @@
+/*
+ * RSS Reader, a simple RSS reader
+ * RFC822 date parser implementation
+ *
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#include "rfcdate.h"
+
+#include <malloc.h>
+
+G_DEFINE_TYPE(RSSRFCDate, rss_rfc_date, G_TYPE_OBJECT)
+
+#define RSS_RFC_DATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o),
RSS_TYPE_RFC_DATE, RSSRFCDatePrivate))
+
+typedef struct _RSSRFCDatePrivate RSSRFCDatePrivate;
+struct _RSSRFCDatePrivate {
+ gchar *string_cache;
+};
+
+static void
+rss_rfc_date_finalize (GObject *object)
+{
+ if ( RSS_RFC_DATE_GET_PRIVATE(object)->string_cache )
+ free (RSS_RFC_DATE_GET_PRIVATE(object)->string_cache);
+
+ G_OBJECT_CLASS(rss_rfc_date_parent_class)->finalize (object);
+}
+
+static void
+rss_rfc_date_class_init (RSSRFCDateClass *klass)
+{
+ g_type_class_add_private (klass, sizeof (RSSRFCDatePrivate));
+
+ /*
+ * virtual functions
+ */
+ G_OBJECT_CLASS(klass)->finalize = rss_rfc_date_finalize;
+}
+
+static void
+rss_rfc_date_init(RSSRFCDate *self)
+{
+ /* I don't know if memset gets called */
+ RSS_RFC_DATE_GET_PRIVATE(self)->string_cache = NULL;
+}
+
+GObject*
+rss_rfc_date_new ()
+{
+ return G_OBJECT(g_object_new(RSS_TYPE_RFC_DATE, NULL));
+}
+
+void
+rss_rfc_date_set (RSSRFCDate *self, const gchar* rfc822date)
+{
+ if ( RSS_RFC_DATE_GET_PRIVATE(self)->string_cache ) {
+ free ( RSS_RFC_DATE_GET_PRIVATE(self)->string_cache );
+ RSS_RFC_DATE_GET_PRIVATE(self)->string_cache = NULL;
+ }
+
+
+ /*
+ * XXX parse the date
+ */
+}
+
+gint
+rss_rfc_date_compare (RSSRFCDate *left, RSSRFCDate *right)
+{
+ /* XXX, FIXME do the comparsion */
+ return 0;
+}
+
+gchar*
+rss_rfc_date_as_string (RSSRFCDate *self)
+{
+ /* XXX, FIXME */
+ return "";
+}
Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
2007-04-01 21:26:01 UTC (rev 1609)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
2007-04-01 22:53:41 UTC (rev 1610)
@@ -0,0 +1,37 @@
+
+#ifndef OPENMOKO_RSS_RFC_DATE_H
+#define OPENMOKO_RSS_RFC_DATE_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define RSS_TYPE_RFC_DATE (rss_rfc_date_get_type())
+#define RSS_RFC_DATE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),
RSS_TYPE_RFC_DATE, RSSRFCDate))
+#define RSS_RFC_DATE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj),
RSS_TYPE_RFC_DATE, RSSRFCDateClass))
+#define RSS_IS_RFC_DATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),
RSS_TYPE_RFC_DATE))
+#define RSS_IS_RFC_DATE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),
RSS_TYPE_RFC_DATE))
+#define RSS_RFC_DATE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),
RSS_TYPE_RFC_DATE, RSSRFCDateClass))
+
+typedef struct _RSSRFCDate RSSRFCDate;
+typedef struct _RSSRFCDateClass RSSRFCDateClass;
+
+struct _RSSRFCDate {
+ GObject parent;
+ gint64 date;
+};
+
+struct _RSSRFCDateClass {
+ GObjectClass parent;
+};
+
+GType rss_rfc_date_get_type ();
+GObject* rss_rfc_date_new ();
+void rss_rfc_date_set (RSSRFCDate* self, const gchar* rfc822_date);
+gint rss_rfc_date_compare (RSSRFCDate* self, RSSRFCDate *other);
+gchar* rss_rfc_date_as_string(RSSRFCDate* self);
+
+
+G_END_DECLS
+
+#endif
--- End Message ---
--- Begin Message ---
Author: alex_tang
Date: 2007-04-02 03:32:40 +0200 (Mon, 02 Apr 2007)
New Revision: 1611
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
Log:
Bug 348 "openmoko-messages crashes in 'New SMS' dialog" patch.
Modified:
trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
2007-04-01 22:53:41 UTC (rev 1610)
+++ trunk/src/target/OM-2007/applications/openmoko-messages/src/callbacks.c
2007-04-02 01:32:40 UTC (rev 1611)
@@ -591,6 +591,8 @@
g_debug("sms select contact done");
GtkWidget* toEntry = (GtkWidget*)data;
GList* contacts = sms_get_selected_contacts(SMS_CONTACT_WINDOW(widget));
+ if (g_list_length(contacts) == 0)
+ return;
g_debug ("start to add %d contacts to entry", g_list_length(contacts));
gchar* nameList = NULL;
gchar* name;
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-02 09:10:54 +0200 (Mon, 02 Apr 2007)
New Revision: 1612
Modified:
trunk/oe/conf/site.conf
Log:
oe/conf: remove OpenAlchemy out of public repository
NOTE: reverted this locally on buildhost
Modified: trunk/oe/conf/site.conf
===================================================================
--- trunk/oe/conf/site.conf 2007-04-02 01:32:40 UTC (rev 1611)
+++ trunk/oe/conf/site.conf 2007-04-02 07:10:54 UTC (rev 1612)
@@ -6,13 +6,6 @@
DL_DIR = "${OMDIR}/sources"
-BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/oa/packages/*/*.bb
${OMDIR}/oe/packages/*/*.bb"
-BBFILE_COLLECTIONS = "upstream openalchemy local"
-BBFILE_PATTERN_upstream = "^${OMDIR}/openembedded/"
-BBFILE_PATTERN_local = "^${OMDIR}/oe/"
-BBFILE_PRIORITY_upstream = "5"
-BBFILE_PRIORITY_local = "10"
-
BBINCLUDELOGS = "yes"
KERNEL_CONSOLE = "tty1"
#DEBUG_OPTIMIZATION = "-O -g3"
--- End Message ---
--- Begin Message ---
Author: mickey
Date: 2007-04-02 09:11:54 +0200 (Mon, 02 Apr 2007)
New Revision: 1613
Modified:
trunk/oe/conf/site.conf
Log:
oe/conf: remove unused stuff from site.conf
Modified: trunk/oe/conf/site.conf
===================================================================
--- trunk/oe/conf/site.conf 2007-04-02 07:10:54 UTC (rev 1612)
+++ trunk/oe/conf/site.conf 2007-04-02 07:11:54 UTC (rev 1613)
@@ -1,11 +1,7 @@
# OpenMoko site configuration file
-#
-# History:
-#
-# 2006.08.16 mickey created.
DL_DIR = "${OMDIR}/sources"
-
+BBFILES := "${OMDIR}/openembedded/packages/*/*.bb ${OMDIR}/oe/packages/*/*.bb"
BBINCLUDELOGS = "yes"
KERNEL_CONSOLE = "tty1"
#DEBUG_OPTIMIZATION = "-O -g3"
--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-04-02 09:33:07 +0200 (Mon, 02 Apr 2007)
New Revision: 1614
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
put gsm gprs signal status image into GtkHbox, which use to realize dynamic
image show.
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-02 07:11:54 UTC (rev 1613)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-02 07:33:07 UTC (rev 1614)
@@ -19,6 +19,7 @@
static GPollFD GPfd;
static gint gsm_q = -99;
static gint gprs_q = -99;
+static int test = 0;
static gboolean
gsm_watcher_prepare (GSource * source, gint * timeout)
@@ -125,38 +126,50 @@
}
}
-GsmSignalQuality
+SignalStatus
moko_panel_gsm_signal_quality()
{
switch (gsm_q)
{
case 4 :
- return GSM_SIGNAL_LEVEL_1 ;
+ return LEVEL_1 ;
case 3 :
- return GSM_SIGNAL_LEVEL_2 ;
+ return LEVEL_2 ;
case 2 :
- return GSM_SIGNAL_LEVEL_3 ;
+ return LEVEL_3 ;
case 1 :
- return GSM_SIGNAL_LEVEL_4 ;
+ return LEVEL_4 ;
case 0 :
- return GSM_SIGNAL_LEVEL_5 ;
+ return LEVEL_5 ;
default :
- return GSM_SIGNAL_ERROR;
+ return UN_CONN;
}
}
/*for a rainning day*/
-GprsSignalQuality
+SignalStatus
moko_panel_gprs_signal_quality()
{
-
-if(0)
-{ switch (gprs_q)
+//some code for only for test, since there have not any methord to check out
gprs signal.
+
+ test ++;
+ if (test > 11 || test < 0)
+ test = 0;
+ switch (test)
{
-
+ case 10 :
+ return LEVEL_1 ;
+ case 9 :
+ return LEVEL_2 ;
+ case 8 :
+ return LEVEL_3 ;
+ case 7 :
+ return LEVEL_4 ;
+ case 6 :
+ return LEVEL_5 ;
+ default :
+ return UN_CONN;
}
}
- return GPRS_CLOSE;
-}
void
gsm_watcher_install (void)
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-04-02 07:11:54 UTC (rev 1613)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.h
2007-04-02 07:33:07 UTC (rev 1614)
@@ -7,31 +7,27 @@
/*signal value: "0": best connection "5": connect error*/
G_BEGIN_DECLS
-typedef enum{
- GSM_SIGNAL_LEVEL_1 = 0,
- GSM_SIGNAL_LEVEL_2,
- GSM_SIGNAL_LEVEL_3,
- GSM_SIGNAL_LEVEL_4,
- GSM_SIGNAL_LEVEL_5,
- GSM_SIGNAL_ERROR,
- TOTAL_GSM_SIGNALS
-}GsmSignalQuality;
+enum{
+ GSM,
+ GPRS,
+ SIN_NO
+};
typedef enum{
- GPRS_SIGNAL_LEVEL_1 = 0,
- GPRS_SIGNAL_LEVEL_2,
- GPRS_SIGNAL_LEVEL_3,
- GPRS_SIGNAL_LEVEL_4,
- GPRS_SIGNAL_LEVEL_5,
- TOTAL_GPRS_SIGNALS,
- GPRS_CLOSE
-}GprsSignalQuality;
+ LEVEL_1 = 0,
+ LEVEL_2,
+ LEVEL_3,
+ LEVEL_4,
+ LEVEL_5,
+ UN_CONN,
+ TOTAL_STATUS
+}SignalStatus;
void gsm_watcher_install (void);
-GsmSignalQuality moko_panel_gsm_signal_quality(void);
+SignalStatus moko_panel_gsm_signal_quality(void);
-GprsSignalQuality moko_panel_gprs_signal_quality(void);
+SignalStatus moko_panel_gprs_signal_quality(void);
G_END_DECLS
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-02 07:11:54 UTC (rev 1613)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-02 07:33:07 UTC (rev 1614)
@@ -17,32 +17,39 @@
#include <libmokoui/moko-panel-applet.h>
#include <gtk/gtkimage.h>
+#include <gtk/gtkbox.h>
#include <time.h>
#include "moko-gsm-conn.h"
+typedef struct{
+ GtkWidget *image;
+ SignalStatus status;
+}MokoSignal;
+
typedef struct {
- GsmSignalQuality gsm_quality;
- GprsSignalQuality gprs_quality;
- GtkImage *image;
+ MokoSignal gsm;
+ MokoSignal gprs;
+ GtkWidget *hbox;
guint timeout_id;
} GsmApplet;
-static gchar *gsm_q_name[TOTAL_GSM_SIGNALS]={
+static gchar *gsm_q_name[TOTAL_STATUS]={
"SignalStrength_01.png",
"SignalStrength_02.png",
"SignalStrength_03.png",
"SignalStrength_04.png",
"SignalStrength_05.png",
- "SignalStrength_00.png",
+ "SignalStrength_00.png"
};
-static gchar *gprs_q_name[TOTAL_GPRS_SIGNALS]={
+static gchar *gprs_q_name[TOTAL_STATUS]={
"SignalStrength25g_01.png",
"SignalStrength25g_02.png",
"SignalStrength25g_03.png",
"SignalStrength25g_04.png",
"SignalStrength25g_05.png",
+ NULL
};
static void
@@ -56,21 +63,36 @@
static gboolean
timeout_cb (GsmApplet *applet)
{
- GsmSignalQuality new_gsm_q = moko_panel_gsm_signal_quality ();
- //GprsSignalQuality new_gprs_q = moko_panel_gprs_signal_quality ();
+ char path[512];
+ static SignalStatus status = 0;
- if (applet->gsm_quality == new_gsm_q)
- /*Keep going, image need not change*/
- return TRUE;
+ status = moko_panel_gsm_signal_quality ();
+ if (status != applet->gsm.status )
+ {
+ applet->gsm.status = status;
+ snprintf (path, 512, "%s/%s", PKGDATADIR, gsm_q_name[applet->gsm.status]);
+ if (GTK_IS_IMAGE(applet->gsm.image))
+ gtk_image_set_from_file (applet->gsm.image, path);
+ else
+ g_error ("gsm image set failed");
+ }
+
+ status = moko_panel_gprs_signal_quality ();
+ g_debug ("status = %d", status);
+ if (status == UN_CONN && GTK_WIDGET (applet->gprs.image))
+ {
+ gtk_widget_hide (GTK_WIDGET(applet->gprs.image));
+ }
else
- applet->gsm_quality = new_gsm_q;
-
- /*load new signal status image, FIXME:load these images in memery when
initial the applet*/
- char path[512];
- snprintf (path, 512, "%s/%s", PKGDATADIR, gsm_q_name[applet->gsm_quality]);
- gtk_image_set_from_file (applet->image, path);
-
- /* Keep going */
+ {
+ applet->gprs.status = status;
+ snprintf (path, 512, "%s/%s", PKGDATADIR,
gprs_q_name[applet->gprs.status]);
+ if (GTK_IS_IMAGE(applet->gprs.image))
+ gtk_image_set_from_file (applet->gprs.image, path);
+ gtk_widget_show (GTK_WIDGET (applet->gprs.image));
+ }
+
+ /* keep going*/
return TRUE;
}
@@ -78,22 +100,25 @@
mb_panel_applet_create(const char* id, GtkOrientation orientation)
{
MokoPanelApplet* mokoapplet = moko_panel_applet_new();
- char path[512];
GsmApplet *applet;
applet = g_slice_new (GsmApplet);
+
+ g_object_weak_ref( G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free,
applet );
+ applet->timeout_id = g_timeout_add(2000, (GSourceFunc) timeout_cb, applet);
- applet->gsm_quality = GSM_SIGNAL_ERROR;
- applet->gprs_quality = GPRS_CLOSE;
+ applet->gsm.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
+ applet->gsm.status = UN_CONN;
+ applet->gprs.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
+ applet->gprs.status = UN_CONN;
- snprintf (path, 512, "%s/%s", PKGDATADIR, gsm_q_name[applet->gsm_quality]);
- applet->image = GTK_IMAGE(gtk_image_new_from_file (path));
- gtk_widget_set_name( applet->image, "OpenMoko gsm applet" );
- g_object_weak_ref( G_OBJECT(applet->image), (GWeakNotify) gsm_applet_free,
applet );
+ applet->hbox = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show (applet->hbox);
- applet->timeout_id = g_timeout_add(10000, (GSourceFunc) timeout_cb,
applet);
+ gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image),
FALSE, FALSE, 2);
+ gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image),
FALSE, FALSE, 2);
- moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->image );
+ moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->hbox );
gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
gsm_watcher_install ();
--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-04-02 09:51:12 +0200 (Mon, 02 Apr 2007)
New Revision: 1615
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
whitespace changes
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-02 07:33:07 UTC (rev 1614)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
2007-04-02 07:51:12 UTC (rev 1615)
@@ -32,7 +32,7 @@
static gboolean
gsm_watcher_check (GSource * source)
{
- if (GPfd.revents & (G_IO_IN | G_IO_PRI))
+ if (GPfd.revents & (G_IO_IN | G_IO_PRI))
{
return TRUE;
}
@@ -68,51 +68,50 @@
static int
sigq_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
{
- printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
- gsm_q = aux->u.signal.sigq.rssi;
- //FIXME: Call panel applet image change function here, instead of use g
timeout function to check singal value
- return 0;
+ printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
+ gsm_q = aux->u.signal.sigq.rssi;
+ //FIXME: Call panel applet image change function here, instead of use g
timeout function to check singal value
+ return 0;
}
static int
netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
{
printf("EVENT: Netreg ");
-
- switch (aux->u.netreg.state)
- {
- case 0:
- printf("not searching for network ");
- break;
- case 1:
- printf("registered (home network) ");
- break;
- case 2:
- printf("searching for network ");
- break;
- case 3:
- printf("registration denied ");
- break;
- case 5:
- printf("registered (roaming) ");
- break;
- }
-
- if (aux->u.netreg.lac)
- printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac);
- if (aux->u.netreg.ci)
- printf("CellID = 0x%04X ", aux->u.netreg.ci);
-
- printf("\n");
-
- return 0;
+
+ switch (aux->u.netreg.state)
+ {
+ case 0:
+ printf("not searching for network ");
+ break;
+ case 1:
+ printf("registered (home network) ");
+ break;
+ case 2:
+ printf("searching for network ");
+ break;
+ case 3:
+ printf("registration denied ");
+ break;
+ case 5:
+ printf("registered (roaming) ");
+ break;
+ }
+
+ if (aux->u.netreg.lac)
+ printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac);
+ if (aux->u.netreg.ci)
+ printf("CellID = 0x%04X ", aux->u.netreg.ci);
+
+ printf("\n");
+ return 0;
}
static int
gsm_connect_init()
{
lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);
-
+
if (!lgsmh)
{
printf("Can't connect to gsmd\n");
@@ -150,7 +149,6 @@
moko_panel_gprs_signal_quality()
{
//some code for only for test, since there have not any methord to check out
gprs signal.
-
test ++;
if (test > 11 || test < 0)
test = 0;
Modified:
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
---
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-02 07:33:07 UTC (rev 1614)
+++
trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
2007-04-02 07:51:12 UTC (rev 1615)
@@ -25,7 +25,7 @@
typedef struct{
GtkWidget *image;
SignalStatus status;
-}MokoSignal;
+} MokoSignal;
typedef struct {
MokoSignal gsm;
@@ -55,9 +55,9 @@
static void
gsm_applet_free (GsmApplet *applet)
{
- g_source_remove (applet->timeout_id);
+ g_source_remove (applet->timeout_id);
- g_slice_free (GsmApplet, applet);
+ g_slice_free (GsmApplet, applet);
}
static gboolean
@@ -99,29 +99,29 @@
G_MODULE_EXPORT GtkWidget*
mb_panel_applet_create(const char* id, GtkOrientation orientation)
{
- MokoPanelApplet* mokoapplet = moko_panel_applet_new();
+ MokoPanelApplet* mokoapplet = moko_panel_applet_new();
- GsmApplet *applet;
- applet = g_slice_new (GsmApplet);
+ GsmApplet *applet;
+ applet = g_slice_new (GsmApplet);
- g_object_weak_ref( G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free,
applet );
- applet->timeout_id = g_timeout_add(2000, (GSourceFunc) timeout_cb, applet);
+ g_object_weak_ref( G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free,
applet );
+ applet->timeout_id = g_timeout_add(4000, (GSourceFunc) timeout_cb, applet);
- applet->gsm.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
- applet->gsm.status = UN_CONN;
- applet->gprs.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
- applet->gprs.status = UN_CONN;
+ applet->gsm.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
+ applet->gsm.status = UN_CONN;
+ applet->gprs.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage
object
+ applet->gprs.status = UN_CONN;
- applet->hbox = gtk_hbox_new(FALSE, 0);
- gtk_widget_show (applet->hbox);
+ applet->hbox = gtk_hbox_new(FALSE, 0);
+ gtk_widget_show (applet->hbox);
- gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image),
FALSE, FALSE, 2);
- gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image),
FALSE, FALSE, 2);
+ gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image),
FALSE, FALSE, 2);
+ gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image),
FALSE, FALSE, 2);
- moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->hbox );
- gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
+ moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->hbox );
+ gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
- gsm_watcher_install ();
+ gsm_watcher_install ();
- return GTK_WIDGET(mokoapplet);
+ return GTK_WIDGET(mokoapplet);
};
--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog