def __init__(self): super().__init__(spacing=12) self.set_border_width(12) self.title = _("Library") scan_at_start_cb = CCB(_("Scan library _on start"), "library", "refresh_on_start", populate=True) req_restart = _( "A restart is required for any changes to take effect") watch_lib_cb = CCB( _("_Watch directories for changes"), "library", "watch", populate=True, tooltip=_( "Watch library directories for external file additions, " "deletions and renames.") + "\n" + req_restart) scan_dirs = ScanBox() vb3 = Gtk.VBox(spacing=6) vb3.pack_start(scan_dirs, True, True, 0) def refresh_cb(button): scan_library(app.library, force=False) refresh = qltk.Button(_("_Scan Library"), Icons.VIEW_REFRESH) refresh.connect("clicked", refresh_cb) refresh.set_tooltip_text(_("Check for changes in your library")) def reload_cb(button): scan_library(app.library, force=True) reload_ = qltk.Button(_("Re_build Library"), Icons.VIEW_REFRESH) reload_.connect("clicked", reload_cb) reload_.set_tooltip_text( _("Reload all songs in your library. " "This can take a long time.")) grid = Gtk.Grid(column_spacing=6, row_spacing=6) scan_at_start_cb.props.hexpand = True watch_lib_cb.props.hexpand = True grid.attach(watch_lib_cb, 0, 0, 1, 1) grid.attach(scan_at_start_cb, 0, 1, 1, 1) grid.attach(refresh, 1, 0, 1, 1) grid.attach(reload_, 1, 1, 1, 1) vb3.pack_start(grid, False, True, 0) f = qltk.Frame(_("Scan Directories"), child=vb3) self.pack_start(f, False, True, 0) # during testing if app.library is not None: masked = MaskedBox(app.library) f = qltk.Frame(_("Hidden Songs"), child=masked) self.pack_start(f, False, True, 0) for child in self.get_children(): child.show_all()
def __init__(self): super(PreferencesWindow.Library, self).__init__(spacing=12) self.set_border_width(12) self.title = _("Library") scan_cb = CCB(_("Scan library _on start"), "library", "refresh_on_start", populate=True) dots_cb = CCB(_("Scan directories starting with \".\""), "library", "scan_dots", populate=True) scan_dirs = ScanBox() vb3 = Gtk.VBox(spacing=6) vb3.pack_start(scan_dirs, True, True, 0) def refresh_cb(button): scan_library(app.library, force=False) refresh = qltk.Button(_("_Scan Library"), Icons.VIEW_REFRESH) refresh.connect("clicked", refresh_cb) refresh.set_tooltip_text(_("Check for changes in your library")) def reload_cb(button): scan_library(app.library, force=True) reload_ = qltk.Button(_("Re_build Library"), Icons.VIEW_REFRESH) reload_.connect("clicked", reload_cb) reload_.set_tooltip_text( _("Reload all songs in your library. " "This can take a long time.")) grid = Gtk.Grid(column_spacing=6, row_spacing=6) scan_cb.props.hexpand = True grid.attach(scan_cb, 0, 0, 1, 1) grid.attach(dots_cb, 0, 1, 1, 1) grid.attach(refresh, 1, 0, 1, 1) grid.attach(reload_, 1, 1, 1, 1) vb3.pack_start(grid, False, True, 0) f = qltk.Frame(_("Scan Directories"), child=vb3) self.pack_start(f, False, True, 0) # during testing if app.library is not None: masked = MaskedBox(app.library) f = qltk.Frame(_("Hidden Songs"), child=masked) self.pack_start(f, False, True, 0) for child in self.get_children(): child.show_all()
def test_main(self): ScanBox().destroy()