def build_widget(self): vbox = widgetset.VBox() grid = dialogwidgets.ControlGrid() count = get_logical_cpu_count() max_concurrent = [] for i in range(0, count): max_concurrent.append((i+1, str(i+1))) max_concurrent_menu = widgetset.OptionMenu([op[1] for op in max_concurrent]) attach_combo(max_concurrent_menu, prefs.MAX_CONCURRENT_CONVERSIONS, [op[0] for op in max_concurrent]) if count == 1: max_concurrent_menu.disable() grid.pack(dialogwidgets.label_with_note( _("Allow this many concurrent conversions:"), _("(changing this will not apply to currently running conversions)")), dialogwidgets.ControlGrid.ALIGN_RIGHT) grid.pack(max_concurrent_menu) grid.end_line(spacing=4) vbox.pack_start(widgetutil.align_left(grid.make_table())) pack_extras(vbox, "conversions") return vbox
def build_widget(self): cc_options = [(1440, _("Every day")), (60, _("Every hour")), (30, _("Every 30 minutes")), (-1 , _("Manually"))] cc_option_menu = widgetset.OptionMenu([op[1] for op in cc_options]) attach_combo(cc_option_menu, prefs.CHECK_CHANNELS_EVERY_X_MN, [op[0] for op in cc_options]) ad_options = [("new", _("New")), ("all", _("All")), ("off", _("Off"))] ad_option_menu = widgetset.OptionMenu([op[1] for op in ad_options]) attach_combo(ad_option_menu, prefs.CHANNEL_AUTO_DEFAULT, [op[0] for op in ad_options]) max_options = [(0, _("0")), (20, _("20")), (50, _("50")), (100, _("100")), (1000, _("1000"))] max_option_menu = widgetset.OptionMenu([op[1] for op in max_options]) attach_combo(max_option_menu, prefs.MAX_OLD_ITEMS_DEFAULT, [op[0] for op in max_options]) grid = dialogwidgets.ControlGrid() grid.pack(dialogwidgets.heading(_("Default settings for new feeds:")), grid.ALIGN_LEFT, span=2) grid.end_line(spacing=2) grid.pack(dialogwidgets.note( _("(These can be changed using the feed's settings button)")), grid.ALIGN_LEFT, span=2) grid.end_line(spacing=12) grid.pack_label(_("Check for new content:"), dialogwidgets.ControlGrid.ALIGN_RIGHT) grid.pack(cc_option_menu) grid.end_line(spacing=4) grid.pack_label(_("Auto-download setting:"), dialogwidgets.ControlGrid.ALIGN_RIGHT) grid.pack(ad_option_menu) grid.end_line(spacing=4) grid.pack(dialogwidgets.label_with_note( _("Remember this many old items:"), _("(in addition to the current contents)")), dialogwidgets.ControlGrid.ALIGN_RIGHT) grid.pack(max_option_menu) grid.end_line() return grid.make_table()