Skip to content

Commit

Permalink
web import adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
DYefremov committed Jul 2, 2024
1 parent 50c2e83 commit cc20042
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions app/ui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,8 @@ def init_actions(self):
self.set_action("on_import_bouquet", self.on_import_bouquet)
self.set_action("on_import_bouquets", self.on_import_bouquets)
self.set_action("on_new_configuration", self.on_new_configuration)
self.set_action("on_import_from_web", self.on_import_from_web)
sa = self.set_action("on_import_from_web", self.on_import_from_web)
self.bind_property("is-data-save-enabled", sa, "enabled")
# Tools.
self.set_action("on_backup_tool_show", self.on_backup_tool_show)
self.set_state_action("on_telnet_show", self.on_telnet_show, False)
Expand Down Expand Up @@ -3334,7 +3335,11 @@ def on_import_from_web(self, action, value=None):
if self._s_type is not SettingsType.ENIGMA_2:
self.show_error_message("Not allowed in this context!")
return
ServicesUpdateDialog(self).show()

if self._page is Page.SATELLITE:
self._satellite_tool.on_update()
else:
ServicesUpdateDialog(self).show()

@run_idle
def on_import_data_from_web(self, services, bouquets=None):
Expand Down
2 changes: 2 additions & 0 deletions app/ui/xml/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ def get_sat_list(self, src, callback):
@run_idle
def append_satellites(self, sats):
model = get_base_model(self._sat_view.get_model())
if not model:
return

for sat in sats:
itr = model.append(sat)
Expand Down
2 changes: 1 addition & 1 deletion app/ui/xml/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def on_upload(self, app, page):
self._app.upload_data(DownloadType.SATELLITES)

@run_idle
def on_update(self, item):
def on_update(self, item=None):
SatellitesUpdateDialog(self._app.get_active_window(), self._settings, self._satellite_view.get_model()).show()


Expand Down

0 comments on commit cc20042

Please sign in to comment.