nekohayo / specto

Automatically exported from code.google.com/p/specto
0 stars 0 forks source link

button in libnotify balloon #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, first, sorry for my English and i don't know if this is the correct
place to post that, but i have a feature request for Specto.
My request is a button on the libnotify popup to go to the website when a
site is updated, with a clock to automatic close before a X time. 

I hope that they understand my poor English. I post a image of my request:

http://img452.imageshack.us/img452/4827/testzm2.png

Nice Work with Specto!

Original issue reported on code.google.com by nicolase...@gmail.com on 23 May 2007 at 11:58

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, this is the good place to file bug reports or feature enhancement requests 
:)

I think the feature could be a nice addition. I was refraining myself from 
doing that
because I initially thought it would be against the human interface guidelines 
(HIG).
However, I just took a look at
http://developer.gnome.org/projects/gup/hig/draft_hig_new/desktop-notification-a
rea.html#desktop-notification-balloon
and I did not see anything that said "don't allow clicking on a balloon" (even 
though
I'm pretty sure I saw that once).

I guess this could be implemented if it does not infringe on desktop 
guidelines. It
would be implemented even faster if you are able to code patch for it or point 
us to
example code I could re-use ;)

I am not sure the "clock" would be needed however, since the user already is 
able to
set the amount of time in the preferences.

Original comment by nekoh...@gmail.com on 23 May 2007 at 1:11

GoogleCodeExporter commented 9 years ago
Hi... I dont have idea for the implementation, but a friend write an 
application with
this button in the program, go to the proyect page, and download the sources. 
The
page is:

http://contacts.sourceforge.net/

Thanks

Original comment by nicolase...@gmail.com on 23 May 2007 at 10:15

GoogleCodeExporter commented 9 years ago
Hi, I'm from http://contacts.sourceforge.net/. 

With libnotify 0.4.3, there's this function:

void        notify_notification_add_action  (NotifyNotification *notification,
                                             const char *action,
                                             const char *label,
                                             NotifyActionCallback callback,
                                             gpointer user_data,
                                             GFreeFunc free_func);

Adds an action to a notification. When the action is invoked, the specified 
callback
function will be called, along with the value passed to user_data.

notification :  The notification.
action :    The action ID.
label :     The human-readable action label.
callback :  The action's callback function.
user_data :     Optional custom data to pass to callback.
free_func :     An optional function to free user_data when the notification is 
destroyed.

Example: 
notify_notification_add_action  (self->closed_notification,
                                 "window-closed-setting",
                                 _("Don't show this anymore"),
                                 (NotifyActionCallback) callback_cb,
                                  data,NULL);

With that you add a button, when I have time...(after i waste time sleeping) 
i'll
check the sources of specto and see if I can write a patch. 
If you want you can give guidelines or ideas to torresmat@gmail.com

Original comment by Torres...@gmail.com on 9 Jun 2007 at 2:04

GoogleCodeExporter commented 9 years ago
Hi, I've done the patch. It works for websites only. I had to learn python and 
fight
with my eyes that are still trying to close them selfs. 
I'd like to make this patch better, i believe the changes aren't in the place 
they
should be. That may be cause i didn't check the code carefully sorry :( ... but 
i'll
take a better look tomorrow to the code and see what i can do.

Original comment by Torres...@gmail.com on 12 Jun 2007 at 2:54

Attachments:

GoogleCodeExporter commented 9 years ago
I've noticed gnome-power-manager is using buttons and clocks in notifications. 
I'm
not a huge fan personally. The clock had a "blind panic of doom" feeling about 
it
first time around.

Original comment by sas.d...@gmail.com on 16 Jun 2007 at 12:41

GoogleCodeExporter commented 9 years ago
Yeah, I'm a bit reluctant to including the clock as it does feel like an 
impending
doom countdown, and also is somewhat visual bloat imho. But hey TorresMAT, 
thanks a
lot for the patch. I'm a bit busy currently, but I will be looking at it (and 
most
likely try to expand it to all kinds of watches)

Original comment by nekoh...@gmail.com on 16 Jun 2007 at 1:10

GoogleCodeExporter commented 9 years ago
Just so you know, I will not be including this patch in my commit tonight yet, 
and I
will not be able to look at it before next week, so if you want to improve your 
patch
in the meantime, you are welcome to do so. Some suggestions of improvements:
- expanding it so that it works with all watches and does the same as clicking 
the
"go to" button in the notifier window
- use a stock GTK button, the same "go to" button that we have in the notifier 
window
pane near the bottom. I believe it would be more consistent and would require 
less
translation work.

Thanks again :)

Original comment by nekoh...@gmail.com on 18 Jun 2007 at 1:55

GoogleCodeExporter commented 9 years ago
Ok, no problem. I'll see what i can do. 

Original comment by Torres...@gmail.com on 18 Jun 2007 at 2:07

GoogleCodeExporter commented 9 years ago
Well after spending two hours looking at the code, i can see now its not 
difficult to
do this. I'll write a patch with what I think could be a generic solution so 
you can
tell me what you think. Bye, good luck with that studying.
I also think that the the timeout clock is a bad idea, it seems that the 
armagedon
will happen if it timeouts. 

Original comment by Torres...@gmail.com on 18 Jun 2007 at 5:12

GoogleCodeExporter commented 9 years ago
Here's the patch.

It works for the same watches that Notifier.open_watch handles.

I had to do a method in NotificationToast that does the same that 
Notifier.open_watch
does. I did this because if I used the method in Notifier I would have to mess 
with
the GUI (selecting a row in the tree view, emit the "row-activate" signal so the
Notifier.open_watch method gets invoked and selecting the row that was 
previously
selected so everything gets back to the previous state). If you want, I can 
make a
patch that takes the "mess-with-gui" approach.

About the timeout-clock, it is automatically added when I add the action to the
notification and I couldn't find a function or property to disable it.

The text in the notification button is now taken from the gtk.Stock so 
translation
issues about it can now be forgotten.

Matias

Original comment by Torres...@gmail.com on 18 Jun 2007 at 6:54

Attachments:

GoogleCodeExporter commented 9 years ago
Don't look the last patch, this one is better, the open_watch method is not 
repeated.

Methods changed or added:

Notifier
>>open_watch(self,id)
    """
    Opens watch with identifier id. Doesn't call clear_watch, I think this is better
because functionality is separated.
    Returns True if watch was opened.
    """
>>open_watch_callback(self,*args)
    """
    Callback to "row-activated" and btnOpen's "clicked" signals
    Calls open_watch(), and then clear_watch().
    """

Specto:
>>find_watch(self,name)
    """
    Finds a watch and retrieves its key or id
    """
NotificationToast
>>__open_watch(self, n, action, id)
    """
    Callback function for the button in the notification.
    Calls Notifier.open_watch and Notifier.clear_watch
    """

Original comment by Torres...@gmail.com on 18 Jun 2007 at 10:32

Attachments:

GoogleCodeExporter commented 9 years ago
Nice!!! After applying the patch (from inside the spectlib folder), it works 
for web
pages, GMail accounts and folders (I try with this watches). 

This works like a charm!!!

B.T.W. The clock in the notification looks great to me

Original comment by nicolase...@gmail.com on 18 Jun 2007 at 11:31

GoogleCodeExporter commented 9 years ago
TorresMAT, I am sorry it too so much time for me to actually get to try your 
patch.
It works really well, I think I will simply add it to the next commit I will do 
to
trunk :) thank you!

I might change the "open" button for a "go to" button to be consistent with the
notifier window, though.

Original comment by nekoh...@gmail.com on 30 Jun 2007 at 3:35

GoogleCodeExporter commented 9 years ago
Don't worry, it's ok, i've been kind of busy also. 

Well, the thing is that the Go-To button in the notifier windor it's perfectly
understood, but in the balloon, i think, it's not quite "self-explicative" 
(sorry
about that word :P) to see a "Go to" text. That's why i use the GTK_STOCK_OPEN.
Anyway, i'm not sure which is better, i was just explaining my self. 

Torres Matias

Original comment by Torres...@gmail.com on 30 Jun 2007 at 4:19

GoogleCodeExporter commented 9 years ago
yeah, I think the problem was that you used .strip('_')

I use French, so "Al_ler a" showed up instead of "Aller a". I presume this is 
what
you are talking about. The problem is, knowing that it worked for our languages 
with
the stock "open" thing, I realized that if I did not fix it "properly", other
languages might suffer.

Turns out that python's strip function only works on the first or last letters 
(wtf?).

So, instead of .strip('_'), in my version, I used this:
.replace('_','')

It worked :)

Original comment by nekoh...@gmail.com on 30 Jun 2007 at 6:41

GoogleCodeExporter commented 9 years ago
Good thing you notice this. 

Matias

Original comment by GonzaloR...@gmail.com on 30 Jun 2007 at 11:56

GoogleCodeExporter commented 9 years ago
Wrong account! :P 

Matias

Original comment by Torres...@gmail.com on 30 Jun 2007 at 11:57

GoogleCodeExporter commented 9 years ago
committed to SVN 114, please test so I can mark this as Verified :)

Original comment by nekoh...@gmail.com on 1 Jul 2007 at 12:13

GoogleCodeExporter commented 9 years ago
Seems to work ok to me. 

Matias

Original comment by Torres...@gmail.com on 1 Jul 2007 at 10:39

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 2 Jul 2007 at 3:15

GoogleCodeExporter commented 9 years ago
Works fine here... Nice work!

Original comment by nicolase...@gmail.com on 3 Jul 2007 at 11:26

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 18 Mar 2008 at 2:14

GoogleCodeExporter commented 9 years ago
This feature will be removed in the 0.3 final release due to issue #215.

Original comment by nekoh...@gmail.com on 20 Mar 2009 at 11:54