Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques FaceBook Applet
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] FaceBook Applet
Page : 1 2 3
jesuisbenjamin English 58 jesuisbenjamin [Read]
27 April 2011 à 16:57

jesuisbenjamin, Tuesday 19 April 2011 à 16:40


Subscription date : 28 October 2009
Messages : 415
fabounet :
I don't think you need to stop the animation, since it is made to catch the user attention, and he may not be watching his screen at the moment.
adding an option to disable the animation is a good solution IMHO


The mail applet for instance bounces few times (even as the dock's hidden) then it stops. I wanted the same behaviour for the Facebook applet to maintain consistency.

fabounet :
jesuisbenjamin :
But then it stays up and hangs above the dock as i mentioned before.
it should stop animating and becomt invisible if the dock is hidden. what exactly appears ?

The dock's hidden. Then then the function is called and the applet's icon bounces up and down, so it's visible (while the rest of the dock remains invisible). When the bouncing stop however the image of the icon when at the top of its bounce remains even though the animation is over.
Take a look at this screen capture: http://videobin.org/+4b9/4nw.html

fabounet :
you don't have to, the Interface does it for you. you just have to redefine the function on_answer_dialog in your class :)

i found that out

EDIT PS: Also how do i add formated urls to the a PopupDialog()?
I added the attribute "use-markup" = True and put <html>...</html> at both ends the message thread. Yet the message appears blank...

jesuisbenjamin, Tuesday 19 April 2011 à 22:43


Subscription date : 28 October 2009
Messages : 415
OK i am almost done with the applet

Just two more things:
i use self.icon.PopupDigalog x 3 in a row, following a step by step procedure of installation. When clicking ok, the on_answer_dialog() method changes a token, so we know the user has given a response. I thought i'd create a while token not good: continue but then the on_answer_dialog() does not respond to the click on the dialog and the program never gets out of the loop. How can i make either a loop or make the program wait till the user did his job with the dialog?
I solved this with a semaphore method and a looping thread from glib

I have some configurations which are not for the user to change, but for the applet. In short i need to write some boolean values to two attributes of the current_theme's .conf file. How can i do that? Is there a function from the API for this?

Then it's ready for testing

PS: it'd be interesting to have a function like this:
variable = self.OnResponse(self.icon.PopupDialog({blabla}{blala})) returning either True or False (OK or Cancel)

jesuisbenjamin, Wednesday 20 April 2011 à 13:47


Subscription date : 28 October 2009
Messages : 415
Aright!

The applet is ready for testing!
I'm quite proud of it: it's my first you see

Released on another thread: http://www.glx-dock.org/bg_topic.php?t=5333

Please let me know if you have this graphic glitch with the bouncing effect too

fabounet, Wednesday 20 April 2011 à 14:21


Subscription date : 30 November 2007
Messages : 17118
ok I'll fix the animation stopping, thanks for noticing

for dialogs, you can pass a small subset of HTML, as understood by Pango (see the Pango doc for more details)
basically you can add some spans in your text, like <b></b>, or <span color='red'></span>

jesuisbenjamin, Friday 22 April 2011 à 16:48


Subscription date : 28 October 2009
Messages : 415
Hi there,

I've been looking at options to improve the applet. I found that perhaps widening its range to other micro-blogging would be nice. So i think of connecting an applet to Gwibber through DBus.
I am not familiar with DBus though, especially i don't understand: how do i get to know what are the arguments i should pass into the dbus object methods?

matttbe, Friday 22 April 2011 à 17:27


Subscription date : 24 January 2009
Messages : 12573
You can have a look to d-feet, it's a interesting application to know all dbus signals with which arguments, etc.

EDIT: if you want to create an interface to Gwibber, it's maybe better to create another applet

jesuisbenjamin, Friday 22 April 2011 à 17:49


Subscription date : 28 October 2009
Messages : 415
Sure i am thinking of making the applet from scratch (more or less).

I have Dfeet (you told me about it before). But DFeet tells me about the methods but not what arguments I need to pass in.
For instance a method of the com.Gwibber.Accounts interface is Query(String query) -> (String) What string am i supposed to pass in? What is the "query" argument? I'm confused.
I found some documents online: http://developer.ubuntu.com/api/ubuntu-11.04/GIR/python/Gwibber-0.1.html But it's not very enlightening...

matttbe, Friday 22 April 2011 à 18:01


Subscription date : 24 January 2009
Messages : 12573
Oh... Yes if there is no documentation about that, I guess there are only 4 solutions:
  • Have a look to Gwibber code or other apps which use this Dbus interface
  • Contact Gwibber devs (on irc)
  • Monitor dbus signals (with dbus-monitor command)
  • Or try something at random :^^:

jesuisbenjamin, Friday 22 April 2011 à 18:55


Subscription date : 28 October 2009
Messages : 415
I'm gettin the idea now that Gwibber does not allow to check for private messages on Facebook. That would suck, i can't use 1000 interfaces for each bit of service of a same provider.
Now there is this http://search.cpan.org/dist/WWW-Facebook-API/
Can you tell me how to use this? Is it in Perl languages? How do i combine this with the applet? Is it really more efficient then that using FBCMD?

matttbe, Friday 22 April 2011 à 20:53


Subscription date : 24 January 2009
Messages : 12573
Yes, it's in Perl but I don't know how does it works. You can create a perl script and interact with it by using Python (or by creating an interface for CD in perl but I think it's not easy to use DBus in Perl)

Is it really more efficient then that using FBCMD?
Mmmh, if you can add this perl library in your applet package and if the user just has to drop your applet into the dock to play with it, yes, it's much better.

jesuisbenjamin, Friday 22 April 2011 à 20:57


Subscription date : 28 October 2009
Messages : 415
Well it will need the user to accept a download of the library and he will have to go authorisation processes and enter keys which is bound to be so using Facebook.

jesuisbenjamin, Sunday 24 April 2011 à 01:29


Subscription date : 28 October 2009
Messages : 415
Update: I managed to log in Facebook from Python!
Now i need to find out how to retrieve my data

jesuisbenjamin, Sunday 24 April 2011 à 11:21


Subscription date : 28 October 2009
Messages : 415
Hey i have some question:

the drop-down list in the .conf file returns numbers to the variables, while the list provides strings it returns integers. Is there anyway to make it return strings or should i change my code accordingly?
Thanks

#l+[superior;always;different;never] Under what condition do you want the applet to notify you?:
#{"always" will notify you whenever the number of notifications is not 0; "different" will do so whenever the number of notifications changes; "superior" will notify you whenever it increases (default), "never"--obviously--will prevent the applet from bothering you. The applet will always set an emblem on the icon however.}
ATTENTION_WHEN=0

#l+[bounce;blink;pulse;rotate;spot;wave;wobbly;none] Do you want the applet to apply any effect on the icon during the notification?
#{Effect is "bounce" by default.}
ATTENTION_HOW=0

fabounet, Tuesday 26 April 2011 à 15:35


Subscription date : 30 November 2007
Messages : 17118
for animation, there is a dedicated key ('a' IIRC, check the Drop&share applet for instance)

for the menu, what's wrong with numbers ? (apart from being hard-coded, but you rarely need to change the numbers)
I think there is a widget for having text though, but I don't remember which one
have a look in cairo-dock-gui-factory.h in the core for the complete list

jesuisbenjamin, Tuesday 26 April 2011 à 15:39


Subscription date : 28 October 2009
Messages : 415
fabounet :
for animation, there is a dedicated key ('a' IIRC, check the Drop&share applet for instance)


huh... i can't figure out what you're talking about here

fabounet :
for the menu, what's wrong with numbers ? (apart from being hard-coded, but you rarely need to change the numbers)
I think there is a widget for having text though, but I don't remember which one
have a look in cairo-dock-gui-factory.h in the core for the complete list


Well yes. I sorted it out with a python dictionary.

fabounet, Wednesday 27 April 2011 à 16:28


Subscription date : 30 November 2007
Messages : 17118
see in the Music Player or the DropAndShare applets, I'm quite sure they have an "animations list" widget.

jesuisbenjamin, Wednesday 27 April 2011 à 16:32


Subscription date : 28 October 2009
Messages : 415
fabounet :
see in the Music Player or the DropAndShare applets, I'm quite sure they have an "animations list" widget.


oh so you're talking about the drop-down menu with the choice between the different animations? In that case i sorted it out in the latest version on LP.

fabounet, Wednesday 27 April 2011 à 16:47


Subscription date : 30 November 2007
Messages : 17118
yep, this one.
I don't know how you did, but using the dedicated widget is better, since you don't know in advance which animations are available (they are plug-ins)

jesuisbenjamin, Wednesday 27 April 2011 à 16:57


Subscription date : 28 October 2009
Messages : 415
fabounet :
yep, this one.
I don't know how you did, but using the dedicated widget is better, since you don't know in advance which animations are available (they are plug-ins) :)


OK i'll look at it.

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] FaceBook Applet
Page : 1 2 3
jesuisbenjamin English 58 jesuisbenjamin [Read]
27 April 2011 à 16:57


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques FaceBook Applet Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.