~ubuntu-branches/ubuntu/quantal/rhythmbox/quantal-proposed

« back to all changes in this revision

Viewing changes to plugins/sendto/sendto.py

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Rico Tzschichholz
  • Date: 2011-12-05 19:31:23 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20111205193123-89047p8yplb0w1vx
Tags: 2.90.1~20111126.89c872b0-0ubuntu1
* Upload the new version to Ubuntu, should solve those issues:
  - the lack of rhythmbox-client command (lp: #875064)
  - the music sharing preferences dialog (lp: #894153)
  - several segfaults (lp: #859195, #814614)
* debian/control.in:
  - let the rhythmbox gir depends on gir1.2-peas-1.0 (lp: #874973)

[ Rico Tzschichholz ]
* New upstream git snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
# along with this program; if not, write to the Free Software
25
25
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
26
26
 
27
 
import glib
28
27
import rb
29
 
from gi.repository import Gtk, GObject, Peas
 
28
from gi.repository import Gtk, GObject, GLib, Peas
30
29
from gi.repository import RB
31
30
 
 
31
import gettext
 
32
gettext.install('rhythmbox', RB.locale_dir())
 
33
 
32
34
ui_definition = """
33
35
<ui>
34
36
    <popup name="BrowserSourceViewPopup">
53
55
        GObject.Object.__init__(self)
54
56
 
55
57
    def do_activate(self):
56
 
        self.__action = Gtk.Action(name='SendTo', label=_('Send to...'),
57
 
                                tooltip=_('Send files by mail, instant message...'),
 
58
        self.__action = Gtk.Action(name='SendTo', label=_("Send to..."),
 
59
                                tooltip=_("Send files by mail, instant message..."),
58
60
                                stock_id='')
59
61
        shell = self.object
60
62
        self.__action.connect('activate', self.send_to, shell)
61
63
 
62
64
        self.__action_group = Gtk.ActionGroup(name='SendToActionGroup')
63
65
        self.__action_group.add_action(self.__action)
64
 
        shell.get_ui_manager().insert_action_group(self.__action_group, -1)
65
66
 
66
 
        self.__ui_id = shell.get_ui_manager().add_ui_from_string(ui_definition)
 
67
        uim = shell.props.ui_manager
 
68
        uim.insert_action_group(self.__action_group, -1)
 
69
        self.__ui_id = uim.add_ui_from_string(ui_definition)
67
70
 
68
71
    def do_deactivate(self):
69
72
        shell = self.object
70
 
        shell.get_ui_manager().remove_action_group(self.__action_group)
71
 
        shell.get_ui_manager().remove_ui(self.__ui_id)
72
 
        shell.get_ui_manager().ensure_update()
 
73
        uim = shell.props.ui_manager
 
74
        uim.remove_action_group(self.__action_group)
 
75
        uim.remove_ui(self.__ui_id)
 
76
        uim.ensure_update()
73
77
 
74
78
        del self.__action_group
75
79
        del self.__action
80
84
            return
81
85
 
82
86
        entries = page.get_entry_view().get_selected_entries()
83
 
        cmdline = ['nautilus-sendto'] + [entry.get_playback_uri() for entry in entries]
84
 
        glib.spawn_async(argv=cmdline, flags=glib.SPAWN_SEARCH_PATH)
 
87
        cmdline = 'nautilus-sendto ' + " ".join(entry.get_playback_uri() for entry in entries)
 
88
        GLib.spawn_command_line_async(cmdline)