def _conversions_panel(): extras = [] lab = widgetset.Label(_("Binaries to use:")) lab.set_bold(True) extras.append(align_left(lab)) grid = dialogwidgets.ControlGrid() grid.pack_label(_("ffmpeg binary path:"), grid.ALIGN_RIGHT) ffmpeg_binary = widgetset.TextEntry() attach_text(ffmpeg_binary, options.FFMPEG_BINARY) grid.pack(ffmpeg_binary) grid.end_line(spacing=4) grid.pack_label(_("ffmpeg2theora binary path:"), grid.ALIGN_RIGHT) ffmpeg2theora_binary = widgetset.TextEntry() attach_text(ffmpeg2theora_binary, options.FFMPEG2THEORA_BINARY) grid.pack(ffmpeg2theora_binary) grid.end_line(spacing=4) extras.append(align_left(grid.make_table())) return extras
def _build_daap_section(self, bottom): label = self.build_header( _("%(shortappname)s Sharing", self.trans_data)) bottom.pack_start( widgetutil.align_left(label, left_pad=20, bottom_pad=10)) # Note: "Miro iPad app" is the name of a piece of software-- # don't substitute Miro for %(appname)s here. label = widgetset.Label( _( "%(shortappname)s can stream and download files to and from " "other %(shortappname)ss on your local network and to the " "Miro iPad app. It's awesome!", self.trans_data)) label.set_size(self.TEXT_SIZE) label.set_color(self.TEXT_COLOR) label.set_wrap(True) label.set_size_request(550, -1) bottom.pack_start( widgetutil.align_left(label, left_pad=20, bottom_pad=20)) if not app.sharing_manager.mdns_present: label = widgetset.Label(_("Disabled: Needs Bonjour")) label.set_bold(True) bottom.pack_start( widgetutil.align_left(label, left_pad=20, bottom_pad=20, top_pad=10)) return container = widgetset.HBox() self.share_button = PrettyToggleButton() self.share_button.connect('clicked', self.daap_changed) self.share_button.connect('dragged-left', self.daap_changed) self.share_button.connect('dragged-right', self.daap_changed) self.share_button.set_value(app.config.get(prefs.SHARE_MEDIA)) container.pack_start(widgetutil.pad(self.share_button, right=20)) vbox = widgetset.VBox() hbox = widgetset.HBox(spacing=30) self.share_audio_cbx = widgetset.Checkbox(_("Share Music"), bold=True) self.share_video_cbx = widgetset.Checkbox(_("Share Videos"), bold=True) self.share_warnonquit_cbx = widgetset.Checkbox( _('Warn on quit when others are connected to my media library.')) hbox.pack_start(widgetutil.align_top(self.share_video_cbx)) hbox.pack_start(widgetutil.align_top(self.share_audio_cbx)) prefpanel.attach_boolean(self.share_audio_cbx, prefs.SHARE_AUDIO) prefpanel.attach_boolean(self.share_video_cbx, prefs.SHARE_VIDEO) vbox.pack_start(hbox) label = widgetset.Label( _("My %(shortappname)s Share Name", self.trans_data)) label.set_bold(True) vbox.pack_start(widgetutil.align_left(label, top_pad=15, bottom_pad=5)) hbox = widgetset.HBox() self.share_entry = widgetset.TextEntry() self.share_entry.set_size_request(230, -1) share_error = prefpanel.build_error_image() prefpanel.attach_text(self.share_entry, prefs.SHARE_NAME, share_error, check_function=prefpanel.text_is_not_blank) if not self.share_button.get_value(): self.share_entry.disable() self.share_video_cbx.disable() self.share_audio_cbx.disable() self.share_warnonquit_cbx.disable() hbox.pack_start(self.share_entry) hbox.pack_start(share_error) vbox.pack_start(hbox) vbox.pack_start(widgetutil.pad(self.share_warnonquit_cbx, top=15)) container.pack_start(vbox) bg = widgetutil.RoundedSolidBackground( widgetutil.css_to_color('#e4e4e4')) bg.add(widgetutil.pad(container, 20, 20, 20, 20)) bottom.pack_start(widgetutil.align_left(bg, left_pad=20, bottom_pad=50))
def _build_daap_section(self, bottom): label = self.build_header(_("%(shortappname)s Sharing", self.trans_data)) bottom.pack_start(widgetutil.align_left(label, left_pad=20, bottom_pad=10)) # Note: "Miro iPad app" is the name of a piece of software-- # don't substitute Miro for %(appname)s here. label = self.build_text( _("%(shortappname)s can stream and download files to and from " "other %(shortappname)ss on your local network and to the " "Miro iPad app. It's awesome!", self.trans_data)) label.set_wrap(True) label.set_size_request(550, -1) bottom.pack_start(widgetutil.align_left(label, left_pad=20, bottom_pad=20)) if not app.sharing_manager.mdns_present: label = widgetset.Label(_("Disabled: Needs Bonjour")) label.set_bold(True) bottom.pack_start(widgetutil.align_left( label, left_pad=20, bottom_pad=20, top_pad=10)) return container = widgetset.HBox() self.share_button = PrettyToggleButton() self.share_button.connect('clicked', self.daap_changed) self.share_button.connect('dragged-left', self.daap_changed) self.share_button.connect('dragged-right', self.daap_changed) self.share_button.set_value(app.config.get(prefs.SHARE_MEDIA)) container.pack_start(widgetutil.pad(self.share_button, right=20)) vbox = widgetset.VBox() hbox = widgetset.HBox(spacing=30) self.share_audio_cbx = widgetset.Checkbox(_("Share Music"), bold=True) self.share_video_cbx = widgetset.Checkbox(_("Share Videos"), bold=True) self.share_feed_cbx = widgetset.Checkbox(_("Share Podcasts"), bold=True) self.share_warnonquit_cbx = widgetset.Checkbox( _('Warn on quit when others are connected to my media library.')) hbox.pack_start(widgetutil.align_top(self.share_video_cbx)) hbox.pack_start(widgetutil.align_top(self.share_audio_cbx)) hbox.pack_start(widgetutil.align_top(self.share_feed_cbx)) prefpanel.attach_boolean(self.share_audio_cbx, prefs.SHARE_AUDIO) prefpanel.attach_boolean(self.share_video_cbx, prefs.SHARE_VIDEO) prefpanel.attach_boolean(self.share_feed_cbx, prefs.SHARE_FEED) prefpanel.attach_boolean(self.share_warnonquit_cbx, prefs.SHARE_WARN_ON_QUIT) vbox.pack_start(hbox) label = widgetset.Label( _("My %(shortappname)s Share Name", self.trans_data)) label.set_bold(True) vbox.pack_start(widgetutil.align_left(label, top_pad=15, bottom_pad=5)) hbox = widgetset.HBox() self.share_entry = widgetset.TextEntry() self.share_entry.set_size_request(230, -1) share_error = prefpanel.build_error_image() prefpanel.attach_text(self.share_entry, prefs.SHARE_NAME, share_error, check_function=prefpanel.text_is_not_blank) if not self.share_button.get_value(): self.share_entry.disable() self.share_feed_cbx.disable() self.share_video_cbx.disable() self.share_audio_cbx.disable() self.share_warnonquit_cbx.disable() hbox.pack_start(self.share_entry) hbox.pack_start(share_error) vbox.pack_start(hbox) vbox.pack_start(widgetutil.pad(self.share_warnonquit_cbx, top=15)) container.pack_start(vbox) bg = widgetutil.RoundedSolidBackground( widgetutil.css_to_color('#e4e4e4')) bg.add(widgetutil.pad(container, 20, 20, 20, 20)) bottom.pack_start(widgetutil.align_left(bg, left_pad=20, bottom_pad=50)) widgets = [self.share_button, self.share_entry, self.share_audio_cbx, self.share_video_cbx, self.share_feed_cbx, self.share_warnonquit_cbx] callbacks = (self.sharing_start_volatile, self.sharing_end_volatile) app.sharing_manager.register_interest(self, callbacks, widgets)