コード例 #1
0
ファイル: dialogs.py プロジェクト: kfatehi/miro
 def __init__(self, title):
     MainDialog.__init__(self, title, description='')
     self.progress_bar = widgetset.ProgressBar()
     self.label = widgetset.Label()
     self.label.set_size(1.2)
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(self.label))
     self.vbox.pack_end(self.progress_bar)
     self.set_extra_widget(self.vbox)
コード例 #2
0
ファイル: itemedit.py プロジェクト: zjmmjzzjm/miro
 def __init__(self):
     widgetset.Dialog.__init__(self, _('Edit Item'))
     self.items = set()
     self.results = {}
     self.vbox = widgetset.VBox()
     self.panels = {}
     self.content_panel = widgetutil.WidgetHolder()
     self.toggler = Toggler()
     self.toggler.connect('choose', self.on_choose_panel)
コード例 #3
0
ファイル: rundialog.py プロジェクト: zjmmjzzjm/miro
 def build_extra_widget(self, window):
     self.checkbox = widgetset.Checkbox(self.dialog.checkbox_text)
     self.checkbox.set_checked(self.dialog.checkbox_value)
     self.entry = widgetset.TextEntry(self.dialog.textbox_value)
     self.entry.set_activates_default(True)
     vbox = widgetset.VBox()
     vbox.pack_start(self.checkbox)
     vbox.pack_start(self.entry)
     window.set_extra_widget(vbox)
コード例 #4
0
ファイル: displays.py プロジェクト: nicolasembleton/miro
 def __init__(self, renderer):
     Display.__init__(self)
     self.create_signal('cant-play')
     self.create_signal('ready-to-play')
     self.renderer = renderer
     self.widget = widgetset.VBox()
     self.widget.pack_start(self.renderer, expand=True)
     self.cant_play_widget = CantPlayWidget()
     self._showing_renderer = True
     self.in_fullscreen = False
コード例 #5
0
 def startup(self):
     window = widgetset.MainWindow('Miro Profiler',
                                   widgetset.Rect(100, 100, 700, 500))
     self.vbox = widgetset.VBox()
     button = widgetset.Button("Start Test")
     button.connect('clicked', self.start_button_clicked)
     self.vbox.pack_end(button)
     window.set_content_widget(self.vbox)
     window.show()
     self.set_up()
コード例 #6
0
ファイル: dialogs.py プロジェクト: nicolasembleton/miro
 def __init__(self, title, text):
     MainDialog.__init__(self, title)
     self.progress_bar = widgetset.ProgressBar()
     self.top_label = widgetset.Label()
     self.top_label.set_text(text)
     self.top_label.set_wrap(True)
     self.top_label.set_size_request(350, -1)
     self.label = widgetset.Label()
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(self.label))
     self.vbox.pack_end(self.progress_bar)
     self.vbox.pack_end(widgetutil.pad(self.top_label, bottom=6))
     self.set_extra_widget(self.vbox)
コード例 #7
0
ファイル: firsttimedialog.py プロジェクト: kmshi/miro
    def build_media_player_import_page(self):
        vbox = widgetset.VBox(spacing=5)

        vbox.pack_start(
            _build_title_question(
                _(
                    "Would you like to display your %(player)s music and "
                    "video in %(appname)s?", {
                        "player": self.mp_name,
                        "appname": app.config.get(prefs.SHORT_APP_NAME)
                    })))

        rbg = widgetset.RadioButtonGroup()
        yes_rb = widgetset.RadioButton(_("Yes"), rbg)
        no_rb = widgetset.RadioButton(_("No"), rbg)
        yes_rb.set_selected()

        vbox.pack_start(widgetutil.align_left(yes_rb))
        vbox.pack_start(widgetutil.align_left(no_rb))

        lab = widgetset.Label(
            _(
                "Note: %(appname)s won't move or copy any files on your "
                "disk.  It will just add them to your %(appname)s library.",
                {"appname": app.config.get(prefs.SHORT_APP_NAME)}))
        lab.set_size_request(WIDTH - 40, -1)
        lab.set_wrap(True)
        vbox.pack_start(widgetutil.align_left(lab))

        def handle_next(widget):
            if rbg.get_selected() == yes_rb:
                self.import_media_player_stuff = True
            else:
                self.import_media_player_stuff = False
            self.next_page()

        prev_button = widgetset.Button(_("< Previous"))
        prev_button.connect('clicked', lambda x: self.prev_page())

        next_button = widgetset.Button(_("Next >"))
        next_button.connect('clicked', handle_next)

        vbox.pack_start(widgetutil.align_bottom(
            widgetutil.align_right(
                widgetutil.build_hbox((prev_button, next_button)))),
                        expand=True)

        vbox = widgetutil.pad(vbox)

        return vbox
コード例 #8
0
    def run_dialog(self):
        """
        Returns (directory, show-in-sidebar) or None
        """
        try:
            extra = widgetset.VBox(spacing=10)
            if self.previous_error:
                extra.pack_start(widgetset.Label(self.previous_error))

            self.folder_entry = widgetset.TextEntry()
            self.folder_entry.set_activates_default(True)
            self.folder_entry.set_text(filename_to_unicode(self.path))
            self.folder_entry.set_size_request(300, -1)

            choose_button = widgetset.Button(_("Choose..."))
            choose_button.connect('clicked', self.handle_choose)

            h = widgetset.HBox(spacing=5)
            h.pack_start(
                widgetutil.align_middle(widgetset.Label(_("Directory:"))))
            h.pack_start(widgetutil.align_middle(self.folder_entry))
            h.pack_start(widgetutil.align_middle(choose_button))

            extra.pack_start(h)

            self.visible_checkbox = widgetset.Checkbox(
                _("Show in my sidebar as a podcast"))
            self.visible_checkbox.set_checked(True)
            extra.pack_start(self.visible_checkbox)

            self.vbox = extra

            self.set_extra_widget(extra)
            self.add_button(BUTTON_ADD_FOLDER.text)
            self.add_button(BUTTON_CANCEL.text)

            ret = self.run()
            if ret == 0:
                # 17407 band-aid - don't init with PlatformFilenameType since
                # str use ascii codec
                dir = self.folder_entry.get_text()
                if PlatformFilenameType == str:
                    dir = dir.encode('utf-8')
                return (dir, self.visible_checkbox.get_checked())

            return None

        except StandardError:
            logging.exception("newwatchedfolder threw exception.")
コード例 #9
0
def _build_header(channel):
    v = widgetset.VBox(6)

    lab = widgetset.Label(clamp_text(channel.name, 60))
    lab.set_bold(True)
    lab.set_size(1.2)
    v.pack_start(widgetutil.align_left(lab))

    lab = widgetset.Label(clamp_text(channel.url, 80))
    lab.set_selectable(True)
    lab.set_size(widgetconst.SIZE_SMALL)
    lab.set_color(widgetconst.DIALOG_NOTE_COLOR)
    v.pack_start(widgetutil.align_left(lab))

    return v
コード例 #10
0
ファイル: guidecontroller.py プロジェクト: zjmmjzzjm/miro
    def __init__(self, title):
        widgetset.VBox.__init__(self)
        self.current_limit = self.ITEM_LIMIT
        hbox = widgetset.HBox()
        label = widgetset.Label(title.upper())
        label.set_size(0.7)
        label.set_color((0.5, 0.5, 0.5))
        hbox.pack_start(widgetutil.align_left(label), expand=True)
        self.pack_start(widgetutil.pad(hbox, top=20, bottom=10))

        self.item_box = widgetset.VBox(
            spacing=8)  # we want 17px of padding, so
        # 17/2 is close to 8
        self.pack_start(self.item_box)

        self.item_list = []
コード例 #11
0
ファイル: update.py プロジェクト: kmshi/miro
 def __init__(self, url):
     dialogs.MainDialog.__init__(self, _("Update Available"))
     self.browser = UpdateAvailableBrowser(url)
     label = widgetset.Label()
     label.set_text(
         _('A new version of %(appname)s is available for download.',
           {"appname": app.config.get(prefs.SHORT_APP_NAME)}))
     label2 = widgetset.Label()
     label2.set_text(_('Do you want to download it now?'))
     self.vbox = widgetset.VBox(spacing=6)
     self.vbox.pack_end(widgetutil.align_center(label2))
     self.vbox.pack_end(self.browser, expand=True)
     self.vbox.pack_end(widgetutil.align_center(label))
     self.set_extra_widget(self.vbox)
     self.add_button(dialogs.BUTTON_YES.text)
     self.add_button(dialogs.BUTTON_NO.text)
コード例 #12
0
    def __init__(self):
        self.device = None
        widgetset.VBox.__init__(self)

        self.button_row = segmented.SegmentedButtonsRow()

        for key, name in (('main', _('Main')), ('podcasts', _('Podcasts')),
                          ('playlists', _('Playlists')), ('settings',
                                                          _('Settings'))):
            button = DeviceTabButtonSegment(key, name, self._tab_clicked)
            self.button_row.add_button(name.lower(), button)

        self.button_row.set_active('main')
        self.pack_start(
            widgetutil.align_center(self.button_row.make_widget(), top_pad=50))

        self.tabs = {}
        self.tab_container = widgetset.Background()
        self.pack_start(self.tab_container, expand=True)

        label_size = widgetutil.font_scale_from_osx_points(16)
        vbox = widgetset.VBox()
        label = widgetset.Label(
            _("Drag individual video and audio files "
              "onto the device in the sidebar to copy "
              "them."))
        label.set_size(label_size)
        vbox.pack_start(widgetutil.align_center(label, top_pad=50))
        label = widgetset.Label(
            _("Use these options and the tabs above for "
              "automatic syncing."))
        label.set_size(label_size)
        vbox.pack_start(widgetutil.align_center(label, top_pad=10))

        self.device_size = SizeWidget()
        self.device_size.sync_button.connect('clicked', self.sync_clicked)
        self.pack_end(self.device_size)

        self.sync_container = widgetset.Background()
        self.pack_end(widgetutil.align_center(self.sync_container))

        self.add_tab('main', vbox)
        self.add_tab('podcasts', widgetutil.align_center(PodcastSyncWidget()))
        self.add_tab('playlists',
                     widgetutil.align_center(PlaylistSyncWidget()))
        self.add_tab('settings',
                     widgetutil.align_center(DeviceSettingsWidget()))
コード例 #13
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)
コード例 #14
0
 def _build_android_section(self, bottom):
     hbox = widgetset.HBox()
     vbox = widgetset.VBox()
     label = self.build_header(_("Miro on Android"))
     vbox.pack_start(
         widgetutil.align_left(label, left_pad=20, bottom_pad=10))
     label = self.build_text(
         _("We don't yet have a Miro app for Android, but you can stream "
           "to your device using other DAAP apps."))
     label.set_wrap(True)
     label.set_size_request(550, -1)
     vbox.pack_start(
         widgetutil.align_left(label,
                               left_pad=20,
                               right_pad=10,
                               bottom_pad=20))
     hbox.pack_start(vbox)
     bottom.pack_start(hbox)
コード例 #15
0
 def _pack_left(self, vbox):
     """Pack the left column into the middle HBox of the main VBox."""
     widget = widgetset.VBox()
     left = []
     left.append(TextField('name', self.items, _("Name")))
     left.append(TextField('artist', self.items, _("Artist")))
     left.append(TextField('album', self.items, _("Album")))
     left.append(TextField('genre', self.items, _("Genre")))
     left.append(
         MultifieldRow(
             NumberField('track', self.items, _("Track"), width=2),
             NumberField('album_tracks', self.items, _("/"), width=2),
             NumberField('year', self.items, _("Year"), width=4),
         ))
     left.append(LongTextField('description', self.items, _("About")))
     for field in left:
         widget.pack_start(field.get_box(), padding=5)
     vbox.pack_start(widget)
     self.fields.extend(left)
コード例 #16
0
ファイル: displays.py プロジェクト: zjmmjzzjm/miro
 def __init__(self, tab_type, selected_tabs):
     Display.__init__(self)
     self.type = tab_type
     self.child_count = self.folder_count = self.folder_child_count = 0
     tab_list = app.tabs[tab_type]
     for tab in selected_tabs:
         if hasattr(tab, "is_folder") and tab.is_folder:
             self.folder_count += 1
             self.folder_child_count += tab_list.get_child_count(tab.id)
         else:
             self.child_count += 1
     vbox = widgetset.VBox(spacing=20)
     label = self._make_label(tab_type, selected_tabs)
     label.set_size(widgetutil.font_scale_from_osx_points(30))
     label.set_bold(True)
     label.set_color((0.3, 0.3, 0.3))
     vbox.pack_start(widgetutil.align_center(label))
     vbox.pack_start(widgetutil.align_center(self._make_buttons(tab_type)))
     self.widget = widgetutil.align_middle(vbox)
コード例 #17
0
ファイル: tabcontroller.py プロジェクト: kmshi/miro
    def __init__(self):
        widgetset.VBox.__init__(self)

        title = widgetset.HBox()
        logo = widgetset.ImageDisplay(
            imagepool.get(resources.path('images/icon-playlist_large.png')))
        title.pack_start(widgetutil.align_middle(logo))
        label = widgetset.Label(_("Playlists"))
        label.set_size(widgetutil.font_scale_from_osx_points(30))
        label.set_bold(True)
        title.pack_start(widgetutil.align_middle(label, left_pad=5))
        self.pack_start(
            widgetutil.align_center(title, top_pad=30, bottom_pad=20))

        bottom = widgetset.VBox()

        self._build_add_playlist_section(bottom)

        self.pack_start(widgetutil.align_center(bottom))
コード例 #18
0
ファイル: guidecontroller.py プロジェクト: zjmmjzzjm/miro
    def __init__(self):
        widgetset.SolidBackground.__init__(self)
        self.set_background_color(widgetutil.css_to_color('#e7e7e7'))
        self.video = GuideSidebarCollection(_("Recently Watched"))
        self.audio = GuideSidebarCollection(_("Recently Listened To"))
        self.download = GuideSidebarCollection(_("Recent Downloads"))
        self.vbox = widgetset.VBox()
        self.vbox.pack_start(self.video)
        self.vbox.pack_start(self.audio)
        self.vbox.pack_start(self.download)
        self.add(widgetutil.pad(self.vbox, left=17, right=17))

        self.id_to_collection = {}

        self.changing_size = False
        self.current_height = None
        self.connect('size-allocated', self.on_size_allocated)

        self.set_size_request(172, 220)
コード例 #19
0
ファイル: displays.py プロジェクト: nicolasembleton/miro
    def __init__(self):
        widgetset.SolidBackground.__init__(self, (0, 0, 0))
        vbox = widgetset.VBox()
        label = widgetset.Label(_(
            "%(appname)s can't play this file.  You may "
            "be able to open it with a different program",
            {"appname": app.config.get(prefs.SHORT_APP_NAME)}
            ))
        label.set_color((1, 1, 1))
        vbox.pack_start(label)
        table = widgetset.Table(2, 2)
        table.set_column_spacing(6)
        self.filename_label = self._make_label('')
        self.filetype_label  = self._make_label('')
        table.pack(widgetutil.align_left(self._make_heading(_('Filename:'))),
                0, 0)
        table.pack(widgetutil.align_left(self.filename_label), 1, 0)
        table.pack(widgetutil.align_left(self._make_heading(_('File type:'))),
                0, 1)
        table.pack(widgetutil.align_left(self.filetype_label), 1, 1)
        vbox.pack_start(widgetutil.align_left(table, top_pad=12))
        hbox = widgetset.HBox(spacing=12)
        reveal_button = widgetset.Button(_('Reveal File'))
        self.play_externally_button = widgetset.Button(_('Play Externally'))
        self.play_externally_button.connect('clicked',
                                            self._on_play_externally)
        skip_button = widgetset.Button(_('Skip'))
        reveal_button.connect('clicked', self._on_reveal)
        skip_button.connect('clicked', self._on_skip)

        self.reveal_button_holder = widgetutil.HideableWidget(reveal_button)
        self.play_externally_button_holder = widgetutil.HideableWidget(
                                          self.play_externally_button)

        hbox.pack_start(self.reveal_button_holder)
        hbox.pack_start(self.play_externally_button_holder)
        hbox.pack_start(skip_button)
        vbox.pack_start(widgetutil.align_center(hbox, top_pad=24))
        alignment = widgetset.Alignment(xalign=0.5, yalign=0.5)
        alignment.add(vbox)
        self.add(alignment)
コード例 #20
0
ファイル: firsttimedialog.py プロジェクト: kmshi/miro
    def build_startup_page(self):
        vbox = widgetset.VBox(spacing=5)

        vbox.pack_start(
            _build_paragraph_text(
                _(
                    "%(name)s can automatically run when you start your "
                    "computer so that it can resume your downloads "
                    "and update your podcasts.",
                    {'name': app.config.get(prefs.SHORT_APP_NAME)})))

        vbox.pack_start(
            _build_title_question(
                _("Would you like to run %(name)s on startup?",
                  {'name': app.config.get(prefs.SHORT_APP_NAME)})))

        rbg = widgetset.RadioButtonGroup()
        yes_rb = widgetset.RadioButton(_("Yes"), rbg)
        no_rb = widgetset.RadioButton(_("No"), rbg)

        prefpanel.attach_radio([(yes_rb, True), (no_rb, False)],
                               prefs.RUN_AT_STARTUP)
        vbox.pack_start(widgetutil.align_left(yes_rb, left_pad=10))
        vbox.pack_start(widgetutil.align_left(no_rb, left_pad=10))

        prev_button = widgetset.Button(_("< Previous"))
        prev_button.connect('clicked', lambda x: self.prev_page())

        next_button = widgetset.Button(_("Next >"))
        next_button.connect('clicked', lambda x: self.next_page())

        vbox.pack_start(self._force_space_label())

        vbox.pack_start(widgetutil.align_bottom(
            widgetutil.align_right(
                widgetutil.build_hbox((prev_button, next_button)))),
                        expand=True)

        vbox = widgetutil.pad(vbox)

        return vbox
コード例 #21
0
    def __init__(self):
        self.in_progress = False
        widgetset.Background.__init__(self)
        hbox = widgetset.HBox()
        # left side: labels on first line, progress on second
        vbox = widgetset.VBox()

        line = widgetset.HBox()
        self.size_label = widgetset.Label(u"")
        self.size_label.set_bold(True)
        self.sync_label = widgetset.Label(u"")
        self.sync_label.set_alignment(widgetconst.TEXT_JUSTIFY_RIGHT)
        self.sync_label.set_bold(True)
        line.pack_start(self.size_label)
        line.pack_end(self.sync_label)
        vbox.pack_start(widgetutil.pad(line, bottom=10))

        self.progress = SizeProgressBar()
        self.progress.set_size_request(-1, 14)
        vbox.pack_start(self.progress)

        hbox.pack_start(vbox, expand=True)

        # right size: sync button
        self.sync_button = widgetutil.ThreeImageButton('device-sync',
                                                       _("Up to date"))
        self.sync_button.set_text_size(1.07)  # 14pt
        self.sync_button.disable()
        self.sync_button.set_size_request(150, 23)
        hbox.pack_end(widgetutil.pad(self.sync_button, left=50))
        self.add(
            widgetutil.align(hbox,
                             0.5,
                             1,
                             1,
                             0,
                             top_pad=10,
                             bottom_pad=10,
                             left_pad=50,
                             right_pad=50))
コード例 #22
0
    def __init__(self):
        self.device = None
        self.bulk_change = False
        widgetset.VBox.__init__(self)
        self.create_signal('changed')
        self.sync_library = widgetset.Checkbox(self.title)
        self.sync_library.connect('toggled', self.sync_library_toggled)
        self.pack_start(widgetutil.pad(self.sync_library, top=50))
        self._pack_extra_buttons()

        self.feed_list = widgetset.VBox()
        self.feed_list.set_size_request(450, -1)
        self.info_map = {}
        feeds = self.get_feeds()
        if feeds:
            for info in feeds:
                checkbox = widgetset.Checkbox(info.name)
                checkbox.connect('toggled', self.feed_toggled, info)
                self.feed_list.pack_start(checkbox)
                self.info_map[self.info_key(info)] = checkbox
        else:
            self.sync_library.disable()
        background = widgetset.SolidBackground(
            widgetutil.css_to_color('#dddddd'))
        background.add(self.feed_list)
        scroller = widgetset.Scroller(False, True)
        scroller.set_child(background)
        self.feed_list.disable()
        self.pack_start(widgetutil.pad(scroller, top=20, bottom=5),
                        expand=True)

        line = widgetset.HBox(spacing=5)
        button = widgetutil.TitlebarButton(_("Select none"))
        button.connect('clicked', self.select_clicked, False)
        line.pack_end(button)
        button = widgetutil.TitlebarButton(_("Select all"))
        button.connect('clicked', self.select_clicked, True)
        line.pack_end(button)
        self.pack_start(widgetutil.pad(line, bottom=20))
コード例 #23
0
ファイル: donate.py プロジェクト: zjmmjzzjm/miro
    def __init__(self):
        widgetset.DonateWindow.__init__(self, _("Donate"))
        self.create_signal('donate-clicked')
        self.vbox = widgetset.VBox(spacing=5)
        self.hbox = widgetset.HBox(spacing=5)
        self.button_yes = widgetset.Button(_('Yes, I can donate now'))
        self.button_no = widgetset.Button(_('Ask me later'))
        self.button_yes.connect('clicked', self._on_button_clicked)
        self.button_no.connect('clicked', self._on_button_clicked)
        self.browser = widgetset.Browser()
        self.browser.set_size_request(640, 440)
        self.browser.connect('net-stop', self._on_browser_stop)
        self.browser.connect('net-error', self._on_browser_error)
        self.hbox.pack_end(
            widgetutil.align_middle(self.button_no, right_pad=10))
        self.hbox.pack_end(widgetutil.align_middle(self.button_yes))
        self.vbox.pack_start(self.browser, padding=10, expand=True)
        self.vbox.pack_start(self.hbox, padding=5)
        self.set_content_widget(self.vbox)
        self.was_shown_invoked = False

        self.callback_object = None
コード例 #24
0
def _run_dialog(title, description, initial_text):
    """Creates and launches the New Feed dialog.  This dialog waits for
    the user to press "Create Podcast" or "Cancel".

    Returns the URL, or None.
    """
    window = MainDialog(title, description)
    try:
        try:
            window.add_button(BUTTON_CREATE_FEED.text)
            window.add_button(BUTTON_CANCEL.text)

            extra = widgetset.VBox()

            lab = widgetset.Label(_('URL:'))
            url_entry = widgetset.TextEntry()
            url_entry.set_text(initial_text)
            url_entry.set_activates_default(True)

            h = widgetset.HBox()
            h.pack_start(lab, padding=5)
            h.pack_start(url_entry, expand=True)
            extra.pack_start(h, padding=5)

            window.set_extra_widget(extra)

            response = window.run()

            if response == 0:
                text = url_entry.get_text()
                return text

            return None

        except StandardError:
            logging.exception("newfeed threw exception.")
    finally:
        window.destroy()
コード例 #25
0
def _run_dialog(title, description, default_type):
    """Creates and launches the New Folder dialog.  This dialog waits for
    the user to press "Create Folder" or "Cancel".

    Returns a the name, or None.
    """
    window = MainDialog(title, description)
    try:
        try:
            window.add_button(BUTTON_CREATE_FOLDER.text)
            window.add_button(BUTTON_CANCEL.text)

            extra = widgetset.VBox()

            lab = widgetset.Label(_('Folder name:'))
            name_entry = widgetset.TextEntry()
            name_entry.set_activates_default(True)

            h = widgetset.HBox()
            h.pack_start(lab, padding=5)
            h.pack_start(name_entry, expand=True)
            extra.pack_start(h, padding=5)

            window.set_extra_widget(extra)

            response = window.run()

            if response == 0:
                name = name_entry.get_text()
                if name:
                    return name

            return None

        except StandardError:
            logging.exception("newfeed threw exception.")
    finally:
        window.destroy()
コード例 #26
0
    def __init__(self):
        widgetset.Background.__init__(self)

        vbox = widgetset.VBox()
        # first line: sync progess and cancel button
        line = widgetset.HBox()
        self.sync_progress = SyncProgressBar()
        self.sync_progress.set_size_request(400, 10)
        self.cancel_button = imagebutton.ImageButton('sync-cancel')
        line.pack_start(widgetutil.pad(self.sync_progress, 10, 10, 5, 5))
        line.pack_end(widgetutil.pad(self.cancel_button, 5, 5, 5, 5))
        vbox.pack_start(line)

        # second line: time remaining, all the way to the right
        line = widgetset.HBox()
        self.sync_files = widgetset.Label(u"")
        self.sync_remaining = widgetset.Label(u"")
        self.sync_remaining.set_bold(True)
        line.pack_start(widgetutil.align_left(self.sync_files, 5, 5, 5, 5))
        line.pack_end(widgetutil.align_right(self.sync_remaining, 5, 5, 5, 5))
        vbox.pack_start(line)

        self.add(widgetutil.pad(vbox, 10, 10, 10, 10))
コード例 #27
0
 def _pack_right(self, vbox):
     """Pack the right column into the middle HBox of the main VBox."""
     widget = widgetset.VBox()
     right = []
     right.append(RatingField(self.items))
     right.append(
         OptionsField('file_type', self.items, _("Type"),
                      [(u'audio', _("Music")), (u'video', _("Video")),
                       (u'other', _("Misc"))]))
     right.append(
         DisplayField('size',
                      self.items,
                      _("Size"),
                      displaytext.size_string,
                      multiple='sum'))
     right.append(ThumbnailField(self.items, _("Art")))
     for field in right:
         field.set_right()
     for field in right[:-1]:
         widget.pack_start(field.get_box(), padding=5)
     widget.pack_end(right[-1].get_box())
     vbox.pack_end(widget)
     self.fields.extend(right)
コード例 #28
0
ファイル: firsttimedialog.py プロジェクト: kmshi/miro
    def __init__(self, done_firsttime_callback, title=None):
        if title == None:
            title = _("%(appname)s Setup",
                      {"appname": app.config.get(prefs.SHORT_APP_NAME)})

        x, y = widgetset.get_first_time_dialog_coordinates(WIDTH, HEIGHT)

        widgetset.DialogWindow.__init__(self, title,
                                        widgetset.Rect(x, y, WIDTH, HEIGHT))

        # the directory panel 3 searches for files in
        self.search_directory = None

        self.finder = None

        self.cancelled = False
        self.gathered_media_files = None
        self.import_media_player_stuff = False
        self.progress_bar = None
        self.progress_label = None
        self.search_cancel_button = None
        self.search_prev_button = None
        self.search_next_button = None

        self._done_firsttime_callback = done_firsttime_callback

        self.mp_name, self.mp_path = get_plat_media_player_name_path()
        self._has_media_player = (self.mp_name is not None
                                  and self.mp_path is not None)

        self._page_box = widgetset.VBox()
        self._pages = self.build_pages()
        self._page_index = -1

        self.set_content_widget(widgetutil.pad(self._page_box, 20, 20, 20, 20))

        self.on_close_handler = self.connect('will-close', self.on_close)
コード例 #29
0
ファイル: firsttimedialog.py プロジェクト: kmshi/miro
    def build_search_page(self):
        vbox = widgetset.VBox(spacing=5)

        self.progress_bar = widgetset.ProgressBar()
        self.progress_bar.set_size_request(400, -1)
        vbox.pack_start(widgetutil.align_center(self.progress_bar, top_pad=50))

        self.progress_label = widgetset.Label("")
        vbox.pack_start(
            widgetutil.align_top(widgetutil.align_center(self.progress_label),
                                 top_pad=10))

        self.cancel_search_button = widgetset.Button(_("Cancel Search"))
        self.cancel_search_button.connect('clicked',
                                          self.handle_search_cancel_clicked)

        vbox.pack_start(
            widgetutil.align_right(self.cancel_search_button, right_pad=5))

        vbox.pack_start(self._force_space_label(), expand=True)

        self.search_prev_button = widgetset.Button(_("< Previous"))
        self.search_prev_button.connect('clicked', lambda x: self.prev_page())

        self.search_next_button = widgetset.Button(_("Finish"))
        self.search_next_button.connect('clicked', lambda x: self.destroy())

        vbox.pack_start(widgetutil.align_bottom(
            widgetutil.align_right(
                widgetutil.build_hbox(
                    (self.search_prev_button, self.search_next_button)))),
                        expand=True)

        vbox = widgetutil.pad(vbox)
        vbox.run_me_on_switch = self.start_search

        return vbox
コード例 #30
0
 def __init__(self, items):
     DialogPanel.__init__(self, items)
     self.fields = [
         TextField('show', self.items, _("Show")),
         TextField('episode_id', self.items, _("Episode ID")),
         MultifieldRow(
             NumberField('season_number',
                         self.items,
                         _("Season Number"),
                         width=15),
             NumberField('episode_number',
                         self.items,
                         _("Episode Number"),
                         width=15),
         ),
         OptionsField(
             'kind',
             self.items,
             _("Video Kind"),
             [
                 # FIXME: changes here need also be applied in messages
                 (None, u""),
                 (u'movie', _("Movie")),
                 (u'show', _("Show")),
                 (u'clip', _("Clip")),
                 (u'podcast', _("Podcast")),
             ]),
     ]
     content = widgetset.VBox()
     for field in self.fields:
         field.set_label_width(120)
         content.pack_start(field.get_box(), padding=5)
     # XXX - hack: OS X is cutting off the right side of the box in single
     # selection mode; this seems like a bug in layout. padding the right
     # side causes only padding to be cut off.
     # XXX - this padding fixes 17065. 17065 is the same layout issue?
     self.vbox = widgetutil.pad(content, right=15)