Skip to content

Commit

Permalink
Dev profiles & categories now load instantly
Browse files Browse the repository at this point in the history
  • Loading branch information
dhtdht020 committed May 18, 2021
1 parent 7194db3 commit c1b704e
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions xosc_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,20 @@ def changed_category(self):
elif self.ui.CategoriesComboBox.currentText() == "Demos":
category = "demos"

self.ui.listAppsWidget.clear()
self.populate_list(category=category)
# hide anything from a different category
for i in range(self.ui.listAppsWidget.count()):
item = self.ui.listAppsWidget.item(i)
if category == "all":
item.setHidden(False)
elif item.data(Qt.UserRole)["category"] != category:
item.setHidden(True)
else:
item.setHidden(False)

# Load developer profile
def developer_profile(self):
developer = self.ui.developer.text()

# Begin
self.status_message(f"Loading developer profile for \"{developer}\"..")

self.ui.SearchBar.setText("")

# Disconnect categories
Expand All @@ -695,9 +699,11 @@ def developer_profile(self):
f'<span style=" text-decoration: underline; color:#0000ff;">Profile on '
f'Website</span></a></p></body></html>')

self.ui.listAppsWidget.clear()

self.populate_list(coder=developer)
# hide anything from a different coder
for i in range(self.ui.listAppsWidget.count()):
item = self.ui.listAppsWidget.item(i)
if item.data(Qt.UserRole)["coder"] != developer:
item.setHidden(True)

# Return from developer view to normal view
def return_to_all_apps_btn(self):
Expand All @@ -708,8 +714,10 @@ def return_to_all_apps_btn(self):
self.ui.ReposComboBox.setHidden(False)
self.ui.RepositoryLabel.setHidden(False)

# Return to host
self.changed_host()
# show all items
for i in range(self.ui.listAppsWidget.count()):
item = self.ui.listAppsWidget.item(i)
item.setHidden(False)

# Select theme dialog
def select_theme_action(self):
Expand Down

0 comments on commit c1b704e

Please sign in to comment.