mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-07-21 06:10:55 +02:00
add extraction support for EPG tab
This commit is contained in:
@@ -410,7 +410,7 @@ class EpgTool(Gtk.Box):
|
||||
|
||||
self._app = app
|
||||
self._app.connect("data-open", self.on_data_open)
|
||||
self._app.connect("data-send", self.on_data_send)
|
||||
self._app.connect("data-extract", self.on_data_extract)
|
||||
self._app.connect("fav-changed", self.on_service_changed)
|
||||
self._app.connect("profile-changed", self.on_profile_changed)
|
||||
self._app.connect("bouquet-changed", self.on_bouquet_changed)
|
||||
@@ -462,19 +462,29 @@ class EpgTool(Gtk.Box):
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
|
||||
if next(self.clear(), False):
|
||||
self._epg_cache = TabEpgCache(self._app, response)
|
||||
if not self._src_xmltv_button.get_active():
|
||||
self._src_xmltv_button.set_active(True)
|
||||
self.open_data(response)
|
||||
|
||||
def on_data_send(self, app, page):
|
||||
def on_data_extract(self, app, page):
|
||||
if page is not Page.EPG:
|
||||
return
|
||||
|
||||
if self._src_xmltv_button.get_active():
|
||||
self._app.show_error_message("Not implemented yet!")
|
||||
else:
|
||||
self._app.show_error_message("Not allowed in this context!")
|
||||
f_filter = Gtk.FileFilter()
|
||||
f_filter.set_name("*.zip, *.gz, *.xz")
|
||||
f_filter.add_mime_type("application/zip")
|
||||
f_filter.add_mime_type("application/gzip")
|
||||
f_filter.add_mime_type("application/x-xz")
|
||||
|
||||
response = get_chooser_dialog(self._app.app_window, self._app.app_settings,
|
||||
"*.zip, *.gz, *.xz files", ("*.zip", "*.gz", "*.xz"), "Open archive", f_filter)
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
self.open_data(response)
|
||||
|
||||
def open_data(self, path):
|
||||
if next(self.clear(), False):
|
||||
self._epg_cache = TabEpgCache(self._app, path)
|
||||
if not self._src_xmltv_button.get_active():
|
||||
self._src_xmltv_button.set_active(True)
|
||||
|
||||
def on_service_changed(self, app, srv):
|
||||
if app.page is not Page.EPG:
|
||||
|
||||
@@ -115,7 +115,7 @@ class Application(Gtk.Application):
|
||||
|
||||
DATA_SAVE_PAGES = {Page.SERVICES, Page.SATELLITE}
|
||||
DATA_OPEN_PAGES = {Page.SERVICES, Page.SATELLITE, Page.PICONS, Page.EPG}
|
||||
DATA_EXTRACT_PAGES = {Page.SERVICES}
|
||||
DATA_EXTRACT_PAGES = {Page.SERVICES, Page.EPG}
|
||||
DATA_SEND_PAGES = {Page.SERVICES, Page.SATELLITE, Page.PICONS, Page.FTP}
|
||||
DATA_RECEIVE_PAGES_enabled = {Page.SERVICES, Page.SATELLITE, Page.PICONS, Page.RECORDINGS, Page.FTP}
|
||||
|
||||
@@ -2191,7 +2191,6 @@ class Application(Gtk.Application):
|
||||
@run_task
|
||||
def upload_data(self, download_type):
|
||||
opts = self._settings
|
||||
use_http = self._s_type is SettingsType.ENIGMA_2 and opts.use_http
|
||||
multiple = len(self._settings.hosts) > 1
|
||||
for host in self._settings.hosts:
|
||||
if multiple:
|
||||
|
||||
Reference in New Issue
Block a user