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. r1395 - in trunk/oe/packages/gsm: . files
      ([EMAIL PROTECTED])
   2. r1396 - in
      trunk/src/target/OM-2007/applications/openmoko-taskmanager: . src
      ([EMAIL PROTECTED])
   3. r1397 -
      trunk/src/target/OM-2007/applications/openmoko-taskmanager/src
      ([EMAIL PROTECTED])
   4. r1398 -
      trunk/src/target/OM-2007/applications/openmoko-taskmanager/src
      ([EMAIL PROTECTED])
   5. r1399 - in
      trunk/src/target/OM-2007/applications/openmoko-taskmanager: . src
      ([EMAIL PROTECTED])
   6. r1400 -
      trunk/src/target/OM-2007/applications/openmoko-taskmanager/src
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2007-03-18 14:57:39 +0100 (Sun, 18 Mar 2007)
New Revision: 1395

Modified:
   trunk/oe/packages/gsm/files/gsmd
   trunk/oe/packages/gsm/libgsmd_svn.bb
Log:
oe/gsm: fix remainders of gpsd start script. taken from OE upstream


Modified: trunk/oe/packages/gsm/files/gsmd
===================================================================
--- trunk/oe/packages/gsm/files/gsmd    2007-03-17 23:17:44 UTC (rev 1394)
+++ trunk/oe/packages/gsm/files/gsmd    2007-03-18 13:57:39 UTC (rev 1395)
@@ -21,7 +21,7 @@
 start() {
        # FIXME add check whether GSM_POW is set at all, otherwise don't try to 
power on
        # Power on GSM device
-       if [ -e "${GSM_POW} ]
+       if [ -e "${GSM_POW}" ]
        then
                echo -n "Powering up GSM device..."
                echo "1" > ${GSM_POW}
@@ -45,17 +45,17 @@
        # 2. We don't need all the logging crud that daemon/initlog sets
        # up -- gsmd does its own syslog calls.
        #
-       if [ -e "${GPS_DEV}" ]
+       if [ -e "${GSM_DEV}" ]
        then
                chown uucp.uucp ${GSM_DEV}
                mkdir -fp /usr/spool/uucp
                chown uucp.uucp /usr/spool/uucp
                stty -F /dev/ttySAC0 crtscts
-               gsmd -p ${GPS_DEV} ${GPSD_OPTS}
+               gsmd -p ${GSM_DEV} ${GSMD_OPTS}
                echo "success"
        else
-           # User needs to symlink ${GPS_DEV} to the right thing
-           echo "No ${GPS_DEV} device, aborting gsmd startup."
+           # User needs to symlink ${GSM_DEV} to the right thing
+           echo "No ${GSM_DEV} device, aborting gsmd startup."
        fi
        RETVAL=$?
        echo

Modified: trunk/oe/packages/gsm/libgsmd_svn.bb
===================================================================
--- trunk/oe/packages/gsm/libgsmd_svn.bb        2007-03-17 23:17:44 UTC (rev 
1394)
+++ trunk/oe/packages/gsm/libgsmd_svn.bb        2007-03-18 13:57:39 UTC (rev 
1395)
@@ -4,7 +4,7 @@
 SECTION = "libs/gsm"
 PROVIDES += "gsmd"
 PV = "0.0+svn${SRCDATE}"
-PR = "r3"
+PR = "r4"
 
 SRC_URI = "svn://svn.openmoko.org/trunk/src/target;module=gsm;proto=http \
            file://gsmd"




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-19 03:48:16 +0100 (Mon, 19 Mar 2007)
New Revision: 1396

Removed:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/patch/
Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/README
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.h
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c
Log:
use root window message handle function to realise close and active window 
functions instead of using matchbox WM command, delete patch for matchbox WM

Modified: trunk/src/target/OM-2007/applications/openmoko-taskmanager/README
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/README   
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/README   
2007-03-19 02:48:16 UTC (rev 1396)
@@ -1,17 +1,2 @@
 This is openmoko-taskmanager application.
 
-usage:
-1. install patch for matchbox-window-manager-1.* (more see README in patch), 
and then reninstall your matchbox-window-manager-1.*.
-
-2. install openmoko-taskmanager 
-
-make sure the openmoko-taskmanager works under matchbox-window-manager-1.*, 
which has been patched.
-
-NOTE: an unpatched matchbox-window-manager-1.* will make the application 
inefficent.
-
-HOWTO run the application:
-openmoko-taskmanager will be launched when openmoko-footer's left button 
clicked. so before you use this application, you must make sure you have 
intalled the openmoko-footer correctly (more see README of openmoko-footer), or 
a more straight way is that you can test it in a terminal, but make sure you 
have run matchbox window manager first. 
-
-TODO:
-UI spec 
-warring message and error handle

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am  
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am  
2007-03-19 02:48:16 UTC (rev 1396)
@@ -3,7 +3,7 @@
 bin_PROGRAMS = openmoko-taskmanager
 
 openmoko_taskmanager_SOURCES = taskmanager.c list_view.c callbacks.c \
-                               popupmenu.c misc.c xatoms.c
+                                              misc.c xatoms.c
 
 openmoko_taskmanager_LDADD = @OPENMOKO_LIBS@
 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-19 02:48:16 UTC (rev 1396)
@@ -82,7 +82,7 @@
     if (!tm)
        return;
     moko_wm_cmd (tm, 
-                       GTK_WIDGET (tm->l->list_view), MB_CMD_ACTIVATE_CLIENT);
+                       GTK_WIDGET (tm->l->list_view), CMD_ACTIVATE_WINDOW);
 }
 
 void
@@ -91,7 +91,7 @@
     if (!tm)
        return;
     moko_wm_cmd (tm, 
-                       GTK_WIDGET (tm->l->list_view), MB_CMD_REMOVE_CLIENT);
+                       GTK_WIDGET (tm->l->list_view), CMD_CLOSE_WINDOW);
 }
 
 void
@@ -118,7 +118,7 @@
     while (1);
 
    do{
-       mbcommand (GDK_DISPLAY(), MB_CMD_REMOVE_CLIENT, list->data, NULL); 
+       mbcommand (GDK_DISPLAY(), CMD_CLOSE_WINDOW, list->data, NULL); 
        g_debug ("%d", list->data);
   
        }
@@ -161,7 +161,7 @@
         gtk_tree_model_get (model, &iter, OBJECT_COL, &w, -1);
         //moko_print_win_list(GDK_DISPLAY(), &w, 1);
         //moko_send_Xclimsgwm(GDK_DISPLAY (), w);
-        mbcommand(GDK_DISPLAY(), MB_CMD_ACTIVATE_CLIENT, w, NULL);
+        mbcommand(GDK_DISPLAY(), CMD_ACTIVATE_WINDOW, w, NULL);
         }
     if (path)
        free (path);
@@ -170,8 +170,8 @@
 void        
 moko_hold_event_cb (GtkButton *btn, MokoTaskList *l) 
 {
-    moko_init_popup_menu(NULL, NULL, l);
- }
+  
+}
 
 void
 moko_wheel_left_up_press_cb (GtkWidget *self, MokoTaskManager *tm)

Modified: trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.c       
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.c       
2007-03-19 02:48:16 UTC (rev 1396)
@@ -277,37 +277,29 @@
 {
     XEvent ev;
     Window root;
-    Atom theme_prop, cmd_prop, desktop_manager_atom;
+    Atom cmd_prop;
 
-    desktop_manager_atom = XInternAtom(dpy, "_NET_DESKTOP_MANGER",False);
-
     root = DefaultRootWindow(dpy);
 
-    /*use to grab desktop later*/
-    if (cmd_id == MB_CMD_DESKTOP) {
-       /* Check if desktop is running */
-       if (!XGetSelectionOwner(dpy, desktop_manager_atom)) {
-          fprintf(stderr, "Desktop not running, exiting...\n");
-          switch (fork()) {
-               case 0:
-                  execvp ("mbdesktop", NULL);
-                  break;
-              case -1:
-                  fprintf(stderr, "failed to exec mbdesktop");
-                  break;
-              }
-          exit(0);
-          }
-       } 
-
-    if (cmd_id == MB_CMD_REMOVE_CLIENT)
+       switch (cmd_id)
        {
-               if (moko_kill_window (dpy, win))
-                       return;
+    /*use to grab desktop later*/
+           case CMD_SHOW_DESKTOP :
+               cmd_prop = atoms[_NET_SHOW_DESKTOP];
+                       break;
+               case CMD_CLOSE_WINDOW :
+               //cmd_prop = atoms[_NET_CLOSE_WINDOW]; FIXME:children windows, 
(wheel and toolbox) could not be close in this way
+                       cmd_prop == NULL;
+                       moko_kill_window (dpy, win);
+                       break;
+               case CMD_ACTIVATE_WINDOW :
+                   cmd_prop = atoms[_NET_ACTIVE_WINDOW];
+                       break;
+               default :
+                       cmd_prop = XInternAtom(dpy, "_MB_COMMAND", False);
        }
-
-    cmd_prop = XInternAtom(dpy, "_MB_COMMAND", False);
-    memset(&ev, '\0', sizeof ev);
+       
+    memset(&ev, '\0', sizeof(ev));
     ev.xclient.type = ClientMessage;
     if (win == NULL)
        ev.xclient.window = root;       /* we send it _from_ root as we have no 
win  */

Modified: trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.h       
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/misc.h       
2007-03-19 02:48:16 UTC (rev 1396)
@@ -35,21 +35,13 @@
 
 #include "xatoms.h"
 
-/*Matchbox windows manager structs*/
-#define MB_CMD_SET_THEME     1
-#define MB_CMD_EXIT          2
-#define MB_CMD_DESKTOP       3
-#define MB_CMD_NEXT          4
-#define MB_CMD_PREV          5
-#define MB_CMD_SHOW_EXT_MENU 6
-#define MB_CMD_MISC          7
-#define MB_CMD_COMPOSITE     8
-#define MB_CMB_KEYS_RELOAD   9
+enum {
+    CMD_ACTIVATE_WINDOW,
+       CMD_CLOSE_WINDOW,
+       CMD_SHOW_DESKTOP,
+       CMD_END
+};
 
-#define MB_CMD_ACTIVATE_CLIENT 100
-#define MB_CMD_REMOVE_CLIENT 101
-#define MB_CMD_REMOVE_AND_ACTIVE 102
-
 Window my_win;
 
 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c  
2007-03-18 13:57:39 UTC (rev 1395)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c  
2007-03-19 02:48:16 UTC (rev 1396)
@@ -23,14 +23,14 @@
 moko_kill_task_cb(GtkMenuItem *item, MokoTaskList *l) {
     g_debug ("kill task cb");
     //moko_wm_cmd(item, l->mokolist_view, MB_CMD_REMOVE_CLIENT);
-    moko_wm_cmd(item, l->list_view, MB_CMD_REMOVE_CLIENT);
+    moko_wm_cmd(item, l->list_view, CMD_CLOSE_WINDOW);
     }
 
 void 
 moko_kill_and_swith_cb(GtkMenuItem *item, MokoTaskList *l) {
     g_debug ("call kill and switch task function");
     //moko_wm_cmd(item, l->mokolist_view, MB_CMD_REMOVE_AND_ACTIVE);
-    moko_wm_cmd(item, l->list_view, MB_CMD_REMOVE_AND_ACTIVE);
+   //moko_wm_cmd(item, l->list_view, MB_CMD_REMOVE_AND_ACTIVE);
     }
 
 void




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-19 03:49:39 +0100 (Mon, 19 Mar 2007)
New Revision: 1397

Removed:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.h
Log:
remove popupmenu

Deleted: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c  
2007-03-19 02:48:16 UTC (rev 1396)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.c  
2007-03-19 02:49:39 UTC (rev 1397)
@@ -1,66 +0,0 @@
-/**
- *  popupmenu.c
- *
- *  Authored by Sun Zhiyong <[EMAIL PROTECTED]>
- *
- *  Copyright (C) 2006-2007 OpenMoko Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Public License as published by
- *  the Free Software Foundation; version 2 of the license.
- *
- *  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 Public License for more details.
- *
- *  Current Version: $Rev$ ($Date$) [$Author$]
- */
-
-#include "popupmenu.h"
-
-void
-moko_kill_task_cb(GtkMenuItem *item, MokoTaskList *l) {
-    g_debug ("kill task cb");
-    //moko_wm_cmd(item, l->mokolist_view, MB_CMD_REMOVE_CLIENT);
-    moko_wm_cmd(item, l->list_view, CMD_CLOSE_WINDOW);
-    }
-
-void 
-moko_kill_and_swith_cb(GtkMenuItem *item, MokoTaskList *l) {
-    g_debug ("call kill and switch task function");
-    //moko_wm_cmd(item, l->mokolist_view, MB_CMD_REMOVE_AND_ACTIVE);
-   //moko_wm_cmd(item, l->list_view, MB_CMD_REMOVE_AND_ACTIVE);
-    }
-
-void
-moko_init_popup_menu (GtkWidget *my_widget, GdkEventButton *event, 
MokoTaskList *l) {
-    GtkWidget *menu;
-    GtkMenuItem *item;
-    int button, event_time;
-    
-    menu = gtk_menu_new ();
-    gtk_widget_show (menu);
-    g_signal_connect (menu, "selection-done", G_CALLBACK (gtk_widget_destroy), 
NULL);
-
-    /* ... add menu items ... */
-    item = gtk_menu_item_new_with_label ("Close and switch");
-    gtk_widget_show (item);
-    gtk_menu_prepend (menu, item);
-    g_signal_connect (item, "activate", G_CALLBACK (moko_kill_and_swith_cb), 
l);
-    item = gtk_menu_item_new_with_label ("Kill the Application");
-    gtk_widget_show (item);
-    gtk_menu_prepend (menu, item);
-    g_signal_connect (item, "activate", G_CALLBACK (moko_kill_task_cb), l);
-    if (event) {
-        button = event->button;
-        event_time = event->time;
-        }
-    else {
-        button = 0;
-        event_time = gtk_get_current_event_time ();
-        }
-    gtk_menu_popup (menu, NULL, NULL, NULL, NULL, 
-                                       button, event_time);
-    }
-

Deleted: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.h  
2007-03-19 02:48:16 UTC (rev 1396)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/popupmenu.h  
2007-03-19 02:49:39 UTC (rev 1397)
@@ -1,33 +0,0 @@
-/**
- *  popupmenu.h
- *
- *  Authored by Sun Zhiyong <[EMAIL PROTECTED]>
- *
- *  Copyright (C) 2006-2007 OpenMoko Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU Public License as published by
- *  the Free Software Foundation; version 2 of the license.
- *
- *  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 Public License for more details.
- *
- *  Current Version: $Rev$ ($Date$) [$Author$]
- */
-
-#ifndef _TASK_MANAGER_POPUP_MENU_H
-#define _TASK_MANAGER_POPUP_MENU_H
-
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-
-#include "list_view.h"
-#include "misc.h"
-
-void
-moko_init_popup_menu (GtkWidget *my_widget, GdkEventButton *event, 
MokoTaskList *l);
-
-
-#endif




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-19 03:54:49 +0100 (Mon, 19 Mar 2007)
New Revision: 1398

Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.h
Log:
small bug fixed 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.h  
2007-03-19 02:49:39 UTC (rev 1397)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.h  
2007-03-19 02:54:49 UTC (rev 1398)
@@ -27,7 +27,6 @@
 #include "misc.h"
 #include "list_view.h"
 #include "xatoms.h"
-#include "popupmenu.h"
 
 GdkFilterReturn
 moko_window_filter (GdkXEvent *xev, GdkEvent *gev, MokoTaskList*l);




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-19 04:20:56 +0100 (Mon, 19 Mar 2007)
New Revision: 1399

Added:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.h
Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/configure.ac
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/taskmanager.c
Log:
add dbus message send function

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/configure.ac
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/configure.ac     
2007-03-19 02:54:49 UTC (rev 1398)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/configure.ac     
2007-03-19 03:20:56 UTC (rev 1399)
@@ -13,11 +13,15 @@
 # base deps
 PKG_CHECK_MODULES(OPENMOKO, openmoko-libs >= 0.0.1,,
                  AC_MSG_ERROR([*** Required OpenMoko Libraries >= 0.0.1 not 
installed ***]))
-PKG_CHECK_MODULES(LIBMB, libmb, ,
-                       exit)
-LIBS="$LIBS $GTK_LIBS"
-CFLAGS="$CFLAGS $OPENMOKO_CFLAGS"
 
+PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1,,
+                 AC_MSG_ERROR([*** Required dbus-glib-1 not installed ***]))
+PKG_CHECK_MODULES(DBUS, dbus-1,,
+                 AC_MSG_ERROR([*** Required dbus-1 not installed ***]))
+
+LIBS="$LIBS $GTK_LIBS $DBUSGLIB_LIBS $DBUS_LIBS"
+CFLAGS="$CFLAGS $OPENMOKO_CFLAGS $DBUSGLIB_CFLAGS $DBUS_CFALGS"
+
 # output stuff
 AC_OUTPUT([
 Makefile

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am  
2007-03-19 02:54:49 UTC (rev 1398)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/Makefile.am  
2007-03-19 03:20:56 UTC (rev 1399)
@@ -3,7 +3,7 @@
 bin_PROGRAMS = openmoko-taskmanager
 
 openmoko_taskmanager_SOURCES = taskmanager.c list_view.c callbacks.c \
-                                              misc.c xatoms.c
+                                              misc.c xatoms.c dbus-conn.c
 
 openmoko_taskmanager_LDADD = @OPENMOKO_LIBS@
 

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-19 02:54:49 UTC (rev 1398)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-19 03:20:56 UTC (rev 1399)
@@ -18,6 +18,7 @@
  */
 
 #include "callbacks.h"
+#include "dbus-conn.h"
 
 GdkFilterReturn
 moko_window_filter (GdkXEvent *xev, GdkEvent *gev, MokoTaskList*l) 
@@ -53,19 +54,11 @@
          return TRUE;
          }
     else 
-       {
-         /*GtkMessageDialog* dialog = gtk_message_dialog_new 
(GTK_WINDOW(gtk_widget_get_toplevel(w)),
-                                                       
GTK_DIALOG_DESTROY_WITH_PARENT,
-                                                  GTK_MESSAGE_ERROR,      
-                                                  GTK_BUTTONS_CLOSE,
-                                                  "No Application selected..." 
);
-         gtk_dialog_run (GTK_DIALOG (dialog));
-         gtk_widget_destroy(GTK_WIDGET(dialog));
-         return TRUE;
-         */
-         g_debug ("send message to footer");
+    {
+            g_debug ("send message to footer");
+         moko_dbus_send_message ("No application selected");
          return FALSE;
-         }
+     }
 }
 
 gboolean 

Added: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.c  
2007-03-19 02:54:49 UTC (rev 1398)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.c  
2007-03-19 03:20:56 UTC (rev 1399)
@@ -0,0 +1,67 @@
+/**
+ *  @file dbus-conn.c
+ *  @brief dbus connection and message send for openmoko mainmenu
+ *  
+ *  Authored by Sun Zhiyong <[EMAIL PROTECTED]>
+ *  
+ *  Copyright (C) 2006-2007 OpenMoko Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Public License as published by
+ *  the Free Software Foundation; version 2 of the license.
+ *
+ *  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 Public License for more details.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ *
+ */
+#include "dbus-conn.h"
+
+static DBusConnection *bus;
+static DBusError error;
+
+gboolean
+moko_dbus_connect_init (void)
+{
+    /* Get a connection to the system bus */
+    dbus_error_init (&error);
+    bus = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+
+    if (!bus)
+    {
+        g_warning ("Failed to connect to the D-BUS daemon: %s", error.message);
+        return FALSE;
+    }
+  
+    if (dbus_error_is_set (&error))
+    {
+        g_warning ("Connection Error (%s)\n", error.message);
+        dbus_error_free (&error);
+    }
+
+    return TRUE;
+}
+
+gboolean
+moko_dbus_send_message (const char *str)
+{
+  DBusMessage *message;
+
+  /* Create a new signal on the "org.openmoko.dbus.TaskManager" interface,
+   * from the object "/org/openmoko/footer". */
+  message = dbus_message_new_signal ("/org/openmoko/footer",
+                                     "org.openmoko.dbus.TaskManager", 
"push_statusbar_message");
+  /* Append the string to the signal */
+  dbus_message_append_args (message,
+                           DBUS_TYPE_STRING, &str,
+                            DBUS_TYPE_INVALID);
+  
+  dbus_connection_send (bus, message, NULL);
+
+  dbus_message_unref (message);
+  
+  return TRUE;
+}

Added: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.h  
2007-03-19 02:54:49 UTC (rev 1398)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/dbus-conn.h  
2007-03-19 03:20:56 UTC (rev 1399)
@@ -0,0 +1,39 @@
+/**
+ *  @file dbus-conn.h
+ *  @brief dbus connection and message send for openmoko mainmenu
+ *  
+ *  Authored by Sun Zhiyong <[EMAIL PROTECTED]>
+ *  
+ *  Copyright (C) 2006-2007 OpenMoko Inc.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU Public License as published by
+ *  the Free Software Foundation; version 2 of the license.
+ *
+ *  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 Public License for more details.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ *
+ */
+#ifndef MOKO_DBUS_MESSAGE_SEND_H
+#define MOKO_DBUS_MESSAGE_SEND_H
+
+#ifndef DBUS_API_SUBJECT_TO_CHANGE
+#define DBUS_API_SUBJECT_TO_CHANGE
+#endif /*DBUS_API_SUBJECT_TO_CHANGE*/
+#include <glib.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+
+gboolean moko_dbus_connect_init (void);
+
+gboolean moko_dbus_send_message (const char *str);
+
+#endif /*MOKO_DBUS_MESSAGE_SEND_H*/

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/taskmanager.c
===================================================================
--- 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/taskmanager.c    
    2007-03-19 02:54:49 UTC (rev 1398)
+++ 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/taskmanager.c    
    2007-03-19 03:20:56 UTC (rev 1399)
@@ -33,6 +33,7 @@
 #include <signal.h>
 
 #include "callbacks.h"
+#include "dbus-conn.h"
 
 #define OPAQUE  0x55555555
 /* set the widget's transparency to opacity 
@@ -248,6 +249,8 @@
     signal (SIGUSR1, handle_sigusr1);
 
     //gtk_widget_set_transparency(tm->window, 50);
+       
+       moko_dbus_connect_init ();
 
     gtk_widget_show_all (GTK_WIDGET (tm->window));
     gtk_widget_show (GTK_WIDGET (tm->wheel));




--- End Message ---
--- Begin Message ---
Author: zhiyong_sun
Date: 2007-03-19 04:46:34 +0100 (Mon, 19 Mar 2007)
New Revision: 1400

Modified:
   trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
Log:
add dbus send function

Modified: 
trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-19 03:20:56 UTC (rev 1399)
+++ trunk/src/target/OM-2007/applications/openmoko-taskmanager/src/callbacks.c  
2007-03-19 03:46:34 UTC (rev 1400)
@@ -55,7 +55,6 @@
          }
     else 
     {
-            g_debug ("send message to footer");
          moko_dbus_send_message ("No application selected");
          return FALSE;
      }
@@ -74,8 +73,7 @@
 {
     if (!tm)
        return;
-    moko_wm_cmd (tm, 
-                       GTK_WIDGET (tm->l->list_view), CMD_ACTIVATE_WINDOW);
+    moko_wm_cmd (tm, GTK_WIDGET (tm->l->list_view), CMD_ACTIVATE_WINDOW);
 }
 
 void
@@ -83,8 +81,7 @@
 {
     if (!tm)
        return;
-    moko_wm_cmd (tm, 
-                       GTK_WIDGET (tm->l->list_view), CMD_CLOSE_WINDOW);
+    moko_wm_cmd (tm, GTK_WIDGET (tm->l->list_view), CMD_CLOSE_WINDOW);
 }
 
 void
@@ -95,7 +92,7 @@
     GtkTreeModel *model;
     Window *win;
     GSList *list = NULL;
-    
+
     gtk_tree_selection_get_selected (sel, &model, &iter);
 
     if (!gtk_tree_model_get_iter_first (model, &iter))
@@ -110,19 +107,12 @@
        }
     while (1);
 
-   do{
-       mbcommand (GDK_DISPLAY(), CMD_CLOSE_WINDOW, list->data, NULL); 
-       g_debug ("%d", list->data);
-  
+   do
+   {
+        mbcommand (GDK_DISPLAY(), CMD_CLOSE_WINDOW, list->data, NULL); 
        }
     while (list = g_slist_next (list));
-         /*Window w;
-
-         gtk_tree_model_get (GTK_TREE_MODEL (model), &iter, OBJECT_COL, &w, 
-1);
-         mbcommand(GDK_DISPLAY(), task, w, NULL);
-         return TRUE;
-         }
-*/
+  
   if (list)
        g_slist_free (list);
 }
@@ -133,8 +123,9 @@
        return;
 
     gtk_window_iconify (GTK_WINDOW (tm->window));
+       moko_dbus_send_message ("");
 }
-
+/*
 void
 moko_tab_event_cb (GtkButton *btn, MokoTaskList *l) 
 {
@@ -165,20 +156,26 @@
 {
   
 }
-
+*/
 void
 moko_wheel_left_up_press_cb (GtkWidget *self, MokoTaskManager *tm)
 {
-   GtkTreeSelection    *selection;
-   GtkTreeModel        *model;
-   GtkTreeIter         iter;
+   GtkTreeSelection *selection;
+   GtkTreeModel *model;
+   GtkTreeIter iter;
    GtkTreePath* path;
 
+   if (!tm->l->list_view)
+       return;
+
    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tm->l->list_view));
 
    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+   {
+     moko_dbus_send_message ("");
         return;
-   
+   }
+
    path = gtk_tree_model_get_path (model, &iter);
    if (!gtk_tree_path_prev (path))
    {
@@ -194,9 +191,9 @@
 void
 moko_wheel_right_down_press_cb (GtkWidget *self, MokoTaskManager *tm)
 {
-   GtkTreeSelection    *selection;
-   GtkTreeModel        *model;
-   GtkTreeIter         iter;
+   GtkTreeSelection *selection;
+   GtkTreeModel *model;
+   GtkTreeIter iter;
    GtkTreePath* path;
 
    if (!tm->l->list_view)
@@ -205,7 +202,10 @@
    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tm->l->list_view));
 
    if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+   {
+     moko_dbus_send_message ("");
         return;
+   }
    
    path = gtk_tree_model_get_path (model, &iter);
    gtk_tree_path_next (path);
@@ -216,4 +216,4 @@
    gtk_tree_view_set_cursor (GTK_TREE_VIEW (tm->l->list_view), path, 0, 0);
    gtk_tree_path_free (path);
    return;
- }
+}




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to