예제 #1
0
파일: tabcontroller.py 프로젝트: kmshi/miro
    def _build_sync_section(self, bottom):
        hbox = widgetset.HBox()
        vbox = widgetset.VBox()
        label_line = widgetset.HBox()
        label = self.build_header(_("Sync a Phone, Tablet, or Digital Camera"))
        label_line.pack_start(
            widgetutil.align_left(label, left_pad=20, bottom_pad=10))
        help_button = HelpButton()
        help_button.connect('clicked', self.help_button_clicked)
        label_line.pack_start(widgetutil.align_top(help_button))
        bottom.pack_start(label_line)

        label = widgetset.Label(
            _(
                "Connect the USB cable to sync your Android device with "
                "%(shortappname)s.  Be sure to set your device to 'USB Mass "
                "Storage' mode in your device settings.  Attach your digital "
                "camera, and convert your video files to be instantly "
                "web-ready.", self.trans_data))
        label.set_size(self.TEXT_SIZE)
        label.set_color(self.TEXT_COLOR)
        label.set_size_request(400, -1)
        label.set_wrap(True)
        vbox.pack_start(
            widgetutil.align_left(label, left_pad=20, bottom_pad=20))

        show_all_vbox = widgetset.VBox()
        self.show_unknown = widgetset.Checkbox(
            _("Show all attached devices and drives"))
        self.show_unknown.set_checked(
            app.config.get(prefs.SHOW_UNKNOWN_DEVICES))
        self.show_unknown.connect('toggled', self.show_all_devices_toggled)
        show_all_vbox.pack_start(self.show_unknown)
        padding = self.show_unknown.get_text_padding()
        label = widgetset.Label(
            _(
                "Use this if your phone doesn't appear in %(shortappname)s when "
                "you connect it to the computer, or if you want to sync with an "
                "external drive.", self.trans_data))
        label.set_size(self.TEXT_SIZE)
        label.set_color(self.TEXT_COLOR)
        label.set_size_request(370 - padding, -1)
        label.set_wrap(True)
        show_all_vbox.pack_start(widgetutil.pad(label, top=10, left=padding))
        bg = widgetutil.RoundedSolidBackground(
            widgetutil.css_to_color('#e4e4e4'))
        bg.set_size_request(400, -1)
        bg.add(widgetutil.pad(show_all_vbox, 20, 20, 20, 20))
        vbox.pack_start(widgetutil.pad(bg, left=20, right=10, bottom=50))
        hbox.pack_start(vbox)
        hbox.pack_start(
            widgetutil.align_top(
                widgetset.ImageDisplay(
                    imagepool.get(
                        resources.path('images/connect-android.png')))))
        bottom.pack_start(hbox)
예제 #2
0
파일: tabcontroller.py 프로젝트: kmshi/miro
    def _build_stores_section(self, bottom):
        vbox = widgetset.VBox()
        from miro.frontends.widgets import prefpanel
        self.store_helper = prefpanel.StoreHelper(height=200)
        self.store_helper.store_list.set_size_request(550, -1)
        vbox.pack_start(
            widgetutil.align_middle(self.store_helper.store_list,
                                    top_pad=20,
                                    bottom_pad=15,
                                    left_pad=15,
                                    right_pad=15))

        bg = widgetutil.RoundedSolidBackground(
            widgetutil.css_to_color('#e4e4e4'))
        bg.add(widgetutil.pad(vbox, 00, 10, 10, 10))

        bottom.pack_start(bg)
예제 #3
0
파일: tabcontroller.py 프로젝트: kmshi/miro
    def _build_add_playlist_section(self, bottom):
        hbox = widgetset.HBox()
        label = widgetset.Label(_("Name"))
        hbox.pack_start(widgetutil.align_middle(label))

        self.name_entry = widgetset.TextEntry()
        self.name_entry.set_size_request(400, -1)
        self.name_entry.connect('activate', self._on_add_playlist)
        hbox.pack_start(widgetutil.align_middle(self.name_entry, left_pad=15))

        self.add_playlist_button = widgetutil.TitlebarButton(_("Add Playlist"))
        self.add_playlist_button.connect('clicked', self._on_add_playlist)
        hbox.pack_start(
            widgetutil.align_middle(self.add_playlist_button, left_pad=15))

        bg = widgetutil.RoundedSolidBackground(
            widgetutil.css_to_color('#e4e4e4'))
        bg.add(widgetutil.pad(hbox, 10, 10, 10, 10))

        bottom.pack_start(bg)
예제 #4
0
    def __init__(self):
        widgetset.SolidBackground.__init__(
            self, itemlistwidgets.StandardView.BACKGROUND_COLOR)
        bg = widgetutil.RoundedSolidBackground(widgetutil.WHITE)
        vbox = widgetset.VBox()
        title = widgetset.HBox()
        logo = imagepool.get_image_display(
            resources.path('images/icon-search_large.png'))
        title.pack_start(widgetutil.align_middle(logo))
        label = widgetset.Label(self.TITLE)
        label.set_bold(True)
        label.set_size(widgetutil.font_scale_from_osx_points(30))
        title.pack_start(widgetutil.align_middle(label, left_pad=5))
        vbox.pack_start(widgetutil.align_center(title, bottom_pad=20))
        desc = widgetset.Label(self.DESC)
        vbox.pack_start(widgetutil.align_center(desc, bottom_pad=40))

        engine_width = int((desc.get_width() - 30) / 2)

        engine_widgets = self.build_engine_widgets()
        for widgets in engine_widgets[:-1]:  # widgets with borders
            hbox = widgetset.HBox(spacing=30)
            for widget in widgets:
                widget.set_size_request(engine_width, 45)
                hbox.pack_start(widget, expand=True)
            vbox.pack_start(hbox)

        hbox = widgetset.HBox(spacing=30)
        for widget in engine_widgets[-1]:  # has no border
            widget.set_has_border(False)
            widget.set_size_request(engine_width, 45)
            hbox.pack_start(widget, expand=True)

        vbox.pack_start(hbox)

        bg.add(widgetutil.pad(vbox, 45, 45, 45, 45))
        self.add(widgetutil.align(bg, xalign=0.5, top_pad=50))
예제 #5
0
파일: tabcontroller.py 프로젝트: kmshi/miro
    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))