playlist: Create a SortOrderPopover
For use by a Gtk.MenuButton to show the SortOrderView Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
d0049e4951
commit
3b15318f7c
|
@ -51,3 +51,12 @@ class TestSortOrderView(unittest.TestCase):
|
|||
|
||||
sview.set_playlist(collection)
|
||||
self.assertEqual(sview.get_model().get_model().get_enabled_model().playlist, collection)
|
||||
|
||||
|
||||
class TestSortOrderPopover(unittest.TestCase):
|
||||
def test_init(self):
|
||||
pop = view.SortOrderPopover()
|
||||
|
||||
self.assertIsInstance(pop, Gtk.Popover)
|
||||
self.assertIsInstance(pop.get_child(), view.SortOrderView)
|
||||
pop.set_playlist(db.user.Table.find("Collection"))
|
||||
|
|
|
@ -46,3 +46,12 @@ class SortOrderView(Gtk.ListView):
|
|||
|
||||
def set_playlist(self, plist):
|
||||
self.get_model().get_model().set_playlist(plist)
|
||||
|
||||
|
||||
class SortOrderPopover(Gtk.Popover):
|
||||
def __init__(self):
|
||||
Gtk.Popover.__init__(self)
|
||||
self.set_child(SortOrderView())
|
||||
|
||||
def set_playlist(self, plist):
|
||||
self.get_child().set_playlist(plist)
|
||||
|
|
Loading…
Reference in New Issue