mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-05-09 09:07:31 +02:00
Compare commits
53 Commits
1.0.0-a2-m
...
1.0.2-b1-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7db02f2a9e | ||
|
|
fd40fd8d72 | ||
|
|
0b4313e4cf | ||
|
|
a74628ed5c | ||
|
|
443f6bf252 | ||
|
|
bb243ce281 | ||
|
|
44049c380e | ||
|
|
281fe2a8f4 | ||
|
|
39cc0ad8b3 | ||
|
|
a625dc9f8b | ||
|
|
53f69b8f67 | ||
|
|
94dfda0fa2 | ||
|
|
cfe3f4c707 | ||
|
|
d18734910d | ||
|
|
d843633043 | ||
|
|
b513d7a9b0 | ||
|
|
92b2f840f8 | ||
|
|
9e4c8f388c | ||
|
|
664c52cfe1 | ||
|
|
cc96cdd8fd | ||
|
|
15cca3f5f7 | ||
|
|
0ec2570043 | ||
|
|
97cb26cd60 | ||
|
|
1da3eacc8c | ||
|
|
cb6f185032 | ||
|
|
a8918bcf1f | ||
|
|
c358197080 | ||
|
|
474fc3ec58 | ||
|
|
c17bad215f | ||
|
|
7891aca6e2 | ||
|
|
608de65897 | ||
|
|
cbed3f7cca | ||
|
|
08c1dca06d | ||
|
|
1edbd7d771 | ||
|
|
0c3f6870dd | ||
|
|
f877872059 | ||
|
|
335dfc005a | ||
|
|
46450cf9b6 | ||
|
|
9ed82ea129 | ||
|
|
555699c2a1 | ||
|
|
83b810286a | ||
|
|
61a56f1989 | ||
|
|
50ce4a688a | ||
|
|
871b428b19 | ||
|
|
3cd864cd84 | ||
|
|
78c6a3c9fa | ||
|
|
4c0904cf6c | ||
|
|
7aa688df15 | ||
|
|
c91d58e0cf | ||
|
|
d071bb5d85 | ||
|
|
8cee77357c | ||
|
|
20f53dee33 | ||
|
|
c454a33b3c |
@@ -25,7 +25,7 @@ a = Analysis([EXE_NAME],
|
||||
hiddenimports=['fileinput', 'uuid'],
|
||||
hookspath=[],
|
||||
runtime_hooks=[],
|
||||
excludes=['youtube_dl'],
|
||||
excludes=['youtube_dl', 'tkinter'],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher)
|
||||
@@ -60,7 +60,8 @@ app = BUNDLE(coll,
|
||||
'CFBundleName': 'DemonEditor',
|
||||
'CFBundleDisplayName': 'DemonEditor',
|
||||
'CFBundleGetInfoString': "Enigma2 channel and satellites editor",
|
||||
'CFBundleShortVersionString': "1.0.0 Alpha-2 (Build: {})".format(BUILD_DATE),
|
||||
'LSApplicationCategoryType': 'public.app-category.utilities',
|
||||
'CFBundleShortVersionString': "1.0.0 Beta (Build: {})".format(BUILD_DATE),
|
||||
'NSHumanReadableCopyright': u"Copyright © 2020, Dmitriy Yefremov",
|
||||
'NSRequiresAquaSystemAppearance': 'false'
|
||||
})
|
||||
|
||||
82
README.md
82
README.md
@@ -1,9 +1,13 @@
|
||||
# <img src="app/ui/icons/hicolor/96x96/apps/demon-editor.png" width="32" /> DemonEditor
|
||||
[](LICENSE)
|
||||
## Enigma2 channel and satellites list editor for macOS (experimental).
|
||||
### The functionality and performance of this version may be different from the Linux version!
|
||||
[](LICENSE) 
|
||||
## Enigma2 channel and satellites list editor for macOS (experimental).
|
||||
Experimental support of Neutrino-MP or others on the same basis (BPanther, etc).
|
||||
Focused on the convenience of working in lists from the keyboard. The mouse is also fully supported (Drag and Drop etc).
|
||||
**The functionality and performance of this version may be different from the [Linux version](https://github.com/DYefremov/DemonEditor)!**
|
||||
|
||||
### Main features of the program:
|
||||

|
||||
|
||||
## Main features of the program
|
||||
* Editing bouquets, channels, satellites.
|
||||
* Import function.
|
||||
* Backup function.
|
||||
@@ -14,7 +18,7 @@
|
||||
* Export of bouquets with IPTV services in m3u.
|
||||
* Assignment of EPGs from DVB or XML for IPTV services (only Enigma2, experimental).
|
||||
* Preview (playback) of IPTV or other streams directly from the bouquet list (should be installed [VLC](https://www.videolan.org/vlc/)).
|
||||
#### Keyboard shortcuts:
|
||||
#### Keyboard shortcuts
|
||||
* **⌘ + X** - only in bouquet list.
|
||||
* **⌘ + C** - only in services list.
|
||||
Clipboard is **"rubber"**. There is an accumulation before the insertion!
|
||||
@@ -34,40 +38,56 @@ Clipboard is **"rubber"**. There is an accumulation before the insertion!
|
||||
* **⇧ + ⌘ + F** - show/hide filter bar.
|
||||
* **Left/Right** - remove selection.
|
||||
|
||||
For multiple mouse selection (including Drag and Drop), press and hold the **⌘** key!
|
||||
For **multiple** selection with the mouse, press and hold the **⌘** key!
|
||||
|
||||
### Minimum requirements:
|
||||
Python >= **3.5**, GTK+ >= **3.16**, pygobject3, adwaita-icon-theme, python3-requests.
|
||||
### Installation:
|
||||
## Minimum requirements
|
||||
*Python >= 3.5.2, GTK+ >= 3.16 with PyGObject bindings, python3-requests.*
|
||||
|
||||
## Installation and Launch
|
||||
To run the program on macOS, you need to install [brew](https://brew.sh/).
|
||||
Then install the required components via terminal:
|
||||
```brew install python3 gtk+3 pygobject3 adwaita-icon-theme```
|
||||
```pip3 install requests```
|
||||
### Optional:
|
||||
#### Optional:
|
||||
```brew install wget```
|
||||
```pip3 install pillow, pyobjc```
|
||||
### Launching:
|
||||
To start the program, just download the archive, unpack and run it from the terminal with the command: ```./start.py```
|
||||
### Building standalone application:
|
||||
Install [PyInstaller](https://www.pyinstaller.org/) with the command from the terminal:
|
||||
```pip3 install pyinstaller```
|
||||
and in th root dir run command:
|
||||
```pyinstaller DemonEditor.spec```
|
||||
### Standalone package:
|
||||
You can download the ready-made package as a ***.dmg** file from the [releases](https://github.com/DYefremov/DemonEditor/releases) page.
|
||||
```pip3 install pillow, pyobjc```
|
||||
|
||||
To start the program, just download the [archive](https://github.com/DYefremov/DemonEditor/archive/experimental-mac.zip), unpack and run it from the terminal
|
||||
with the command: ```./start.py```
|
||||
## Standalone package
|
||||
You can also download the ready-made package as a ***.dmg** file from the [releases](https://github.com/DYefremov/DemonEditor/releases) page.
|
||||
Recommended copy the package to the **Application** directory.
|
||||
Perhaps in the security settings it will be necessary to allow the launch of this application!
|
||||
**The package may not contain all the latest changes. Not all features can be supported and tested!**
|
||||
### Note:
|
||||
|
||||
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY.
|
||||
AUTHOR IS NOT LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY CONNECTION WITH THIS SOFTWARE.
|
||||
The package may contain components distributed under the GPL [v3](http://www.gnu.org/licenses/gpl-3.0.html) or lower license.
|
||||
By downloading and using this package you agree to the terms of this [license](http://www.gnu.org/licenses/gpl-3.0.html) and the possible inconvenience associated with this!
|
||||
|
||||
### Important:
|
||||
Terrestrial(DVB-T/T2) and cable(DVB-C) channels are only supported for Enigma2!
|
||||
Main supported *lamedb* format is version **4**. Versions **3** and **5** has only **experimental** support!
|
||||
For version **3** is only read mode available. When saving, version **4** format is used instead!
|
||||
By downloading and using this package you agree to the terms of this [license](http://www.gnu.org/licenses/gpl-3.0.html) and the possible inconvenience associated with this!
|
||||
|
||||
When using the multiple import feature, from *lamedb* will be taken data **only for channels that are in the
|
||||
selected bouquets!** If you need full set of the data, including *[satellites, terrestrial, cables].xml* (current files will be overwritten),
|
||||
just load your data via *"File/Open"* and press *"Save"*. When importing separate bouquet files, only those services
|
||||
(excluding IPTV) that are in the **current open lamedb** (main list of services) will be imported.
|
||||
#### Building your own package
|
||||
Install [PyInstaller](https://www.pyinstaller.org/) with the command from the terminal:
|
||||
|
||||
```pip3 install pyinstaller```
|
||||
|
||||
and in the root dir run command:
|
||||
|
||||
```pyinstaller DemonEditor.spec```
|
||||
## Important
|
||||
**This version is not fully tested and has experimental status!**
|
||||
|
||||
Terrestrial(DVB-T/T2) and cable(DVB-C) channels are only supported for Enigma2.
|
||||
Main supported *lamedb* format is version **4**. Versions **3** and **5** has only **experimental** support!
|
||||
For version **3** is only read mode available. When saving, version **4** format is used instead.
|
||||
|
||||
When using the multiple import feature, from *lamedb* will be taken data **only for channels that are in the selected bouquets!**
|
||||
If you need full set of the data, including *[satellites, terrestrial, cables].xml* (current files will be overwritten),
|
||||
just load your data via *"File/Open"* and press *"Save"*. When importing separate bouquet files, only those services
|
||||
(excluding IPTV) that are in the **current open lamedb** (main list of services) will be imported.
|
||||
#### Command line arguments:
|
||||
* **-l** - write logs to file.
|
||||
* **-d on/off** - turn on/off debug mode. Allows to display more information in the logs.
|
||||
* **-t on/off** - show/hide simple built-in **telnet** client (experimental). **ANSI escape sequences are not supported!**
|
||||
|
||||
## License
|
||||
Licensed under the [MIT](LICENSE) license.
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
theme: jekyll-theme-cayman
|
||||
theme: jekyll-theme-slate
|
||||
show_downloads: true
|
||||
|
||||
@@ -35,25 +35,6 @@ class DownloadType(Enum):
|
||||
EPG = 5
|
||||
|
||||
|
||||
class HttpRequestType(Enum):
|
||||
ZAP = "zap?sRef="
|
||||
INFO = "about"
|
||||
SIGNAL = "signal"
|
||||
STREAM = "stream.m3u?ref="
|
||||
STREAM_CURRENT = "streamcurrent.m3u"
|
||||
CURRENT = "getcurrent"
|
||||
TEST = None
|
||||
TOKEN = "session"
|
||||
PLAY = "mediaplayerplay?file="
|
||||
PLAYER_LIST = "mediaplayerlist?path=playlist"
|
||||
PLAYER_PLAY = "mediaplayercmd?command=play"
|
||||
PLAYER_NEXT = "mediaplayercmd?command=next"
|
||||
PLAYER_PREV = "mediaplayercmd?command=previous"
|
||||
PLAYER_STOP = "mediaplayercmd?command=stop"
|
||||
PLAYER_REMOVE = "mediaplayerremove?file="
|
||||
GRUB = "grab?format=jpg&"
|
||||
|
||||
|
||||
class TestException(Exception):
|
||||
pass
|
||||
|
||||
@@ -72,8 +53,7 @@ def download_data(*, settings, download_type=DownloadType.ALL, callback=print, f
|
||||
if download_type is DownloadType.ALL or download_type is DownloadType.BOUQUETS:
|
||||
ftp.cwd(settings.services_path)
|
||||
file_list = BQ_FILES_LIST + DATA_FILES_LIST if download_type is DownloadType.ALL else BQ_FILES_LIST
|
||||
for file in filter(lambda f: f.endswith(file_list), ftp.nlst()):
|
||||
download_file(ftp, file, save_path, callback)
|
||||
download_files(ftp, save_path, file_list, callback)
|
||||
# *.xml and webtv
|
||||
if download_type in (DownloadType.ALL, DownloadType.SATELLITES):
|
||||
download_xml(ftp, save_path, settings.satellites_xml_path, STC_XML_FILE, callback)
|
||||
@@ -93,8 +73,7 @@ def download_data(*, settings, download_type=DownloadType.ALL, callback=print, f
|
||||
save_path = epg_options.get("epg_dat_path", save_path)
|
||||
|
||||
ftp.cwd(stb_path)
|
||||
for file in filter(lambda f: f.endswith("epg.dat"), ftp.nlst()):
|
||||
download_file(ftp, file, save_path, callback)
|
||||
download_files(ftp, save_path, "epg.dat", callback)
|
||||
|
||||
callback("\nDone.\n")
|
||||
|
||||
@@ -138,7 +117,9 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False
|
||||
timeout=settings.telnet_timeout)
|
||||
next(tn)
|
||||
# terminate enigma or neutrino
|
||||
callback("Telnet initialization ...\n")
|
||||
tn.send("init 4")
|
||||
callback("Stopping GUI...\n")
|
||||
|
||||
with FTP(host=host, user=settings.user, passwd=settings.password) as ftp:
|
||||
ftp.encoding = "utf-8"
|
||||
@@ -171,6 +152,7 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False
|
||||
if tn and not use_http:
|
||||
# resume enigma or restart neutrino
|
||||
tn.send("init 3" if s_type is SettingsType.ENIGMA_2 else "init 6")
|
||||
callback("Starting...\n" if s_type is SettingsType.ENIGMA_2 else "Rebooting...\n")
|
||||
elif ht and use_http:
|
||||
if download_type is DownloadType.BOUQUETS:
|
||||
ht.send((url + "servicelistreload?mode=2", "Reloading Userbouquets."))
|
||||
@@ -202,7 +184,11 @@ def upload_files(ftp, data_path, file_list, callback):
|
||||
|
||||
|
||||
def remove_unused_bouquets(ftp, callback):
|
||||
for file in filter(lambda f: f.endswith(("tv", "radio", "bouquets.xml", "ubouquets.xml")), ftp.nlst()):
|
||||
files = []
|
||||
ftp.dir(files.append)
|
||||
bq_files = ("tv", "radio", "bouquets.xml", "ubouquets.xml")
|
||||
|
||||
for file in filter(lambda f: f.endswith(bq_files), map(lambda f: f.split()[-1], map(str.rstrip, files))):
|
||||
callback("Deleting file: {}. Status: {}\n".format(file, ftp.delete(file)))
|
||||
|
||||
|
||||
@@ -216,7 +202,7 @@ def upload_xml(ftp, data_path, xml_path, xml_files, callback):
|
||||
def download_xml(ftp, data_path, xml_path, xml_files, callback):
|
||||
""" Used for download *.xml files. """
|
||||
ftp.cwd(xml_path)
|
||||
list(map(lambda f: download_file(ftp, f, data_path, callback), (f for f in ftp.nlst() if f.endswith(xml_files))))
|
||||
download_files(ftp, data_path, xml_files, callback)
|
||||
|
||||
|
||||
# ***************** Picons *******************#
|
||||
@@ -240,7 +226,10 @@ def download_picons(ftp, src, dest, callback, files_filter=None):
|
||||
callback(str(e))
|
||||
return
|
||||
|
||||
for file in filter(picons_filter_function(files_filter), ftp.nlst()):
|
||||
files = []
|
||||
ftp.dir(files.append)
|
||||
|
||||
for file in filter(picons_filter_function(files_filter), map(lambda f: f.split()[-1], map(str.rstrip, files))):
|
||||
download_file(ftp, file, dest, callback)
|
||||
|
||||
|
||||
@@ -252,7 +241,10 @@ def delete_picons(ftp, callback, dest=None, files_filter=None):
|
||||
callback(str(e))
|
||||
return
|
||||
|
||||
for file in filter(picons_filter_function(files_filter), ftp.nlst()):
|
||||
files = []
|
||||
ftp.dir(files.append)
|
||||
|
||||
for file in filter(picons_filter_function(files_filter), map(lambda f: f.split()[-1], map(str.rstrip, files))):
|
||||
callback("Delete file: {}. Status: {}\n".format(file, ftp.delete(file)))
|
||||
|
||||
|
||||
@@ -269,6 +261,15 @@ def picons_filter_function(files_filter=None):
|
||||
return lambda f: f in files_filter if files_filter else f.endswith(PICONS_SUF)
|
||||
|
||||
|
||||
def download_files(ftp, save_path, file_list, callback):
|
||||
""" Downloads files from the receiver via FTP. """
|
||||
files = []
|
||||
ftp.dir(files.append)
|
||||
|
||||
for file in map(lambda f: f.split()[-1], filter(lambda s: s.endswith(file_list), map(str.rstrip, files))):
|
||||
download_file(ftp, file, save_path, callback)
|
||||
|
||||
|
||||
def download_file(ftp, name, save_path, callback):
|
||||
with open(save_path + name, "wb") as f:
|
||||
callback("Downloading file: {}. Status: {}\n".format(name, str(ftp.retrbinary("RETR " + name, f.write))))
|
||||
@@ -291,7 +292,7 @@ def http(user, password, url, callback, use_ssl=False):
|
||||
|
||||
while True:
|
||||
url, message = yield
|
||||
resp = get_response(HttpRequestType.TEST, url, data).get("e2statetext", None)
|
||||
resp = get_response(HttpAPI.Request.TEST, url, data).get("e2statetext", None)
|
||||
callback("HTTP: {} {}\n".format(message, "Successful." if resp and message else ""))
|
||||
|
||||
|
||||
@@ -304,11 +305,11 @@ def telnet(host, port=23, user="", password="", timeout=5):
|
||||
time.sleep(1)
|
||||
command = yield
|
||||
if user != "":
|
||||
tn.read_until(b"login: ")
|
||||
tn.read_until(b"login: ", timeout)
|
||||
tn.write(user.encode("utf-8") + b"\n")
|
||||
time.sleep(timeout)
|
||||
if password != "":
|
||||
tn.read_until(b"Password: ")
|
||||
tn.read_until(b"Password: ", timeout)
|
||||
tn.write(password.encode("utf-8") + b"\n")
|
||||
time.sleep(timeout)
|
||||
tn.write("{}\r\n".format(command).encode("utf-8"))
|
||||
@@ -325,6 +326,58 @@ def telnet(host, port=23, user="", password="", timeout=5):
|
||||
class HttpAPI:
|
||||
__MAX_WORKERS = 4
|
||||
|
||||
class Request(Enum):
|
||||
ZAP = "zap?sRef="
|
||||
INFO = "about"
|
||||
SIGNAL = "signal"
|
||||
STREAM = "stream.m3u?ref="
|
||||
STREAM_CURRENT = "streamcurrent.m3u"
|
||||
CURRENT = "getcurrent"
|
||||
TEST = None
|
||||
TOKEN = "session"
|
||||
# Player
|
||||
PLAY = "mediaplayerplay?file="
|
||||
PLAYER_LIST = "mediaplayerlist?path=playlist"
|
||||
PLAYER_PLAY = "mediaplayercmd?command=play"
|
||||
PLAYER_NEXT = "mediaplayercmd?command=next"
|
||||
PLAYER_PREV = "mediaplayercmd?command=previous"
|
||||
PLAYER_STOP = "mediaplayercmd?command=stop"
|
||||
PLAYER_REMOVE = "mediaplayerremove?file="
|
||||
# Remote control
|
||||
POWER = "powerstate?newstate="
|
||||
REMOTE = "remotecontrol?command="
|
||||
VOL = "vol?set=set"
|
||||
# EPG
|
||||
EPG = "epgservice?sRef="
|
||||
# Timer
|
||||
TIMER = ""
|
||||
TIMER_LIST = "timerlist"
|
||||
# Screenshot
|
||||
GRUB = "grab?format=jpg&"
|
||||
|
||||
class Remote(str, Enum):
|
||||
""" Args for HttpRequestType [REMOTE] class. """
|
||||
UP = "103"
|
||||
LEFT = "105"
|
||||
RIGHT = "106"
|
||||
DOWN = "108"
|
||||
MENU = "139"
|
||||
EXIT = "174"
|
||||
OK = "352"
|
||||
RED = "398"
|
||||
GREEN = "399"
|
||||
YELLOW = "400"
|
||||
BLUE = "401"
|
||||
|
||||
class Power(str, Enum):
|
||||
""" Args for HttpRequestType [POWER] class. """
|
||||
TOGGLE_STANDBY = "0"
|
||||
DEEP_STANDBY = "1"
|
||||
REBOOT = "2"
|
||||
RESTART_GUI = "3"
|
||||
WAKEUP = "4"
|
||||
STANDBY = "5"
|
||||
|
||||
def __init__(self, settings):
|
||||
from concurrent.futures import ThreadPoolExecutor as PoolExecutor
|
||||
self._executor = PoolExecutor(max_workers=self.__MAX_WORKERS)
|
||||
@@ -345,13 +398,19 @@ class HttpAPI:
|
||||
url = self._base_url + req_type.value
|
||||
data = self._data
|
||||
|
||||
if req_type is HttpRequestType.ZAP or req_type is HttpRequestType.STREAM:
|
||||
if req_type is self.Request.ZAP or req_type is self.Request.STREAM:
|
||||
url += urllib.parse.quote(ref)
|
||||
elif req_type is HttpRequestType.PLAY or req_type is HttpRequestType.PLAYER_REMOVE:
|
||||
elif req_type is self.Request.PLAY or req_type is self.Request.PLAYER_REMOVE:
|
||||
url += "{}{}".format(ref_prefix, urllib.parse.quote(ref).replace("%3A", "%253A"))
|
||||
elif req_type is HttpRequestType.GRUB:
|
||||
elif req_type is self.Request.GRUB:
|
||||
data = None # Must be disabled for token-based security.
|
||||
url = "{}/{}{}".format(self._main_url, req_type.value, ref)
|
||||
elif req_type in (self.Request.REMOTE,
|
||||
self.Request.POWER,
|
||||
self.Request.VOL,
|
||||
self.Request.EPG,
|
||||
self.Request.TIMER):
|
||||
url += ref
|
||||
|
||||
def done_callback(f):
|
||||
callback(f.result())
|
||||
@@ -366,12 +425,12 @@ class HttpAPI:
|
||||
self._main_url = "http{}://{}:{}".format("s" if use_ssl else "", self._settings.host, self._settings.http_port)
|
||||
self._base_url = "{}/web/".format(self._main_url)
|
||||
init_auth(user, password, self._main_url, use_ssl)
|
||||
url = "{}/web/{}".format(self._main_url, HttpRequestType.TOKEN.value)
|
||||
url = "{}/web/{}".format(self._main_url, self.Request.TOKEN.value)
|
||||
s_id = get_session_id(user, password, url)
|
||||
if s_id != "0":
|
||||
self._data = urllib.parse.urlencode({"user": user, "password": password, "sessionid": s_id}).encode("utf-8")
|
||||
|
||||
self.send(HttpRequestType.INFO, None, self.init_callback)
|
||||
self.send(self.Request.INFO, None, self.init_callback)
|
||||
|
||||
def init_callback(self, info):
|
||||
if info:
|
||||
@@ -394,24 +453,30 @@ class HttpAPI:
|
||||
def get_response(req_type, url, data=None):
|
||||
try:
|
||||
with urlopen(Request(url, data=data), timeout=10) as f:
|
||||
if req_type is HttpRequestType.STREAM or req_type is HttpRequestType.STREAM_CURRENT:
|
||||
if req_type is HttpAPI.Request.STREAM or req_type is HttpAPI.Request.STREAM_CURRENT:
|
||||
return {"m3u": f.read().decode("utf-8")}
|
||||
elif req_type is HttpRequestType.GRUB:
|
||||
elif req_type is HttpAPI.Request.GRUB:
|
||||
return {"img_data": f.read()}
|
||||
elif req_type is HttpRequestType.CURRENT:
|
||||
elif req_type is HttpAPI.Request.CURRENT:
|
||||
for el in ETree.fromstring(f.read().decode("utf-8")).iter("e2event"):
|
||||
return {el.tag: el.text for el in el.iter()} # return first[current] event from the list
|
||||
elif req_type is HttpRequestType.PLAYER_LIST:
|
||||
elif req_type is HttpAPI.Request.PLAYER_LIST:
|
||||
return [{el.tag: el.text for el in el.iter()} for el in
|
||||
ETree.fromstring(f.read().decode("utf-8")).iter("e2file")]
|
||||
elif req_type is HttpAPI.Request.EPG:
|
||||
return {"event_list": [{el.tag: el.text for el in el.iter()} for el in
|
||||
ETree.fromstring(f.read().decode("utf-8")).iter("e2event")]}
|
||||
elif req_type is HttpAPI.Request.TIMER_LIST:
|
||||
return {"timer_list": [{el.tag: el.text for el in el.iter()} for el in
|
||||
ETree.fromstring(f.read().decode("utf-8")).iter("e2timer")]}
|
||||
else:
|
||||
return {el.tag: el.text for el in ETree.fromstring(f.read().decode("utf-8")).iter()}
|
||||
except HTTPError as e:
|
||||
if req_type is HttpRequestType.TEST:
|
||||
if req_type is HttpAPI.Request.TEST:
|
||||
raise e
|
||||
return {"error_code": e.code}
|
||||
except (URLError, RemoteDisconnected, ConnectionResetError) as e:
|
||||
if req_type is HttpRequestType.TEST:
|
||||
if req_type is HttpAPI.Request.TEST:
|
||||
raise e
|
||||
except ETree.ParseError as e:
|
||||
log("Parsing response error: {}".format(e))
|
||||
@@ -438,11 +503,11 @@ def init_auth(user, password, url, use_ssl=False):
|
||||
|
||||
def get_session_id(user, password, url):
|
||||
data = urllib.parse.urlencode(dict(user=user, password=password)).encode("utf-8")
|
||||
return get_response(HttpRequestType.TOKEN, url, data=data).get("e2sessionid", "0")
|
||||
return get_response(HttpAPI.Request.TOKEN, url, data=data).get("e2sessionid", "0")
|
||||
|
||||
|
||||
def get_post_data(base_url, password, user):
|
||||
s_id = get_session_id(user, password, "{}/web/{}".format(base_url, HttpRequestType.TOKEN.value))
|
||||
s_id = get_session_id(user, password, "{}/web/{}".format(base_url, HttpAPI.Request.TOKEN.value))
|
||||
data = None
|
||||
if s_id != "0":
|
||||
data = urllib.parse.urlencode({"user": user, "password": password, "sessionid": s_id}).encode("utf-8")
|
||||
@@ -468,7 +533,7 @@ def test_http(host, port, user, password, timeout=5, use_ssl=False, skip_message
|
||||
data = get_post_data(base_url, password, user)
|
||||
|
||||
try:
|
||||
return get_response(HttpRequestType.TEST, "{}/web/{}".format(base_url, params), data).get("e2statetext", "")
|
||||
return get_response(HttpAPI.Request.TEST, "{}/web/{}".format(base_url, params), data).get("e2statetext", "")
|
||||
except (RemoteDisconnected, URLError, HTTPError) as e:
|
||||
raise TestException(e)
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ def get_blacklist(path):
|
||||
with open(path + __FILE_NAME, "r") as file:
|
||||
# filter empty values and "\n"
|
||||
return {*list(filter(None, (x.strip() for x in file.readlines())))}
|
||||
return {}
|
||||
|
||||
|
||||
def write_blacklist(path, channels):
|
||||
|
||||
@@ -25,11 +25,16 @@ def write_services(path, services, format_version=4):
|
||||
|
||||
def write_to_lamedb(path, services):
|
||||
""" Writing lamedb file ver.4 """
|
||||
with open(path + _FILE_NAME, "w") as file:
|
||||
file.writelines(get_services_lines(services))
|
||||
|
||||
|
||||
def get_services_lines(services):
|
||||
""" Returns a list of strings from services for lamedb [v.4]. """
|
||||
lines = [_HEADER.format(4), "\ntransponders\n"]
|
||||
tr_lines = []
|
||||
services_lines = ["end\nservices\n"]
|
||||
tr_set = set()
|
||||
|
||||
for srv in services:
|
||||
data_id = str(srv.data_id).split(_SEP)
|
||||
tr_id = "{}:{}:{}".format(data_id[1], data_id[2], data_id[3])
|
||||
@@ -44,12 +49,12 @@ def write_to_lamedb(path, services):
|
||||
lines.extend(tr_lines)
|
||||
lines.extend(services_lines)
|
||||
lines.append("end\n" + _END_LINE)
|
||||
with open(path + _FILE_NAME, "w") as file:
|
||||
file.writelines(lines)
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def write_to_lamedb5(path, services):
|
||||
""" Writing lamedb5 file """
|
||||
""" Writing lamedb5 file. """
|
||||
lines = [_HEADER.format(5) + "\n"]
|
||||
services_lines = []
|
||||
tr_set = set()
|
||||
@@ -73,7 +78,7 @@ def write_to_lamedb5(path, services):
|
||||
|
||||
|
||||
def parse(path, version=4):
|
||||
""" Parsing lamedb """
|
||||
""" Parsing lamedb. """
|
||||
if version == 4:
|
||||
return parse_v4(path)
|
||||
elif version == 5:
|
||||
@@ -82,7 +87,7 @@ def parse(path, version=4):
|
||||
|
||||
|
||||
def parse_v3(services, transponders, path):
|
||||
""" Parsing version 3 """
|
||||
""" Parsing version 3. """
|
||||
for t in transponders:
|
||||
tr = transponders[t].lower()
|
||||
tr_type = tr[0:1]
|
||||
@@ -108,32 +113,37 @@ def parse_v3(services, transponders, path):
|
||||
|
||||
|
||||
def parse_v4(path):
|
||||
""" Parsing version 4 """
|
||||
""" Parsing version 4. """
|
||||
with open(path + _FILE_NAME, "r", encoding="utf-8", errors="replace") as file:
|
||||
try:
|
||||
data = str(file.read())
|
||||
except UnicodeDecodeError as e:
|
||||
log("lamedb parse error: " + str(e))
|
||||
else:
|
||||
transponders, sep, services = data.partition("transponders") # 1 step
|
||||
pattern = re.compile("/[34]/$")
|
||||
match = re.search(pattern, transponders)
|
||||
if not match:
|
||||
msg = "lamedb parsing error: unsupported format."
|
||||
log(msg)
|
||||
raise SyntaxError(msg)
|
||||
return get_services_list(data, path)
|
||||
|
||||
transponders, sep, services = services.partition("services") # 2 step
|
||||
services, sep, _ = services.partition("\nend") # 3 step
|
||||
|
||||
if match.group() == "/3/":
|
||||
return parse_v3(services.split("\n"), parse_transponders(transponders.split("/")), path)
|
||||
def get_services_list(data, path=None):
|
||||
""" Returns a list of services from a string data representation. """
|
||||
transponders, sep, services = data.partition("transponders") # 1 step
|
||||
pattern = re.compile("/[34]/$")
|
||||
match = re.search(pattern, transponders)
|
||||
if not match:
|
||||
msg = "lamedb parsing error: unsupported format."
|
||||
log(msg)
|
||||
raise SyntaxError(msg)
|
||||
|
||||
return parse_services(services.split("\n"), parse_transponders(transponders.split("/")), path)
|
||||
transponders, sep, services = services.partition("services") # 2 step
|
||||
services, sep, _ = services.partition("\nend") # 3 step
|
||||
|
||||
if match.group() == "/3/":
|
||||
return parse_v3(services.split("\n"), parse_transponders(transponders.split("/")), path)
|
||||
|
||||
return parse_services(services.split("\n"), parse_transponders(transponders.split("/")), path)
|
||||
|
||||
|
||||
def parse_v5(path):
|
||||
""" Parsing version 5 """
|
||||
""" Parsing version 5. """
|
||||
with open(path + "lamedb5", "r", encoding="utf-8", errors="replace") as file:
|
||||
lns = file.readlines()
|
||||
|
||||
@@ -141,9 +151,9 @@ def parse_v5(path):
|
||||
raise SyntaxError("lamedb v.5 parsing error: unsupported format.")
|
||||
|
||||
trs, srvs = {}, [""]
|
||||
for l in lns:
|
||||
if l.startswith("s:"):
|
||||
srv_data = l.strip("s:").split(",", 2)
|
||||
for line in lns:
|
||||
if line.startswith("s:"):
|
||||
srv_data = line.strip("s:").split(",", 2)
|
||||
srv_data[1] = srv_data[1].strip("\"")
|
||||
data_len = len(srv_data)
|
||||
if data_len == 3:
|
||||
@@ -151,15 +161,15 @@ def parse_v5(path):
|
||||
elif data_len == 2:
|
||||
srv_data.append("p:")
|
||||
srvs.extend(srv_data)
|
||||
elif l.startswith("t:"):
|
||||
tr, srv = l.split(",")
|
||||
elif line.startswith("t:"):
|
||||
tr, srv = line.split(",")
|
||||
trs[tr.strip("t:")] = srv.strip().replace(":", " ", 1)
|
||||
|
||||
return parse_services(srvs, trs, path)
|
||||
|
||||
|
||||
def parse_transponders(arg):
|
||||
""" Parsing transponders """
|
||||
""" Parsing transponders. """
|
||||
transponders = {}
|
||||
for ar in arg:
|
||||
tr = ar.replace("\n", "").split("\t")
|
||||
@@ -170,9 +180,9 @@ def parse_transponders(arg):
|
||||
|
||||
|
||||
def parse_services(services, transponders, path):
|
||||
""" Parsing services """
|
||||
""" Parsing services. """
|
||||
services_list = []
|
||||
blacklist = str(get_blacklist(path))
|
||||
blacklist = get_blacklist(path) if path else {}
|
||||
srvs = split(services, 3)
|
||||
if srvs[0][0] == "": # remove first empty element
|
||||
srvs.remove(srvs[0])
|
||||
@@ -208,12 +218,13 @@ def parse_services(services, transponders, path):
|
||||
# For comparison in bouquets. Needed in upper case!!!
|
||||
fav_id = "{}:{}:{}:{}".format(ssid, tid, nid, onid)
|
||||
picon_id = "1_0_{:X}_{}_{}_{}_{}_0_0_0.png".format(srv_type, ssid, tid, nid, onid)
|
||||
s_id = "1:0:{:X}:{}:{}:{}:{}:0:0:0:".format(srv_type, ssid, tid, nid, onid)
|
||||
|
||||
all_flags = srv[2].split(",")
|
||||
coded = CODED_ICON if list(filter(lambda x: x.startswith("C:"), all_flags)) else None
|
||||
flags = list(filter(lambda x: x.startswith("f:"), all_flags))
|
||||
hide = HIDE_ICON if flags and Flag.is_hide(int(flags[0][2:])) else None
|
||||
locked = LOCKED_ICON if fav_id in blacklist else None
|
||||
locked = LOCKED_ICON if s_id in blacklist else None
|
||||
|
||||
package = list(filter(lambda x: x.startswith("p:"), all_flags))
|
||||
package = package[0][2:] if package else ""
|
||||
|
||||
@@ -2,11 +2,10 @@ import glob
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
||||
from collections import namedtuple
|
||||
from html.parser import HTMLParser
|
||||
|
||||
from app.commons import run_task
|
||||
from app.commons import run_task, log
|
||||
from app.settings import SettingsType
|
||||
|
||||
_ENIGMA2_PICON_KEY = "{:X}:{:X}:{}"
|
||||
@@ -33,9 +32,9 @@ class PiconsParser(HTMLParser):
|
||||
self.picons = []
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == 'td':
|
||||
if tag == "td":
|
||||
self._is_td = True
|
||||
if tag == 'th':
|
||||
if tag == "th":
|
||||
self._is_th = True
|
||||
if tag == "img":
|
||||
self._current_row.append(attrs[0][1])
|
||||
@@ -46,16 +45,16 @@ class PiconsParser(HTMLParser):
|
||||
self._current_cell.append(data.strip())
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if tag == 'td':
|
||||
if tag == "td":
|
||||
self._is_td = False
|
||||
elif tag == 'th':
|
||||
elif tag == "th":
|
||||
self._is_th = False
|
||||
|
||||
if tag in ('td', 'th'):
|
||||
if tag in ("td", "th"):
|
||||
final_cell = self._separator.join(self._current_cell).strip()
|
||||
self._current_row.append(final_cell)
|
||||
self._current_cell = []
|
||||
elif tag == 'tr':
|
||||
elif tag == "tr":
|
||||
row = self._current_row
|
||||
ln = len(row)
|
||||
|
||||
@@ -80,6 +79,10 @@ class PiconsParser(HTMLParser):
|
||||
|
||||
@staticmethod
|
||||
def parse(open_path, picons_path, tmp_path, provider, picon_ids, s_type=SettingsType.ENIGMA_2):
|
||||
if not os.path.isfile(open_path):
|
||||
log("PiconsParser error [parse]. No such file or directory: {}".format(open_path))
|
||||
return
|
||||
|
||||
with open(open_path, encoding="utf-8", errors="replace") as f:
|
||||
on_id, pos, ssid, single = provider.on_id, provider.pos, provider.ssid, provider.single
|
||||
neg_pos = pos.endswith("W")
|
||||
@@ -105,8 +108,7 @@ class PiconsParser(HTMLParser):
|
||||
shutil.copyfile(tmp_path + "www.lyngsat.com/" + p.ref.lstrip("."), p_name)
|
||||
except (TypeError, ValueError) as e:
|
||||
msg = "Picons format parse error: {}".format(p) + "\n" + str(e)
|
||||
# log(msg)
|
||||
print(msg)
|
||||
log(msg)
|
||||
|
||||
@staticmethod
|
||||
def format(ssid, on_id, namespace, picon_ids, s_type):
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
""" Module for download satellites from internet ("flysat.com")
|
||||
for replace or update current satellites.xml file.
|
||||
""" Module for downloading satellites, transponders ans services from the web.
|
||||
|
||||
Sources: www.flysat.com, www.lyngsat.com.
|
||||
Replaces or updates the current satellites.xml file.
|
||||
"""
|
||||
import re
|
||||
|
||||
import requests
|
||||
from enum import Enum
|
||||
from html.parser import HTMLParser
|
||||
|
||||
import requests
|
||||
|
||||
from app.commons import log
|
||||
from app.eparser import Satellite, Transponder, is_transponder_valid
|
||||
from app.eparser.ecommons import PLS_MODE
|
||||
from app.eparser.ecommons import (PLS_MODE, get_key_by_value, FEC, SYSTEM, POLARIZATION, MODULATION, SERVICE_TYPE,
|
||||
Service, CAS)
|
||||
|
||||
_HEADERS = {"User-Agent": "Mozilla/5.0 (X11; Linux i586; rv:31.0) Gecko/20100101 Firefox/69.0"}
|
||||
|
||||
|
||||
class SatelliteSource(Enum):
|
||||
@@ -22,11 +27,55 @@ class SatelliteSource(Enum):
|
||||
return src.value
|
||||
|
||||
|
||||
class Cell:
|
||||
""" Cell representation for table parsers. """
|
||||
__slots__ = ["_text", "_url", "_img"]
|
||||
|
||||
def __init__(self, text=None, link=None, img=None):
|
||||
self._text = text
|
||||
self._url = link
|
||||
self._img = img
|
||||
|
||||
def __repr__(self):
|
||||
return "Cell({}, {}, {})".format(self._text, self._url, self._img)
|
||||
|
||||
def __str__(self):
|
||||
return "<Cell(text={}, link={}, img={})>".format(self._text, self._url, self._img)
|
||||
|
||||
def __iter__(self):
|
||||
return (x for x in (self._text, self._url, self._img))
|
||||
|
||||
def __len__(self):
|
||||
return 3
|
||||
|
||||
@property
|
||||
def text(self):
|
||||
return self._text
|
||||
|
||||
@text.setter
|
||||
def text(self, value):
|
||||
self._text = value
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
return self._url
|
||||
|
||||
@url.setter
|
||||
def url(self, value):
|
||||
self._url = value
|
||||
|
||||
@property
|
||||
def img(self):
|
||||
return self._img
|
||||
|
||||
@img.setter
|
||||
def img(self, value):
|
||||
self._img = value
|
||||
|
||||
|
||||
class SatellitesParser(HTMLParser):
|
||||
""" Parser for satellite html page. """
|
||||
|
||||
_HEADERS = {"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Firefox/59.02"}
|
||||
|
||||
def __init__(self, source=SatelliteSource.FLYSAT, entities=False, separator=' '):
|
||||
|
||||
HTMLParser.__init__(self)
|
||||
@@ -42,9 +91,9 @@ class SatellitesParser(HTMLParser):
|
||||
self._source = source
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == 'td':
|
||||
if tag == "td":
|
||||
self._is_td = True
|
||||
if tag == 'tr':
|
||||
if tag == "tr":
|
||||
self._is_th = True
|
||||
if tag == "a":
|
||||
self._current_row.append(attrs[0][1])
|
||||
@@ -55,16 +104,16 @@ class SatellitesParser(HTMLParser):
|
||||
self._current_cell.append(data.strip())
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if tag == 'td':
|
||||
if tag == "td":
|
||||
self._is_td = False
|
||||
elif tag == 'tr':
|
||||
elif tag == "tr":
|
||||
self._is_th = False
|
||||
|
||||
if tag in ('td', 'th'):
|
||||
if tag in ("td", "th"):
|
||||
final_cell = self._separator.join(self._current_cell).strip()
|
||||
self._current_row.append(final_cell)
|
||||
self._current_cell = []
|
||||
elif tag == 'tr':
|
||||
elif tag == "tr":
|
||||
row = self._current_row
|
||||
self._rows.append(row)
|
||||
self._current_row = []
|
||||
@@ -80,7 +129,7 @@ class SatellitesParser(HTMLParser):
|
||||
|
||||
for src in SatelliteSource.get_sources(self._source):
|
||||
try:
|
||||
request = requests.get(url=src, headers=self._HEADERS)
|
||||
request = requests.get(url=src, headers=_HEADERS)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
log(repr(e))
|
||||
return []
|
||||
@@ -98,17 +147,24 @@ class SatellitesParser(HTMLParser):
|
||||
|
||||
return list(map(get_sat, filter(lambda x: all(x) and len(x) == 5, self._rows)))
|
||||
elif self._source is SatelliteSource.LYNGSAT:
|
||||
extra_pattern = re.compile("^https://www\.lyngsat\.com/[\w-]+\.html")
|
||||
extra_pattern = re.compile(r"^https://www\.lyngsat\.com/[\w-]+\.html")
|
||||
base_url = "https://www.lyngsat.com/"
|
||||
sats = []
|
||||
names = set()
|
||||
current_pos = "0"
|
||||
for row in filter(lambda x: len(x) in (5, 7, 8), self._rows):
|
||||
r_len = len(row)
|
||||
if r_len == 7:
|
||||
current_pos = self.parse_position(row[2])
|
||||
name = row[1].rsplit("/")[-1].rstrip(".html").replace("-", " ")
|
||||
sats.append((name, current_pos, row[5], base_url + row[1], False)) # [all in one] satellites
|
||||
sats.append((row[4], current_pos, row[5], base_url + row[3], False))
|
||||
if name not in names:
|
||||
# [all in one] satellites
|
||||
sats.append((name, current_pos, row[5], base_url + row[1], False))
|
||||
names.add(name)
|
||||
name = row[4]
|
||||
if name not in names:
|
||||
sats.append((name, current_pos, row[5], base_url + row[3], False))
|
||||
names.add(name)
|
||||
if r_len == 8: # for a very limited number of satellites
|
||||
data = list(filter(None, row))
|
||||
urls = set()
|
||||
@@ -146,7 +202,7 @@ class SatellitesParser(HTMLParser):
|
||||
""" Getting transponders(sorted by frequency). """
|
||||
self._rows.clear()
|
||||
url = "https://www.flysat.com/" + sat_url if self._source is SatelliteSource.FLYSAT else sat_url
|
||||
request = requests.get(url=url, headers=self._HEADERS)
|
||||
request = requests.get(url=url, headers=_HEADERS)
|
||||
reason = request.reason
|
||||
trs = []
|
||||
if reason == "OK":
|
||||
@@ -247,5 +303,198 @@ class SatellitesParser(HTMLParser):
|
||||
trs.append(tr)
|
||||
|
||||
|
||||
class ServicesParser(HTMLParser):
|
||||
""" Services parser for LYNGSAT source. """
|
||||
|
||||
def __init__(self, source=SatelliteSource.LYNGSAT, entities=False, separator=' '):
|
||||
|
||||
HTMLParser.__init__(self)
|
||||
|
||||
self._S_TYPES = {"": "2", "MPEG-2 SD": "1", "SD": "1", "MPEG-4 SD": "22", "HEVC SD": "22", "MPEG-4 HD": "25",
|
||||
"MPEG-4 HD 1080": "25", "MPEG-4 HD 720": "25", "HEVC HD": "25", "HEVC UHD": "31",
|
||||
"HEVC UHD 4K": "31"}
|
||||
self._TR_PAT = re.compile(r"(DVB-S[2]?)/?(.*PSK)?\s+SR\s+(\d+)\s+FEC\s+(\d/\d).*ONID/TID:\s+(\d+)/(\d+)\s+.*")
|
||||
self._PTR_PAT = re.compile(r".*?(\d+\.\d°[EW]):\s+(\d+)\s+([RLHV]).*")
|
||||
self._TR = "s {}000:{}000:{}:{}:{}:{}:{}:{}"
|
||||
self._S2_TR = "{}:{}:{}:{}"
|
||||
|
||||
self._parse_html_entities = entities
|
||||
self._separator = separator
|
||||
self._is_td = False
|
||||
self._is_th = False
|
||||
self._current_row = []
|
||||
self._current_cell_text = []
|
||||
self._current_cell = Cell()
|
||||
self._rows = []
|
||||
self._source = source
|
||||
|
||||
def handle_starttag(self, tag, attrs):
|
||||
if tag == "td":
|
||||
self._is_td = True
|
||||
elif tag == "tr":
|
||||
self._is_th = True
|
||||
elif tag == "a" and not self._current_cell.url:
|
||||
self._current_cell.url = attrs[0][1]
|
||||
elif tag == "img":
|
||||
img_link = attrs[0][1]
|
||||
if img_link.startswith("/logo/"):
|
||||
self._current_cell.img = img_link
|
||||
|
||||
def handle_data(self, data):
|
||||
""" Save content to a cell """
|
||||
if self._is_td or self._is_th:
|
||||
self._current_cell_text.append(data.strip())
|
||||
|
||||
def handle_endtag(self, tag):
|
||||
if tag == "td":
|
||||
self._is_td = False
|
||||
elif tag == "tr":
|
||||
self._is_th = False
|
||||
|
||||
if tag in ("td", "th"):
|
||||
final_cell = self._separator.join(self._current_cell_text).strip()
|
||||
self._current_cell.text = final_cell
|
||||
self._current_row.append(self._current_cell)
|
||||
self._current_cell_text = []
|
||||
self._current_cell = Cell()
|
||||
elif tag == "tr":
|
||||
row = self._current_row
|
||||
self._rows.append(row)
|
||||
self._current_row = []
|
||||
|
||||
def error(self, message):
|
||||
log("ServicesParser error: {}".format(message))
|
||||
|
||||
def init_data(self, url):
|
||||
""" Initializes data for the given URL. """
|
||||
if self._source is not SatelliteSource.LYNGSAT:
|
||||
raise ValueError("Unsupported source: {}!".format(self._source.name))
|
||||
|
||||
self._rows.clear()
|
||||
request = requests.get(url=url, headers=_HEADERS)
|
||||
reason = request.reason
|
||||
|
||||
if reason == "OK":
|
||||
self.feed(request.text)
|
||||
else:
|
||||
raise ValueError(reason)
|
||||
|
||||
def get_transponders_links(self, sat_url):
|
||||
""" Returns transponder links. """
|
||||
try:
|
||||
self.init_data(sat_url)
|
||||
except ValueError as e:
|
||||
log(e)
|
||||
else:
|
||||
url = "https://www.lyngsat.com/muxes/"
|
||||
return [row[1] for row in
|
||||
filter(lambda x: x and len(x) > 8 and x[1].url and x[1].url.startswith(url), self._rows)]
|
||||
return []
|
||||
|
||||
def get_transponder_services(self, tr_url, sat_position=None, use_pids=False):
|
||||
""" Returns services for given transponder.
|
||||
|
||||
@param tr_url: transponder URL.
|
||||
@param sat_position: custom satellite position. Sometimes required to adjust the namespace.
|
||||
@param use_pids: if possible use additional pids [video, audio].
|
||||
"""
|
||||
services = []
|
||||
try:
|
||||
self.init_data(tr_url)
|
||||
except ValueError as e:
|
||||
log(e)
|
||||
else:
|
||||
pos, freq, sr, fec, pol, namespace, tid, nid = sat_position or 0, 0, 0, 0, 0, 0, 0, 0
|
||||
sys = "DVB-S"
|
||||
tr_found = False
|
||||
pos_found = False
|
||||
tr = None
|
||||
# Transponder
|
||||
for r in filter(lambda x: x and len(x) == 2, self._rows):
|
||||
if not pos_found:
|
||||
pos_tr = re.match(self._PTR_PAT, r[1].text)
|
||||
if pos_tr:
|
||||
if not sat_position:
|
||||
pos = int(SatellitesParser.get_position(
|
||||
"".join(c for c in pos_tr.group(1) if c.isdigit() or c.isalpha())))
|
||||
freq = int(pos_tr.group(2))
|
||||
pol = get_key_by_value(POLARIZATION, pos_tr.group(3))
|
||||
pos_found = True
|
||||
|
||||
if pos_found and not tr_found:
|
||||
td = re.match(self._TR_PAT, r[1].text) or re.match(self._TR_PAT, r[0].text)
|
||||
if td:
|
||||
sys, mod, sr, _fec, nid, tid = td.group(1), td.group(2), td.group(3), td.group(4), td.group(
|
||||
5), td.group(6)
|
||||
neg_pos = False # POS = W
|
||||
# For negative (West) positions: 3600 - numeric position value!!!
|
||||
namespace = "{:04x}0000".format(3600 - pos if neg_pos else pos)
|
||||
inv = 2 # Default
|
||||
fec = get_key_by_value(FEC, _fec)
|
||||
sys = get_key_by_value(SYSTEM, sys)
|
||||
tr_flag = 1
|
||||
mod = get_key_by_value(MODULATION, mod)
|
||||
roll_off = 0 # 35% DVB-S2/DVB-S (default)
|
||||
pilot = 2 # Auto
|
||||
s2_flags = "" if sys == "DVB-S" else self._S2_TR.format(tr_flag, mod or 0, roll_off, pilot)
|
||||
nid, tid = int(nid), int(tid)
|
||||
tr = self._TR.format(freq, sr, pol, fec, pos, inv, sys, s2_flags)
|
||||
tr_found = True
|
||||
|
||||
if not tr:
|
||||
msg = "ServicesParser error [get transponder services]: {}"
|
||||
er = "Transponder [{}] not found or its type [T2-MI, etc] not supported yet.".format(freq)
|
||||
log(msg.format(er))
|
||||
return []
|
||||
|
||||
# Services
|
||||
for r in filter(lambda x: x and len(x) == 12 and (x[0].text.isdigit()), self._rows):
|
||||
sid, name, cas, pkg, s_type, v_pid, a_pid = r[0].text, r[2].text, r[4].text, r[5].text, r[
|
||||
6].text.strip(), r[7].text, r[8].text.split()
|
||||
|
||||
try:
|
||||
s_type = self._S_TYPES.get(s_type, "3") # 3 = Data
|
||||
_s_type = SERVICE_TYPE.get(s_type, SERVICE_TYPE.get("3")) # str repr
|
||||
sid = int(sid)
|
||||
data_id = "{:04x}:{}:{:04x}:{:04x}:{}:0:0".format(sid, namespace, tid, nid, s_type)
|
||||
fav_id = "{}:{}:{}:{}".format(sid, tid, nid, namespace)
|
||||
picon_id = "1_0_{:X}_{}_{}_{}_{}_0_0_0.png".format(int(s_type), sid, tid, nid, namespace)
|
||||
# Flags.
|
||||
flags = "p:{}".format(pkg)
|
||||
cas = ",".join(get_key_by_value(CAS, c) or "C:0000" for c in cas.split()) if cas else None
|
||||
if use_pids:
|
||||
v_pid = "c:00{:04x}".format(int(v_pid)) if v_pid else None
|
||||
a_pid = ",".join(["c:01{:04x}".format(int(p)) for p in a_pid]) if a_pid else None
|
||||
flags = ",".join(filter(None, (flags, v_pid, a_pid, cas)))
|
||||
else:
|
||||
flags = ",".join(filter(None, (flags, cas)))
|
||||
|
||||
srv = Service(flags_cas=flags,
|
||||
transponder_type="s",
|
||||
coded=None,
|
||||
service=name,
|
||||
locked=None,
|
||||
hide=None,
|
||||
package=pkg,
|
||||
service_type=_s_type,
|
||||
picon=r[1].img,
|
||||
picon_id=picon_id,
|
||||
ssid=sid,
|
||||
freq=freq,
|
||||
rate=sr,
|
||||
pol=pol,
|
||||
fec=fec,
|
||||
system=sys,
|
||||
pos=pos,
|
||||
data_id=data_id,
|
||||
fav_id=fav_id,
|
||||
transponder=tr)
|
||||
services.append(srv)
|
||||
except ValueError as e:
|
||||
log("ServicesParser error [get transponder services]: {}".format(e))
|
||||
|
||||
return services
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
pass
|
||||
|
||||
@@ -164,7 +164,7 @@ class PlayListParser(HTMLParser):
|
||||
|
||||
ct = resp.get("contents", None)
|
||||
if ct:
|
||||
for d in [(d.get("title", {}).get("simpleText", ""),
|
||||
for d in [(d.get("title", {}).get("runs", [{}])[0].get("text", ""),
|
||||
d.get("videoId", "")) for d in flat("playlistVideoRenderer", ct)]:
|
||||
self._playlist.append(d)
|
||||
self._is_script = False
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Import from Web</attribute>
|
||||
<attribute name="action">app.on_import_from_web</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">New empty configuration</attribute>
|
||||
<attribute name="action">app.on_new_configuration</attribute>
|
||||
@@ -47,6 +51,10 @@
|
||||
<attribute name="label" translatable="yes">Open</attribute>
|
||||
<attribute name="action">app.on_data_open</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Extract...</attribute>
|
||||
<attribute name="action">app.on_archive_open</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Save</attribute>
|
||||
<attribute name="action">app.on_data_save</attribute>
|
||||
|
||||
1849
app/ui/control.glade
Normal file
1849
app/ui/control.glade
Normal file
File diff suppressed because it is too large
Load Diff
680
app/ui/control.py
Normal file
680
app/ui/control.py
Normal file
@@ -0,0 +1,680 @@
|
||||
""" Receiver control module via HTTP API. """
|
||||
import os
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from urllib.parse import quote
|
||||
|
||||
from gi.repository import GLib
|
||||
|
||||
from .dialogs import get_dialogs_string, show_dialog, DialogType
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, Column
|
||||
from ..commons import run_task, run_with_delay, log, run_idle
|
||||
from ..connections import HttpAPI
|
||||
|
||||
|
||||
class ControlBox(Gtk.HBox):
|
||||
_TIME_STR = "%Y-%m-%d %H:%M"
|
||||
|
||||
class Tool(Enum):
|
||||
""" The currently displayed tool. """
|
||||
REMOTE = "control"
|
||||
EPG = "epg"
|
||||
TIMERS = "timers"
|
||||
TIMER = "timer"
|
||||
|
||||
class EpgRow(Gtk.ListBoxRow):
|
||||
def __init__(self, event: dict, **properties):
|
||||
super().__init__(**properties)
|
||||
|
||||
self._event_data = event
|
||||
h_box = Gtk.HBox()
|
||||
h_box.set_orientation(Gtk.Orientation.VERTICAL)
|
||||
|
||||
self._title = event.get("e2eventtitle", "")
|
||||
title_label = Gtk.Label(self._title)
|
||||
|
||||
self._desc = event.get("e2eventdescription", "")
|
||||
description = Gtk.Label()
|
||||
description.set_markup("<i>{}</i>".format(self._desc))
|
||||
description.set_line_wrap(True)
|
||||
description.set_max_width_chars(25)
|
||||
|
||||
start = int(event.get("e2eventstart", "0"))
|
||||
start_time = datetime.fromtimestamp(start)
|
||||
end_time = datetime.fromtimestamp(start + int(event.get("e2eventduration", "0")))
|
||||
time_label = Gtk.Label()
|
||||
time_label.set_margin_top(5)
|
||||
self._time_header = "{} - {}".format(start_time.strftime("%A, %H:%M"), end_time.strftime("%H:%M"))
|
||||
time_label.set_markup("<b>{}</b>".format(self._time_header))
|
||||
|
||||
h_box.add(time_label)
|
||||
h_box.add(title_label)
|
||||
h_box.add(description)
|
||||
sep = Gtk.Separator()
|
||||
sep.set_margin_top(5)
|
||||
h_box.add(sep)
|
||||
h_box.set_spacing(5)
|
||||
|
||||
self.add(h_box)
|
||||
self.show_all()
|
||||
|
||||
@property
|
||||
def event_data(self):
|
||||
return self._event_data
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
return self._title
|
||||
|
||||
@property
|
||||
def desc(self):
|
||||
return self._desc
|
||||
|
||||
@property
|
||||
def time_header(self):
|
||||
return self._time_header
|
||||
|
||||
class TimerRow(Gtk.ListBoxRow):
|
||||
|
||||
_UI_PATH = UI_RESOURCES_PATH + "timer_row.glade"
|
||||
|
||||
def __init__(self, timer, **properties):
|
||||
super().__init__(**properties)
|
||||
|
||||
self._timer = timer
|
||||
|
||||
builder = Gtk.Builder()
|
||||
builder.add_from_string(get_dialogs_string(self._UI_PATH))
|
||||
row_box = builder.get_object("timer_row_box")
|
||||
name_label = builder.get_object("timer_name_label")
|
||||
description_label = builder.get_object("timer_description_label")
|
||||
service_name_label = builder.get_object("timer_service_name_label")
|
||||
time_label = builder.get_object("timer_time_label")
|
||||
|
||||
name_label.set_text(timer.get("e2name", "") or "")
|
||||
description_label.set_text(timer.get("e2description", "") or "")
|
||||
service_name_label.set_text(timer.get("e2servicename", "") or "")
|
||||
# Time
|
||||
start_time = datetime.fromtimestamp(int(timer.get("e2timebegin", "0")))
|
||||
end_time = datetime.fromtimestamp(int(timer.get("e2timeend", "0")))
|
||||
time_label.set_text("{} - {}".format(start_time.strftime("%A, %H:%M"), end_time.strftime("%H:%M")))
|
||||
|
||||
self.add(row_box)
|
||||
self.show()
|
||||
|
||||
@property
|
||||
def timer(self):
|
||||
return self._timer
|
||||
|
||||
class TimerAction(Enum):
|
||||
ADD = 0
|
||||
EVENT = 1
|
||||
CHANGE = 2
|
||||
|
||||
def __init__(self, app, http_api, settings, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self._http_api = http_api
|
||||
self._settings = settings
|
||||
self._update_epg = False
|
||||
self._app = app
|
||||
self._last_tool = self.Tool.REMOTE
|
||||
self._timer_action = self.TimerAction.ADD
|
||||
self._current_timer = {}
|
||||
|
||||
handlers = {"on_visible_tool": self.on_visible_tool,
|
||||
"on_volume_changed": self.on_volume_changed,
|
||||
"on_epg_press": self.on_epg_press,
|
||||
"on_epg_filter_changed": self.on_epg_filter_changed,
|
||||
"on_timers_press": self.on_timers_press,
|
||||
"on_timers_drag_data_received": self.on_timers_drag_data_received}
|
||||
|
||||
builder = Gtk.Builder()
|
||||
builder.add_from_file(UI_RESOURCES_PATH + "control.glade")
|
||||
builder.connect_signals(handlers)
|
||||
|
||||
self.add(builder.get_object("main_box_frame"))
|
||||
self._stack = builder.get_object("stack")
|
||||
self._screenshot_image = builder.get_object("screenshot_image")
|
||||
self._screenshot_button_box = builder.get_object("screenshot_button_box")
|
||||
self._screenshot_check_button = builder.get_object("screenshot_check_button")
|
||||
self._screenshot_check_button.bind_property("active", self._screenshot_image, "visible")
|
||||
self._snr_value_label = builder.get_object("snr_value_label")
|
||||
self._ber_value_label = builder.get_object("ber_value_label")
|
||||
self._agc_value_label = builder.get_object("agc_value_label")
|
||||
self._volume_button = builder.get_object("volume_button")
|
||||
self._epg_list_box = builder.get_object("epg_list_box")
|
||||
self._epg_list_box.set_filter_func(self.epg_filter_function)
|
||||
self._epg_filter_entry = builder.get_object("epg_filter_entry")
|
||||
self._timers_list_box = builder.get_object("timers_list_box")
|
||||
self._app._control_revealer.bind_property("visible", self, "visible")
|
||||
# Timers
|
||||
self._timer_remove_button = builder.get_object("timer_remove_button")
|
||||
self._timer_remove_button.bind_property("visible", builder.get_object("timer_edit_button"), "visible")
|
||||
# Timer
|
||||
self._timer_name_entry = builder.get_object("timer_name_entry")
|
||||
self._timer_desc_entry = builder.get_object("timer_desc_entry")
|
||||
self._timer_service_entry = builder.get_object("timer_service_entry")
|
||||
self._timer_service_ref_entry = builder.get_object("timer_service_ref_entry")
|
||||
self._timer_event_id_entry = builder.get_object("timer_event_id_entry")
|
||||
self._timer_begins_entry = builder.get_object("timer_begins_entry")
|
||||
self._timer_ends_entry = builder.get_object("timer_ends_entry")
|
||||
self._timer_begins_calendar = builder.get_object("timer_begins_calendar")
|
||||
self._timer_begins_hr_button = builder.get_object("timer_begins_hr_button")
|
||||
self._timer_begins_min_button = builder.get_object("timer_begins_min_button")
|
||||
self._timer_ends_calendar = builder.get_object("timer_ends_calendar")
|
||||
self._timer_ends_hr_button = builder.get_object("timer_ends_hr_button")
|
||||
self._timer_ends_min_button = builder.get_object("timer_ends_min_button")
|
||||
self._timer_enabled_switch = builder.get_object("timer_enabled_switch")
|
||||
self._timer_action_combo_box = builder.get_object("timer_action_combo_box")
|
||||
self._timer_after_combo_box = builder.get_object("timer_after_combo_box")
|
||||
self._timer_mo_check_button = builder.get_object("timer_mo_check_button")
|
||||
self._timer_tu_check_button = builder.get_object("timer_tu_check_button")
|
||||
self._timer_we_check_button = builder.get_object("timer_we_check_button")
|
||||
self._timer_th_check_button = builder.get_object("timer_th_check_button")
|
||||
self._timer_fr_check_button = builder.get_object("timer_fr_check_button")
|
||||
self._timer_sa_check_button = builder.get_object("timer_sa_check_button")
|
||||
self._timer_su_check_button = builder.get_object("timer_su_check_button")
|
||||
self._timer_location_switch = builder.get_object("timer_location_switch")
|
||||
self._timer_location_entry = builder.get_object("timer_location_entry")
|
||||
self._timer_location_switch.bind_property("active", self._timer_location_entry, "sensitive")
|
||||
# Disable DnD for timer entries.
|
||||
self._timer_name_entry.drag_dest_unset()
|
||||
self._timer_desc_entry.drag_dest_unset()
|
||||
self._timer_service_entry.drag_dest_unset()
|
||||
# DnD initialization for the timer list.
|
||||
self._timers_list_box.drag_dest_set(Gtk.DestDefaults.ALL, [], Gdk.DragAction.DEFAULT | Gdk.DragAction.COPY)
|
||||
self._timers_list_box.drag_dest_add_text_targets()
|
||||
|
||||
builder.get_object("stack_switcher").set_visible(settings.is_enable_experimental)
|
||||
builder.get_object("epg_box").set_visible(settings.is_enable_experimental)
|
||||
builder.get_object("timers_box").set_visible(settings.is_enable_experimental)
|
||||
|
||||
self.init_actions(app)
|
||||
self.connect("hide", self.on_hide)
|
||||
self.show()
|
||||
|
||||
def init_actions(self, app):
|
||||
# Remote controller actions
|
||||
app.set_action("on_up", lambda a, v: self.on_remote_action(HttpAPI.Remote.UP))
|
||||
app.set_action("on_down", lambda a, v: self.on_remote_action(HttpAPI.Remote.DOWN))
|
||||
app.set_action("on_left", lambda a, v: self.on_remote_action(HttpAPI.Remote.LEFT))
|
||||
app.set_action("on_right", lambda a, v: self.on_remote_action(HttpAPI.Remote.RIGHT))
|
||||
app.set_action("on_ok", lambda a, v: self.on_remote_action(HttpAPI.Remote.OK))
|
||||
app.set_action("on_menu", lambda a, v: self.on_remote_action(HttpAPI.Remote.MENU))
|
||||
app.set_action("on_exit", lambda a, v: self.on_remote_action(HttpAPI.Remote.EXIT))
|
||||
app.set_action("on_red", lambda a, v: self.on_remote_action(HttpAPI.Remote.RED))
|
||||
app.set_action("on_green", lambda a, v: self.on_remote_action(HttpAPI.Remote.GREEN))
|
||||
app.set_action("on_yellow", lambda a, v: self.on_remote_action(HttpAPI.Remote.YELLOW))
|
||||
app.set_action("on_blue", lambda a, v: self.on_remote_action(HttpAPI.Remote.BLUE))
|
||||
# Power
|
||||
app.set_action("on_standby", lambda a, v: self.on_power_action(HttpAPI.Power.STANDBY))
|
||||
app.set_action("on_wake_up", lambda a, v: self.on_power_action(HttpAPI.Power.WAKEUP))
|
||||
app.set_action("on_reboot", lambda a, v: self.on_power_action(HttpAPI.Power.REBOOT))
|
||||
app.set_action("on_restart_gui", lambda a, v: self.on_power_action(HttpAPI.Power.RESTART_GUI))
|
||||
app.set_action("on_shutdown", lambda a, v: self.on_power_action(HttpAPI.Power.DEEP_STANDBY))
|
||||
# Screenshots
|
||||
app.set_action("on_screenshot_all", self.on_screenshot_all)
|
||||
app.set_action("on_screenshot_video", self.on_screenshot_video)
|
||||
app.set_action("on_screenshot_osd", self.on_screenshot_osd)
|
||||
# Timers
|
||||
app.set_action("on_timer_add", self.on_timer_add)
|
||||
app.set_action("on_timer_add_from_event", self.on_timer_add_from_event)
|
||||
app.set_action("on_timer_remove", self.on_timer_remove)
|
||||
app.set_action("on_timer_edit", self.on_timer_edit)
|
||||
app.set_action("on_timer_save", self.on_timer_save)
|
||||
app.set_action("on_timer_cancel", self.on_timer_cancel)
|
||||
app.set_action("on_timer_begins_set", self.on_timer_begins_set)
|
||||
app.set_action("on_timer_ends_set", self.on_timer_ends_set)
|
||||
|
||||
@property
|
||||
def update_epg(self):
|
||||
return self._update_epg
|
||||
|
||||
def on_visible_tool(self, stack, param):
|
||||
tool = self.Tool(stack.get_visible_child_name())
|
||||
self._update_epg = tool is self.Tool.EPG
|
||||
|
||||
if tool is self.Tool.TIMERS:
|
||||
self.update_timer_list()
|
||||
|
||||
if tool is not self.Tool.TIMER:
|
||||
self._last_tool = tool
|
||||
|
||||
def on_hide(self, item):
|
||||
self._update_epg = False
|
||||
|
||||
# ***************** Remote controller ********************* #
|
||||
|
||||
def on_remote(self, action, state=False):
|
||||
""" Shows/Hides [R key] remote controller. """
|
||||
action.set_state(state)
|
||||
self._remote_revealer.set_visible(state)
|
||||
self._remote_revealer.set_reveal_child(state)
|
||||
|
||||
if state:
|
||||
self._http_api.send(HttpAPI.Request.VOL, "state", self.update_volume)
|
||||
|
||||
def on_remote_action(self, action):
|
||||
self._http_api.send(HttpAPI.Request.REMOTE, action, self.on_response)
|
||||
|
||||
@run_with_delay(0.5)
|
||||
def on_volume_changed(self, button, value):
|
||||
self._http_api.send(HttpAPI.Request.VOL, "{:.0f}".format(value), self.on_response)
|
||||
|
||||
def update_volume(self, vol):
|
||||
if "error_code" in vol:
|
||||
return
|
||||
|
||||
GLib.idle_add(self._volume_button.set_value, int(vol.get("e2current", "0")))
|
||||
|
||||
def on_response(self, resp):
|
||||
if "error_code" in resp:
|
||||
return
|
||||
|
||||
if self._screenshot_check_button.get_active():
|
||||
ref = "mode=all" if self._http_api.is_owif else "d="
|
||||
self._http_api.send(HttpAPI.Request.GRUB, ref, self.update_screenshot)
|
||||
|
||||
@run_task
|
||||
def update_screenshot(self, data):
|
||||
if "error_code" in data:
|
||||
return
|
||||
|
||||
data = data.get("img_data", None)
|
||||
if data:
|
||||
from gi.repository import GdkPixbuf
|
||||
|
||||
loader = GdkPixbuf.PixbufLoader.new_with_type("jpeg")
|
||||
loader.set_size(280, 165)
|
||||
try:
|
||||
loader.write(data)
|
||||
pix = loader.get_pixbuf()
|
||||
except GLib.Error:
|
||||
pass # NOP
|
||||
else:
|
||||
GLib.idle_add(self._screenshot_image.set_from_pixbuf, pix)
|
||||
finally:
|
||||
loader.close()
|
||||
|
||||
def on_screenshot_all(self, action, value=None):
|
||||
self._http_api.send(HttpAPI.Request.GRUB, "mode=all" if self._http_api.is_owif else "d=",
|
||||
self.on_screenshot)
|
||||
|
||||
def on_screenshot_video(self, action, value=None):
|
||||
self._http_api.send(HttpAPI.Request.GRUB, "mode=video" if self._http_api.is_owif else "v=",
|
||||
self.on_screenshot)
|
||||
|
||||
def on_screenshot_osd(self, action, value=None):
|
||||
self._http_api.send(HttpAPI.Request.GRUB, "mode=osd" if self._http_api.is_owif else "o=",
|
||||
self.on_screenshot)
|
||||
|
||||
@run_task
|
||||
def on_screenshot(self, data):
|
||||
if "error_code" in data:
|
||||
return
|
||||
|
||||
img = data.get("img_data", None)
|
||||
if img:
|
||||
is_darwin = self._settings.is_darwin
|
||||
GLib.idle_add(self._screenshot_button_box.set_sensitive, is_darwin)
|
||||
path = os.path.expanduser("~/Desktop") if is_darwin else None
|
||||
|
||||
try:
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
with tempfile.NamedTemporaryFile(mode="wb", suffix=".jpg", dir=path, delete=not is_darwin) as tf:
|
||||
tf.write(img)
|
||||
cmd = ["open" if is_darwin else "xdg-open", tf.name]
|
||||
subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||
finally:
|
||||
GLib.idle_add(self._screenshot_button_box.set_sensitive, True)
|
||||
|
||||
def on_power_action(self, action):
|
||||
self._http_api.send(HttpAPI.Request.POWER, action, lambda resp: log("Power status changed..."))
|
||||
|
||||
def update_signal(self, sig):
|
||||
self._snr_value_label.set_text(sig.get("e2snrdb", "0 dB").strip())
|
||||
self._ber_value_label.set_text(str(sig.get("e2ber", None) or "0").strip())
|
||||
self._agc_value_label.set_text(sig.get("e2acg", "0 %").strip())
|
||||
|
||||
# ************************ EPG **************************** #
|
||||
|
||||
def on_service_changed(self, ref):
|
||||
self._app._wait_dialog.show()
|
||||
self._http_api.send(HttpAPI.Request.EPG, ref, self.update_epg_data)
|
||||
|
||||
@run_idle
|
||||
def update_epg_data(self, epg):
|
||||
list(map(self._epg_list_box.remove, (r for r in self._epg_list_box)))
|
||||
list(map(lambda e: self._epg_list_box.add(self.EpgRow(e)), epg.get("event_list", [])))
|
||||
self._app._wait_dialog.hide()
|
||||
|
||||
def on_epg_press(self, list_box, event):
|
||||
if event.get_event_type() == Gdk.EventType.DOUBLE_BUTTON_PRESS and len(list_box) > 0:
|
||||
row = list_box.get_selected_row()
|
||||
if row:
|
||||
self.set_timer_from_event_data(row.event_data)
|
||||
|
||||
def on_epg_filter_changed(self, entry):
|
||||
self._epg_list_box.invalidate_filter()
|
||||
|
||||
def epg_filter_function(self, row: EpgRow):
|
||||
txt = self._epg_filter_entry.get_text().upper()
|
||||
return any((not txt, txt in row.time_header.upper(), txt in row.title.upper(), txt in row.desc.upper()))
|
||||
|
||||
def on_timer_add_from_event(self, action, value=None):
|
||||
rows = self._epg_list_box.get_selected_rows()
|
||||
if not rows:
|
||||
self._app.show_error_dialog("No selected item!")
|
||||
return
|
||||
|
||||
refs = []
|
||||
for row in rows:
|
||||
event = row.event_data
|
||||
ref = "timeraddbyeventid?sRef={}&eventid={}&justplay=0".format(event.get("e2eventservicereference", ""),
|
||||
event.get("e2eventid", ""))
|
||||
refs.append(ref)
|
||||
|
||||
gen = self.write_timers_list(refs)
|
||||
GLib.idle_add(lambda: next(gen, False))
|
||||
|
||||
def write_timers_list(self, refs):
|
||||
self._app._wait_dialog.show()
|
||||
tasks = list(refs)
|
||||
for ref in refs:
|
||||
self._http_api.send(HttpAPI.Request.TIMER, ref, lambda x: tasks.pop())
|
||||
yield True
|
||||
|
||||
while tasks:
|
||||
yield True
|
||||
|
||||
self._stack.set_visible_child_name(self.Tool.TIMERS.value)
|
||||
|
||||
# *********************** Timers *************************** #
|
||||
|
||||
def on_timers_press(self, list_box, event):
|
||||
if event.get_event_type() == Gdk.EventType.DOUBLE_BUTTON_PRESS and len(list_box) > 0:
|
||||
self.on_timer_edit()
|
||||
|
||||
def update_timer_list(self):
|
||||
self._app._wait_dialog.show()
|
||||
self._http_api.send(HttpAPI.Request.TIMER_LIST, "", self.update_timers_data)
|
||||
|
||||
@run_idle
|
||||
def update_timers_data(self, timers):
|
||||
list(map(self._timers_list_box.remove, (r for r in self._timers_list_box)))
|
||||
list(map(lambda t: self._timers_list_box.add(self.TimerRow(t)), timers.get("timer_list", [])))
|
||||
self._timer_remove_button.set_visible(len(self._timers_list_box))
|
||||
self._app._wait_dialog.hide()
|
||||
|
||||
def on_timer_add(self, action=None, value=None):
|
||||
self._timer_action = self.TimerAction.ADD
|
||||
date = datetime.now()
|
||||
self.set_begins_date(date)
|
||||
self.set_ends_date(date)
|
||||
self._timer_event_id_entry.set_text("")
|
||||
self._timer_location_switch.set_active(False)
|
||||
self.set_repetition_flags(0)
|
||||
self._stack.set_visible_child_name(self.Tool.TIMER.value)
|
||||
|
||||
def on_timer_remove(self, action, value=None):
|
||||
rows = self._timers_list_box.get_selected_rows()
|
||||
if not rows or show_dialog(DialogType.QUESTION, self._app._main_window) != Gtk.ResponseType.OK:
|
||||
return
|
||||
|
||||
refs = {}
|
||||
for row in rows:
|
||||
timer = row.timer
|
||||
ref = "timerdelete?sRef={}&begin={}&end={}".format(timer.get("e2servicereference", ""),
|
||||
timer.get("e2timebegin", ""),
|
||||
timer.get("e2timeend", ""))
|
||||
refs[ref] = row
|
||||
|
||||
self._app._wait_dialog.show("Deleting data...")
|
||||
gen = self.remove_timers(refs)
|
||||
GLib.idle_add(lambda: next(gen, False))
|
||||
|
||||
def remove_timers(self, refs):
|
||||
tasks = list(refs)
|
||||
removed = set()
|
||||
for ref in refs:
|
||||
yield from self.remove_timer(ref, removed, tasks)
|
||||
|
||||
while tasks:
|
||||
yield True
|
||||
|
||||
list(map(self._timers_list_box.remove, (refs[ref] for ref in refs if ref in removed)))
|
||||
self._app._wait_dialog.hide()
|
||||
self._timer_remove_button.set_visible(len(self._timers_list_box))
|
||||
yield True
|
||||
|
||||
def remove_timer(self, ref, removed, tasks=None):
|
||||
def callback(resp):
|
||||
if resp.get("e2state", "") == "True":
|
||||
log(resp.get("e2statetext", ""))
|
||||
removed.add(ref)
|
||||
else:
|
||||
log(resp.get("e2statetext", None) or "Timer deletion error.")
|
||||
if tasks:
|
||||
tasks.pop()
|
||||
|
||||
self._http_api.send(HttpAPI.Request.TIMER, ref, callback)
|
||||
yield True
|
||||
|
||||
def on_timer_edit(self, action=None, value=None):
|
||||
row = self._timers_list_box.get_selected_row()
|
||||
if row:
|
||||
self._timer_action = self.TimerAction.CHANGE
|
||||
|
||||
timer = row.timer
|
||||
self._current_timer = timer
|
||||
self._timer_name_entry.set_text(timer.get("e2name", ""))
|
||||
self._timer_desc_entry.set_text(timer.get("e2description", "") or "")
|
||||
self._timer_service_entry.set_text(timer.get("e2servicename", "") or "")
|
||||
self._timer_service_ref_entry.set_text(timer.get("e2servicereference", ""))
|
||||
self._timer_event_id_entry.set_text(timer.get("e2eit", ""))
|
||||
self._timer_enabled_switch.set_active((timer.get("e2disabled", "0") == "0"))
|
||||
self._timer_action_combo_box.set_active_id(timer.get("e2justplay", "0"))
|
||||
self._timer_after_combo_box.set_active_id(timer.get("e2afterevent", "0"))
|
||||
self.set_time_data(int(timer.get("e2timebegin", "0")), int(timer.get("e2timeend", "0")))
|
||||
location = timer.get("e2location", "")
|
||||
self._timer_location_entry.set_text("" if location == "None" else location)
|
||||
# Days
|
||||
self.set_repetition_flags(int(timer.get("e2repeated", "0")))
|
||||
self._stack.set_visible_child_name(self.Tool.TIMER.value)
|
||||
|
||||
def on_timer_save(self, action, value=None):
|
||||
args = []
|
||||
t_data = self.get_timer_data()
|
||||
s_ref = t_data.get("sRef", "")
|
||||
|
||||
if self._timer_action is self.TimerAction.EVENT:
|
||||
args.append("timeraddbyeventid?sRef={}".format(s_ref))
|
||||
args.append("eventid={}".format(t_data.get("eit", "0")))
|
||||
args.append("justplay={}".format(t_data.get("justplay", "")))
|
||||
args.append("tags={}".format(""))
|
||||
else:
|
||||
if self._timer_action is self.TimerAction.ADD:
|
||||
args.append("timeradd?sRef={}".format(s_ref))
|
||||
args.append("deleteOldOnSave={}".format(0))
|
||||
elif self._timer_action is self.TimerAction.CHANGE:
|
||||
args.append("timerchange?sRef={}".format(s_ref))
|
||||
args.append("channelOld={}".format(s_ref))
|
||||
args.append("beginOld={}".format(self._current_timer.get("e2timebegin", "0")))
|
||||
args.append("endOld={}".format(self._current_timer.get("e2timeend", "0")))
|
||||
args.append("deleteOldOnSave={}".format(1))
|
||||
|
||||
args.append("begin={}".format(t_data.get("begin", "")))
|
||||
args.append("end={}".format(t_data.get("end", "")))
|
||||
args.append("name={}".format(quote(t_data.get("name", ""))))
|
||||
args.append("description={}".format(quote(t_data.get("description", ""))))
|
||||
args.append("tags={}".format(""))
|
||||
args.append("eit={}".format("0"))
|
||||
args.append("disabled={}".format(t_data.get("disabled", "1")))
|
||||
args.append("justplay={}".format(t_data.get("justplay", "1")))
|
||||
args.append("afterevent={}".format(t_data.get("afterevent", "0")))
|
||||
args.append("repeated={}".format(self.get_repetition_flags()))
|
||||
|
||||
if self._timer_location_switch.get_active():
|
||||
args.append("dirname={}".format(self._timer_location_entry.get_text()))
|
||||
|
||||
self._http_api.send(HttpAPI.Request.TIMER, "&".join(args), self.timer_add_edit_callback)
|
||||
|
||||
@run_idle
|
||||
def timer_add_edit_callback(self, resp):
|
||||
if "error_code" in resp:
|
||||
msg = "Error getting timer status.\n{}".format(resp.get("error_code"))
|
||||
self._app.show_error_dialog(msg)
|
||||
log(msg)
|
||||
return
|
||||
|
||||
state = resp.get("e2state", None)
|
||||
if state == "False":
|
||||
msg = resp.get("e2statetext", "")
|
||||
self._app.show_error_dialog(msg)
|
||||
log(msg)
|
||||
if state == "True":
|
||||
log(resp.get("e2statetext", ""))
|
||||
self._stack.set_visible_child_name(self._last_tool.value)
|
||||
else:
|
||||
log("Error getting timer status. No response!")
|
||||
|
||||
def on_timer_cancel(self, action, value=None):
|
||||
self._stack.set_visible_child_name(self._last_tool.value)
|
||||
|
||||
def on_timer_begins_set(self, action, value=None):
|
||||
self.set_begins_date(self.get_begins_date())
|
||||
|
||||
def on_timer_ends_set(self, action, value=None):
|
||||
self.set_ends_date(self.get_ends_date())
|
||||
|
||||
def get_begins_date(self):
|
||||
date = self._timer_begins_calendar.get_date()
|
||||
return datetime(year=date.year, month=date.month + 1, day=date.day,
|
||||
hour=int(self._timer_begins_hr_button.get_value()),
|
||||
minute=int(self._timer_begins_min_button.get_value()))
|
||||
|
||||
def set_begins_date(self, date):
|
||||
hour = date.hour
|
||||
minute = date.minute
|
||||
self._timer_begins_hr_button.set_value(hour)
|
||||
self._timer_begins_min_button.set_value(minute)
|
||||
self._timer_begins_calendar.select_day(date.day)
|
||||
self._timer_begins_calendar.select_month(date.month - 1, date.year)
|
||||
self._timer_begins_entry.set_text("{}-{}-{} {}:{:02d}".format(date.year, date.month, date.day, hour, minute))
|
||||
|
||||
def get_ends_date(self):
|
||||
date = self._timer_ends_calendar.get_date()
|
||||
return datetime(year=date.year, month=date.month + 1, day=date.day,
|
||||
hour=int(self._timer_ends_hr_button.get_value()),
|
||||
minute=int(self._timer_ends_min_button.get_value()))
|
||||
|
||||
def set_ends_date(self, date):
|
||||
hour = date.hour
|
||||
minute = date.minute
|
||||
self._timer_ends_hr_button.set_value(hour)
|
||||
self._timer_ends_min_button.set_value(minute)
|
||||
self._timer_ends_calendar.select_day(date.day)
|
||||
self._timer_ends_calendar.select_month(date.month - 1, date.year)
|
||||
self._timer_ends_entry.set_text("{}-{}-{} {}:{:02d}".format(date.year, date.month, date.day, hour, minute))
|
||||
|
||||
def set_timer_from_event_data(self, timer):
|
||||
self._stack.set_visible_child_name(self.Tool.TIMER.value)
|
||||
self._timer_action = self.TimerAction.EVENT
|
||||
self._timer_name_entry.set_text(timer.get("e2eventtitle", ""))
|
||||
self._timer_desc_entry.set_text(timer.get("e2eventdescription", ""))
|
||||
self._timer_service_entry.set_text(timer.get("e2eventservicename", ""))
|
||||
self._timer_service_ref_entry.set_text(timer.get("e2eventservicereference", ""))
|
||||
self._timer_event_id_entry.set_text(timer.get("e2eventid", ""))
|
||||
self._timer_action_combo_box.set_active_id("1")
|
||||
self._timer_after_combo_box.set_active_id("3")
|
||||
start_time = int(timer.get("e2eventstart", "0"))
|
||||
self.set_time_data(start_time, start_time + int(timer.get("e2eventduration", "0")))
|
||||
|
||||
def set_time_data(self, start_time, end_time):
|
||||
""" Sets values for time widgets. """
|
||||
ev_time_start = datetime.fromtimestamp(start_time) or datetime.now()
|
||||
ev_time_end = datetime.fromtimestamp(end_time) or datetime.now()
|
||||
self._timer_begins_entry.set_text(ev_time_start.strftime(self._TIME_STR))
|
||||
self._timer_ends_entry.set_text(ev_time_end.strftime(self._TIME_STR))
|
||||
self._timer_begins_calendar.select_day(ev_time_start.day)
|
||||
self._timer_begins_calendar.select_month(ev_time_start.month - 1, ev_time_start.year)
|
||||
self._timer_ends_calendar.select_day(ev_time_end.day)
|
||||
self._timer_ends_calendar.select_month(ev_time_end.month - 1, ev_time_end.year)
|
||||
self._timer_begins_hr_button.set_value(ev_time_start.hour)
|
||||
self._timer_begins_min_button.set_value(ev_time_start.minute)
|
||||
self._timer_ends_hr_button.set_value(ev_time_end.hour)
|
||||
self._timer_ends_min_button.set_value(ev_time_end.minute)
|
||||
|
||||
def get_timer_data(self):
|
||||
""" Returns timer data as a dict. """
|
||||
return {"sRef": self._timer_service_ref_entry.get_text(),
|
||||
"begin": int(datetime.strptime(self._timer_begins_entry.get_text(), self._TIME_STR).timestamp()),
|
||||
"end": int(datetime.strptime(self._timer_ends_entry.get_text(), self._TIME_STR).timestamp()),
|
||||
"name": self._timer_name_entry.get_text(),
|
||||
"description": self._timer_desc_entry.get_text(),
|
||||
"dirname": "",
|
||||
"eit": self._timer_event_id_entry.get_text(),
|
||||
"disabled": int(not self._timer_enabled_switch.get_active()),
|
||||
"justplay": self._timer_action_combo_box.get_active_id(),
|
||||
"afterevent": self._timer_after_combo_box.get_active_id(),
|
||||
"repeated": self.get_repetition_flags()}
|
||||
|
||||
def get_repetition_flags(self):
|
||||
""" Returns flags for repetition. """
|
||||
day_flags = 0
|
||||
for i, box in enumerate((self._timer_mo_check_button,
|
||||
self._timer_tu_check_button,
|
||||
self._timer_we_check_button,
|
||||
self._timer_th_check_button,
|
||||
self._timer_fr_check_button,
|
||||
self._timer_sa_check_button,
|
||||
self._timer_su_check_button)):
|
||||
|
||||
if box.get_active():
|
||||
day_flags = day_flags | (1 << i)
|
||||
|
||||
return day_flags
|
||||
|
||||
def set_repetition_flags(self, flags):
|
||||
for i, box in enumerate((self._timer_mo_check_button,
|
||||
self._timer_tu_check_button,
|
||||
self._timer_we_check_button,
|
||||
self._timer_th_check_button,
|
||||
self._timer_fr_check_button,
|
||||
self._timer_sa_check_button,
|
||||
self._timer_su_check_button)):
|
||||
box.set_active(flags & 1 == 1)
|
||||
flags = flags >> 1
|
||||
|
||||
# ***************** Drag-and-drop ********************* #
|
||||
|
||||
def on_timers_drag_data_received(self, box, context, x, y, data, info, time):
|
||||
txt = data.get_text()
|
||||
if txt:
|
||||
itr_str, sep, source = txt.partition(self._app.DRAG_SEP)
|
||||
if not source:
|
||||
return
|
||||
|
||||
itrs = itr_str.split(",")
|
||||
if len(itrs) > 1:
|
||||
self._app.show_error_dialog("Please, select only one item!")
|
||||
return
|
||||
|
||||
fav_id = None
|
||||
if source == self._app.FAV_MODEL_NAME:
|
||||
model = self._app.fav_view.get_model()
|
||||
fav_id = model.get_value(model.get_iter_from_string(itrs[0]), Column.FAV_ID)
|
||||
elif source == self._app.SERVICE_MODEL_NAME:
|
||||
model = self._app.services_view.get_model()
|
||||
fav_id = model.get_value(model.get_iter_from_string(itrs[0]), Column.SRV_FAV_ID)
|
||||
|
||||
service = self._app.current_services.get(fav_id, None)
|
||||
if service:
|
||||
self._timer_name_entry.set_text(service.service)
|
||||
self._timer_service_entry.set_text(service.service)
|
||||
self._timer_service_ref_entry.set_text(service.picon_id.rstrip(".png").replace("_", ":"))
|
||||
self.on_timer_add()
|
||||
context.finish(True, False, time)
|
||||
@@ -40,10 +40,10 @@ Author: Dmitriy Yefremov
|
||||
<property name="icon_name">system-help</property>
|
||||
<property name="type_hint">normal</property>
|
||||
<property name="program_name">DemonEditor</property>
|
||||
<property name="version">1.0.0 Alpha-2</property>
|
||||
<property name="version">1.0.2 Beta</property>
|
||||
<property name="copyright">2018-2020 Dmitriy Yefremov
|
||||
</property>
|
||||
<property name="comments" translatable="yes">Enigma2 channel and satellites list editor for MacOS.
|
||||
<property name="comments" translatable="yes">Enigma2 channel and satellite list editor for MacOS.
|
||||
(Experimental)</property>
|
||||
<property name="website">https://github.com/DYefremov/DemonEditor/tree/experimental-mac</property>
|
||||
<property name="license" translatable="yes">Это приложение распространяется без каких-либо гарантий.
|
||||
@@ -51,7 +51,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="authors">Dmitriy Yefremov
|
||||
</property>
|
||||
<property name="translator_credits" translatable="yes">translator-credits</property>
|
||||
<property name="artists">Program logo: <a href="http://ihad.tv"> mfgeg</a></property>
|
||||
<property name="artists">Program logo: <a href="http://ihad.tv">mfgeg</a></property>
|
||||
<property name="logo_icon_name">demon-editor</property>
|
||||
<property name="wrap_license">True</property>
|
||||
<property name="license_type">mit-x11</property>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import gettext
|
||||
from enum import Enum
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
|
||||
from app.commons import run_idle
|
||||
from .uicommons import Gtk, UI_RESOURCES_PATH, TEXT_DOMAIN, IS_GNOME_SESSION
|
||||
@@ -72,12 +73,13 @@ class WaitDialog:
|
||||
self._dialog.destroy()
|
||||
|
||||
|
||||
def show_dialog(dialog_type: DialogType, transient, text=None, settings=None, action_type=None, file_filter=None):
|
||||
""" Shows dialogs by name """
|
||||
def show_dialog(dialog_type, transient, text=None, settings=None, action_type=None, file_filter=None, buttons=None,
|
||||
title=None):
|
||||
""" Shows dialogs by name. """
|
||||
if dialog_type in (DialogType.INFO, DialogType.ERROR):
|
||||
return get_message_dialog(transient, dialog_type, Gtk.ButtonsType.OK, text)
|
||||
elif dialog_type is DialogType.CHOOSER and settings:
|
||||
return get_file_chooser_dialog(transient, text, settings, action_type, file_filter)
|
||||
return get_file_chooser_dialog(transient, text, settings, action_type, file_filter, buttons, title)
|
||||
elif dialog_type is DialogType.INPUT:
|
||||
return get_input_dialog(transient, text)
|
||||
elif dialog_type is DialogType.QUESTION:
|
||||
@@ -87,7 +89,7 @@ def show_dialog(dialog_type: DialogType, transient, text=None, settings=None, ac
|
||||
return get_about_dialog(transient)
|
||||
|
||||
|
||||
def get_chooser_dialog(transient, settings, name, patterns):
|
||||
def get_chooser_dialog(transient, settings, name, patterns, title=None):
|
||||
file_filter = Gtk.FileFilter()
|
||||
file_filter.set_name(name)
|
||||
for p in patterns:
|
||||
@@ -97,30 +99,28 @@ def get_chooser_dialog(transient, settings, name, patterns):
|
||||
transient=transient,
|
||||
settings=settings,
|
||||
action_type=Gtk.FileChooserAction.OPEN,
|
||||
file_filter=file_filter)
|
||||
file_filter=file_filter,
|
||||
title=title)
|
||||
|
||||
|
||||
def get_file_chooser_dialog(transient, text, settings, action_type, file_filter):
|
||||
dialog = Gtk.FileChooserNative()
|
||||
dialog.set_title(get_message(text) if text else "")
|
||||
dialog.set_transient_for(transient)
|
||||
dialog.set_action(action_type if action_type is not None else Gtk.FileChooserAction.SELECT_FOLDER)
|
||||
def get_file_chooser_dialog(transient, text, settings, action_type, file_filter, buttons=None, title=None):
|
||||
action_type = Gtk.FileChooserAction.SELECT_FOLDER if action_type is None else action_type
|
||||
dialog = Gtk.FileChooserNative.new(get_message(title) if title else "", transient, action_type)
|
||||
dialog.set_create_folders(False)
|
||||
dialog.set_modal(True)
|
||||
|
||||
if file_filter is not None:
|
||||
dialog.add_filter(file_filter)
|
||||
|
||||
path = settings.data_local_path
|
||||
dialog.set_current_folder(path)
|
||||
dialog.set_current_folder(settings.data_local_path)
|
||||
response = dialog.run()
|
||||
|
||||
if response == Gtk.ResponseType.ACCEPT:
|
||||
if dialog.get_filename():
|
||||
path = dialog.get_filename()
|
||||
if action_type is not Gtk.FileChooserAction.OPEN:
|
||||
path = path + "/"
|
||||
response = path
|
||||
path = Path(dialog.get_filename() or dialog.get_current_folder())
|
||||
if path.is_dir():
|
||||
response = "{}/".format(path.resolve())
|
||||
elif path.is_file():
|
||||
response = str(path.resolve())
|
||||
dialog.destroy()
|
||||
|
||||
return response
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from contextlib import suppress
|
||||
from pathlib import Path
|
||||
|
||||
from app.commons import run_idle
|
||||
from app.commons import run_idle, log
|
||||
from app.eparser import get_bouquets, get_services
|
||||
from app.eparser.ecommons import BqType, BqServiceType, Bouquet
|
||||
from app.eparser.enigma.bouquets import get_bouquet
|
||||
@@ -123,6 +123,7 @@ class ImportDialog:
|
||||
self._services_model.clear()
|
||||
try:
|
||||
if not self._bouquets:
|
||||
log("Import [init data]: getting bouquets...")
|
||||
self._bouquets = get_bouquets(path, self._profile)
|
||||
for bqs in self._bouquets:
|
||||
for bq in bqs.bouquets:
|
||||
@@ -133,6 +134,7 @@ class ImportDialog:
|
||||
for srv in services:
|
||||
self._services[srv.fav_id] = srv
|
||||
except FileNotFoundError as e:
|
||||
log("Import error [init data]: {}".format(e))
|
||||
self.show_info_message(str(e), Gtk.MessageType.ERROR)
|
||||
|
||||
def on_import(self, item):
|
||||
@@ -143,9 +145,17 @@ class ImportDialog:
|
||||
if not self._bouquets or show_dialog(DialogType.QUESTION, self._dialog_window) == Gtk.ResponseType.CANCEL:
|
||||
return
|
||||
|
||||
self.import_data()
|
||||
|
||||
@run_idle
|
||||
def import_data(self):
|
||||
""" Importing data into models. """
|
||||
if not self._bouquets:
|
||||
return
|
||||
|
||||
log("Importing data...")
|
||||
services = set()
|
||||
to_delete = set()
|
||||
|
||||
for row in self._main_model:
|
||||
bq = (row[0], row[1])
|
||||
if row[-1]:
|
||||
@@ -155,19 +165,16 @@ class ImportDialog:
|
||||
services.add(srv)
|
||||
else:
|
||||
to_delete.add(bq)
|
||||
|
||||
bqs_to_delete = []
|
||||
for bqs in self._bouquets:
|
||||
for bq in bqs.bouquets:
|
||||
if (bq.name, bq.type) in to_delete:
|
||||
bqs_to_delete.append(bq)
|
||||
|
||||
for bqs in self._bouquets:
|
||||
bq = bqs.bouquets
|
||||
for b in bqs_to_delete:
|
||||
with suppress(ValueError):
|
||||
bq.remove(b)
|
||||
|
||||
self._append(self._bouquets, list(filter(lambda s: s.fav_id not in self._service_ids, services)))
|
||||
self._dialog_window.destroy()
|
||||
|
||||
|
||||
BIN
app/ui/lang/be/LC_MESSAGES/demon-editor.mo
Normal file
BIN
app/ui/lang/be/LC_MESSAGES/demon-editor.mo
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -4,12 +4,13 @@ from contextlib import suppress
|
||||
from datetime import datetime
|
||||
from functools import lru_cache
|
||||
from itertools import chain
|
||||
from urllib.parse import urlparse, unquote
|
||||
|
||||
from gi.repository import GLib, Gio
|
||||
|
||||
from app.commons import run_idle, log, run_task, run_with_delay, init_logger
|
||||
from app.connections import (HttpAPI, HttpRequestType, download_data, DownloadType, upload_data, test_http,
|
||||
TestException, HttpApiException, STC_XML_FILE)
|
||||
from app.connections import (HttpAPI, download_data, DownloadType, upload_data, test_http, TestException,
|
||||
HttpApiException, STC_XML_FILE)
|
||||
from app.eparser import get_blacklist, write_blacklist, parse_m3u
|
||||
from app.eparser import get_services, get_bouquets, write_bouquets, write_services, Bouquets, Bouquet, Service
|
||||
from app.eparser.ecommons import CAS, Flag, BouquetService
|
||||
@@ -30,7 +31,7 @@ from .main_helper import (insert_marker, move_items, rename, ViewTarget, set_fla
|
||||
remove_picon, is_only_one_item_selected, gen_bouquets, BqGenType, get_iptv_url, append_picons,
|
||||
get_selection, get_model_data, remove_all_unused_picons, get_picon_pixbuf, get_base_itrs)
|
||||
from .picons_manager import PiconsDialog
|
||||
from .satellites_dialog import show_satellites_dialog
|
||||
from .satellites_dialog import show_satellites_dialog, ServicesUpdateDialog
|
||||
from .search import SearchProvider
|
||||
from .service_details_dialog import ServiceDetailsDialog, Action
|
||||
from .settings_dialog import show_settings_dialog
|
||||
@@ -42,6 +43,7 @@ class Application(Gtk.Application):
|
||||
SERVICE_MODEL_NAME = "services_list_store"
|
||||
FAV_MODEL_NAME = "fav_list_store"
|
||||
BQ_MODEL_NAME = "bouquets_tree_store"
|
||||
DRAG_SEP = "::::"
|
||||
|
||||
DEL_FACTOR = 50 # Batch size to delete in one pass.
|
||||
FAV_FACTOR = DEL_FACTOR * 2
|
||||
@@ -90,6 +92,7 @@ class Application(Gtk.Application):
|
||||
"on_tree_view_key_release": self.on_tree_view_key_release,
|
||||
"on_bouquets_selection": self.on_bouquets_selection,
|
||||
"on_satellite_editor_show": self.on_satellite_editor_show,
|
||||
"on_fav_selection": self.on_fav_selection,
|
||||
"on_services_selection": self.on_services_selection,
|
||||
"on_fav_cut": self.on_fav_cut,
|
||||
"on_bouquets_cut": self.on_bouquets_cut,
|
||||
@@ -109,12 +112,14 @@ class Application(Gtk.Application):
|
||||
"on_fav_view_query_tooltip": self.on_fav_view_query_tooltip,
|
||||
"on_services_view_query_tooltip": self.on_services_view_query_tooltip,
|
||||
"on_view_drag_begin": self.on_view_drag_begin,
|
||||
"on_view_drag_end": self.on_view_drag_end,
|
||||
"on_view_drag_data_get": self.on_view_drag_data_get,
|
||||
"on_services_view_drag_drop": self.on_services_view_drag_drop,
|
||||
"on_services_view_drag_data_received": self.on_services_view_drag_data_received,
|
||||
"on_view_drag_data_received": self.on_view_drag_data_received,
|
||||
"on_bq_view_drag_data_received": self.on_bq_view_drag_data_received,
|
||||
"on_view_press": self.on_view_press,
|
||||
"on_view_release": self.on_view_release,
|
||||
"on_view_popup_menu": self.on_view_popup_menu,
|
||||
"on_view_focus": self.on_view_focus,
|
||||
"on_model_changed": self.on_model_changed,
|
||||
@@ -178,6 +183,7 @@ class Application(Gtk.Application):
|
||||
self._blacklist = set()
|
||||
self._current_bq_name = None
|
||||
self._bq_selected = "" # Current selected bouquet
|
||||
self._select_enabled = True # Multiple selection
|
||||
# Current satellite positions in the services list
|
||||
self._sat_positions = []
|
||||
self._marker_types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name}
|
||||
@@ -191,6 +197,7 @@ class Application(Gtk.Application):
|
||||
self._http_api = None
|
||||
self._fav_click_mode = None
|
||||
self._links_transmitter = None
|
||||
self._control_box = None
|
||||
# Colors
|
||||
self._use_colors = False
|
||||
self._NEW_COLOR = None # Color for new services in the main list
|
||||
@@ -245,9 +252,10 @@ class Application(Gtk.Application):
|
||||
self._signal_level_bar.bind_property("visible", builder.get_object("record_button"), "visible")
|
||||
self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4)
|
||||
self._receiver_info_box.bind_property("visible", self._signal_box, "visible")
|
||||
# Screenshots
|
||||
self._screenshots_button = builder.get_object("screenshots_button")
|
||||
self._receiver_info_box.bind_property("visible", self._screenshots_button, "visible")
|
||||
# Control
|
||||
self._control_button = builder.get_object("control_button")
|
||||
self._receiver_info_box.bind_property("visible", self._control_button, "visible")
|
||||
self._control_revealer = builder.get_object("control_revealer")
|
||||
# Force ctrl press event for view. Multiple selections in lists only with Space key(as in file managers)!!!
|
||||
self._services_view.connect("key-press-event", self.force_ctrl)
|
||||
self._fav_view.connect("key-press-event", self.force_ctrl)
|
||||
@@ -351,21 +359,14 @@ class Application(Gtk.Application):
|
||||
iptv_handlers = ("on_iptv", "on_import_yt_list", "on_import_m3u", "on_export_to_m3u",
|
||||
"on_epg_list_configuration", "on_iptv_list_configuration", "on_remove_all_unavailable")
|
||||
|
||||
def set_action(n, fun, enabled=True):
|
||||
ac = Gio.SimpleAction.new(n, None)
|
||||
ac.connect("activate", fun)
|
||||
ac.set_enabled(enabled)
|
||||
self.add_action(ac)
|
||||
return ac
|
||||
|
||||
list(map(lambda x: set_action(x, self._handlers.get(x)), main_handlers))
|
||||
list(map(lambda x: self.set_action(x, self._handlers.get(x)), main_handlers))
|
||||
# Import
|
||||
action = set_action("on_import_bouquet", self._handlers.get("on_import_bouquet"), False)
|
||||
action = self.set_action("on_import_bouquet", self._handlers.get("on_import_bouquet"), False)
|
||||
self._tool_elements.get("bouquet_import_popup_item").bind_property("sensitive", action, "enabled")
|
||||
# IPTV
|
||||
iptv_elem = self._tool_elements.get("fav_iptv_popup_item")
|
||||
for h in iptv_handlers:
|
||||
action = set_action(h, self._handlers.get(h), False)
|
||||
action = self.set_action(h, self._handlers.get(h), False)
|
||||
iptv_elem.bind_property("sensitive", action, "enabled")
|
||||
# Search, Filter
|
||||
search_action = Gio.SimpleAction.new_stateful("search", None, GLib.Variant.new_boolean(False))
|
||||
@@ -379,21 +380,31 @@ class Application(Gtk.Application):
|
||||
self._app_info_box.bind_property("visible", filter_action, "enabled", 4)
|
||||
self._main_window.add_action(filter_action)
|
||||
# Lock, Hide
|
||||
self._app_info_box.bind_property("visible", set_action("on_hide", self.on_hide, False), "enabled", 4)
|
||||
self._app_info_box.bind_property("visible", set_action("on_locked", self.on_locked, False), "enabled", 4)
|
||||
self._app_info_box.bind_property("visible", self.set_action("on_hide", self.on_hide, False), "enabled", 4)
|
||||
self._app_info_box.bind_property("visible", self.set_action("on_locked", self.on_locked, False), "enabled", 4)
|
||||
# Open and download/upload data
|
||||
set_action("open_data", lambda a, v: self.open_data())
|
||||
set_action("on_download_data", self.on_download_data)
|
||||
set_action("upload_all", lambda a, v: self.on_upload_data(DownloadType.ALL))
|
||||
set_action("upload_bouquets", lambda a, v: self.on_upload_data(DownloadType.BOUQUETS))
|
||||
self.set_action("open_data", lambda a, v: self.open_data())
|
||||
self.set_action("on_download_data", self.on_download_data)
|
||||
self.set_action("upload_all", lambda a, v: self.on_upload_data(DownloadType.ALL))
|
||||
self.set_action("upload_bouquets", lambda a, v: self.on_upload_data(DownloadType.BOUQUETS))
|
||||
self.set_action("on_archive_open", self.on_archive_open)
|
||||
self.set_action("on_import_from_web", self.on_import_from_web)
|
||||
# Edit
|
||||
set_action("on_edit", self.on_edit)
|
||||
self.set_action("on_edit", self.on_edit)
|
||||
# Save
|
||||
self._app_info_box.bind_property("visible", set_action("on_data_save", self.on_data_save, False), "enabled", 4)
|
||||
# Screenshots
|
||||
set_action("on_screenshot_all", self.on_screenshot_all)
|
||||
set_action("on_screenshot_video", self.on_screenshot_video)
|
||||
set_action("on_screenshot_osd", self.on_screenshot_osd)
|
||||
self._app_info_box.bind_property("visible", self.set_action("on_data_save", self.on_data_save, False),
|
||||
"enabled", 4)
|
||||
# Control
|
||||
remote_action = Gio.SimpleAction.new_stateful("on_remote", None, GLib.Variant.new_boolean(False))
|
||||
remote_action.connect("change-state", self.on_control)
|
||||
self.add_action(remote_action)
|
||||
|
||||
def set_action(self, name, fun, enabled=True):
|
||||
ac = Gio.SimpleAction.new(name, None)
|
||||
ac.connect("activate", fun)
|
||||
ac.set_enabled(enabled)
|
||||
self.add_action(ac)
|
||||
return ac
|
||||
|
||||
def set_accels(self):
|
||||
""" Setting accelerators for the actions. """
|
||||
@@ -475,14 +486,14 @@ class Application(Gtk.Application):
|
||||
self.set_profile(profile)
|
||||
|
||||
def init_drag_and_drop(self):
|
||||
""" Enable drag-and-drop """
|
||||
""" Enable drag-and-drop. """
|
||||
target = []
|
||||
bq_target = []
|
||||
|
||||
self._services_view.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, target, Gdk.DragAction.COPY)
|
||||
self._services_view.enable_model_drag_dest([], Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||
self._fav_view.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, target,
|
||||
Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||
Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE | Gdk.DragAction.COPY)
|
||||
self._fav_view.enable_model_drag_dest(target, Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||
self._bouquets_view.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, bq_target,
|
||||
Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||
@@ -503,6 +514,17 @@ class Application(Gtk.Application):
|
||||
self._bouquets_view.drag_source_add_text_targets()
|
||||
self._bouquets_view.drag_dest_add_uri_targets()
|
||||
|
||||
self._app_info_box.drag_dest_set(Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY)
|
||||
if self._settings.is_darwin:
|
||||
self._app_info_box.drag_dest_add_uri_targets()
|
||||
else:
|
||||
self._app_info_box.drag_dest_add_text_targets()
|
||||
self._services_view.drag_dest_add_text_targets()
|
||||
# For multiple selection.
|
||||
self._services_view.get_selection().set_select_function(lambda *args: self._select_enabled)
|
||||
self._fav_view.get_selection().set_select_function(lambda *args: self._select_enabled)
|
||||
self._bouquets_view.get_selection().set_select_function(lambda *args: self._select_enabled)
|
||||
|
||||
def init_colors(self, update=False):
|
||||
""" Initialisation of background colors for the services.
|
||||
|
||||
@@ -763,6 +785,8 @@ class Application(Gtk.Application):
|
||||
self._bouquets.pop("{}:{}".format(b_row[Column.BQ_NAME], b_row[Column.BQ_TYPE]), None)
|
||||
self._bouquets_model.remove(itr)
|
||||
|
||||
self._bq_selected = ""
|
||||
self._bq_name_label.set_text(self._bq_selected)
|
||||
self._wait_dialog.hide()
|
||||
yield True
|
||||
|
||||
@@ -976,30 +1000,116 @@ class Application(Gtk.Application):
|
||||
|
||||
pol = ", {}: {},".format(get_message("Pol"), srv.pol) if srv.pol else ","
|
||||
fec = "{}: {}".format("FEC", srv.fec) if srv.fec else ","
|
||||
ht = "{}{}: {}\n{}: {}\n{}: {}\n{}: {}{} {}, {}: {}\n{}"
|
||||
ht = "{}{}: {}\n{}: {}\n{}: {}\n{}: {}{} {}, {}\n{}"
|
||||
return ht.format(header,
|
||||
get_message("Package"), srv.package,
|
||||
get_message("System"), srv.system,
|
||||
get_message("Freq"), srv.freq,
|
||||
get_message("Rate"), srv.rate, pol, fec, "SID", srv.ssid,
|
||||
get_message("Rate"), srv.rate, pol, fec, self.get_ssid_info(srv),
|
||||
ref)
|
||||
|
||||
def get_hint_for_srv_list(self, srv):
|
||||
""" Returns short info about service as formatted string for using as hint. """
|
||||
return "{}{}".format(*self.get_hint_header_info(srv))
|
||||
header, ref = self.get_hint_header_info(srv)
|
||||
return "{}{}\n{}".format(header, self.get_ssid_info(srv), ref)
|
||||
|
||||
def get_hint_header_info(self, srv):
|
||||
header = "{}: {}\n{}: {}\n".format(get_message("Name"), srv.service, get_message("Type"), srv.service_type)
|
||||
ref = "{}: {}".format(get_message("Service reference"), srv.picon_id.rstrip(".png"))
|
||||
return header, ref
|
||||
|
||||
def get_ssid_info(self, srv):
|
||||
""" Returns SID representation in hex and dec formats. """
|
||||
sid = srv.ssid or "0"
|
||||
try:
|
||||
dec = "{0:04d}".format(int(sid, 16))
|
||||
except ValueError as e:
|
||||
log("SID value conversion error: {}".format(e))
|
||||
else:
|
||||
return "SID: 0x{} ({})".format(sid.upper(), dec)
|
||||
|
||||
return "SID: 0x{}".format(sid.upper())
|
||||
|
||||
# ***************** Drag-and-drop *********************#
|
||||
|
||||
def on_view_drag_begin(self, view, context):
|
||||
""" Selects a row under the cursor in the view at the dragging beginning. """
|
||||
path, column = view.get_cursor()
|
||||
if path:
|
||||
view.get_selection().select_path(path)
|
||||
""" Sets its own icon for dragging.
|
||||
|
||||
We have to use "connect_after" (after="yes" in xml) to override what the default handler did.
|
||||
https://lazka.github.io/pgi-docs/Gtk-3.0/classes/Widget.html#Gtk.Widget.signals.drag_begin
|
||||
"""
|
||||
model, paths = view.get_selection().get_selected_rows()
|
||||
if len(paths) < 1:
|
||||
return
|
||||
|
||||
name, model = get_model_data(view)
|
||||
name_column, type_column = Column.SRV_SERVICE, Column.SRV_TYPE
|
||||
if name == self.FAV_MODEL_NAME:
|
||||
name_column, type_column = Column.FAV_SERVICE, Column.FAV_TYPE
|
||||
elif name == self.BQ_MODEL_NAME:
|
||||
name_column, type_column = Column.BQ_NAME, Column.BQ_TYPE
|
||||
# https://stackoverflow.com/a/52248549
|
||||
Gtk.drag_set_icon_pixbuf(context, self.get_drag_icon_pixbuf(model, paths, name_column, type_column), 0, 0)
|
||||
return True
|
||||
|
||||
def on_view_drag_end(self, view, context):
|
||||
self._select_enabled = True
|
||||
view.get_selection().unselect_all()
|
||||
|
||||
def get_drag_icon_pixbuf(self, model, paths, text_column, type_column):
|
||||
""" Creates and returns Pixbuf for a dragging icon. """
|
||||
import cairo
|
||||
|
||||
window = Gtk.OffscreenWindow()
|
||||
window.get_style_context().add_class(Gtk.STYLE_CLASS_DND)
|
||||
frame = Gtk.Frame()
|
||||
list_box = Gtk.ListBox()
|
||||
list_box.set_selection_mode(Gtk.SelectionMode.NONE)
|
||||
padding = 10
|
||||
|
||||
for index, row in enumerate([model[p] for p in paths]):
|
||||
if index == 25:
|
||||
list_box.add(Gtk.Arrow(Gtk.ArrowType.DOWN))
|
||||
break
|
||||
|
||||
h_box = Gtk.HBox()
|
||||
h_box.set_spacing(10)
|
||||
h_box.get_style_context().add_class(Gtk.STYLE_CLASS_LIST_ROW)
|
||||
label = Gtk.Label(row[text_column])
|
||||
label.set_alignment(0, 0)
|
||||
label.set_padding(padding, 2)
|
||||
h_box.add(label)
|
||||
label = Gtk.Label(row[type_column])
|
||||
label.set_halign(Gtk.Align.END)
|
||||
label.set_padding(padding, 2)
|
||||
h_box.add(label)
|
||||
list_box.add(h_box)
|
||||
|
||||
if len(paths) > 1:
|
||||
list_box.add(Gtk.Separator())
|
||||
h_box = Gtk.HBox()
|
||||
h_box.set_spacing(2)
|
||||
img = Gtk.Image.new_from_icon_name("document-properties", 0)
|
||||
h_box.add(img)
|
||||
h_box.add(Gtk.Label(len(paths)))
|
||||
h_box.set_halign(Gtk.Align.START)
|
||||
h_box.set_margin_left(10)
|
||||
h_box.set_margin_bottom(5)
|
||||
h_box.set_margin_top(2)
|
||||
list_box.add(h_box)
|
||||
|
||||
frame.add(list_box)
|
||||
frame.show_all()
|
||||
window.add(frame)
|
||||
window.show()
|
||||
alloc = frame.get_allocation()
|
||||
w, h = alloc.width, alloc.height
|
||||
surf = cairo.ImageSurface(cairo.FORMAT_ARGB32, w, h)
|
||||
frame.draw(cairo.Context(surf))
|
||||
pix = Gdk.pixbuf_get_from_surface(surf, 0, 0, w, h)
|
||||
window.destroy()
|
||||
|
||||
return pix
|
||||
|
||||
def on_view_drag_data_get(self, view, drag_context, data, info, time):
|
||||
selection = self.get_selection(view)
|
||||
@@ -1021,17 +1131,23 @@ class Application(Gtk.Application):
|
||||
def on_view_drag_data_received(self, view, drag_context, x, y, data, info, time):
|
||||
txt = data.get_text()
|
||||
uris = data.get_uris()
|
||||
name, model = get_model_data(view)
|
||||
|
||||
if txt:
|
||||
self.receive_selection(view=view, drop_info=view.get_dest_row_at_pos(x, y), data=txt)
|
||||
if txt.startswith("file://") and name == self.SERVICE_MODEL_NAME:
|
||||
self.on_import_data(urlparse(unquote(txt)).path.strip())
|
||||
elif name == self.FAV_MODEL_NAME:
|
||||
self.receive_selection(view=view, drop_info=view.get_dest_row_at_pos(x, y), data=txt)
|
||||
|
||||
if uris:
|
||||
from urllib.parse import unquote, urlparse
|
||||
|
||||
src, sep, dest = uris[0].partition("::::")
|
||||
picon_path = urlparse(unquote(src)).path
|
||||
dest_path = urlparse(unquote(dest)).path + "/"
|
||||
self.picons_buffer = self.on_assign_picon(view, picon_path, dest_path)
|
||||
drag_context.finish(True, None, time)
|
||||
src_path = urlparse(unquote(src)).path
|
||||
if dest:
|
||||
dest_path = urlparse(unquote(dest)).path + "/"
|
||||
self.picons_buffer = self.on_assign_picon(view, src_path, dest_path)
|
||||
elif name == self.SERVICE_MODEL_NAME:
|
||||
self.on_import_data(src_path)
|
||||
drag_context.finish(True, False, time)
|
||||
|
||||
def on_bq_view_drag_data_received(self, view, drag_context, x, y, data, info, time):
|
||||
model_name, model = get_model_data(view)
|
||||
@@ -1047,7 +1163,11 @@ class Application(Gtk.Application):
|
||||
if not data:
|
||||
return
|
||||
|
||||
itr_str, sep, source = data.partition("::::")
|
||||
if data.startswith("file://"):
|
||||
self.on_import_bouquet(None, file_path=urlparse(unquote(data)).path.strip())
|
||||
return
|
||||
|
||||
itr_str, sep, source = data.partition(self.DRAG_SEP)
|
||||
if source != self.BQ_MODEL_NAME:
|
||||
return
|
||||
|
||||
@@ -1067,7 +1187,8 @@ class Application(Gtk.Application):
|
||||
break
|
||||
|
||||
if all((not is_darwin, p_itr, model.get_path(p_itr)[0] == p_path)):
|
||||
top_iter = model.move_before(itr, top_iter)
|
||||
model.move_after(itr, top_iter)
|
||||
top_iter = itr
|
||||
else:
|
||||
model.insert(parent_itr, model.get_path(top_iter)[1], model[itr][:])
|
||||
to_del.append(itr)
|
||||
@@ -1092,7 +1213,7 @@ class Application(Gtk.Application):
|
||||
def receive_selection(self, *, view, drop_info, data):
|
||||
""" Update fav view after data received """
|
||||
try:
|
||||
itr_str, sep, source = data.partition("::::")
|
||||
itr_str, sep, source = data.partition(self.DRAG_SEP)
|
||||
if source == self.BQ_MODEL_NAME:
|
||||
return
|
||||
|
||||
@@ -1137,10 +1258,22 @@ class Application(Gtk.Application):
|
||||
self.show_error_dialog(str(e))
|
||||
|
||||
def on_view_press(self, view, event):
|
||||
""" Handles a mouse click (press) to view. """
|
||||
if event.get_event_type() == Gdk.EventType.BUTTON_PRESS and event.button == Gdk.BUTTON_PRIMARY:
|
||||
target = view.get_path_at_pos(event.x, event.y)
|
||||
# Idea taken from here: https://kevinmehall.net/2010/pygtk_multi_select_drag_drop
|
||||
mask = not (event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK))
|
||||
if target and mask and view.get_selection().path_is_selected(target[0]):
|
||||
self._select_enabled = False
|
||||
|
||||
name, model = get_model_data(view)
|
||||
self.delete_views_selection(name)
|
||||
|
||||
def on_view_release(self, view, event):
|
||||
""" Handles a mouse click (release) to view. """
|
||||
# Enable selection.
|
||||
self._select_enabled = True
|
||||
|
||||
def delete_views_selection(self, name):
|
||||
if name == self.SERVICE_MODEL_NAME:
|
||||
self.delete_selection(self._fav_view)
|
||||
@@ -1163,7 +1296,7 @@ class Application(Gtk.Application):
|
||||
self.delete_selection(self._services_view, self._fav_view)
|
||||
self.on_view_focus(self._bouquets_view)
|
||||
|
||||
menu.popup(None, None, None, None, event.button, event.time)
|
||||
menu.popup_at_pointer(None)
|
||||
return True
|
||||
|
||||
def on_satellite_editor_show(self, action, value=None):
|
||||
@@ -1224,21 +1357,86 @@ class Application(Gtk.Application):
|
||||
self.show_error_dialog(str(e))
|
||||
|
||||
def on_data_open(self, action=None, value=None):
|
||||
response = show_dialog(DialogType.CHOOSER, self._main_window, settings=self._settings)
|
||||
""" Opening data via "File/Open". """
|
||||
response = show_dialog(DialogType.CHOOSER, self._main_window, settings=self._settings, title="Open folder")
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
self.open_data(response)
|
||||
|
||||
def on_archive_open(self, action=None, value=None):
|
||||
""" Opening the data archive via "File/Open archive". """
|
||||
file_filter = Gtk.FileFilter()
|
||||
file_filter.set_name("*.zip, *.gz")
|
||||
file_filter.add_mime_type("application/zip")
|
||||
file_filter.add_mime_type("application/gzip")
|
||||
|
||||
response = show_dialog(DialogType.CHOOSER, self._main_window,
|
||||
action_type=Gtk.FileChooserAction.OPEN,
|
||||
file_filter=file_filter,
|
||||
settings=self._settings,
|
||||
title="Open archive")
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
self.open_data(response)
|
||||
|
||||
def open_data(self, data_path=None, callback=None):
|
||||
""" Opening data and fill views. """
|
||||
gen = self.update_data(data_path, callback)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
if data_path and os.path.isfile(data_path):
|
||||
self.open_compressed_data(data_path)
|
||||
else:
|
||||
gen = self.update_data(data_path, callback)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
|
||||
def open_compressed_data(self, data_path):
|
||||
""" Opening archived data. """
|
||||
arch_path = self.get_archive_path(data_path)
|
||||
if arch_path:
|
||||
gen = self.update_data("{}{}".format(arch_path.name, os.sep), callback=arch_path.cleanup)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
|
||||
def get_archive_path(self, data_path):
|
||||
""" Returns the temp dir path for the extracted data, or None if the archive format is not supported. """
|
||||
import zipfile
|
||||
import tarfile
|
||||
import tempfile
|
||||
|
||||
tmp_path = tempfile.TemporaryDirectory()
|
||||
tmp_path_name = tmp_path.name
|
||||
|
||||
if zipfile.is_zipfile(data_path):
|
||||
with zipfile.ZipFile(data_path) as zip_file:
|
||||
for zip_info in zip_file.infolist():
|
||||
if not zip_info.filename.endswith(os.sep):
|
||||
try:
|
||||
f_name = zip_info.filename.encode("cp437").decode("utf-8")
|
||||
except (UnicodeEncodeError, UnicodeDecodeError) as e:
|
||||
log("Filename [{}] error in zip archive: {}".format(zip_info.filename, e))
|
||||
else:
|
||||
zip_info.filename = os.path.basename(f_name)
|
||||
zip_file.extract(zip_info, path=tmp_path_name)
|
||||
elif tarfile.is_tarfile(data_path):
|
||||
with tarfile.open(data_path) as tar:
|
||||
for mb in tar.getmembers():
|
||||
if mb.isfile():
|
||||
mb.name = os.path.basename(mb.name)
|
||||
tar.extract(mb, path=tmp_path_name)
|
||||
else:
|
||||
tmp_path.cleanup()
|
||||
log("Error getting the path for the archive. Unsupported file format: {}".format(data_path))
|
||||
self.show_error_dialog("Unsupported format!")
|
||||
return
|
||||
|
||||
return tmp_path
|
||||
|
||||
def update_data(self, data_path, callback=None):
|
||||
self._profile_combo_box.set_sensitive(False)
|
||||
self._wait_dialog.show()
|
||||
|
||||
yield from self.clear_current_data()
|
||||
# Reset of sorting
|
||||
self._services_view.get_model().reset_default_sort_func()
|
||||
self.reset_view_sort_indication(self._services_view)
|
||||
self.reset_view_sort_indication(self._fav_view)
|
||||
|
||||
try:
|
||||
current_profile = self._profile_combo_box.get_active_text()
|
||||
@@ -1514,8 +1712,17 @@ class Application(Gtk.Application):
|
||||
self._bouquets_model.append(None, ["Providers", None, None, BqType.BOUQUET.value])
|
||||
self._bouquets_model.append(None, ["FAV", None, None, BqType.TV.value])
|
||||
self._bouquets_model.append(None, ["WEBTV", None, None, BqType.WEBTV.value])
|
||||
|
||||
self._data_hash = self.get_data_hash()
|
||||
yield True
|
||||
|
||||
def on_fav_selection(self, model, path, column):
|
||||
if self._control_box and self._control_box.update_epg:
|
||||
ref = self.get_service_ref(path)
|
||||
if not ref:
|
||||
return
|
||||
self._control_box.on_service_changed(ref)
|
||||
|
||||
def on_services_selection(self, model, path, column):
|
||||
self.update_service_bar(model, path)
|
||||
|
||||
@@ -1545,7 +1752,7 @@ class Application(Gtk.Application):
|
||||
|
||||
if len(path) > 1:
|
||||
gen = self.update_bouquet_services(model, path)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
GLib.idle_add(lambda: next(gen, False))
|
||||
|
||||
def update_bouquet_services(self, model, path, bq_key=None):
|
||||
""" Updates list of bouquet services """
|
||||
@@ -1557,12 +1764,12 @@ class Application(Gtk.Application):
|
||||
services = self._bouquets.get(key, [])
|
||||
ex_services = self._extra_bouquets.get(key, None)
|
||||
|
||||
factor = self.FAV_FACTOR * 20
|
||||
if len(services) > factor or len(self._fav_model) > factor:
|
||||
if len(services) > self.FAV_FACTOR * 20:
|
||||
self._bouquets_view.set_sensitive(False)
|
||||
yield True
|
||||
|
||||
self._fav_view.set_model(None)
|
||||
self._fav_model.clear()
|
||||
yield True
|
||||
|
||||
num = 0
|
||||
for srv_id in services:
|
||||
@@ -1581,11 +1788,11 @@ class Application(Gtk.Application):
|
||||
self._fav_model.append((0 if is_marker else num, srv.coded, ex_srv_name if ex_srv_name else srv.service,
|
||||
srv.locked, srv.hide, srv_type, srv.pos, srv.fav_id,
|
||||
self._picons.get(srv.picon_id, None), None, background))
|
||||
if num % self.FAV_FACTOR == 0:
|
||||
yield True
|
||||
|
||||
GLib.idle_add(self._bouquets_view.set_sensitive, True)
|
||||
GLib.idle_add(self._bouquets_view.grab_focus)
|
||||
yield True
|
||||
self._fav_view.set_model(self._fav_model)
|
||||
self._bouquets_view.set_sensitive(True)
|
||||
self._bouquets_view.grab_focus()
|
||||
yield True
|
||||
|
||||
def check_bouquet_selection(self):
|
||||
@@ -1972,6 +2179,16 @@ class Application(Gtk.Application):
|
||||
else:
|
||||
show_dialog(DialogType.INFO, self._main_window, "Done!")
|
||||
|
||||
def on_import_data(self, path):
|
||||
msg = "Combine with the current data?"
|
||||
if len(self._services_model) > 0 and show_dialog(DialogType.QUESTION, self._main_window,
|
||||
msg) == Gtk.ResponseType.OK:
|
||||
self.import_data(path, force=True)
|
||||
else:
|
||||
if os.path.isdir(path) and not path.endswith(os.sep):
|
||||
path += os.sep
|
||||
self.open_data(path)
|
||||
|
||||
def on_import_bouquet(self, action, value=None, file_path=None):
|
||||
model, paths = self._bouquets_view.get_selection().get_selected_rows()
|
||||
if not paths:
|
||||
@@ -1986,19 +2203,62 @@ class Application(Gtk.Application):
|
||||
if response in (Gtk.ResponseType.CANCEL, Gtk.ResponseType.DELETE_EVENT):
|
||||
return
|
||||
|
||||
self.import_data(response)
|
||||
|
||||
def import_data(self, path, force=None, callback=None):
|
||||
if os.path.isdir(path) and not path.endswith(os.sep):
|
||||
path += os.sep
|
||||
elif os.path.isfile(path):
|
||||
arch_path = self.get_archive_path(path)
|
||||
if not arch_path:
|
||||
return
|
||||
|
||||
path = arch_path.name + os.sep
|
||||
callback = arch_path.cleanup
|
||||
|
||||
def append(b, s):
|
||||
gen = self.append_imported_data(b, s)
|
||||
gen = self.append_imported_data(b, s, callback)
|
||||
GLib.idle_add(lambda: next(gen, False))
|
||||
|
||||
ImportDialog(self._main_window, response, self._settings, self._services.keys(), append).show()
|
||||
dialog = ImportDialog(self._main_window, path, self._settings, self._services.keys(), append)
|
||||
dialog.import_data() if force else dialog.show()
|
||||
|
||||
def append_imported_data(self, bouquets, services):
|
||||
def append_imported_data(self, bouquets, services, callback=None):
|
||||
try:
|
||||
self._wait_dialog.show()
|
||||
yield from self.append_data(bouquets, services)
|
||||
finally:
|
||||
log("Importing data done!")
|
||||
if callback:
|
||||
callback()
|
||||
self._wait_dialog.hide()
|
||||
|
||||
def on_import_from_web(self, action, value=None):
|
||||
if self._s_type is not SettingsType.ENIGMA_2:
|
||||
self.show_error_dialog("Not allowed in this context!")
|
||||
return
|
||||
ServicesUpdateDialog(self._main_window, self._settings, self.on_import_data_from_web).show()
|
||||
|
||||
@run_idle
|
||||
def on_import_data_from_web(self, services):
|
||||
msg = "Combine with the current data?"
|
||||
if len(self._services_model) > 0 and show_dialog(DialogType.QUESTION, self._main_window,
|
||||
msg) == Gtk.ResponseType.OK:
|
||||
gen = self.append_imported_data([], services)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
else:
|
||||
gen = self.import_data_from_web(services)
|
||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||
|
||||
def import_data_from_web(self, services):
|
||||
self._wait_dialog.show()
|
||||
if self._app_info_box.get_visible():
|
||||
yield from self.create_new_configuration(self._s_type)
|
||||
yield from self.append_services(services)
|
||||
self.update_sat_positions()
|
||||
yield True
|
||||
self._wait_dialog.hide()
|
||||
|
||||
# ***************** Backup ********************#
|
||||
|
||||
def on_backup_tool_show(self, action, value=None):
|
||||
@@ -2055,8 +2315,7 @@ class Application(Gtk.Application):
|
||||
self.set_playback_elms_active()
|
||||
else:
|
||||
if not self._player_box.get_visible():
|
||||
w, h = self._main_window.get_size()
|
||||
self._player_box.set_size_request(w * 0.6, -1)
|
||||
self.set_player_area_size(self._player_box)
|
||||
self._current_mrl = url
|
||||
self._player_box.set_visible(True)
|
||||
|
||||
@@ -2126,14 +2385,13 @@ class Application(Gtk.Application):
|
||||
self._fav_view.do_grab_focus(self._fav_view)
|
||||
|
||||
def get_time_str(self, duration):
|
||||
""" returns a string representation of time from duration in milliseconds """
|
||||
""" Returns a string representation of time from duration in milliseconds """
|
||||
m, s = divmod(duration // 1000, 60)
|
||||
h, m = divmod(m, 60)
|
||||
return "{}{:02d}:{:02d}".format(str(h) + ":" if h else "", m, s)
|
||||
|
||||
def on_drawing_area_realize(self, widget):
|
||||
w, h = self._main_window.get_size()
|
||||
widget.set_size_request(w * 0.6, -1)
|
||||
self.set_player_area_size(widget)
|
||||
|
||||
if not self._player:
|
||||
try:
|
||||
@@ -2153,6 +2411,10 @@ class Application(Gtk.Application):
|
||||
finally:
|
||||
self.set_playback_elms_active()
|
||||
|
||||
def set_player_area_size(self, widget):
|
||||
w, h = self._main_window.get_size()
|
||||
widget.set_size_request(w * 0.6, -1)
|
||||
|
||||
def on_player_drawing_area_draw(self, widget, cr):
|
||||
""" Used for black background drawing in the player drawing area.
|
||||
|
||||
@@ -2203,7 +2465,7 @@ class Application(Gtk.Application):
|
||||
if is_record:
|
||||
self._recorder.stop()
|
||||
else:
|
||||
self._http_api.send(HttpRequestType.STREAM_CURRENT, None, self.record)
|
||||
self._http_api.send(HttpAPI.Request.STREAM_CURRENT, None, self.record)
|
||||
|
||||
def record(self, data):
|
||||
url = self.get_url_from_m3u(data)
|
||||
@@ -2268,11 +2530,16 @@ class Application(Gtk.Application):
|
||||
if self._player and self._player.is_playing():
|
||||
self._player.stop()
|
||||
|
||||
self._http_api.send(HttpRequestType.STREAM, ref, self.watch)
|
||||
self._http_api.send(HttpAPI.Request.STREAM, ref, self.watch)
|
||||
|
||||
def on_watch(self, item=None):
|
||||
""" Switch to the channel and watch in the player """
|
||||
self._http_api.send(HttpRequestType.STREAM_CURRENT, None, self.watch)
|
||||
if self._app_info_box.get_visible() and self._settings.play_streams_mode is PlayStreamsMode.BUILT_IN:
|
||||
self.set_player_area_size(self._player_box)
|
||||
self._player_box.set_visible(True)
|
||||
GLib.idle_add(self._app_info_box.set_visible, False)
|
||||
|
||||
self._http_api.send(HttpAPI.Request.STREAM_CURRENT, None, self.watch)
|
||||
|
||||
def watch(self, data):
|
||||
url = self.get_url_from_m3u(data)
|
||||
@@ -2332,7 +2599,7 @@ class Application(Gtk.Application):
|
||||
self.show_error_dialog("No connection to the receiver!")
|
||||
self.set_playback_elms_active()
|
||||
|
||||
self._http_api.send(HttpRequestType.ZAP, ref, zap)
|
||||
self._http_api.send(HttpAPI.Request.ZAP, ref, zap)
|
||||
|
||||
def get_service_ref(self, path):
|
||||
row = self._fav_model[path][:]
|
||||
@@ -2354,7 +2621,7 @@ class Application(Gtk.Application):
|
||||
GLib.idle_add(self._receiver_info_box.set_visible, False)
|
||||
return False
|
||||
|
||||
self._http_api.send(HttpRequestType.INFO, None, self.update_receiver_info)
|
||||
self._http_api.send(HttpAPI.Request.INFO, None, self.update_receiver_info)
|
||||
return True
|
||||
|
||||
def update_receiver_info(self, info):
|
||||
@@ -2382,10 +2649,13 @@ class Application(Gtk.Application):
|
||||
|
||||
def update_service_info(self):
|
||||
if self._http_api:
|
||||
self._http_api.send(HttpRequestType.SIGNAL, None, self.update_signal)
|
||||
self._http_api.send(HttpRequestType.CURRENT, None, self.update_status)
|
||||
self._http_api.send(HttpAPI.Request.SIGNAL, None, self.update_signal)
|
||||
self._http_api.send(HttpAPI.Request.CURRENT, None, self.update_status)
|
||||
|
||||
def update_signal(self, sig):
|
||||
if self._control_box:
|
||||
self._control_box.update_signal(sig)
|
||||
|
||||
self.set_signal(sig.get("e2snr", "0 %") if sig else "0 %")
|
||||
|
||||
@lru_cache(maxsize=2)
|
||||
@@ -2414,40 +2684,26 @@ class Application(Gtk.Application):
|
||||
self._service_epg_label.set_text(dsc)
|
||||
self._service_epg_label.set_tooltip_text(evn.get("e2eventdescription", ""))
|
||||
|
||||
# ******************** Screenshots ************************#
|
||||
# ******************* Control *********************** #
|
||||
|
||||
def on_screenshot_all(self, action, value=None):
|
||||
self._http_api.send(HttpRequestType.GRUB, "mode=all" if self._http_api.is_owif else "d=", self.on_screenshot)
|
||||
def on_control(self, action, state=False):
|
||||
""" Shows/Hides [R key] remote controller. """
|
||||
action.set_state(state)
|
||||
self._control_revealer.set_visible(state)
|
||||
self._control_revealer.set_reveal_child(state)
|
||||
|
||||
def on_screenshot_video(self, action, value=None):
|
||||
self._http_api.send(HttpRequestType.GRUB, "mode=video" if self._http_api.is_owif else "v=", self.on_screenshot)
|
||||
if not self._control_box:
|
||||
from app.ui.control import ControlBox
|
||||
self._control_box = ControlBox(self, self._http_api, self._settings)
|
||||
self._control_revealer.add(self._control_box)
|
||||
|
||||
def on_screenshot_osd(self, action, value=None):
|
||||
self._http_api.send(HttpRequestType.GRUB, "mode=osd" if self._http_api.is_owif else "o=", self.on_screenshot)
|
||||
if state:
|
||||
self._http_api.send(HttpAPI.Request.VOL, "state", self._control_box.update_volume)
|
||||
|
||||
@run_task
|
||||
def on_screenshot(self, data):
|
||||
if "error_code" in data:
|
||||
return
|
||||
def on_http_status_visible(self, img):
|
||||
self._control_button.set_active(False)
|
||||
|
||||
img = data.get("img_data", None)
|
||||
if img:
|
||||
is_darwin = self._settings.is_darwin
|
||||
GLib.idle_add(self._screenshots_button.set_sensitive, is_darwin)
|
||||
path = os.path.expanduser("~/Desktop") if is_darwin else None
|
||||
|
||||
try:
|
||||
import tempfile
|
||||
import subprocess
|
||||
|
||||
with tempfile.NamedTemporaryFile(mode="wb", suffix=".jpg", dir=path, delete=not is_darwin) as tf:
|
||||
tf.write(img)
|
||||
cmd = ["open" if is_darwin else "xdg-open", tf.name]
|
||||
subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||
finally:
|
||||
GLib.idle_add(self._screenshots_button.set_sensitive, True)
|
||||
|
||||
# ***************** Filter and search *********************#
|
||||
# ***************** Filter and search ********************* #
|
||||
|
||||
def on_filter_toggled(self, action, value):
|
||||
if self._app_info_box.get_visible():
|
||||
@@ -2607,7 +2863,7 @@ class Application(Gtk.Application):
|
||||
dialog.show()
|
||||
|
||||
def on_bouquets_edit(self, view):
|
||||
""" Rename bouquets """
|
||||
""" Renaming bouquets. """
|
||||
if not self._bq_selected:
|
||||
self.show_error_dialog("This item is not allowed to edit!")
|
||||
return
|
||||
@@ -2627,10 +2883,15 @@ class Application(Gtk.Application):
|
||||
return
|
||||
|
||||
model.set_value(itr, 0, response)
|
||||
self._bouquets[bq] = self._bouquets.pop("{}:{}".format(bq_name, bq_type))
|
||||
old_bq_name = "{}:{}".format(bq_name, bq_type)
|
||||
self._bouquets[bq] = self._bouquets.pop(old_bq_name)
|
||||
self._current_bq_name = response
|
||||
self._bq_name_label.set_text(self._current_bq_name)
|
||||
self._bq_selected = "{}:{}".format(response, bq_type)
|
||||
self._bq_selected = bq
|
||||
# services with extra names for the bouquet
|
||||
ext_bq = self._extra_bouquets.get(old_bq_name, None)
|
||||
if ext_bq:
|
||||
self._extra_bouquets[bq] = ext_bq
|
||||
|
||||
def on_rename(self, view):
|
||||
name, model = get_model_data(view)
|
||||
|
||||
@@ -46,54 +46,57 @@ def move_items(key, view: Gtk.TreeView):
|
||||
""" Move items in the tree view """
|
||||
selection = view.get_selection()
|
||||
model, paths = selection.get_selected_rows()
|
||||
if not paths:
|
||||
return
|
||||
|
||||
if paths:
|
||||
mod_length = len(model)
|
||||
if mod_length == len(paths):
|
||||
return
|
||||
cursor_path = view.get_cursor()[0]
|
||||
max_path = Gtk.TreePath.new_from_indices((mod_length,))
|
||||
min_path = Gtk.TreePath.new_from_indices((0,))
|
||||
is_tree_store = type(model) is Gtk.TreeStore
|
||||
mod_length = len(model)
|
||||
if not is_tree_store and mod_length == len(paths):
|
||||
return
|
||||
|
||||
cursor_path = view.get_cursor()[0]
|
||||
max_path = Gtk.TreePath.new_from_indices((mod_length,))
|
||||
min_path = Gtk.TreePath.new_from_indices((0,))
|
||||
|
||||
if is_tree_store:
|
||||
is_tree_store = False
|
||||
parent_paths = list(filter(lambda p: p.get_depth() == 1, paths))
|
||||
if parent_paths:
|
||||
paths = parent_paths
|
||||
min_path = model.get_path(model.get_iter_first())
|
||||
view.collapse_all()
|
||||
if mod_length == len(paths):
|
||||
return
|
||||
else:
|
||||
if not is_some_level(paths):
|
||||
return
|
||||
parent_itr = model.iter_parent(model.get_iter(paths[0]))
|
||||
parent_index = model.get_path(parent_itr)
|
||||
children_num = model.iter_n_children(parent_itr)
|
||||
if key in (KeyboardKey.PAGE_DOWN, KeyboardKey.END, KeyboardKey.END_KP, KeyboardKey.PAGE_DOWN_KP):
|
||||
children_num -= 1
|
||||
min_path = Gtk.TreePath.new_from_string("{}:{}".format(parent_index, 0))
|
||||
max_path = Gtk.TreePath.new_from_string("{}:{}".format(parent_index, children_num))
|
||||
is_tree_store = True
|
||||
|
||||
if type(model) is Gtk.TreeStore:
|
||||
parent_paths = list(filter(lambda p: p.get_depth() == 1, paths))
|
||||
if parent_paths:
|
||||
paths = parent_paths
|
||||
min_path = model.get_path(model.get_iter_first())
|
||||
view.collapse_all()
|
||||
if mod_length == len(paths):
|
||||
return
|
||||
else:
|
||||
if not is_some_level(paths):
|
||||
return
|
||||
parent_itr = model.iter_parent(model.get_iter(paths[0]))
|
||||
parent_index = model.get_path(parent_itr)
|
||||
children_num = model.iter_n_children(parent_itr)
|
||||
if key in (KeyboardKey.PAGE_DOWN, KeyboardKey.END, KeyboardKey.END_KP, KeyboardKey.PAGE_DOWN_KP):
|
||||
children_num -= 1
|
||||
min_path = Gtk.TreePath.new_from_string("{}:{}".format(parent_index, 0))
|
||||
max_path = Gtk.TreePath.new_from_string("{}:{}".format(parent_index, children_num))
|
||||
is_tree_store = True
|
||||
|
||||
if key is KeyboardKey.UP:
|
||||
top_path = Gtk.TreePath(paths[0])
|
||||
set_cursor(top_path, paths, selection, view)
|
||||
top_path.prev()
|
||||
move_up(top_path, model, paths)
|
||||
elif key is KeyboardKey.DOWN:
|
||||
down_path = Gtk.TreePath(paths[-1])
|
||||
set_cursor(down_path, paths, selection, view)
|
||||
down_path.next()
|
||||
if down_path < max_path:
|
||||
move_down(down_path, model, paths)
|
||||
else:
|
||||
max_path.prev()
|
||||
move_down(max_path, model, paths)
|
||||
elif key in (KeyboardKey.PAGE_UP, KeyboardKey.HOME, KeyboardKey.PAGE_UP_KP, KeyboardKey.HOME_KP):
|
||||
move_up(min_path if is_tree_store else cursor_path, model, paths)
|
||||
elif key in (KeyboardKey.PAGE_DOWN, KeyboardKey.END, KeyboardKey.END_KP, KeyboardKey.PAGE_DOWN_KP):
|
||||
move_down(max_path if is_tree_store else cursor_path, model, paths)
|
||||
if key is KeyboardKey.UP:
|
||||
top_path = Gtk.TreePath(paths[0])
|
||||
set_cursor(top_path, paths, selection, view)
|
||||
top_path.prev()
|
||||
move_up(top_path, model, paths)
|
||||
elif key is KeyboardKey.DOWN:
|
||||
down_path = Gtk.TreePath(paths[-1])
|
||||
set_cursor(down_path, paths, selection, view)
|
||||
down_path.next()
|
||||
if down_path < max_path:
|
||||
move_down(down_path, model, paths)
|
||||
else:
|
||||
max_path.prev()
|
||||
move_down(max_path, model, paths)
|
||||
elif key in (KeyboardKey.PAGE_UP, KeyboardKey.HOME, KeyboardKey.PAGE_UP_KP, KeyboardKey.HOME_KP):
|
||||
move_up(min_path if is_tree_store else cursor_path, model, paths)
|
||||
elif key in (KeyboardKey.PAGE_DOWN, KeyboardKey.END, KeyboardKey.END_KP, KeyboardKey.PAGE_DOWN_KP):
|
||||
move_down(max_path if is_tree_store else cursor_path, model, paths)
|
||||
|
||||
|
||||
def move_up(top_path, model, paths):
|
||||
@@ -161,7 +164,8 @@ def rename(view, parent_window, target, fav_view=None, service_view=None, servic
|
||||
return
|
||||
|
||||
srv_name = response
|
||||
model.set_value(itr, Column.FAV_SERVICE, response)
|
||||
if not model.get_value(itr, Column.FAV_BACKGROUND):
|
||||
model.set_value(itr, Column.FAV_SERVICE, response)
|
||||
|
||||
if service_view is not None:
|
||||
for row in get_base_model(service_view.get_model()):
|
||||
@@ -401,15 +405,19 @@ def assign_picons(target, srv_view, fav_view, transient, picons, settings, servi
|
||||
picons_path = dst_path or settings.picons_local_path
|
||||
os.makedirs(os.path.dirname(picons_path), exist_ok=True)
|
||||
picon_file = picons_path + picon_id
|
||||
shutil.copy(src_path, picon_file)
|
||||
picons_files.append(picon_file)
|
||||
picon = get_picon_pixbuf(picon_file)
|
||||
picons[picon_id] = picon
|
||||
model.set_value(itr, p_pos, picon)
|
||||
if target is ViewTarget.SERVICES:
|
||||
set_picon(fav_id, fav_view.get_model(), picon, Column.FAV_ID, p_pos)
|
||||
try:
|
||||
shutil.copy(src_path, picon_file)
|
||||
except shutil.SameFileError:
|
||||
pass # NOP
|
||||
else:
|
||||
set_picon(fav_id, get_base_model(srv_view.get_model()), picon, Column.SRV_FAV_ID, p_pos)
|
||||
picons_files.append(picon_file)
|
||||
picon = get_picon_pixbuf(picon_file)
|
||||
picons[picon_id] = picon
|
||||
model.set_value(itr, p_pos, picon)
|
||||
if target is ViewTarget.SERVICES:
|
||||
set_picon(fav_id, fav_view.get_model(), picon, Column.FAV_ID, p_pos)
|
||||
else:
|
||||
set_picon(fav_id, get_base_model(srv_view.get_model()), picon, Column.SRV_FAV_ID, p_pos)
|
||||
|
||||
return picons_files
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -790,6 +790,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="use-header-bar">{use_header}</property>
|
||||
<property name="title" translatable="yes">Satellite</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="modal">True</property>
|
||||
<property name="window_position">center-on-parent</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
@@ -797,25 +798,6 @@ Author: Dmitriy Yefremov
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
<property name="gravity">center</property>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="sat_cancel_button">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="sat_ok_button">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="width_request">90</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="satelitte_dialog_vbox">
|
||||
<property name="can_focus">False</property>
|
||||
@@ -825,6 +807,35 @@ Author: Dmitriy Yefremov
|
||||
<object class="GtkButtonBox" id="dialog-action_area3">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="sat_cancel_button">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="sat_ok_button">
|
||||
<property name="label" translatable="yes">OK</property>
|
||||
<property name="width_request">90</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -876,7 +887,7 @@ Author: Dmitriy Yefremov
|
||||
<object class="GtkEntry" id="sat_name_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="primary_icon_stock">gtk-edit</property>
|
||||
<property name="primary_icon_name">document-edit-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_sensitive">False</property>
|
||||
@@ -978,25 +989,6 @@ Author: Dmitriy Yefremov
|
||||
<property name="skip_taskbar_hint">True</property>
|
||||
<property name="skip_pager_hint">True</property>
|
||||
<property name="gravity">center</property>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="tr_cancel_button">
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="tr_ok_button">
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="width_request">90</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="tr_dialog_vbox">
|
||||
<property name="can_focus">False</property>
|
||||
@@ -1006,6 +998,35 @@ Author: Dmitriy Yefremov
|
||||
<object class="GtkButtonBox" id="tr_dialog-action_area">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="tr_cancel_button">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="tr_ok_button">
|
||||
<property name="label" translatable="yes">OK</property>
|
||||
<property name="width_request">90</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="receives_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -1109,7 +1130,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">12</property>
|
||||
<property name="max_width_chars">10</property>
|
||||
<property name="primary_icon_stock">gtk-edit</property>
|
||||
<property name="primary_icon_name">document-edit-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_activatable">False</property>
|
||||
<property name="secondary_icon_sensitive">False</property>
|
||||
@@ -1128,7 +1149,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">12</property>
|
||||
<property name="max_width_chars">10</property>
|
||||
<property name="primary_icon_stock">gtk-edit</property>
|
||||
<property name="primary_icon_name">document-edit-symbolic</property>
|
||||
<property name="placeholder_text" translatable="yes">27500000</property>
|
||||
<property name="input_purpose">digits</property>
|
||||
<signal name="changed" handler="on_entry_changed" swapped="no"/>
|
||||
@@ -1284,7 +1305,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="max_width_chars">12</property>
|
||||
<property name="primary_icon_stock">gtk-edit</property>
|
||||
<property name="primary_icon_name">document-edit-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="placeholder_text" translatable="yes">0 - 262142</property>
|
||||
<property name="input_purpose">digits</property>
|
||||
@@ -1301,7 +1322,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="can_focus">True</property>
|
||||
<property name="width_chars">5</property>
|
||||
<property name="max_width_chars">12</property>
|
||||
<property name="primary_icon_stock">gtk-edit</property>
|
||||
<property name="primary_icon_name">document-edit-symbolic</property>
|
||||
<property name="primary_icon_activatable">False</property>
|
||||
<property name="placeholder_text" translatable="yes">0 - 255</property>
|
||||
<property name="input_purpose">digits</property>
|
||||
@@ -1385,6 +1406,32 @@ Author: Dmitriy Yefremov
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
<object class="GtkListStore" id="update_service_store">
|
||||
<columns>
|
||||
<!-- column-name picon -->
|
||||
<column type="GdkPixbuf"/>
|
||||
<!-- column-name service -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name package -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name type -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name sid -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name cas -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkListStore" id="update_transponder_store">
|
||||
<columns>
|
||||
<!-- column-name transponder -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name link -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name selected -->
|
||||
<column type="gboolean"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkWindow" id="satellites_update_window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Satellites update</property>
|
||||
@@ -1395,6 +1442,9 @@ Author: Dmitriy Yefremov
|
||||
<property name="skip_pager_hint">True</property>
|
||||
<property name="gravity">center</property>
|
||||
<signal name="delete-event" handler="on_quit" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="satellites_update_main_box">
|
||||
<property name="visible">True</property>
|
||||
@@ -1434,9 +1484,9 @@ Author: Dmitriy Yefremov
|
||||
<property name="valign">center</property>
|
||||
<property name="layout_style">expand</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="satellites_update_cancel_button">
|
||||
<object class="GtkButton" id="cancel_data_button">
|
||||
<property name="label" translatable="yes">Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="visible">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Cancel</property>
|
||||
@@ -1452,7 +1502,7 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="receive_sat_list_tool_button">
|
||||
<object class="GtkButton" id="receive_data_button">
|
||||
<property name="label" translatable="yes">Receive</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
@@ -1460,7 +1510,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="tooltip_text" translatable="yes">Receive</property>
|
||||
<property name="image">sat_receive_image</property>
|
||||
<property name="always_show_image">True</property>
|
||||
<signal name="clicked" handler="on_receive_satellites_list" swapped="no"/>
|
||||
<signal name="clicked" handler="on_receive_data" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
@@ -1772,99 +1822,297 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="sat_update_scrolled_window">
|
||||
<property name="width_request">480</property>
|
||||
<property name="height_request">320</property>
|
||||
<object class="GtkPaned" id="sat_update_main_paned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="wide_handle">True</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="sat_update_tree_view">
|
||||
<object class="GtkScrolledWindow" id="sat_update_scrolled_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">update_sat_list_model_sort</property>
|
||||
<signal name="button-press-event" handler="on_popup_menu" object="satellites_update_popup_menu" swapped="no"/>
|
||||
<signal name="select-all" handler="on_select_all" swapped="no"/>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="sat_update_treeview_selection">
|
||||
<property name="mode">multiple</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_satellite_column">
|
||||
<property name="title" translatable="yes">Satellite</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">0</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_satellite_cellrenderertext"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_position_column">
|
||||
<property name="title" translatable="yes">Position</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">1</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_position_cellrenderertext"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_type_column">
|
||||
<property name="title" translatable="yes">Type</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">2</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_type_cellrenderertext"/>
|
||||
<attributes>
|
||||
<attribute name="text">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_url_column">
|
||||
<property name="visible">False</property>
|
||||
<property name="title" translatable="yes">Url</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_url_cellrenderertext"/>
|
||||
<attributes>
|
||||
<attribute name="text">3</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_selected_treeviewcolumn">
|
||||
<property name="title" translatable="yes">Selected</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">4</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererToggle" id="upd_selected_cellrenderertoggle">
|
||||
<signal name="toggled" handler="on_selected_toggled" swapped="no"/>
|
||||
<object class="GtkTreeView" id="sat_update_tree_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">update_sat_list_model_sort</property>
|
||||
<property name="search_column">0</property>
|
||||
<property name="activate_on_single_click">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection">
|
||||
<property name="mode">multiple</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_satellite_column">
|
||||
<property name="title" translatable="yes">Satellite</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="clickable">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">0</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_satellite_cellrenderertext">
|
||||
<property name="xalign">0.0099999997764825821</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_position_column">
|
||||
<property name="title" translatable="yes">Position</property>
|
||||
<property name="clickable">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">1</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_position_cellrenderertext">
|
||||
<property name="xalign">0.49000000953674316</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_type_column">
|
||||
<property name="title" translatable="yes">Type</property>
|
||||
<property name="clickable">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">2</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_type_cellrenderertext">
|
||||
<property name="xalign">0.49000000953674316</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_url_column">
|
||||
<property name="visible">False</property>
|
||||
<property name="title" translatable="yes">Url</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_url_cellrenderertext"/>
|
||||
<attributes>
|
||||
<attribute name="text">3</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="upd_selected_column">
|
||||
<property name="title" translatable="yes">Selected</property>
|
||||
<property name="clickable">True</property>
|
||||
<property name="reorderable">True</property>
|
||||
<property name="sort_column_id">4</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererToggle" id="upd_selected_cellrenderer">
|
||||
<signal name="toggled" handler="on_satellite_toggled" swapped="no"/>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="active">4</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="active">4</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPaned" id="sat_update_tr_paned">
|
||||
<property name="can_focus">True</property>
|
||||
<property name="wide_handle">True</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="sat_update_tr_scrolled_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="sat_update_tr_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">update_transponder_store</property>
|
||||
<property name="search_column">0</property>
|
||||
<property name="activate_on_single_click">True</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="tr_view_tr_column">
|
||||
<property name="title" translatable="yes">Transponder</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_tr_renderer">
|
||||
<property name="xalign">0.0099999997764825821</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="tr_view_link_column">
|
||||
<property name="visible">False</property>
|
||||
<property name="title" translatable="yes">link</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="upd_tr_link_renderer"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="tr_view_selected_column">
|
||||
<property name="title" translatable="yes">Selected</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererToggle" id="upd_tr_select_renderer">
|
||||
<signal name="toggled" handler="on_transponder_toggled" swapped="no"/>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="active">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="sat_update_srv_scrolled_window">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="sat_update_srv_view">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">update_service_store</property>
|
||||
<property name="search_column">1</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="srv_view_servcie_column">
|
||||
<property name="title" translatable="yes">Service</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="srv_picon_renderer">
|
||||
<property name="xpad">2</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="pixbuf">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="srv_service_renderer">
|
||||
<property name="xalign">0.0099999997764825821</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="srv_view_package_column">
|
||||
<property name="title" translatable="yes">Package</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="srv_package_renderer">
|
||||
<property name="ellipsize">end</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">2</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="srv_view_type_column">
|
||||
<property name="title" translatable="yes">Type</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="srv_type_renderer">
|
||||
<property name="xalign">0.49000000953674316</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">3</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="srv_view_sid_column">
|
||||
<property name="title" translatable="yes">SID</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="srv_sid_renderer">
|
||||
<property name="xalign">0.49000000953674316</property>
|
||||
</object>
|
||||
<attributes>
|
||||
<attribute name="text">4</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="srv_view_cas_column">
|
||||
<property name="title" translatable="yes">CAS</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="alignment">0.5</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText" id="srv_cas_renderer">
|
||||
<property name="xalign">0.49000000953674316</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">4</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -1875,7 +2123,6 @@ Author: Dmitriy Yefremov
|
||||
<property name="margin_right">1</property>
|
||||
<property name="margin_top">2</property>
|
||||
<property name="margin_bottom">2</property>
|
||||
<property name="resize_toplevel">True</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="text_view_scrolled_window">
|
||||
<property name="height_request">120</property>
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import concurrent.futures
|
||||
import re
|
||||
import time
|
||||
import concurrent.futures
|
||||
from math import fabs
|
||||
|
||||
from gi.repository import GLib
|
||||
|
||||
from app.commons import run_idle, run_task
|
||||
from app.commons import run_idle, run_task, log
|
||||
from app.eparser import get_satellites, write_satellites, Satellite, Transponder
|
||||
from app.eparser.ecommons import PLS_MODE, get_key_by_value
|
||||
from app.tools.satellites import SatellitesParser, SatelliteSource
|
||||
from .dialogs import show_dialog, DialogType, get_dialogs_string, get_chooser_dialog
|
||||
from app.tools.satellites import SatellitesParser, SatelliteSource, ServicesParser
|
||||
from .dialogs import show_dialog, DialogType, get_dialogs_string, get_chooser_dialog, get_message
|
||||
from .main_helper import move_items, scroll_to, append_text_to_tview, get_base_model, on_popup_menu
|
||||
from .search import SearchProvider
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, TEXT_DOMAIN, MOVE_KEYS, KeyboardKey, IS_GNOME_SESSION, MOD_MASK
|
||||
@@ -280,7 +280,7 @@ class SatellitesDialog:
|
||||
|
||||
@run_idle
|
||||
def on_update(self, item):
|
||||
SatellitesUpdateDialog(self._window, self._sat_view.get_model()).show()
|
||||
SatellitesUpdateDialog(self._window, self._settings, self._sat_view.get_model()).show()
|
||||
|
||||
@staticmethod
|
||||
def parse_data(model, path, itr, sats):
|
||||
@@ -327,7 +327,7 @@ class TransponderDialog:
|
||||
self._pls_code_entry = builder.get_object("pls_code_entry")
|
||||
self._is_id_entry = builder.get_object("is_id_entry")
|
||||
# pattern for frequency and rate entries (only digits)
|
||||
self._pattern = re.compile("\D")
|
||||
self._pattern = re.compile(r"\D")
|
||||
# style
|
||||
self._style_provider = Gtk.CssProvider()
|
||||
self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css")
|
||||
@@ -429,16 +429,17 @@ class SatelliteDialog:
|
||||
return Satellite(name=name, flags="0", position=pos, transponders=None)
|
||||
|
||||
|
||||
# ***************** Satellite update dialog *******************#
|
||||
# ********************** Update dialogs ************************ #
|
||||
|
||||
class SatellitesUpdateDialog:
|
||||
""" Dialog for update satellites over internet """
|
||||
class UpdateDialog:
|
||||
""" Base dialog for update satellites, transponders and services from the web."""
|
||||
|
||||
def __init__(self, transient, main_model):
|
||||
def __init__(self, transient, settings, title=None):
|
||||
handlers = {"on_update_satellites_list": self.on_update_satellites_list,
|
||||
"on_receive_satellites_list": self.on_receive_satellites_list,
|
||||
"on_receive_data": self.on_receive_data,
|
||||
"on_cancel_receive": self.on_cancel_receive,
|
||||
"on_selected_toggled": self.on_selected_toggled,
|
||||
"on_satellite_toggled": self.on_satellite_toggled,
|
||||
"on_transponder_toggled": self.on_transponder_toggled,
|
||||
"on_info_bar_close": self.on_info_bar_close,
|
||||
"on_filter_toggled": self.on_filter_toggled,
|
||||
"on_find_toggled": self.on_find_toggled,
|
||||
@@ -451,6 +452,11 @@ class SatellitesUpdateDialog:
|
||||
"on_search_up": self.on_search_up,
|
||||
"on_quit": self.on_quit}
|
||||
|
||||
self._settings = settings
|
||||
self._download_task = False
|
||||
self._parser = None
|
||||
self._size_name = "{}_window_size".format("_".join(re.findall("[A-Z][^A-Z]*", self.__class__.__name__))).lower()
|
||||
|
||||
builder = Gtk.Builder()
|
||||
builder.set_translation_domain(TEXT_DOMAIN)
|
||||
builder.add_objects_from_file(UI_RESOURCES_PATH + "satellites_dialog.glade",
|
||||
@@ -458,20 +464,26 @@ class SatellitesUpdateDialog:
|
||||
"update_sat_list_model_filter", "update_sat_list_model_sort", "side_store",
|
||||
"pos_adjustment", "pos_adjustment2", "satellites_update_popup_menu",
|
||||
"remove_selection_image", "sat_update_cancel_image", "sat_receive_image",
|
||||
"sat_update_filter_image", "sat_update_search_image", "sat_update_image"))
|
||||
"sat_update_filter_image", "sat_update_search_image", "sat_update_image",
|
||||
"update_transponder_store", "update_service_store"))
|
||||
builder.connect_signals(handlers)
|
||||
|
||||
self._window = builder.get_object("satellites_update_window")
|
||||
self._window.set_transient_for(transient)
|
||||
self._main_model = main_model
|
||||
# self._dialog.get_content_area().set_border_width(0)
|
||||
if title:
|
||||
self._window.set_title(title)
|
||||
|
||||
self._transponder_paned = builder.get_object("sat_update_tr_paned")
|
||||
self._sat_view = builder.get_object("sat_update_tree_view")
|
||||
self._transponder_view = builder.get_object("sat_update_tr_view")
|
||||
self._service_view = builder.get_object("sat_update_srv_view")
|
||||
self._source_box = builder.get_object("source_combo_box")
|
||||
self._sat_update_expander = builder.get_object("sat_update_expander")
|
||||
self._text_view = builder.get_object("text_view")
|
||||
self._receive_button = builder.get_object("receive_sat_list_tool_button")
|
||||
self._receive_button = builder.get_object("receive_data_button")
|
||||
self._sat_update_info_bar = builder.get_object("sat_update_info_bar")
|
||||
self._info_bar_message_label = builder.get_object("info_bar_message_label")
|
||||
self._receive_button.bind_property("visible", builder.get_object("cancel_data_button"), "visible", 4)
|
||||
# Filter
|
||||
self._filter_bar = builder.get_object("sat_update_filter_bar")
|
||||
self._from_pos_button = builder.get_object("from_pos_button")
|
||||
@@ -487,21 +499,31 @@ class SatellitesUpdateDialog:
|
||||
builder.get_object("sat_update_search_down_button"),
|
||||
builder.get_object("sat_update_search_up_button"))
|
||||
|
||||
self._download_task = False
|
||||
self._parser = None
|
||||
window_size = self._settings.get(self._size_name)
|
||||
if window_size:
|
||||
self._window.resize(*window_size)
|
||||
|
||||
def show(self):
|
||||
self._window.show()
|
||||
|
||||
@property
|
||||
def is_download(self):
|
||||
return self._download_task
|
||||
|
||||
@is_download.setter
|
||||
def is_download(self, value):
|
||||
self._download_task = value
|
||||
self._receive_button.set_visible(not value)
|
||||
|
||||
@run_idle
|
||||
def on_update_satellites_list(self, item):
|
||||
if self._download_task:
|
||||
if self.is_download:
|
||||
show_dialog(DialogType.ERROR, self._window, "The task is already running!")
|
||||
return
|
||||
|
||||
model = get_base_model(self._sat_view.get_model())
|
||||
model.clear()
|
||||
self._download_task = True
|
||||
self.is_download = True
|
||||
src = self._source_box.get_active()
|
||||
if not self._parser:
|
||||
self._parser = SatellitesParser()
|
||||
@@ -513,7 +535,7 @@ class SatellitesUpdateDialog:
|
||||
sats = self._parser.get_satellites_list(SatelliteSource.FLYSAT if src == 0 else SatelliteSource.LYNGSAT)
|
||||
if sats:
|
||||
callback(sats)
|
||||
self._download_task = False
|
||||
self.is_download = False
|
||||
|
||||
@run_idle
|
||||
def append_satellites(self, sats):
|
||||
@@ -522,70 +544,16 @@ class SatellitesUpdateDialog:
|
||||
model.append(sat)
|
||||
|
||||
@run_idle
|
||||
def on_receive_satellites_list(self, item):
|
||||
if self._download_task:
|
||||
def on_receive_data(self, item):
|
||||
if self.is_download:
|
||||
show_dialog(DialogType.ERROR, self._window, "The task is already running!")
|
||||
return
|
||||
self.receive_satellites()
|
||||
|
||||
@run_task
|
||||
def receive_satellites(self):
|
||||
self._download_task = True
|
||||
self.update_expander()
|
||||
model = self._sat_view.get_model()
|
||||
start = time.time()
|
||||
|
||||
with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor:
|
||||
text = "Processing: {}\n"
|
||||
sats = []
|
||||
appender = self.append_output()
|
||||
next(appender)
|
||||
futures = {executor.submit(self._parser.get_satellite, sat[:-1]): sat for sat in [r for r in model if r[4]]}
|
||||
for future in concurrent.futures.as_completed(futures):
|
||||
if not self._download_task:
|
||||
self._download_task = True
|
||||
executor.shutdown()
|
||||
appender.send("\nCanceled\n")
|
||||
appender.close()
|
||||
self._download_task = False
|
||||
return
|
||||
data = future.result()
|
||||
appender.send(text.format(data[0]))
|
||||
sats.append(data)
|
||||
|
||||
appender.send("-" * 75 + "\n")
|
||||
appender.send("Consumed : {:0.0f}s, {} satellites received.".format(start - time.time(), len(sats)))
|
||||
appender.close()
|
||||
|
||||
sats = {s[2]: s for s in sats} # key = position, v = satellite
|
||||
|
||||
for row in self._main_model:
|
||||
pos = row[-1]
|
||||
if pos in sats:
|
||||
sat = sats.pop(pos)
|
||||
itr = row.iter
|
||||
self.update_satellite(itr, row, sat)
|
||||
|
||||
for sat in sats.values():
|
||||
append_satellite(self._main_model, sat)
|
||||
|
||||
self._download_task = False
|
||||
|
||||
@run_idle
|
||||
def update_expander(self):
|
||||
self._sat_update_expander.set_expanded(True)
|
||||
self._text_view.get_buffer().set_text("", 0)
|
||||
|
||||
@run_idle
|
||||
def update_satellite(self, itr, row, sat):
|
||||
if self._main_model.iter_has_child(itr):
|
||||
children = row.iterchildren()
|
||||
for ch in children:
|
||||
self._main_model.remove(ch.iter)
|
||||
|
||||
for tr in sat[3]:
|
||||
self._main_model.append(itr, ["Transponder:", *tr, None, None])
|
||||
|
||||
def append_output(self):
|
||||
@run_idle
|
||||
def append(t):
|
||||
@@ -598,11 +566,15 @@ class SatellitesUpdateDialog:
|
||||
def on_cancel_receive(self, item=None):
|
||||
self._download_task = False
|
||||
|
||||
def on_selected_toggled(self, toggle, path):
|
||||
def on_satellite_toggled(self, toggle, path):
|
||||
model = self._sat_view.get_model()
|
||||
self.update_state(model, path, not toggle.get_active())
|
||||
self.update_receive_button_state(self._filter_model)
|
||||
|
||||
def on_transponder_toggled(self, toggle, path):
|
||||
model = self._transponder_view.get_model()
|
||||
model.set_value(model.get_iter(path), 2, not toggle.get_active())
|
||||
|
||||
@run_idle
|
||||
def update_receive_button_state(self, model):
|
||||
self._receive_button.set_sensitive((any(r[4] for r in model)))
|
||||
@@ -627,7 +599,7 @@ class SatellitesUpdateDialog:
|
||||
self._filter_positions = self.get_positions()
|
||||
self._filter_model.refilter()
|
||||
|
||||
def filter_function(self, model, iter, data):
|
||||
def filter_function(self, model, itr, data):
|
||||
if self._filter_model is None or self._filter_model == "None":
|
||||
return True
|
||||
|
||||
@@ -638,7 +610,7 @@ class SatellitesUpdateDialog:
|
||||
if from_pos > to_pos:
|
||||
from_pos, to_pos = to_pos, from_pos
|
||||
|
||||
return from_pos <= float(self._parser.get_position(model.get(iter, 1)[0])) <= to_pos
|
||||
return from_pos <= float(self._parser.get_position(model.get(itr, 1)[0])) <= to_pos
|
||||
|
||||
def get_positions(self):
|
||||
from_pos = round(self._from_pos_button.get_value(), 1) * (-1 if self._filter_from_combo_box.get_active() else 1)
|
||||
@@ -671,10 +643,298 @@ class SatellitesUpdateDialog:
|
||||
self._filter_model.get_model().set_value(itr, 4, select)
|
||||
|
||||
def on_quit(self, window, event):
|
||||
self._download_task = False
|
||||
self._settings.add(self._size_name, window.get_size())
|
||||
self.is_download = False
|
||||
|
||||
|
||||
# ***************** Commons *******************#
|
||||
class SatellitesUpdateDialog(UpdateDialog):
|
||||
""" Dialog for update satellites from the web. """
|
||||
|
||||
def __init__(self, transient, settings, main_model):
|
||||
super().__init__(transient=transient, settings=settings)
|
||||
|
||||
self._main_model = main_model
|
||||
|
||||
@run_idle
|
||||
def on_receive_data(self, item):
|
||||
if self.is_download:
|
||||
show_dialog(DialogType.ERROR, self._window, "The task is already running!")
|
||||
return
|
||||
|
||||
self.receive_satellites()
|
||||
|
||||
@run_task
|
||||
def receive_satellites(self):
|
||||
self.is_download = True
|
||||
self.update_expander()
|
||||
model = self._sat_view.get_model()
|
||||
start = time.time()
|
||||
|
||||
with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor:
|
||||
text = "Processing: {}\n"
|
||||
sats = []
|
||||
appender = self.append_output()
|
||||
next(appender)
|
||||
futures = {executor.submit(self._parser.get_satellite, sat[:-1]): sat for sat in [r for r in model if r[4]]}
|
||||
for future in concurrent.futures.as_completed(futures):
|
||||
if not self.is_download:
|
||||
self.is_download = True
|
||||
executor.shutdown()
|
||||
appender.send("\nCanceled\n")
|
||||
appender.close()
|
||||
self.is_download = False
|
||||
return
|
||||
data = future.result()
|
||||
appender.send(text.format(data[0]))
|
||||
sats.append(data)
|
||||
|
||||
appender.send("-" * 75 + "\n")
|
||||
appender.send("Consumed: {:0.0f}s, {} satellites received.".format(time.time() - start, len(sats)))
|
||||
appender.close()
|
||||
|
||||
sats = {s[2]: s for s in sats} # key = position, v = satellite
|
||||
|
||||
for row in self._main_model:
|
||||
pos = row[-1]
|
||||
if pos in sats:
|
||||
sat = sats.pop(pos)
|
||||
itr = row.iter
|
||||
self.update_satellite(itr, row, sat)
|
||||
|
||||
for sat in sats.values():
|
||||
append_satellite(self._main_model, sat)
|
||||
|
||||
self.is_download = False
|
||||
|
||||
@run_idle
|
||||
def update_satellite(self, itr, row, sat):
|
||||
if self._main_model.iter_has_child(itr):
|
||||
children = row.iterchildren()
|
||||
for ch in children:
|
||||
self._main_model.remove(ch.iter)
|
||||
|
||||
for tr in sat[3]:
|
||||
self._main_model.append(itr, ["Transponder:", *tr, None, None])
|
||||
|
||||
|
||||
class ServicesUpdateDialog(UpdateDialog):
|
||||
""" Dialog for updating services from the web. """
|
||||
|
||||
def __init__(self, transient, settings, callback):
|
||||
super().__init__(transient=transient, settings=settings, title="Services update")
|
||||
|
||||
self._callback = callback
|
||||
self._satellite_paths = {}
|
||||
self._transponders = {}
|
||||
self._services = {}
|
||||
self._selected_transponders = set()
|
||||
self._services_parser = ServicesParser(source=SatelliteSource.LYNGSAT)
|
||||
|
||||
self._transponder_paned.set_visible(True)
|
||||
s_model = self._source_box.get_model()
|
||||
s_model.remove(s_model.get_iter_first())
|
||||
self._source_box.set_active(0)
|
||||
# Transponder view popup menu
|
||||
tr_popup_menu = Gtk.Menu()
|
||||
select_all_item = Gtk.ImageMenuItem.new_from_stock("gtk-select-all")
|
||||
select_all_item.connect("activate", lambda w: self.update_transponder_selection(True))
|
||||
tr_popup_menu.append(select_all_item)
|
||||
remove_selection_item = Gtk.ImageMenuItem.new_from_stock("gtk-undo")
|
||||
remove_selection_item.set_label(get_message("Remove selection"))
|
||||
remove_selection_item.connect("activate", lambda w: self.update_transponder_selection(False))
|
||||
tr_popup_menu.append(remove_selection_item)
|
||||
tr_popup_menu.show_all()
|
||||
|
||||
self._sat_view.connect("row-activated", self.on_activate_satellite)
|
||||
self._transponder_view.connect("row-activated", self.on_activate_transponder)
|
||||
self._transponder_view.connect("button-press-event", lambda w, e: on_popup_menu(tr_popup_menu, e))
|
||||
self._transponder_view.connect("select_all", lambda w: self.update_transponder_selection(True))
|
||||
|
||||
@run_idle
|
||||
def on_receive_data(self, item):
|
||||
if self.is_download:
|
||||
show_dialog(DialogType.ERROR, self._window, "The task is already running!")
|
||||
return
|
||||
|
||||
self.receive_services()
|
||||
|
||||
@run_task
|
||||
def receive_services(self):
|
||||
self.is_download = True
|
||||
self.update_expander()
|
||||
model = self._sat_view.get_model()
|
||||
appender = self.append_output()
|
||||
next(appender)
|
||||
|
||||
start = time.time()
|
||||
non_cached_sats = []
|
||||
sat_names = {}
|
||||
t_names = {}
|
||||
t_urls = []
|
||||
services = []
|
||||
|
||||
for r in (r for r in model if r[-1]):
|
||||
if not self.is_download:
|
||||
appender.send("\nCanceled\n")
|
||||
return
|
||||
|
||||
sat, url = r[0], r[3]
|
||||
trs = self._transponders.get(url, None)
|
||||
if trs:
|
||||
for t in filter(lambda tp: tp.url in self._selected_transponders, trs):
|
||||
t_urls.append(t.url)
|
||||
t_names[t.url] = t.text
|
||||
else:
|
||||
non_cached_sats.append(url)
|
||||
sat_names[url] = sat
|
||||
|
||||
if non_cached_sats:
|
||||
with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor:
|
||||
futures = {executor.submit(self._services_parser.get_transponders_links, u): u for u in non_cached_sats}
|
||||
for future in concurrent.futures.as_completed(futures):
|
||||
if not self.is_download:
|
||||
appender.send("\nCanceled.\n")
|
||||
self.is_download = False
|
||||
return
|
||||
|
||||
appender.send("Getting transponders for: {}.\n".format(sat_names.get(futures[future])))
|
||||
for t in future.result():
|
||||
t_urls.append(t.url)
|
||||
t_names[t.url] = t.text
|
||||
|
||||
appender.send("-" * 75 + "\n")
|
||||
appender.send("{} transponders received.\n\n".format(len(t_urls)))
|
||||
|
||||
non_cached_ts = []
|
||||
for tr in t_urls:
|
||||
srvs = self._services.get(tr)
|
||||
services.extend(srvs) if srvs else non_cached_ts.append(tr)
|
||||
|
||||
if non_cached_ts:
|
||||
with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor:
|
||||
futures = {executor.submit(self._services_parser.get_transponder_services, u): u for u in non_cached_ts}
|
||||
for future in concurrent.futures.as_completed(futures):
|
||||
if not self.is_download:
|
||||
appender.send("\nCanceled.\n")
|
||||
self.is_download = False
|
||||
return
|
||||
|
||||
appender.send("Getting services for: {}.\n".format(t_names.get(futures[future], "")))
|
||||
list(map(services.append, future.result()))
|
||||
|
||||
appender.send("-" * 75 + "\n")
|
||||
appender.send("Consumed: {:0.0f}s, {} services received.".format(time.time() - start, len(services)))
|
||||
|
||||
try:
|
||||
from app.eparser.enigma.lamedb import get_services_lines, get_services_list
|
||||
# Used for double checking!
|
||||
srvs = get_services_list("".join(get_services_lines(services)))
|
||||
except ValueError as e:
|
||||
log("ServicesUpdateDialog [on receive data] error: {}".format(e))
|
||||
else:
|
||||
self._callback(srvs)
|
||||
|
||||
self.is_download = False
|
||||
|
||||
@run_task
|
||||
def get_sat_list(self, src, callback):
|
||||
sats = self._parser.get_satellites_list(SatelliteSource.LYNGSAT)
|
||||
if sats:
|
||||
callback(sats)
|
||||
self.is_download = False
|
||||
|
||||
def on_satellite_toggled(self, toggle, path):
|
||||
model = self._sat_view.get_model()
|
||||
self.update_state(model, path, not toggle.get_active())
|
||||
self.update_receive_button_state(self._filter_model)
|
||||
|
||||
url = model.get_value(model.get_iter(path), 3)
|
||||
selected = toggle.get_active()
|
||||
transponders = self._transponders.get(url, None)
|
||||
|
||||
if transponders:
|
||||
for t in transponders:
|
||||
self._selected_transponders.add(t.url) if selected else self._selected_transponders.discard(t.url)
|
||||
|
||||
def on_transponder_toggled(self, toggle, path):
|
||||
model = self._transponder_view.get_model()
|
||||
itr = model.get_iter(path)
|
||||
active = not toggle.get_active()
|
||||
url = self.update_transponder_state(itr, model, active)
|
||||
|
||||
s_path = self._satellite_paths.get(url, None)
|
||||
if s_path:
|
||||
self.update_sat_state(model, s_path, active)
|
||||
|
||||
def update_sat_state(self, model, path, active):
|
||||
sat_model = self._sat_view.get_model()
|
||||
if active:
|
||||
self.update_state(sat_model, path, active)
|
||||
else:
|
||||
self.update_state(sat_model, path, any((r[-1] for r in model)))
|
||||
self.update_receive_button_state(self._filter_model)
|
||||
|
||||
def update_transponder_state(self, itr, model, active):
|
||||
model.set_value(itr, 2, active)
|
||||
url = model.get_value(itr, 1)
|
||||
self._selected_transponders.add(url) if active else self._selected_transponders.discard(url)
|
||||
return url
|
||||
|
||||
@run_task
|
||||
def on_activate_satellite(self, view, path, column):
|
||||
model = view.get_model()
|
||||
itr = model.get_iter(path)
|
||||
url, selected = model.get_value(itr, 3), model.get_value(itr, 4)
|
||||
transponders = self._transponders.get(url, None)
|
||||
if transponders is None:
|
||||
GLib.idle_add(view.set_sensitive, False)
|
||||
transponders = self._services_parser.get_transponders_links(url)
|
||||
self._transponders[url] = transponders
|
||||
|
||||
for t in transponders:
|
||||
t_url = t.url
|
||||
self._satellite_paths[t_url] = path
|
||||
self._selected_transponders.add(t_url) if selected else self._selected_transponders.discard(t_url)
|
||||
|
||||
self.append_transponders(self._transponder_view.get_model(), transponders)
|
||||
|
||||
@run_idle
|
||||
def append_transponders(self, model, trs_list):
|
||||
model.clear()
|
||||
list(map(model.append, [(t.text, t.url, t.url in self._selected_transponders) for t in trs_list]))
|
||||
self._sat_view.set_sensitive(True)
|
||||
|
||||
@run_task
|
||||
def on_activate_transponder(self, view, path, column):
|
||||
url = view.get_model()[path][1]
|
||||
services = self._services.get(url, None)
|
||||
if services is None:
|
||||
GLib.idle_add(view.set_sensitive, False)
|
||||
services = self._services_parser.get_transponder_services(url)
|
||||
self._services[url] = services
|
||||
|
||||
self.append_services(self._service_view.get_model(), services)
|
||||
|
||||
@run_idle
|
||||
def append_services(self, model, srv_list):
|
||||
model.clear()
|
||||
for s in srv_list:
|
||||
model.append((None, s.service, s.package, s.service_type, str(s.ssid), None))
|
||||
|
||||
self._transponder_view.set_sensitive(True)
|
||||
|
||||
def update_transponder_selection(self, select):
|
||||
m = self._transponder_view.get_model()
|
||||
if not len(m):
|
||||
return
|
||||
|
||||
s_path = self._satellite_paths.get({self.update_transponder_state(r.iter, m, select) for r in m}.pop(), None)
|
||||
if s_path:
|
||||
self.update_sat_state(m, s_path, select)
|
||||
|
||||
|
||||
# ************************* Commons ************************* #
|
||||
|
||||
|
||||
@run_idle
|
||||
def append_satellite(model, sat):
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import re
|
||||
import os
|
||||
import re
|
||||
|
||||
from app.commons import run_idle
|
||||
from app.eparser import Service
|
||||
from app.eparser.ecommons import MODULATION, Inversion, ROLL_OFF, Pilot, Flag, Pids, POLARIZATION, \
|
||||
get_key_by_value, get_value_by_name, FEC_DEFAULT, PLS_MODE, SERVICE_TYPE, T_MODULATION, C_MODULATION, TrType, \
|
||||
SystemCable, T_SYSTEM, BANDWIDTH, TRANSMISSION_MODE, GUARD_INTERVAL, HIERARCHY, T_FEC
|
||||
from app.eparser.ecommons import (MODULATION, Inversion, ROLL_OFF, Pilot, Flag, Pids, POLARIZATION, get_key_by_value,
|
||||
get_value_by_name, FEC_DEFAULT, PLS_MODE, SERVICE_TYPE, T_MODULATION, C_MODULATION,
|
||||
TrType, SystemCable, T_SYSTEM, BANDWIDTH, TRANSMISSION_MODE, GUARD_INTERVAL, T_FEC,
|
||||
HIERARCHY)
|
||||
from app.settings import SettingsType
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, HIDE_ICON, TEXT_DOMAIN, CODED_ICON, Column, IS_GNOME_SESSION
|
||||
from .dialogs import show_dialog, DialogType, Action, get_dialogs_string
|
||||
from .main_helper import get_base_model
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, HIDE_ICON, TEXT_DOMAIN, CODED_ICON, Column, IS_GNOME_SESSION
|
||||
|
||||
_UI_PATH = UI_RESOURCES_PATH + "service_details_dialog.glade"
|
||||
|
||||
@@ -438,14 +439,17 @@ class ServiceDetailsDialog:
|
||||
def update_fav_view(self, old_service, new_service):
|
||||
model = self._fav_view.get_model()
|
||||
for row in filter(lambda r: old_service.fav_id == r[7], model):
|
||||
model.set(row.iter, {1: new_service.coded,
|
||||
2: new_service.service,
|
||||
3: new_service.locked,
|
||||
4: new_service.hide,
|
||||
5: new_service.service_type,
|
||||
6: new_service.pos,
|
||||
7: new_service.fav_id,
|
||||
8: new_service.picon})
|
||||
itr = row.iter
|
||||
if not model.get_value(itr, Column.FAV_BACKGROUND):
|
||||
model.set_value(itr, Column.FAV_SERVICE, new_service.service)
|
||||
|
||||
model.set(itr, {Column.FAV_CODED: new_service.coded,
|
||||
Column.FAV_LOCKED: new_service.locked,
|
||||
Column.FAV_HIDE: new_service.hide,
|
||||
Column.FAV_TYPE: new_service.service_type,
|
||||
Column.FAV_POS: new_service.pos,
|
||||
Column.FAV_ID: new_service.fav_id,
|
||||
Column.FAV_PICON: new_service.picon})
|
||||
|
||||
def update_picon_name(self, old_name, new_name):
|
||||
if not os.path.isdir(self._picons_dir_path):
|
||||
|
||||
@@ -972,6 +972,8 @@ Author: Dmitriy Yefremov
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="width_chars">12</property>
|
||||
<property name="max_width_chars">15</property>
|
||||
<property name="primary_icon_name">emblem-readonly</property>
|
||||
@@ -2105,6 +2107,7 @@ Author: Dmitriy Yefremov
|
||||
<item id="pl_PL" translatable="yes">Polski</item>
|
||||
<item id="pt_PT" translatable="yes">Português</item>
|
||||
<item id="tr_TR" translatable="yes">Türkçe</item>
|
||||
<item id="be_BY" translatable="yes">Беларуская</item>
|
||||
<item id="ru_RU" translatable="yes">Русский</item>
|
||||
</items>
|
||||
<signal name="changed" handler="on_lang_changed" swapped="no"/>
|
||||
|
||||
@@ -7,10 +7,35 @@
|
||||
margin: 0.1em;
|
||||
}
|
||||
|
||||
.red-button {
|
||||
background-image: none;
|
||||
background-color: red;
|
||||
}
|
||||
|
||||
.green-button {
|
||||
background-image: none;
|
||||
background-color: green;
|
||||
}
|
||||
|
||||
.yellow-button {
|
||||
background-image: none;
|
||||
background-color: yellow;
|
||||
}
|
||||
|
||||
.blue-button {
|
||||
background-image: none;
|
||||
background-color: blue;
|
||||
}
|
||||
|
||||
#textview-large {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.time-entry {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.group {}
|
||||
|
||||
.group :first-child {
|
||||
@@ -23,10 +48,11 @@
|
||||
.group :last-child {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-left-width: 0;
|
||||
}
|
||||
|
||||
.group :not(:first-child):not(:last-child) {
|
||||
border-radius: 0;
|
||||
border-left-width: 0;
|
||||
border-right-width: 0;
|
||||
border-right-width: 1px;
|
||||
}
|
||||
141
app/ui/timer_row.glade
Normal file
141
app/ui/timer_row.glade
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.2 -->
|
||||
<interface domain="demon-editor">
|
||||
<requires lib="gtk+" version="3.16"/>
|
||||
<object class="GtkBox" id="timer_row_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">2</property>
|
||||
<property name="margin_right">2</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="timer_name_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="timer_name_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="semibold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="timer_description_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="timer_description_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<attributes>
|
||||
<attribute name="style" value="italic"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="timer_service_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="timer_service_name_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="ellipsize">end</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="timer_time_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8000"/>
|
||||
</attributes>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="timer_row_separator">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -6,7 +6,7 @@ from gi.repository import GLib
|
||||
|
||||
from app.commons import log
|
||||
from app.settings import IS_DARWIN
|
||||
from app.connections import HttpRequestType
|
||||
from app.connections import HttpAPI
|
||||
from app.tools.yt import YouTube
|
||||
from app.ui.iptv import get_yt_icon
|
||||
from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH
|
||||
@@ -128,7 +128,7 @@ class LinksTransmitter:
|
||||
else:
|
||||
self._url_entry.set_icon_from_stock(Gtk.EntryIconPosition.SECONDARY, None)
|
||||
|
||||
self._http_api.send(HttpRequestType.PLAY, url, self.on_done, self.__STREAM_PREFIX)
|
||||
self._http_api.send(HttpAPI.Request.PLAY, url, self.on_done, self.__STREAM_PREFIX)
|
||||
yield True
|
||||
|
||||
def on_done(self, res):
|
||||
@@ -138,21 +138,21 @@ class LinksTransmitter:
|
||||
GLib.idle_add(self._tool_bar.set_sensitive, True)
|
||||
|
||||
def on_previous(self, item):
|
||||
self._http_api.send(HttpRequestType.PLAYER_PREV, None, self.on_done)
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_PREV, None, self.on_done)
|
||||
|
||||
def on_next(self, item):
|
||||
self._http_api.send(HttpRequestType.PLAYER_NEXT, None, self.on_done)
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_NEXT, None, self.on_done)
|
||||
|
||||
def on_play(self, item):
|
||||
self._http_api.send(HttpRequestType.PLAYER_PLAY, None, self.on_done)
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_PLAY, None, self.on_done)
|
||||
|
||||
def on_stop(self, item):
|
||||
self._http_api.send(HttpRequestType.PLAYER_STOP, None, self.on_done)
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_STOP, None, self.on_done)
|
||||
|
||||
def on_clear(self, item):
|
||||
""" Remove added links in the playlist. """
|
||||
GLib.idle_add(self._tool_bar.set_sensitive, False)
|
||||
self._http_api.send(HttpRequestType.PLAYER_LIST, None, self.clear_playlist)
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_LIST, None, self.clear_playlist)
|
||||
|
||||
def clear_playlist(self, res):
|
||||
GLib.idle_add(self._tool_bar.set_sensitive, not res)
|
||||
@@ -163,7 +163,7 @@ class LinksTransmitter:
|
||||
|
||||
for ref in res:
|
||||
GLib.idle_add(self._tool_bar.set_sensitive, False)
|
||||
self._http_api.send(HttpRequestType.PLAYER_REMOVE,
|
||||
self._http_api.send(HttpAPI.Request.PLAYER_REMOVE,
|
||||
ref.get("e2servicereference", ""),
|
||||
self.on_done,
|
||||
self.__STREAM_PREFIX)
|
||||
|
||||
1161
po/be/demon-editor.po
Normal file
1161
po/be/demon-editor.po
Normal file
File diff suppressed because it is too large
Load Diff
@@ -105,6 +105,9 @@ msgstr "Standardbezeichnung setzen"
|
||||
msgid "Insert marker"
|
||||
msgstr "Marker einfügen"
|
||||
|
||||
msgid "Insert space"
|
||||
msgstr "Leerzeichen einfügen"
|
||||
|
||||
msgid "Locate in services"
|
||||
msgstr "In den Diensten suchen"
|
||||
|
||||
@@ -160,7 +163,7 @@ msgid "Remove"
|
||||
msgstr "Entfernen"
|
||||
|
||||
msgid "Remove all unavailable"
|
||||
msgstr "Entfernt alle nicht verfügbaren"
|
||||
msgstr "Entfernen alle nicht verfügbaren"
|
||||
|
||||
msgid "Satellites editor"
|
||||
msgstr "Satelliten-Editor"
|
||||
@@ -201,8 +204,8 @@ msgstr "Aktueller Datenpfad:"
|
||||
msgid "Data:"
|
||||
msgstr "Daten:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Enigma2 Kanal- und Satellitenlisteneditor für GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Enigma2 Kanal- und Satellitenlisteneditor für GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Host:"
|
||||
@@ -516,6 +519,9 @@ msgstr "Bitte wählen Sie nur einen Eintrag aus!"
|
||||
msgid "No png file is selected!"
|
||||
msgstr "Es ist keine png-Datei ausgewählt!"
|
||||
|
||||
msgid "No profile selected!"
|
||||
msgstr "Kein Profil ausgewählt!"
|
||||
|
||||
msgid "No reference is present!"
|
||||
msgstr "Es liegt keine Referenz vor!"
|
||||
|
||||
@@ -1035,6 +1041,134 @@ msgstr "Kann nicht abgespielt werden!"
|
||||
msgid "Enable Dark Mode"
|
||||
msgstr "Dunkelmodus aktivieren"
|
||||
|
||||
msgid "Extract..."
|
||||
msgstr "Entpacken..."
|
||||
|
||||
msgid "Unsupported format!"
|
||||
msgstr "Nicht unterstütztes Format!"
|
||||
|
||||
msgid "Combine with the current data?"
|
||||
msgstr "Mit den aktuellen Daten kombinieren?"
|
||||
|
||||
msgid "Importing data done!"
|
||||
msgstr "Daten importieren erledigt!"
|
||||
|
||||
msgid "Current service"
|
||||
msgstr "Aktueller Service"
|
||||
|
||||
msgid "Open folder"
|
||||
msgstr "Ordner öffnen"
|
||||
|
||||
msgid "Open archive"
|
||||
msgstr "Archiv öffnen"
|
||||
|
||||
msgid "Import from Web"
|
||||
msgstr "Import aus dem Web"
|
||||
|
||||
msgid "Control"
|
||||
msgstr "Steuerung"
|
||||
|
||||
msgid "Timers"
|
||||
msgstr "Timers"
|
||||
|
||||
msgid "Timer"
|
||||
msgstr "Timer"
|
||||
|
||||
msgid "Add timer"
|
||||
msgstr "Timer hinzufügen"
|
||||
|
||||
msgid "Hr."
|
||||
msgstr "Std."
|
||||
|
||||
msgid "Min."
|
||||
msgstr "Min."
|
||||
|
||||
msgid "Power"
|
||||
msgstr "Power"
|
||||
|
||||
msgid "Standby"
|
||||
msgstr "Standby"
|
||||
|
||||
msgid "Wake Up"
|
||||
msgstr "Aufwachen"
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr "Neustarten"
|
||||
|
||||
msgid "Restart GUI"
|
||||
msgstr "GUI neustarten"
|
||||
|
||||
msgid "Shutdown"
|
||||
msgstr "Ausschalten"
|
||||
|
||||
msgid "Shut down"
|
||||
msgstr "Ausschalten"
|
||||
|
||||
msgid "Do Nothing"
|
||||
msgstr "Nichts tun"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "Auto"
|
||||
|
||||
msgid "Grab screenshot"
|
||||
msgstr "Screenshot schnappen"
|
||||
|
||||
msgid "Enabled:"
|
||||
msgstr "Aktiviert:"
|
||||
|
||||
msgid "Name:"
|
||||
msgstr "Name:"
|
||||
|
||||
msgid "Description:"
|
||||
msgstr "Beschreibung:"
|
||||
|
||||
msgid "Service:"
|
||||
msgstr "Service"
|
||||
|
||||
msgid "Service reference:"
|
||||
msgstr "Kanalreferenz"
|
||||
|
||||
msgid "Event ID:"
|
||||
msgstr "Ereignis-ID:"
|
||||
|
||||
msgid "Begins:"
|
||||
msgstr "Beginnt:"
|
||||
|
||||
msgid "Ends:"
|
||||
msgstr "Endet:"
|
||||
|
||||
msgid "Repeated:"
|
||||
msgstr "Wiederhole:"
|
||||
|
||||
msgid "Action:"
|
||||
msgstr "Aktion:"
|
||||
|
||||
msgid "After event:"
|
||||
msgstr "Nach dem Ereignis:"
|
||||
|
||||
msgid "Location:"
|
||||
msgstr "Zielverzeichnis:"
|
||||
|
||||
msgid "Mo"
|
||||
msgstr "Mo"
|
||||
|
||||
msgid "Tu"
|
||||
msgstr "Di"
|
||||
|
||||
msgid "We"
|
||||
msgstr "Mi"
|
||||
|
||||
msgid "Th"
|
||||
msgstr "Do"
|
||||
|
||||
msgid "Fr"
|
||||
msgstr "Fr"
|
||||
|
||||
msgid "Sa"
|
||||
msgstr "Sa"
|
||||
|
||||
msgid "Su"
|
||||
msgstr "So"
|
||||
|
||||
msgid "Set"
|
||||
msgstr "Einstellen"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2018-2020 Frank Neirynck
|
||||
# This file is distributed under the MIT license.
|
||||
#
|
||||
# Frank Neirynck <frank@insink.be>, 2018-2019.
|
||||
# Frank Neirynck <frank@insink.be>, 2018-2020.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
@@ -54,7 +54,7 @@ msgid "Current IP:"
|
||||
msgstr "IP actual:"
|
||||
|
||||
msgid "Assign"
|
||||
msgstr "Assignar"
|
||||
msgstr "Asignar"
|
||||
|
||||
msgid "Bouquet details"
|
||||
msgstr "Detalles bouquet"
|
||||
@@ -66,7 +66,7 @@ msgid "Copy"
|
||||
msgstr "Copiar"
|
||||
|
||||
msgid "Copy reference"
|
||||
msgstr "Copia de referencia"
|
||||
msgstr "Copiar referencia"
|
||||
|
||||
msgid "Download"
|
||||
msgstr "Descargar"
|
||||
@@ -123,7 +123,7 @@ msgid "New"
|
||||
msgstr "Nuevo"
|
||||
|
||||
msgid "New bouquet"
|
||||
msgstr "Bouquet nuevo"
|
||||
msgstr "Nuevo bouquet"
|
||||
|
||||
msgid "Create bouquet"
|
||||
msgstr "Crear bouquet"
|
||||
@@ -156,10 +156,10 @@ msgid "Picons"
|
||||
msgstr "Picons"
|
||||
|
||||
msgid "Picons downloader"
|
||||
msgstr "Descargar picons"
|
||||
msgstr "Descarga de picons"
|
||||
|
||||
msgid "Satellites downloader"
|
||||
msgstr "Descargar satélites"
|
||||
msgstr "Descarga de satélites"
|
||||
|
||||
msgid "Remove"
|
||||
msgstr "Quitar"
|
||||
@@ -206,11 +206,11 @@ msgstr "Ruta de datos actual:"
|
||||
msgid "Data:"
|
||||
msgstr "Datos:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Editor de canales y satélites Enigma2 para GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Editor de canales y satélites Enigma2 para GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Anfitrión:"
|
||||
msgstr "Host:"
|
||||
|
||||
msgid "Loading data..."
|
||||
msgstr "Cargando datos..."
|
||||
@@ -256,7 +256,7 @@ msgstr "Extra:"
|
||||
|
||||
# Filter bar
|
||||
msgid "Only free"
|
||||
msgstr "Solamente gratis"
|
||||
msgstr "Solamente libres"
|
||||
|
||||
msgid "All positions"
|
||||
msgstr "Todas las posiciones"
|
||||
@@ -272,10 +272,10 @@ msgid "Stop playback"
|
||||
msgstr "Detener la reproducción"
|
||||
|
||||
msgid "Previous stream in the list"
|
||||
msgstr "Anterior flujo en la lista"
|
||||
msgstr "Anterior stream en la lista"
|
||||
|
||||
msgid "Next stream in the list"
|
||||
msgstr "Siguiente flujo en la lista"
|
||||
msgstr "Siguiente stream en la lista"
|
||||
|
||||
msgid "Toggle in fullscreen"
|
||||
msgstr "Cambiar a pantalla completa"
|
||||
@@ -294,7 +294,7 @@ msgid "Receive picons"
|
||||
msgstr "Recibir picons"
|
||||
|
||||
msgid "Picons name format:"
|
||||
msgstr "Picons formato nombres:"
|
||||
msgstr "Formato del nombre de los picons:"
|
||||
|
||||
msgid "Resize:"
|
||||
msgstr "Redimensionar:"
|
||||
@@ -433,7 +433,7 @@ msgstr "Buscar"
|
||||
|
||||
# IPTV dialog
|
||||
msgid "Stream data"
|
||||
msgstr "Transmitir flujo"
|
||||
msgstr "Transmitir stream"
|
||||
|
||||
# IPTV list configuration dialog
|
||||
msgid "Starting values"
|
||||
@@ -443,7 +443,7 @@ msgid "Reset to default"
|
||||
msgstr "Restablecer a predeterminado"
|
||||
|
||||
msgid "IPTV streams list configuration"
|
||||
msgstr "Configurar lista de flujos IPTV"
|
||||
msgstr "Configurar lista de streams IPTV"
|
||||
|
||||
# Settings dialog
|
||||
msgid "Preferences"
|
||||
@@ -511,13 +511,13 @@ msgid "No m3u file is selected!"
|
||||
msgstr "¡No se ha seleccionado ningún fichero m3u!"
|
||||
|
||||
msgid "Not implemented yet!"
|
||||
msgstr "¡Aún sin implementar!"
|
||||
msgstr "¡No implementado!"
|
||||
|
||||
msgid "The text of marker is empty, please try again!"
|
||||
msgstr "¡El texto del marcador está vacío, inténtalo de nuevo!"
|
||||
|
||||
msgid "Please, select only one item!"
|
||||
msgstr "¡Por favor, seleccione sólo un elemento!"
|
||||
msgstr "¡Por favor, seleccione un único elemento!"
|
||||
|
||||
msgid "No png file is selected!"
|
||||
msgstr "¡No se ha seleccionado ningún fichero png!"
|
||||
@@ -526,7 +526,7 @@ msgid "No reference is present!"
|
||||
msgstr "¡Ninguna referencia presente!"
|
||||
|
||||
msgid "No selected item!"
|
||||
msgstr "¡Ningún elemento seleccionado!"
|
||||
msgstr "¡No se ha seleccionado ningún elemento!"
|
||||
|
||||
msgid "The task is already running!"
|
||||
msgstr "¡La tarea ya se está ejecutando!"
|
||||
@@ -562,23 +562,23 @@ msgid "Operation not allowed in this context!"
|
||||
msgstr "¡Operación no permitida en este contexto!"
|
||||
|
||||
msgid "No VLC is found. Check that it is installed!"
|
||||
msgstr "VLC no encontrado. ¡Verifique que está instalado!"
|
||||
msgstr "VLC no encontrado. ¡Compruebe que está instalado!"
|
||||
|
||||
# Search unavailable streams dialog
|
||||
msgid "Please wait, streams testing in progress..."
|
||||
msgstr "Por favor espere, hay una prueba de flujo en progreso..."
|
||||
msgstr "Por favor espere, hay una prueba de stream en progreso..."
|
||||
|
||||
msgid "Found"
|
||||
msgstr "Encontrado"
|
||||
|
||||
msgid "unavailable streams."
|
||||
msgstr "Flujos no presentes."
|
||||
msgstr "Streams no presentes."
|
||||
|
||||
msgid "No changes required!"
|
||||
msgstr "¡Ningún cambio requerido!"
|
||||
msgstr "¡No se requieren cambios!"
|
||||
|
||||
msgid "This list does not contains IPTV streams!"
|
||||
msgstr "¡La lista no contiene flujos IPTV!"
|
||||
msgstr "¡La lista no contiene streams IPTV!"
|
||||
|
||||
msgid "New empty configuration"
|
||||
msgstr "Nueva configuración vacía"
|
||||
@@ -672,7 +672,7 @@ msgid "Zap"
|
||||
msgstr "Zapear"
|
||||
|
||||
msgid "Play stream"
|
||||
msgstr "Reproducir flujo"
|
||||
msgstr "Reproducir stream"
|
||||
|
||||
msgid "Disabled"
|
||||
msgstr "Desactivado"
|
||||
@@ -690,7 +690,7 @@ msgid "Switch the channel and watch in the program(Ctrl + W)"
|
||||
msgstr "Poner el canal y ver en el programa (Ctrl + W)"
|
||||
|
||||
msgid "Play IPTV or other stream in the program(Ctrl + P)"
|
||||
msgstr "Reproducir IPTV u otro flujo en el programa (Ctrl + P)"
|
||||
msgstr "Reproducir IPTV u otro stream en el programa (Ctrl + P)"
|
||||
|
||||
msgid "Export to m3u"
|
||||
msgstr "Exportar a m3u"
|
||||
@@ -795,7 +795,7 @@ msgid "Language:"
|
||||
msgstr "Idioma:"
|
||||
|
||||
msgid "Load the last open configuration at program startup"
|
||||
msgstr "Cargar la última configuración abierta al iniciar el programa"
|
||||
msgstr "Cargar la última configuración usada al iniciar el programa"
|
||||
|
||||
msgid "Enable direct playback bar"
|
||||
msgstr "Habilitar la barra de reproducción directa"
|
||||
@@ -828,16 +828,16 @@ msgid "Reset"
|
||||
msgstr "Reset"
|
||||
|
||||
msgid "File"
|
||||
msgstr "Archivo"
|
||||
msgstr "Fichero"
|
||||
|
||||
msgid "Picons manager"
|
||||
msgstr "Picons manager"
|
||||
msgstr "Gestor de picons"
|
||||
|
||||
msgid "Explorer"
|
||||
msgstr "Explorador"
|
||||
|
||||
msgid "Satellite url:"
|
||||
msgstr "Url Satelite:"
|
||||
msgstr "Url satélite:"
|
||||
|
||||
msgid "Cut"
|
||||
msgstr "Cortar"
|
||||
@@ -867,43 +867,43 @@ msgid "IPTV tools"
|
||||
msgstr "Intrumentos IPTV"
|
||||
|
||||
msgid "Make profile folder as default for the additional data"
|
||||
msgstr "Has folder de perfil estandar para datos adicionales"
|
||||
msgstr "Usar por defecto el directorio de perfil para los datos adionales"
|
||||
|
||||
msgid "Default data path:"
|
||||
msgstr "Ruta estandar de datos:"
|
||||
msgstr "Ruta estándar de datos:"
|
||||
|
||||
msgid "Streams record path:"
|
||||
msgstr "Ruta de gravacion de stream:"
|
||||
msgstr "Ruta de grabación del stream:"
|
||||
|
||||
msgid "Record"
|
||||
msgstr "Gravar"
|
||||
msgstr "Grabación"
|
||||
|
||||
msgid "Record:"
|
||||
msgstr "Gravar:"
|
||||
msgstr "Grabación:"
|
||||
|
||||
msgid "Record to disk:"
|
||||
msgstr "Gravar en disco:"
|
||||
msgstr "Grabación en disco:"
|
||||
|
||||
msgid "Streaming"
|
||||
msgstr "Streameando"
|
||||
msgstr "Streaming"
|
||||
|
||||
msgid "Activate transcoding"
|
||||
msgstr "Activer transcodificacion"
|
||||
msgstr "Activar transcodificación"
|
||||
|
||||
msgid "Presets:"
|
||||
msgstr "Presets:"
|
||||
msgstr "Preajustes:"
|
||||
|
||||
msgid "Video options:"
|
||||
msgstr "Opciones Video:"
|
||||
msgstr "Opciones vídeo:"
|
||||
|
||||
msgid "Audio options:"
|
||||
msgstr "Opciones Audio:"
|
||||
msgstr "Opciones audio:"
|
||||
|
||||
msgid "Bitrate (kb/s):"
|
||||
msgstr "Bitrate (kb/s):"
|
||||
|
||||
msgid "Codec:"
|
||||
msgstr "Codec:"
|
||||
msgstr "Códec:"
|
||||
|
||||
msgid "Width (px):"
|
||||
msgstr "Ancho (px):"
|
||||
@@ -915,10 +915,10 @@ msgid "Channels:"
|
||||
msgstr "Canales:"
|
||||
|
||||
msgid "Sample rate (Hz):"
|
||||
msgstr "Sample rate (Гц):"
|
||||
msgstr "Frecuencia de muestreo (Hz):"
|
||||
|
||||
msgid "Play streams mode:"
|
||||
msgstr "Tocar en modo streams:"
|
||||
msgstr "Modo de reproducción de los streams:"
|
||||
|
||||
msgid "Built-in player"
|
||||
msgstr "Reproductor interno"
|
||||
@@ -927,40 +927,40 @@ msgid "VLC media player"
|
||||
msgstr "Reproductor VLC"
|
||||
|
||||
msgid "Only get m3u file"
|
||||
msgstr "Solo bajar archivo *.m3u"
|
||||
msgstr "Sólo bajar fichero m3u"
|
||||
|
||||
msgid "Save and restart the program to apply the settings."
|
||||
msgstr "Guarde y reinicie el programa para aplicar la configuración."
|
||||
msgstr "Guardar y reiniciar el programa para aplicar la configuración."
|
||||
|
||||
msgid "Some images may have problems displaying the favorites list!"
|
||||
msgstr "Algunas imágenes pueden tener problemas para mostrar la lista de favoritos!"
|
||||
msgstr "Algunas imágenes pueden tener problemas al mostrar la lista de favoritos!"
|
||||
|
||||
msgid "Operates in standby mode or current active transponder!"
|
||||
msgstr "Funciona en modo de espera o transpondedor activo actual!"
|
||||
msgstr "¡Funciona en modo de espera o transpondedor activo actual!"
|
||||
|
||||
msgid "No connection to the receiver!"
|
||||
msgstr "Sin conexión al receptor!"
|
||||
msgstr "¡Desconectado del receptor!"
|
||||
|
||||
msgid "Signal level"
|
||||
msgstr "Nivel de señal"
|
||||
|
||||
msgid "Receiver info"
|
||||
msgstr "Informacion sobre receptor"
|
||||
msgstr "Información sobre el receptor"
|
||||
|
||||
msgid "A profile with that name exists!"
|
||||
msgstr "Existe un perfil con ese nombre!"
|
||||
msgstr "¡Ya existe un perfil con ese nombre!"
|
||||
|
||||
msgid "Show short info as hints in the main services list"
|
||||
msgstr "Mostrar información breve como sugerencias en la lista de servicios principal"
|
||||
|
||||
msgid "Show detailed info as hints in the bouquet list"
|
||||
msgstr "Mostrar información detallada como pistas en la lista de bouquet"
|
||||
msgstr "Mostrar información detallada como consejo en la lista de bouquets"
|
||||
|
||||
msgid "Enable alternate bouquet file naming"
|
||||
msgstr "Habilitar nombres alternativos de archivos de bouquet"
|
||||
msgstr "Habilitar nombres alternativos para los ficheros de bouquets"
|
||||
|
||||
msgid "Allows you to name bouquet files using their names."
|
||||
msgstr "Le permite nombrar archivos de bouquet usando sus nombres."
|
||||
msgstr "Permite nombrar ficheros de bouquets usando sus propios nombres."
|
||||
|
||||
msgid "Appearance"
|
||||
msgstr "Apariencia"
|
||||
@@ -969,16 +969,16 @@ msgid "Enable Themes support"
|
||||
msgstr "Habilitar compatibilidad con temas"
|
||||
|
||||
msgid "Gtk3 Theme:"
|
||||
msgstr "Тема Gtk3:"
|
||||
msgstr "Теma Gtk3:"
|
||||
|
||||
msgid "Icon Theme:"
|
||||
msgstr "Тема Icono:"
|
||||
msgstr "Icono del tema:"
|
||||
|
||||
msgid "Gtk3 Themes and Icons:"
|
||||
msgstr "Tema Gtk3 e Iconos:"
|
||||
msgstr "Tema Gtk3 e iconos:"
|
||||
|
||||
msgid "Deleting data..."
|
||||
msgstr "Borrando datos ..."
|
||||
msgstr "Borrando datos..."
|
||||
|
||||
msgid "Download from the receiver"
|
||||
msgstr "Descargar desde el receptor"
|
||||
@@ -987,13 +987,13 @@ msgid "Remove all picons from the receiver"
|
||||
msgstr "Eliminar todos los picons del receptor"
|
||||
|
||||
msgid "Service reference"
|
||||
msgstr "Referencia de servicio"
|
||||
msgstr "Referencia del servicio"
|
||||
|
||||
msgid "Enable support for"
|
||||
msgstr "Habilitar soporte para"
|
||||
|
||||
msgid "Auto-check for updates"
|
||||
msgstr "Verificación automática de actualizaciones"
|
||||
msgstr "Comprobación automática de actualizaciones"
|
||||
|
||||
msgid "Filter services"
|
||||
msgstr "Filtrar servicios"
|
||||
@@ -1005,23 +1005,23 @@ msgid "Destination:"
|
||||
msgstr "Destino:"
|
||||
|
||||
msgid "EXPERIMENTAL!"
|
||||
msgstr "EXPERIMENTAL!"
|
||||
msgstr "¡EXPERIMENTAL!"
|
||||
|
||||
msgid "Sorting data..."
|
||||
msgstr "Ordenando datos..."
|
||||
|
||||
msgid "There are unsaved changes.\n\n\t Save them now?"
|
||||
msgstr "Hay cambios sin guardar.\n\n\t ¿Guardarlos ahora?"
|
||||
msgstr "Hay cambios sin guardar.\n\n\t ¿Desea guardarlos ahora?"
|
||||
|
||||
msgid "Are you sure you want to change the order\n\t of services in this bouquet?"
|
||||
msgstr "¿Está seguro de que desea cambiar el orden\n\t de servicios en este bouquet?"
|
||||
msgstr "¿Está seguro de querer cambiar el orden\n\t de servicios en este bouquet?"
|
||||
|
||||
msgid "Remove from the receiver"
|
||||
msgstr "Retirar del receptor"
|
||||
msgstr "Eliminar del receptor"
|
||||
|
||||
msgid "Screenshot"
|
||||
msgstr "Captura de pantalla"
|
||||
|
||||
msgid "Video"
|
||||
msgstr "Vidео"
|
||||
msgstr "Vídео"
|
||||
|
||||
|
||||
@@ -201,8 +201,8 @@ msgstr "Huidig datapad:"
|
||||
msgid "Data:"
|
||||
msgstr "Data:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Enigma2 kanaal and satelliet lijst editor voor GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Enigma2 kanaal and satelliet lijst editor voor GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Host:"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Copyright (C) 2018-2019 Dmitriy Yefremov
|
||||
# Copyright (C) 2018-2020 Dmitriy Yefremov
|
||||
# This file is distributed under the MIT license.
|
||||
#
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Last-Translator: wwns\n"
|
||||
@@ -205,8 +206,8 @@ msgstr "Aktualna ścieżka danych:"
|
||||
msgid "Data:"
|
||||
msgstr "Dane:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Edytor kanałów Enigma2 i listy satelitów dla GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Edytor kanałów Enigma2 i listy satelitów dla GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Host:"
|
||||
@@ -265,6 +266,9 @@ msgstr "Ukryj/Pomiń"
|
||||
msgid "Parent lock"
|
||||
msgstr "Blokada rodzicielska"
|
||||
|
||||
msgid "There are unsaved changes.\n\n\t Save them now?"
|
||||
msgstr "Istnieją niezapisane zmiany.\n\n\t Zapisać je teraz?"
|
||||
|
||||
# Filter bar
|
||||
msgid "Only free"
|
||||
msgstr "Tylko FTA"
|
||||
@@ -386,6 +390,12 @@ msgid "Remove selection"
|
||||
msgstr "Usuń wybrane"
|
||||
|
||||
# Service details dialog
|
||||
msgid "To the top"
|
||||
msgstr "Przenieś na góre bukietu"
|
||||
|
||||
msgid "To the end"
|
||||
msgstr "Przenieś na koniec bukietu"
|
||||
|
||||
msgid "Service data:"
|
||||
msgstr "Dane usług:"
|
||||
|
||||
@@ -596,9 +606,6 @@ msgstr "Brak danych do zapisania!"
|
||||
msgid "Network"
|
||||
msgstr "Sieć"
|
||||
|
||||
msgid "Program"
|
||||
msgstr "Program"
|
||||
|
||||
msgid "Backup"
|
||||
msgstr "Kopia"
|
||||
|
||||
@@ -626,6 +633,15 @@ msgstr "Wyjście"
|
||||
msgid "Tools"
|
||||
msgstr "Narzędzia"
|
||||
|
||||
msgid "Cut"
|
||||
msgstr "Wytnij"
|
||||
|
||||
msgid "Paste"
|
||||
msgstr "Wklej"
|
||||
|
||||
msgid "Insert space"
|
||||
msgstr "Wstaw spację"
|
||||
|
||||
# Import
|
||||
msgid "Import"
|
||||
msgstr "Importuj"
|
||||
@@ -648,12 +664,12 @@ msgstr "Usuń wszystkie nieużywane"
|
||||
msgid "Test"
|
||||
msgstr "Test"
|
||||
|
||||
msgid "Details"
|
||||
msgstr "Właściwości"
|
||||
|
||||
msgid "Test connection"
|
||||
msgstr "Testuj połączenie"
|
||||
|
||||
msgid "Double click on the service in the bouquet list:"
|
||||
msgstr "Kliknij dwukrotnie usługę na liście bukietów:"
|
||||
|
||||
msgid "Switch(zap) the channel(Ctrl + Z)"
|
||||
msgstr "Przełącz(zap) kanał(Ctrl + Z)"
|
||||
|
||||
@@ -667,7 +683,7 @@ msgid "Export to m3u"
|
||||
msgstr "Eksportuj do m3u"
|
||||
|
||||
msgid "EPG configuration"
|
||||
msgstr "Koniguruj EPG"
|
||||
msgstr "Konfiguruj EPG"
|
||||
|
||||
msgid "Apply"
|
||||
msgstr "Zatwierdź"
|
||||
@@ -754,17 +770,11 @@ msgstr "Import listy odtwarzania"
|
||||
msgid "Getting link error:"
|
||||
msgstr "Błąd pobierania łącza:"
|
||||
|
||||
msgid "Apply profile settings"
|
||||
msgstr "Zastosuj ustawienia profilu"
|
||||
|
||||
msgid "Settings type:"
|
||||
msgstr "Ustawienia dla:"
|
||||
|
||||
msgid "Set default"
|
||||
msgstr "Uataw domyślnie"
|
||||
|
||||
msgid "Enable direct playback bar"
|
||||
msgstr "Włącz pasek bezpośredniego odtwarzania"
|
||||
msgstr "Ustaw domyślnie"
|
||||
|
||||
msgid "Enables direct sending and playback of media links on the receiver"
|
||||
msgstr "Umożliwia bezpośrednie wysyłanie i odtwarzanie łączy multimedialnych w odbiorniku"
|
||||
@@ -785,7 +795,10 @@ msgid "Remove picons from the receiver"
|
||||
msgstr "Usuń pikony z odbiornika"
|
||||
|
||||
msgid "Use http to reload data in the receiver."
|
||||
msgstr "Użyj http aby ponownie załadować dane do odbiornika."
|
||||
msgstr "Użyj http aby przeładować dane w odbiorniku."
|
||||
|
||||
msgid "Apply profile settings"
|
||||
msgstr "Zastosuj ustawienia profilu"
|
||||
|
||||
msgid "Drag or paste the link here"
|
||||
msgstr "Przeciągnij lub wklej tutaj link"
|
||||
@@ -808,10 +821,16 @@ msgstr "Pobierz z odbiornika"
|
||||
msgid "The Neutrino has only experimental support. Not all features are supported!"
|
||||
msgstr "Neutrino ma jedynie wsparcie eksperymentalne. Nie wszystkie funkcje są obsługiwane!"
|
||||
|
||||
msgid "Some images may have problems displaying the favorites list!"
|
||||
msgstr "Niektóre obrazy mogą mieć problemy z wyświetlaniem listy ulubionych!"
|
||||
|
||||
# Appearance
|
||||
msgid "Appearance"
|
||||
msgstr "Wygląd"
|
||||
|
||||
msgid "Enable Dark Mode"
|
||||
msgstr "Włącz tryb ciemny"
|
||||
|
||||
msgid "Enable Themes support"
|
||||
msgstr "Włącz obsługę motywów"
|
||||
|
||||
@@ -834,23 +853,17 @@ msgstr "Zapisz i uruchom ponownie program, aby zastosować ustawienia."
|
||||
msgid "Extra"
|
||||
msgstr "Ekstra"
|
||||
|
||||
msgid "Enable lamedb ver. 5 support"
|
||||
msgstr "Włącz lamedb wer. 5 wsparcie"
|
||||
|
||||
msgid "Enable alternate bouquet file naming"
|
||||
msgstr "Włącz alternatywne nazewnictwo plików bukietów"
|
||||
|
||||
msgid "Some images may have problems displaying the favorites list!"
|
||||
msgstr "Niektóre obrazy mogą mieć problemy z wyświetlaniem listy ulubionych!"
|
||||
|
||||
msgid "Allows you to name bouquet files using their names."
|
||||
msgstr "Pozwala nazwać pliki bukietów przy użyciu ich nazw."
|
||||
|
||||
msgid "Enable HTTP API"
|
||||
msgstr "Włącz API HTTP"
|
||||
|
||||
msgid "Enable send to receiver"
|
||||
msgstr "Włącz wysyłanie do odbiornika"
|
||||
msgid "Double click on the service in the bouquet list:"
|
||||
msgstr "Kliknij dwukrotnie usługę na liście bukietów:"
|
||||
|
||||
msgid "Zap"
|
||||
msgstr "Przełącz"
|
||||
@@ -867,6 +880,28 @@ msgstr "Odtwórz strumień"
|
||||
msgid "Disabled"
|
||||
msgstr "Wyłączone"
|
||||
|
||||
msgid "Enable experimental features"
|
||||
msgstr "Włącz funkcje eksperymentalne"
|
||||
|
||||
msgid "Enable lamedb ver. 5 support"
|
||||
msgstr "Włącz wsparcie dla lamedb w wer.5"
|
||||
|
||||
msgid "Enable support for"
|
||||
msgstr "Włącz obsługę"
|
||||
|
||||
msgid "Enables parsing links using youtube-dl to get direct links to media"
|
||||
msgstr "Umożliwia analizowanie linków za pomocą youtube-dl, aby uzyskać bezpośrednie linki do multimediów"
|
||||
|
||||
msgid "Auto-check for updates"
|
||||
msgstr "Automatyczne sprawdzanie aktualizacji"
|
||||
|
||||
msgid "Enable direct playback bar"
|
||||
msgstr "Włącz pasek bezpośredniego odtwarzania"
|
||||
|
||||
#Program
|
||||
msgid "Program"
|
||||
msgstr "Program"
|
||||
|
||||
msgid "Language:"
|
||||
msgstr "Język:"
|
||||
|
||||
@@ -876,7 +911,7 @@ msgstr "Załaduj ostatnią otwartą konfigurację podczas uruchamiania programu"
|
||||
msgid "Show short info as hints in the main services list"
|
||||
msgstr "Pokaż krótkie informacje jako wskazówki na głównej liście usług"
|
||||
|
||||
msgid "Show detailed info as hints in the bouquet list"
|
||||
msgid "Show detailed info as hints in the bouquet list"
|
||||
msgstr "Pokaż szczegółowe informacje jako wskazówki na liście bukietów"
|
||||
|
||||
msgid "Set background color for the services"
|
||||
@@ -962,8 +997,8 @@ msgstr "Ustawia folder profilu jako domyślny do przechowywania pikonów, kopii
|
||||
msgid "Default data path:"
|
||||
msgstr "Domyślna ścieżka danych:"
|
||||
|
||||
msgid "Record"
|
||||
msgstr "Nagrania"
|
||||
msgid "Record:"
|
||||
msgstr "Nagrania:"
|
||||
|
||||
msgid "Streams record path:"
|
||||
msgstr "Ścieżka zapisu nagrań:"
|
||||
|
||||
@@ -201,8 +201,8 @@ msgstr "Rota de dados atual:"
|
||||
msgid "Data:"
|
||||
msgstr "Dados:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Editor de Canais e Satélites Enigma2 para GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Editor de Canais e Satélites Enigma2 para GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Anfitrião:"
|
||||
|
||||
@@ -104,6 +104,9 @@ msgstr "Имя по умолчанию"
|
||||
msgid "Insert marker"
|
||||
msgstr "Вставить маркер"
|
||||
|
||||
msgid "Insert space"
|
||||
msgstr "Вставить пробел"
|
||||
|
||||
msgid "Locate in services"
|
||||
msgstr "Найти в списке сервисов"
|
||||
|
||||
@@ -200,8 +203,8 @@ msgstr "Текущий путь к данным:"
|
||||
msgid "Data:"
|
||||
msgstr "Данные:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "Редактор списка каналов и спутников Enigma2\n для GNU/Linux"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "Редактор списка каналов и спутников Enigma2\n для GNU/Linux."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Адрес ресивера:"
|
||||
@@ -507,6 +510,9 @@ msgstr "Пожалуйста, выберите только один элеме
|
||||
msgid "No png file is selected!"
|
||||
msgstr "Не выбран png файл!"
|
||||
|
||||
msgid "No profile selected!"
|
||||
msgstr "Не выбран профиль!"
|
||||
|
||||
msgid "No reference is present!"
|
||||
msgstr "Ссылка не найдена!"
|
||||
|
||||
@@ -672,7 +678,7 @@ msgid "Switch(zap) the channel(Ctrl + Z)"
|
||||
msgstr "Переключить канал(Ctrl + Z)"
|
||||
|
||||
msgid "Switch the channel and watch in the program(Ctrl + W)"
|
||||
msgstr "Переклють канал и просмотр в программе(Ctrl + W)."
|
||||
msgstr "Переключить канал и просмотр в программе(Ctrl + W)."
|
||||
|
||||
msgid "Play IPTV or other stream in the program(Ctrl + P)"
|
||||
msgstr "Воспроизведение IPTV или другого потока в программе(Ctrl + P)"
|
||||
@@ -1022,3 +1028,134 @@ msgstr "Не удается воспроизвести!"
|
||||
msgid "Enable Dark Mode"
|
||||
msgstr "Включить темный режим"
|
||||
|
||||
msgid "Extract..."
|
||||
msgstr "Извлечь..."
|
||||
|
||||
msgid "Unsupported format!"
|
||||
msgstr "Неподдерживаемый формат!"
|
||||
|
||||
msgid "Combine with the current data?"
|
||||
msgstr "Объединить с текущими данными?"
|
||||
|
||||
msgid "Importing data done!"
|
||||
msgstr "Импорт данных завершен!"
|
||||
|
||||
msgid "Current service"
|
||||
msgstr "Текущий сервис"
|
||||
|
||||
msgid "Open folder"
|
||||
msgstr "Открыть папку"
|
||||
|
||||
msgid "Open archive"
|
||||
msgstr "Открыть архив"
|
||||
|
||||
msgid "Import from Web"
|
||||
msgstr "Импорт из сети"
|
||||
|
||||
msgid "Control"
|
||||
msgstr "Управление"
|
||||
|
||||
msgid "Timers"
|
||||
msgstr "Таймеры"
|
||||
|
||||
msgid "Timer"
|
||||
msgstr "Таймер"
|
||||
|
||||
msgid "Add timer"
|
||||
msgstr "Добавить таймер"
|
||||
|
||||
msgid "Hr."
|
||||
msgstr "ч."
|
||||
|
||||
msgid "Min."
|
||||
msgstr "мин."
|
||||
|
||||
msgid "Power"
|
||||
msgstr "Питание"
|
||||
|
||||
msgid "Standby"
|
||||
msgstr "Режим ожидания"
|
||||
|
||||
msgid "Wake Up"
|
||||
msgstr "Пробуждение"
|
||||
|
||||
msgid "Reboot"
|
||||
msgstr "Перезагрузка"
|
||||
|
||||
msgid "Restart GUI"
|
||||
msgstr "Перезагрузить графический интерфейс"
|
||||
|
||||
msgid "Shutdown"
|
||||
msgstr "Выключение"
|
||||
|
||||
msgid "Shut down"
|
||||
msgstr "Выключить"
|
||||
|
||||
msgid "Do Nothing"
|
||||
msgstr "Ничего не делать"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "Авто"
|
||||
|
||||
msgid "Grab screenshot"
|
||||
msgstr "Сделать скриншот"
|
||||
|
||||
msgid "Enabled:"
|
||||
msgstr "Включен:"
|
||||
|
||||
msgid "Name:"
|
||||
msgstr "Имя:"
|
||||
|
||||
msgid "Description:"
|
||||
msgstr "Описание:"
|
||||
|
||||
msgid "Service:"
|
||||
msgstr "Сервис:"
|
||||
|
||||
msgid "Service reference:"
|
||||
msgstr "Сервисная ссылка:"
|
||||
|
||||
msgid "Event ID:"
|
||||
msgstr "ID события:"
|
||||
|
||||
msgid "Begins:"
|
||||
msgstr "Начало:"
|
||||
|
||||
msgid "Ends:"
|
||||
msgstr "Окончание:"
|
||||
|
||||
msgid "Repeated:"
|
||||
msgstr "Повтор:"
|
||||
|
||||
msgid "Action:"
|
||||
msgstr "Действие:"
|
||||
|
||||
msgid "After event:"
|
||||
msgstr "После события:"
|
||||
|
||||
msgid "Location:"
|
||||
msgstr "Расположение:"
|
||||
|
||||
msgid "Mo"
|
||||
msgstr "Пн"
|
||||
|
||||
msgid "Tu"
|
||||
msgstr "Вт"
|
||||
|
||||
msgid "We"
|
||||
msgstr "Ср"
|
||||
|
||||
msgid "Th"
|
||||
msgstr "Чт"
|
||||
|
||||
msgid "Fr"
|
||||
msgstr "Пт"
|
||||
|
||||
msgid "Sa"
|
||||
msgstr "Сб"
|
||||
|
||||
msgid "Su"
|
||||
msgstr "Вс"
|
||||
|
||||
msgid "Set"
|
||||
msgstr "Установить"
|
||||
|
||||
@@ -203,8 +203,8 @@ msgstr "Mevcut veri yolu:"
|
||||
msgid "Data:"
|
||||
msgstr "Veri:"
|
||||
|
||||
msgid "Enigma2 channel and satellites list editor for GNU/Linux"
|
||||
msgstr "GNU/Linux için Enigma2 kanalı ve uydu listesi editörü"
|
||||
msgid "Enigma2 channel and satellite list editor for GNU/Linux."
|
||||
msgstr "GNU/Linux için Enigma2 kanalı ve uydu listesi editörü."
|
||||
|
||||
msgid "Host:"
|
||||
msgstr "Ana bilgisayar:"
|
||||
|
||||
Reference in New Issue
Block a user