~ken-vandine/ubuntu/maverick/rhythmbox-ubuntuone-music-store/gconf

« back to all changes in this revision

Viewing changes to umusicstore/__init__.py

  • Committer: Ken VanDine
  • Date: 2010-04-14 18:24:33 UTC
  • mfrom: (19.1.4 upstream)
  • Revision ID: ken.vandine@canonical.com-20100414182433-0zy03waiz4la4f3k
releasing version 0.0.9-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
MUSIC_STORE_WIDGET = U1MusicStore() # keep this around for later
37
37
U1LIBRARYPATH = MUSIC_STORE_WIDGET.get_library_location()
38
38
RB_LIBRARY_LOCATIONS = "/apps/rhythmbox/library_locations"
 
39
U1_CONFIG_PATH = "/apps/rhythmbox/plugins/umusicstore"
 
40
U1_FIRST_TIME_FLAG_ENTRY = U1_CONFIG_PATH + "/first_time_flag"
39
41
 
40
42
class U1MusicStorePlugin (rb.Plugin):
41
43
    """The Ubuntu One Music Store."""
72
74
        shell.append_source(self.source, None) # Add the source to the list
73
75
        self.add_u1_library()
74
76
 
 
77
        # Select the source if it's the first time
 
78
        conf_client = gconf.client_get_default ()
 
79
        if not conf_client.get_bool(U1_FIRST_TIME_FLAG_ENTRY):
 
80
            shell.props.sourcelist.select(self.source)
 
81
            conf_client.set_bool(U1_FIRST_TIME_FLAG_ENTRY, True)
 
82
 
75
83
    def deactivate(self, shell):
76
84
        """Plugin shutdown."""
77
85
        # remove source
312
320
        self.install_label_body.set_text(_('To listen to your purchased songs'
313
321
            ', you need to install MP3 plugins. Click below to install them.'))
314
322
        self.install_label_body.set_alignment(0.0, 0.5)
 
323
        self.install_label_eula = gtk.Label()
 
324
        # EULA text copied from /var/lib/dpkg/info/gstreamer0.10-fluendo-plugins-mp3-partner.templates
 
325
        # The partner package shows the EULA itself on installations, but
 
326
        #  aptdaemon installations work like DEBIAN_FRONTEND=noninteractive
 
327
        # so we show the EULA here. (This also avoids a popup window.)
 
328
        # EULA text is not translatable; do not wrap it with gettext!
 
329
        self.install_label_eula.set_markup(
 
330
            "<small>MPEG Layer-3 audio decoding technology notice\n"
 
331
            "MPEG Layer-3 audio decoding technology licensed "
 
332
            "from Fraunhofer IIS and Thomson\n"
 
333
            "This product cannot be installed in product other than Personal "
 
334
            "Computers sold for general purpose usage, and not for set-top "
 
335
            "boxes, embedded PC, PC which are sold and customized for "
 
336
            "mainly audio or multimedia playback and/or registration, "
 
337
            "unless the seller has received a license by Fraunhofer IIS"
 
338
            "and Thomson and pay the relevant royalties to them.</small>")
 
339
        self.install_label_eula.set_alignment(0.0, 0.5)
 
340
        self.install_label_eula.set_size_request(400,200)
 
341
        self.install_label_eula.set_line_wrap(True)
315
342
        self.install_hbtn = gtk.HButtonBox()
316
343
        self.install_hbtn.set_layout(gtk.BUTTONBOX_END)
317
344
        self.install_button = gtk.Button(label=_("Install MP3 plugins"))
321
348
        self.install_vbox.pack_start(self.install_label_body, expand=False,
322
349
            padding=12)
323
350
        self.install_vbox.pack_start(self.install_hbtn, expand=False)
 
351
        self.install_vbox.pack_start(self.install_label_eula, expand=False,
 
352
            padding=12)
324
353
        self.install_box.add(self.install_vbox)
325
354
        self.install_box.show_all()
326
355
        self.add(self.install_box)
343
372
        self.update_progress.show()
344
373
        self.install_label_head.set_text("")
345
374
        self.install_label_body.set_text(_("Finding MP3 plugins"))
 
375
        self.install_label_eula.hide()
346
376
        self.install_hbtn.hide()
347
377
        self.install_vbox.pack_start(self.update_progress, expand=False)
348
378
        transaction.run(reply_handler=lambda: True, 
358
388
        self.install_progress.show()
359
389
        self.install_label_head.set_text("")
360
390
        self.install_label_body.set_text(_("Installing MP3 plugins"))
 
391
        self.install_label_eula.hide()
361
392
        self.install_hbtn.hide()
362
393
        self.install_vbox.pack_start(self.install_progress, expand=False)
363
394
        transaction.run(reply_handler=lambda: True,