Example #1
0
    def __init__(self):
        widgetset.Background.__init__(self)
        self.create_signal('install-clicked')

        vbox = widgetset.VBox()
        label = widgetset.Label(_("Sharing Disabled").upper())
        label.set_bold(True)
        label.set_color((1, 1, 1))
        vbox.pack_start(widgetutil.align_left(label, top_pad=10))
        # Note: "Miro iPad app" is the name of a specific piece of
        # software and thus should not be %(appname)s iPad app.
        label = widgetset.Label(
            _(
                "You need to install the Bonjour libraries to be able to "
                "share files from %(appname)s-to-%(appname)s or to the "
                "Miro iPad app.\n\n"
                "Once you install the Bonjour libraries, you will have "
                "to restart %(appname)s.",
                {'appname': app.config.get(prefs.SHORT_APP_NAME)}))

        label.set_wrap(True)
        label.set_size_request(550, -1)
        label.set_color((1, 1, 1))
        vbox.pack_start(widgetutil.align_left(label, top_pad=20))
        button = widgetset.Button(_("Click here to install"))
        button.connect('clicked', self.on_clicked)
        vbox.pack_start(
            widgetutil.align_left(button, top_pad=20, bottom_pad=20))

        self.add(widgetutil.align(vbox, xscale=1, left_pad=20))
Example #2
0
    def __init__(self):
        self.in_progress = False
        widgetset.Background.__init__(self)
        vbox = widgetset.VBox()
        # first line: size remaining on the left, sync status on the right
        line = widgetset.HBox()
        self.size_label = widgetset.Label(u"")
        self.size_label.set_bold(True)
        self.sync_label = widgetset.Label(u"")
        line.pack_start(self.size_label)
        line.pack_end(self.sync_label)
        vbox.pack_start(widgetutil.pad(line, bottom=10))

        # second line: bigger; size status on left, sync button on right
        line = widgetset.HBox()
        self.progress = SizeProgressBar()
        self.progress.set_size_request(425, 36)
        self.sync_button = widgetutil.ThreeImageButton(
            'device-sync', _("Sync Now"))
        self.sync_button.set_size_request(100, 39)
        line.pack_start(self.progress)
        line.pack_end(widgetutil.pad(self.sync_button, left=50))
        vbox.pack_start(line)
        self.add(widgetutil.align(vbox, 0.5, 1, 0, 0, top_pad=15,
                                  bottom_pad=15, right_pad=20))
Example #3
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))
Example #4
0
    def __init__(self):
        widgetset.Background.__init__(self)
        self.create_signal('install-clicked')

        vbox = widgetset.VBox()
        label = widgetset.Label(_("Sharing Disabled").upper())
        label.set_bold(True)
        label.set_color((1, 1, 1))
        vbox.pack_start(widgetutil.align_left(label, top_pad=10))
        # Note: "Miro iPad app" is the name of a specific piece of
        # software and thus should not be %(appname)s iPad app.
        label = widgetset.Label(
            _("You need to install the Bonjour libraries to be able to "
              "share files from %(appname)s-to-%(appname)s or to the "
              "Miro iPad app.\n\n"
              "Once you install the Bonjour libraries, you will have "
              "to restart %(appname)s.",
              {'appname': app.config.get(prefs.SHORT_APP_NAME)}))

        label.set_wrap(True)
        label.set_size_request(550, -1)
        label.set_color((1, 1, 1))
        vbox.pack_start(widgetutil.align_left(label, top_pad=20))
        button = widgetset.Button(_("Click here to install"))
        button.connect('clicked', self.on_clicked)
        vbox.pack_start(widgetutil.align_left(button, top_pad=20,
                                              bottom_pad=20))

        self.add(widgetutil.align(vbox, xscale=1, left_pad=20))
    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))
Example #6
0
    def __init__(self):
        self.in_progress = False
        widgetset.Background.__init__(self)
        vbox = widgetset.VBox()
        # first line: size remaining on the left, sync status on the right
        line = widgetset.HBox()
        self.size_label = widgetset.Label(u"")
        self.size_label.set_bold(True)
        self.sync_label = widgetset.Label(u"")
        line.pack_start(self.size_label)
        line.pack_end(self.sync_label)
        vbox.pack_start(widgetutil.pad(line, bottom=10))

        # second line: bigger; size status on left, sync button on right
        line = widgetset.HBox()
        self.progress = SizeProgressBar()
        self.progress.set_size_request(425, 36)
        self.sync_button = widgetutil.ThreeImageButton('device-sync',
                                                       _("Sync Now"))
        self.sync_button.set_size_request(100, 39)
        line.pack_start(self.progress)
        line.pack_end(widgetutil.pad(self.sync_button, left=50))
        vbox.pack_start(line)
        self.add(
            widgetutil.align(vbox,
                             0.5,
                             1,
                             0,
                             0,
                             top_pad=15,
                             bottom_pad=15,
                             right_pad=20))
Example #7
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))
Example #8
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))
Example #9
0
 def create_table(self):
     self.remove()
     def _get_conversion_name(id_):
         if id_ == 'copy':
             return _('Copy')
         else:
             return conversion_manager.lookup_converter(id_).name
     conversion_details = {
         'audio': _get_conversion_name(self.device.info.audio_conversion),
         'video': _get_conversion_name(self.device.info.video_conversion)
         }
     audio_conversion_names = [_('Device Default (%(audio)s)',
                                 conversion_details), _('Copy')]
     self.audio_conversion_values = [None, 'copy']
     video_conversion_names = [_('Device Default (%(video)s)',
                                 conversion_details), _('Copy')]
     self.video_conversion_values = [None, 'copy']
     for section_name, converters in conversion_manager.get_converters():
         for converter in converters:
             if converter.mediatype == 'video':
                 video_conversion_names.append(converter.name)
                 self.video_conversion_values.append(converter.identifier)
             elif converter.mediatype == 'audio':
                 audio_conversion_names.append(converter.name)
                 self.audio_conversion_values.append(converter.identifier)
     widgets = []
     for text, setting, type_ in (
         (_("Name of Device"), u'name', 'text'),
         (_("Video Conversion"), u'video_conversion', 'video_conversion'),
         (_("Audio Conversion"), u'audio_conversion', 'audio_conversion'),
         (_("Store video in this directory"), u'video_path', 'text'),
         (_("Store audio in this directory"), u'audio_path', 'text'),
         (_("Always show this device, even if "
            "'show all devices' is turned off"), u'always_show', 'bool')
         ):
         if type_ == 'text':
             widget = widgetset.TextEntry()
             widget.set_size_request(260, -1)
         elif type_.endswith('conversion'):
             if type_ == 'video_conversion':
                 options = video_conversion_names
             elif type_ == 'audio_conversion':
                 options = audio_conversion_names
             widget = widgetset.OptionMenu(options)
             widget.set_size_request(260, -1)
         elif type_== 'bool':
             widget = widgetset.Checkbox(text)
         else:
             raise RuntimeError('unknown settings widget: %r' % type_)
         self.boxes[setting] = widget
         if type_ != 'bool': # has a label already
             widgets.append((widgetset.Label(text), widget))
             if type_ == 'text':
                 widget.connect('focus-out', self.setting_changed, setting)
             else:
                 widget.connect('changed', self.setting_changed, setting)
         else:
             widgets.append((widget,))
             widget.connect('toggled', self.setting_changed, setting)
     table = widgetset.Table(2, len(widgets))
     for row, widget in enumerate(widgets):
         if len(widget) == 1: # checkbox
             table.pack(widget[0], 0, row, column_span=2)
         else:
             table.pack(widgetutil.align_right(widget[0]), 0, row)
             table.pack(widgetutil.align_left(widget[1]), 1, row)
     table.set_column_spacing(20)
     table.set_row_spacing(20)
     self.set_child(widgetutil.align(table, 0.5, top_pad=50))
Example #10
0
    def create_table(self):
        self.remove()

        def _get_conversion_name(id_):
            if id_ == 'copy':
                return _('Copy')
            else:
                return conversion_manager.lookup_converter(id_).name

        conversion_details = {
            'audio': _get_conversion_name(self.device.info.audio_conversion),
            'video': _get_conversion_name(self.device.info.video_conversion)
        }
        audio_conversion_names = [
            _('Device Default (%(audio)s)', conversion_details),
            _('Copy')
        ]
        self.audio_conversion_values = [None, 'copy']
        video_conversion_names = [
            _('Device Default (%(video)s)', conversion_details),
            _('Copy')
        ]
        self.video_conversion_values = [None, 'copy']
        for section_name, converters in conversion_manager.get_converters():
            for converter in converters:
                if converter.mediatype == 'video':
                    video_conversion_names.append(converter.name)
                    self.video_conversion_values.append(converter.identifier)
                elif converter.mediatype == 'audio':
                    audio_conversion_names.append(converter.name)
                    self.audio_conversion_values.append(converter.identifier)
        widgets = []
        for text, setting, type_ in ((_("Name of Device"), u'name', 'text'),
                                     (_("Video Conversion"),
                                      u'video_conversion', 'video_conversion'),
                                     (_("Audio Conversion"),
                                      u'audio_conversion', 'audio_conversion'),
                                     (_("Store video in this directory"),
                                      u'video_path', 'text'),
                                     (_("Store audio in this directory"),
                                      u'audio_path', 'text'),
                                     (_("Always show this device, even if "
                                        "'show all devices' is turned off"),
                                      u'always_show', 'bool')):
            if type_ == 'text':
                widget = widgetset.TextEntry()
                widget.set_size_request(260, -1)
            elif type_.endswith('conversion'):
                if type_ == 'video_conversion':
                    options = video_conversion_names
                elif type_ == 'audio_conversion':
                    options = audio_conversion_names
                widget = widgetset.OptionMenu(options)
                widget.set_size_request(260, -1)
            elif type_ == 'bool':
                widget = widgetset.Checkbox(text)
            else:
                raise RuntimeError('unknown settings widget: %r' % type_)
            self.boxes[setting] = widget
            if type_ != 'bool':  # has a label already
                widgets.append((widgetset.Label(text), widget))
                if type_ == 'text':
                    widget.connect('focus-out', self.setting_changed, setting)
                else:
                    widget.connect('changed', self.setting_changed, setting)
            else:
                widgets.append((widget, ))
                widget.connect('toggled', self.setting_changed, setting)
        table = widgetset.Table(2, len(widgets))
        for row, widget in enumerate(widgets):
            if len(widget) == 1:  # checkbox
                table.pack(widget[0], 0, row, column_span=2)
            else:
                table.pack(widgetutil.align_right(widget[0]), 0, row)
                table.pack(widgetutil.align_left(widget[1]), 1, row)
        table.set_column_spacing(20)
        table.set_row_spacing(20)
        self.set_child(widgetutil.align(table, 0.5, top_pad=50))