Skip to content

Commit

Permalink
Remove hacky function I forgot to migrate to GTK4
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Jul 14, 2024
1 parent b563984 commit 65b8e0b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
3 changes: 2 additions & 1 deletion cozy/ui/library_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def _on_sort_stack_changed(self, widget, _):
self._view_model.library_view_mode = view_mode

def populate_book_box(self):
self._book_box.remove_all_children()
for child in self._book_box:
self._book_box.remove(child)

for book in self._view_model.books:
book_element = BookElement(book)
Expand Down
9 changes: 2 additions & 7 deletions cozy/ui/widgets/filter_list_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, **properties):
super().__init__(**properties)

def populate(self, elements: list[str]):
self.remove_all_children()
self.remove_all()

all_row = ListBoxRowWithData(_("All"), True)
all_row.set_tooltip_text(_("Display all books"))
Expand All @@ -23,12 +23,7 @@ def populate(self, elements: list[str]):
self.append(row)

def select_row_with_content(self, row_content: str):
child = self.get_first_child()
while child:
next = child.get_next_sibling()

for child in self:
if isinstance(child, ListBoxRowWithData) and child.data == row_content:
self.select_row(child)
break

child = next
20 changes: 0 additions & 20 deletions cozy/ui/widgets/list_box_extensions.py

This file was deleted.

7 changes: 0 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,10 @@ def __on_command_line():
])


def extend_classes():
extend_gtk_container()


def main():
__on_command_line()
print(sys.argv)

extend_classes()

listen()

application = Application(pkgdatadir)
Expand Down Expand Up @@ -144,6 +138,5 @@ def listen():
# Some modules import multiprocessing which would lead to an exception
# when setting the start method
from cozy.application import Application
from cozy.ui.widgets.list_box_extensions import extend_gtk_container

main()

0 comments on commit 65b8e0b

Please sign in to comment.