def __init__(self): widgetset.VBox.__init__(self) label = widgetset.Label() label.set_text( _("Your device isn't telling us its exact model number.")) self.pack_start(widgetutil.align_center(label, left_pad=20, top_pad=50, bottom_pad=20)) label = widgetset.Label() label.set_text( _('For optimal video conversion, select the device model.')) label.set_bold(True) self.pack_start(widgetutil.align_center(label, left_pad=20, bottom_pad=20)), self.device_choices = widgetset.VBox() self.pack_start(widgetutil.align_center(self.device_choices, left_pad=20, top_pad=20, bottom_pad=20)) image = widgetset.ImageDisplay( imagepool.get(resources.path('images/sync-unknown.png'))) self.pack_start(widgetutil.align_center(image, left_pad=20, bottom_pad=20)) label = widgetset.Label() label.set_text(_("If you don't know the model or it doesn't appear " "in the list, it's fine to choose the 'Generic' " "device option.")) label.set_bold(True) self.pack_start(widgetutil.align_center(label, left_pad=20, bottom_pad=20))
def __init__(self): widgetset.VBox.__init__(self) if not app.sharing_manager.mdns_present: sharing_broken = SharingBroken() sharing_broken.connect('install-clicked', self.daap_install_clicked) self.pack_start(widgetutil.align_center(sharing_broken)) title = widgetset.HBox() logo = widgetset.ImageDisplay(imagepool.get( resources.path('images/icon-connect_large.png'))) title.pack_start(widgetutil.align_middle(logo)) label = widgetset.Label(_("Connect")) 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_daap_section(bottom) self._build_sync_section(bottom) self._build_app_store_section(bottom) self._build_android_section(bottom) self.pack_start(widgetutil.align_center(bottom))
def build_widget(self): feed_info = widgetutil.get_feed_info(self.id) icon = imagepool.get(feed_info.thumbnail, size=(41, 41)) self._make_item_views() add_icon_box = not self.is_folder and not feed_info.thumbnail.startswith(resources.root()) if feed_info.is_directory_feed: self.titlebar = itemlistwidgets.ItemListTitlebar(feed_info.name, icon, add_icon_box=add_icon_box) else: self.titlebar = itemlistwidgets.ChannelTitlebar(feed_info.name, icon, add_icon_box=add_icon_box) self.titlebar.connect('save-search', self._on_save_search) self.titlebar.connect('search-changed', self._on_search_changed) self.widget.titlebar_vbox.pack_start(self.titlebar) if not self.is_folder: sep = separator.HSeparator((0.85, 0.85, 0.85), (0.95, 0.95, 0.95)) self.widget.titlebar_vbox.pack_start(sep) self.widget.titlebar_vbox.pack_start(self._make_toolbar(feed_info)) vbox = widgetset.VBox() vbox.pack_start(self.downloading_section) vbox.pack_start(self.full_section) vbox.pack_start(self.downloaded_section) background = widgetset.SolidBackground((1, 1, 1)) background.add(vbox) scroller = widgetset.Scroller(False, True) scroller.add(background) self.widget.normal_view_vbox.pack_start(scroller, expand=True)
def __init__(self): widgetset.VBox.__init__(self) if not app.sharing_manager.mdns_present: sharing_broken = SharingBroken() sharing_broken.connect('install-clicked', self.daap_install_clicked) self.pack_start(widgetutil.align_center(sharing_broken)) title = widgetset.HBox() logo = widgetset.ImageDisplay( imagepool.get(resources.path('images/icon-connect_large.png'))) title.pack_start(widgetutil.align_middle(logo)) label = widgetset.Label(_("Connect")) 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_daap_section(bottom) self._build_sync_section(bottom) self._build_app_store_section(bottom) self._build_android_section(bottom) self.pack_start(widgetutil.align_center(bottom))
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)
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)
def __init__(self): widgetset.VBox.__init__(self) label = widgetset.Label() label.set_text(_('This device is not yet mounted.')) label.set_bold(True) label.set_size(1.5) self.pack_start(widgetutil.align_center(label, left_pad=20, top_pad=50, bottom_pad=20)) self.device_text = widgetset.Label() self.device_text.set_size(1.5) self.device_text.set_wrap(True) self.pack_start(widgetutil.align_center(self.device_text, left_pad=20, bottom_pad=40)) image = widgetset.ImageDisplay( imagepool.get(resources.path('images/sync-unmounted.png'))) self.pack_start(widgetutil.align_center(image, left_pad=20, bottom_pad=20))
def build_widget(self): image_path = resources.path("images/icon-conversions_large.png") icon = imagepool.get(image_path) titlebar = ConversionsTitleBar(_("Conversions"), icon) self.widget.pack_start(titlebar) sep = separator.HSeparator((0.85, 0.85, 0.85), (0.95, 0.95, 0.95)) self.widget.pack_start(sep) self.stop_all_button = widgetset.Button(_('Stop All Conversions'), style='smooth') self.stop_all_button.set_size(widgetconst.SIZE_SMALL) self.stop_all_button.set_color(widgetset.TOOLBAR_GRAY) self.stop_all_button.disable() self.stop_all_button.connect('clicked', self.on_cancel_all) reveal_button = widgetset.Button(_('Show Conversion Folder'), style='smooth') reveal_button.set_size(widgetconst.SIZE_SMALL) reveal_button.set_color(widgetset.TOOLBAR_GRAY) reveal_button.connect('clicked', self.on_reveal_conversions_folder) self.clear_finished_button = widgetset.Button( _('Clear Finished Conversions'), style='smooth') self.clear_finished_button.set_size(widgetconst.SIZE_SMALL) self.clear_finished_button.set_color(widgetset.TOOLBAR_GRAY) self.clear_finished_button.connect('clicked', self.on_clear_finished) toolbar = itemlistwidgets.DisplayToolbar() hbox = widgetset.HBox() hbox.pack_start(widgetutil.pad(self.stop_all_button, top=8, bottom=8, left=8)) hbox.pack_end(widgetutil.pad(reveal_button, top=8, bottom=8, right=8)) hbox.pack_end(widgetutil.pad(self.clear_finished_button, top=8, bottom=8, right=8)) toolbar.add(hbox) self.widget.pack_start(toolbar) self.iter_map = dict() self.model = widgetset.TableModel('object') self.table = ConversionTableView(self.model) self.table.connect_weak('hotspot-clicked', self.on_hotspot_clicked) scroller = widgetset.Scroller(False, True) scroller.add(self.table) self.widget.pack_start(scroller, expand=True) conversion_manager.fetch_tasks_list()
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))
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))
def __init__(self): widgetset.VBox.__init__(self) label = widgetset.Label() label.set_text(_('This device is not yet mounted.')) label.set_bold(True) label.set_size(1.5) self.pack_start( widgetutil.align_center(label, left_pad=20, top_pad=50, bottom_pad=20)) self.device_text = widgetset.Label() self.device_text.set_size(1.5) self.device_text.set_wrap(True) self.pack_start( widgetutil.align_center(self.device_text, left_pad=20, bottom_pad=40)) image = widgetset.ImageDisplay( imagepool.get(resources.path('images/sync-unmounted.png'))) self.pack_start( widgetutil.align_center(image, left_pad=20, bottom_pad=20))
def __init__(self): widgetset.VBox.__init__(self) label = widgetset.Label() label.set_text( _("Your device isn't telling us its exact model number.")) self.pack_start( widgetutil.align_center(label, left_pad=20, top_pad=50, bottom_pad=20)) label = widgetset.Label() label.set_text( _('For optimal video conversion, select the device model.')) label.set_bold(True) self.pack_start( widgetutil.align_center(label, left_pad=20, bottom_pad=20)), self.device_choices = widgetset.VBox() self.pack_start( widgetutil.align_center(self.device_choices, left_pad=20, top_pad=20, bottom_pad=20)) image = widgetset.ImageDisplay( imagepool.get(resources.path('images/sync-unknown.png'))) self.pack_start( widgetutil.align_center(image, left_pad=20, bottom_pad=20)) label = widgetset.Label() label.set_text( _("If you don't know the model or it doesn't appear " "in the list, it's fine to choose the 'Generic' " "device option.")) label.set_bold(True) self.pack_start( widgetutil.align_center(label, left_pad=20, bottom_pad=20))
def __init__(self): itemlistwidgets.Titlebar.__init__(self) hbox = widgetset.HBox() self.add(hbox) self.create_signal('browser-reload') self.create_signal('browser-back') self.create_signal('browser-forward') self.create_signal('browser-stop') self.create_signal('browser-home') self.create_signal('address-entered') self.create_signal('browser-download') self.create_signal('browser-open') self.back_button = imagebutton.ImageButton('navback') self.back_button.set_squish_width(True) self.back_button.connect('clicked', self._on_back_button_clicked) self.back_button.disable() hbox.pack_start(widgetutil.align_middle(self.back_button, left_pad=10)) nav_separator = widgetset.ImageDisplay( imagepool.get(resources.path('images/navseparator.png'))) hbox.pack_start(widgetutil.align_middle(nav_separator)) self.forward_button = imagebutton.ImageButton('navforward') self.forward_button.set_squish_width(True) self.forward_button.connect('clicked', self._on_forward_button_clicked) self.forward_button.disable() hbox.pack_start(widgetutil.align_middle(self.forward_button)) self.reload_button = imagebutton.ImageButton('navreload') self.reload_button.connect('clicked', self._on_reload_button_clicked) hbox.pack_start(widgetutil.align_middle(self.reload_button, left_pad=4)) self.stop_button = imagebutton.ImageButton('navstop') self.stop_button.connect('clicked', self._on_stop_button_clicked) hbox.pack_start(widgetutil.align_middle(self.stop_button, left_pad=4)) self.home_button = imagebutton.ImageButton('navhome') self.home_button.connect('clicked', self._on_home_button_clicked) hbox.pack_start(widgetutil.align_middle(self.home_button, left_pad=4)) self.browser_open_button = widgetutil.TitlebarButton( _('Open in browser'), 'navopen') self.browser_open_button.connect('clicked', self._on_browser_open_activate) hbox.pack_end( widgetutil.align_middle(self.browser_open_button, right_pad=10)) self.download_button = widgetutil.TitlebarButton( _("Download this video"), 'navdownload') self.download_button.connect('clicked', self._on_download_button_clicked) self.download_button = widgetutil.HideableWidget(self.download_button) hbox.pack_end( widgetutil.align_middle(self.download_button, right_pad=4)) self.loading_icon = BrowserLoadingImage() hbox.pack_start(widgetutil.align_middle(self.loading_icon), expand=True)
def _make_icon(self): return imagepool.get(resources.path('images/folder-icon.png'))
def make_titlebar(self): image_path = resources.path("images/icon-downloading_large.png") icon = imagepool.get(image_path) titlebar = ItemListTitlebar(_("Downloads"), icon) titlebar.connect('search-changed', self._on_search_changed) return titlebar
def make_titlebar(device): image_path = resources.path("images/phone-large.png") icon = imagepool.get(image_path) return DeviceTitlebar(device.name, icon)
def __init__(self): itemlistwidgets.Titlebar.__init__(self) hbox = widgetset.HBox() self.add(hbox) self.create_signal('browser-reload') self.create_signal('browser-back') self.create_signal('browser-forward') self.create_signal('browser-stop') self.create_signal('browser-home') self.create_signal('address-entered') self.create_signal('browser-download') self.create_signal('browser-open') self.back_button = imagebutton.ImageButton('navback') self.back_button.set_squish_width(True) self.back_button.connect('clicked', self._on_back_button_clicked) self.back_button.disable() hbox.pack_start(widgetutil.align_middle(self.back_button, left_pad=10)) nav_separator = widgetset.ImageDisplay(imagepool.get( resources.path('images/navseparator.png'))) hbox.pack_start(widgetutil.align_middle(nav_separator)) self.forward_button = imagebutton.ImageButton('navforward') self.forward_button.set_squish_width(True) self.forward_button.connect('clicked', self._on_forward_button_clicked) self.forward_button.disable() hbox.pack_start(widgetutil.align_middle(self.forward_button)) self.reload_button = imagebutton.ImageButton('navreload') self.reload_button.connect('clicked', self._on_reload_button_clicked) hbox.pack_start(widgetutil.align_middle(self.reload_button, left_pad=4)) self.stop_button = imagebutton.ImageButton('navstop') self.stop_button.connect('clicked', self._on_stop_button_clicked) hbox.pack_start(widgetutil.align_middle(self.stop_button, left_pad=4)) self.home_button = imagebutton.ImageButton('navhome') self.home_button.connect('clicked', self._on_home_button_clicked) hbox.pack_start(widgetutil.align_middle(self.home_button, left_pad=4)) self.browser_open_button = widgetutil.TitlebarButton( _('Open in browser'), 'navopen') self.browser_open_button.connect( 'clicked', self._on_browser_open_activate) hbox.pack_end(widgetutil.align_middle(self.browser_open_button, right_pad=10)) self.download_button = widgetutil.TitlebarButton( _("Download this video"), 'navdownload') self.download_button.connect('clicked', self._on_download_button_clicked) self.download_button = widgetutil.HideableWidget(self.download_button) hbox.pack_end(widgetutil.align_middle(self.download_button, right_pad=4)) self.loading_icon = BrowserLoadingImage() hbox.pack_start(widgetutil.align_middle(self.loading_icon), expand=True)
def _make_icon(self): image_path = resources.path("images/%s" % self.image_filename) return imagepool.get(image_path)