copy title information to clipboard

Bug #666564 reported by mccurly on 2010-10-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Panflute
Wishlist
Unassigned

Bug Description

Feature request:
Please add a menu item, that copies the current title information to the clipboard.
The output might be configured by the preferences dialog.

Paul Kuliniewicz (kuliniew) wrote :

What would the use case for this be?

Changed in panflute:
status: New → Triaged
importance: Undecided → Wishlist
mccurly (mccurly) wrote :

In my case i often listen to web radios and often they're playing nice songs. If i like them, i write them down, to buy them in ubuntu one music store, i-tunes, or whatever. I could imagine, that other people do the same, too. A problem is, that not all players support a "current - title - copy -function", or it is impossible to copy them to the clipboard (e.g. rhythmbox, banshee, ...). The great feature would be to simply get that information from panflute applet. Another case could be, to write the current title when texting in social networks, or messangers (if current playing doesn't exist). Thanks for developing panflute and thanks for your attention.

mccurly (mccurly) wrote :

i tinkered a little to get it work for me (based on current maverick release), maybe you find that useful, if you decide to implement it.
ps: sorry, i am not familiar to patching & codeing...

File: GNOME_Panflute_Applet.xml
[snip]
        <popup name="button3">
            <menuitem name="Preferences" verb="Preferences" _label="_Preferences" pixtype="stock" pixname="gtk-preferences"/>
            <menuitem name="Clip" verb="Clip" _label="_Copy to clipboard" pixtype="stock" pixname="gtk-clipboard"/>
            <menuitem name="About" verb="About" _label="_About" pixtype="stock" pixname="gtk-about"/>
        </popup>
[snap]

File: applet.py
[snip]
        applet.setup_menu_from_file (panflute.defs.DATA_DIR, "GNOME_Panflute_Applet.xml", None, [
            ("Preferences", self.__preferences_cb),
            ("Clip", self.__clip_cb),
            ("About", self.__about_cb)
        ])
[snap]

[snip]
    def __clip_cb (self, component, verb):
        """
        Copy meta information to clipboard.
        """
        if self.__player.props.artist is not None and self.__player.props.title is not None:
                if self.__player.props.album is not None:
                        cliptext = self.__player.props.artist + " - " + self.__player.props.title + " from " + self.__player.props.album
                else:
                        cliptext = self.__player.props.artist + " - " + self.__player.props.title
                clipboard = gtk.Clipboard(display=gtk.gdk.display_get_default(), selection="CLIPBOARD")
                clipboard.set_text(cliptext)
[snap]

greetings,
mcc

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers