Re: Illume patch/question

2008-08-16 Thread Stefan Schmidt
Hello.

On Fri, 2008-08-15 at 11:48, Carsten Haitzler wrote:
 
 HAHAHAHA! ok. well... i guess its mergies time in stefan-land. i cleaned a
 little code today in the e_mod_gad_gsm.c file - but that's it.

Was indeed a bit painful. Patch attached. Moved the gsmget code into the gadget,
removed all gsmget spawn and communication handling, split edje updates into
update_signal and update_operator, passing the instance around.

It works fine for me with FSO, but please test it with qtopia first to see if it
breaks something.

  Will fix this up and then you a patch right after some testing this time.
  
  Thomas, thanks for this stuff. Next item on my list is operator name with 
  FSO
  API so I can use a lot of your code already.
 
 i put in a fake  api call there for FSO - dont know if its right. change it as
 needed! :)

Good idea. Sadly it is a bit more difficult. FSO does not have a OperatorChanged
signal. That's inside StatusChanged. The latter brings you also some more
informations. I'll have a poke at it once this one is in.

regards
Stefan Schmidt
Index: src/e_mod_gad_gsm.c
===
--- src/e_mod_gad_gsm.c	(revision 215)
+++ src/e_mod_gad_gsm.c	(working copy)
@@ -1,5 +1,26 @@
 #include e.h
+/* for complex link stuff */
+#include config.h
+#include Ecore.h
+#include E_DBus.h
 
+#include stdio.h
+#include stdlib.h
+#include unistd.h
+#include string.h
+
+static E_DBus_Connection *conn = NULL;
+static E_DBus_Connection *conn_system = NULL;
+static E_DBus_Signal_Handler *changed_h = NULL;
+static E_DBus_Signal_Handler *changed_fso_h = NULL;
+static E_DBus_Signal_Handler *operatorch_h = NULL;
+static E_DBus_Signal_Handler *operatorch_fso_h = NULL;
+static E_DBus_Signal_Handler *namech_h = NULL;
+static E_DBus_Signal_Handler *namech_system_h = NULL;
+
+static Ecore_Timer *try_again_timer = NULL;
+static int success = 0;
+
 /***/
 typedef struct _Instance Instance;
 
@@ -7,9 +28,6 @@
 {
E_Gadcon_Client *gcc;
Evas_Object *obj;
-   Ecore_Exe *gsmget_exe;
-   Ecore_Event_Handler *gsmget_data_handler;
-   Ecore_Event_Handler *gsmget_del_handler;
int strength;
char *operator;
 };
@@ -37,11 +55,28 @@
 /**/
 /***/
 
-static void _gsmget_spawn(Instance *inst);
-static void _gsmget_kill(Instance *inst);
-static int _gsmget_cb_exe_data(void *data, int type, void *event);
-static int _gsmget_cb_exe_del(void *data, int type, void *event);
+static int try_again(void *data);
+static void *signal_unmarhsall(DBusMessage *msg, DBusError *err);
+static void *operator_unmarhsall(DBusMessage *msg, DBusError *err);
+static void signal_callback(void *data, void *ret, DBusError *err);
+static void operator_callback(void *data, void *ret, DBusError *err);
+static void signal_result_free(void *data);
+static void operator_result_free(void *data);
+static void get_signal(void *data);
+static void get_operator(void *data);
+static void signal_changed(void *data, DBusMessage *msg);
+static void operator_changed(void *data, DBusMessage *msg);
+static void name_changed(void *data, DBusMessage *msg);
 
+static int
+try_again(void *data)
+{
+   get_signal(data);
+   get_operator(data);
+   try_again_timer = 0;
+   return 0;
+}
+
 /* called from the module core */
 void
 _e_mod_gad_gsm_init(E_Module *m)
@@ -99,8 +134,56 @@

inst-strength = -1;
inst-operator = NULL;
-   _gsmget_spawn(inst);

+   int sleeptime = 8;
+
+   ecore_init();
+   ecore_string_init();
+   e_dbus_init();
+   
+   conn = e_dbus_bus_get(DBUS_BUS_SESSION);
+   conn_system = e_dbus_bus_get(DBUS_BUS_SYSTEM);
+  
+   namech_h = e_dbus_signal_handler_add(conn,
+	org.freedesktop.DBus,
+	/org/freedesktop/DBus,
+	org.freedesktop.DBus,
+	NameOwnerChanged,
+	name_changed, inst);
+   namech_system_h = e_dbus_signal_handler_add(conn_system,
+	   org.freedesktop.DBus,
+	   /org/freedesktop/DBus,
+	   org.freedesktop.DBus,
+	   NameOwnerChanged,
+	   name_changed, inst);
+   changed_h = e_dbus_signal_handler_add(conn,
+	 org.openmoko.qtopia.Phonestatus,
+	 /Status,
+	 org.openmoko.qtopia.Phonestatus,
+	 signalStrengthChanged,
+	 signal_changed, inst);
+   operatorch_h = e_dbus_signal_handler_add(conn,
+	org.openmoko.qtopia.Phonestatus,
+	/Status,
+	org.openmoko.qtopia.Phonestatus,
+	networkOperatorChanged,
+	operator_changed, inst);
+   changed_fso_h = e_dbus_signal_handler_add(conn_system,
+	 org.freesmartphone.ogsmd,
+	 /org/freesmartphone/GSM/Device,
+	 org.freesmartphone.GSM.Network,
+	 SignalStrength,
+	 signal_changed, inst);
+   operatorch_fso_h = e_dbus_signal_handler_add(conn,
+		org.freesmartphone.ogsmd,
+		/org/freesmartphone/GSM/Device,
+		org.freesmartphone.GSM.Network,
+		

Re: Illume patch/question

2008-08-14 Thread The Rasterman
On Wed, 13 Aug 2008 22:07:09 +0200 Thomas Köckerbauer [EMAIL PROTECTED]
babbled:

thanks for the patch! it's now in svn. i've combined thins with the FSO patches
and hope that they will work with FSO (i don't know). i can confirm they work
with qtopia. i made the font smaller and aligned it to the top-right of the
gadget - it does overflow, but it's hard really to cram text without either
resizing the gadget or having a popup, as you mentioned. the popup also isn't a
useful continual status meter as it either pops up briefly when network status
changes, or you need to click to get it - that's fine, just no popup code
there. i do need to make that gagdet better - stefan was going to remove gsmget
as everything is now dbus and there is no need for a slave process to fetch
status (to avoid blocking the main UI loop). when there is finally a stable
working network manager (wifi connector) api going (connman is good - but
having lots of issues with connman, hald and wpa_supplication as well as kernel
and the atheros wifi all liking eachother). wifiget exists because it drops
down to the lowest layer (netlink socket to kernel), just rummages and finds a
wifi device and gets current signal status every few seconds. it works
irrespective of whatever management layer above exists. batget is from e - the
standard battery meter that also slaves off blocking reads. on a todo list is
to support hal's power management messages - but it's never been an urgent
issue ad batget supports pretty much every power/battery system in exsistence
(from old apm, acpi, /sys/class/power, bsd power api's, powerbook and even
OSX), so it's just never been an urgent issue to solve.

anyway.. patches are now in svn (as promised). they don't break anything -
extend functionality (i've seen it working.. but right now qtopia doesn't want
to talk to my sim card... switched sim card to a local one).

so cool! thanks! :) well done!

 Hi
 
 As mentioned a few days ago I tried to add the operator name into the illume 
 gsm gadget. I've created two patch files, one for the source and one for the 
 freerunner.edc file which is used for illume.edj. The thing where I'm still 
 struggling is the placement of the operator name label. I did not manage to 
 place the label next to the gsm icon so that it does not overlap anything 
 else or it allocates lots of space it does not use. I've now only added the 
 label without any ref1 and ref2 entries. Does anyone have a hint how to get 
 that right?
 
 Here are the patches:
 source: http://www.gup.jku.at/~tkoeck/illume/illume_operator_name.patch
 freerunner.edc: http://www.gup.jku.at/~tkoeck/illume/freerunner_edc.patch
 
 Btw, how should patches be submitted (trac entry, posting on the project
 page, mail, ...)?
 
 
 Cheers,
 Thomas
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community


-- 
Carsten Haitzler (The Rasterman) [EMAIL PROTECTED]

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Illume patch/question

2008-08-14 Thread Stefan Schmidt
Hello.

On Thu, 2008-08-14 at 17:35, Carsten Haitzler wrote:
 On Wed, 13 Aug 2008 22:07:09 +0200 Thomas Köckerbauer [EMAIL PROTECTED]
 babbled:
 
 thanks for the patch! it's now in svn. i've combined thins with the FSO 
 patches
 and hope that they will work with FSO (i don't know).

Will test it.

 there. i do need to make that gagdet better - stefan was going to remove 
 gsmget
 as everything is now dbus and there is no need for a slave process to fetch
 status (to avoid blocking the main UI loop).

And I had it already working on tuesday. I should have sent it out that day
instead of waiting for my next work-day. Now I have the merge conflicts. Well,
that happends to the lazy boys. :)

Will fix this up and then you a patch right after some testing this time.

Thomas, thanks for this stuff. Next item on my list is operator name with FSO
API so I can use a lot of your code already.

regards
Stefan Schmidt


signature.asc
Description: Digital signature
___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Illume patch/question

2008-08-14 Thread The Rasterman
On Thu, 14 Aug 2008 09:54:10 +0200 Stefan Schmidt [EMAIL PROTECTED] babbled:

 Hello.
 
 On Thu, 2008-08-14 at 17:35, Carsten Haitzler wrote:
  On Wed, 13 Aug 2008 22:07:09 +0200 Thomas Köckerbauer [EMAIL PROTECTED]
  babbled:
  
  thanks for the patch! it's now in svn. i've combined thins with the FSO
  patches and hope that they will work with FSO (i don't know).
 
 Will test it.
 
  there. i do need to make that gagdet better - stefan was going to remove
  gsmget as everything is now dbus and there is no need for a slave process
  to fetch status (to avoid blocking the main UI loop).
 
 And I had it already working on tuesday. I should have sent it out that day
 instead of waiting for my next work-day. Now I have the merge conflicts. Well,
 that happends to the lazy boys. :)

HAHAHAHA! ok. well... i guess its mergies time in stefan-land. i cleaned a
little code today in the e_mod_gad_gsm.c file - but that's it.

 Will fix this up and then you a patch right after some testing this time.
 
 Thomas, thanks for this stuff. Next item on my list is operator name with FSO
 API so I can use a lot of your code already.

i put in a fake  api call there for FSO - dont know if its right. change it as
needed! :)

-- 
Carsten Haitzler (The Rasterman) [EMAIL PROTECTED]

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Illume patch/question

2008-08-13 Thread Yaroslav Halchenko
ok -- lets make this thread active so it catches OM people's eyes

 struggling is the placement of the operator name label. I did not manage to 
I wonder if illume or whatever has ability to popup a 'hint' window
and also make that GPS icon react on the 'click' -- then the best
solution imho would be simply to bring that pop-up for few seconds where
provider/signal strength/etc is displayed... similar to 2007.2 display
when it gets connected to the GSM network

 Here are the patches:
 source: http://www.gup.jku.at/~tkoeck/illume/illume_operator_name.patch
 freerunner.edc: http://www.gup.jku.at/~tkoeck/illume/freerunner_edc.patch

 Btw, how should patches be submitted (trac entry, posting on the project 
 page, 
 mail, ...)?
well -- my guess is through the trac BTS although it might be cumbersome

then it will not be lost in the hundreds of emails in the mailing list

-- 
  .-.
=--   /v\  =
Keep in touch// \\ (yoh@|www.)onerussian.com
Yaroslav Halchenko  /(   )\   ICQ#: 60653192
   Linux User^^-^^[17]



___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Illume patch/question

2008-08-13 Thread Holger Freyther
On Wednesday 13 August 2008 22:07:09 Thomas Köckerbauer wrote:

 Btw, how should patches be submitted (trac entry, posting on the project
 page, mail, ...)?

trac, mail to raster would work. We might need to make this runtime 
configurable... So trac might be the best idea so our PM does see it.

z.

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community


Re: Illume patch/question

2008-08-13 Thread The Rasterman
On Wed, 13 Aug 2008 22:07:09 +0200 Thomas Köckerbauer [EMAIL PROTECTED]
babbled:

let me take a look. yes - you can do popups. though there is no theme or
standard popup layout - you can always do your own or recycle an existing
one, but it won't match the theme. as any form of popup was not specified in
ASU's design - i pretty much have no nice and easy support for it. :( what is
useful here is the code patches to get the nuts and bolts data. good work! i
need to merge this and the FSO dbus support patches. i'll look at yours today
and deal with the FSO ones from stefan now that i have dictionary
lookup/correction support back in illume's keyboard. (though need to build an
image and test...)

 Hi
 
 As mentioned a few days ago I tried to add the operator name into the illume 
 gsm gadget. I've created two patch files, one for the source and one for the 
 freerunner.edc file which is used for illume.edj. The thing where I'm still 
 struggling is the placement of the operator name label. I did not manage to 
 place the label next to the gsm icon so that it does not overlap anything 
 else or it allocates lots of space it does not use. I've now only added the 
 label without any ref1 and ref2 entries. Does anyone have a hint how to get 
 that right?
 
 Here are the patches:
 source: http://www.gup.jku.at/~tkoeck/illume/illume_operator_name.patch
 freerunner.edc: http://www.gup.jku.at/~tkoeck/illume/freerunner_edc.patch
 
 Btw, how should patches be submitted (trac entry, posting on the project
 page, mail, ...)?
 
 
 Cheers,
 Thomas
 
 ___
 Openmoko community mailing list
 community@lists.openmoko.org
 http://lists.openmoko.org/mailman/listinfo/community


-- 
Carsten Haitzler (The Rasterman) [EMAIL PROTECTED]

___
Openmoko community mailing list
community@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/community