diff --git a/main/editor_ui.glade b/main/editor_ui.glade
index 44821f94..e2234ea8 100644
--- a/main/editor_ui.glade
+++ b/main/editor_ui.glade
@@ -35,270 +35,35 @@
False
go-top
-
-
True
autosize
Package
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
True
autosize
@@ -483,6 +248,7 @@
True
False
False
+
@@ -736,6 +502,7 @@
Tools
True
applications-utilities
+
False
@@ -1252,11 +1019,389 @@
button1
+
+ 640
+ False
+ applications-utilities
+ dialog
+ main_window
+
+
+ False
+ vertical
+ 2
+
+
+ False
+ end
+
+
+ gtk-cancel
+ True
+ True
+ True
+ True
+
+
+ True
+ True
+ 0
+
+
+
+
+ False
+ False
+ 0
+
+
+
+
+ 320
+ True
+ False
+ vertical
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ True
+ False
+ Load
+ True
+ gtk-goto-bottom
+
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+
+
+ False
+ False
+
+
+
+
+ True
+ False
+ Save
+ True
+ gtk-floppy
+
+
+ False
+ True
+
+
+
+
+ True
+ False
+
+
+ False
+ False
+
+
+
+
+ True
+ False
+ Delete
+ True
+ gtk-remove
+
+
+ False
+ True
+
+
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ True
+ in
+
+
+ True
+ True
+ satellites_tree_store
+
+
+ multiple
+
+
+
+
+ Satellite
+
+
+
+ 0
+
+
+
+
+
+
+ Freq.
+ True
+
+
+
+ 1
+
+
+
+
+
+
+ Rate
+ True
+
+
+
+ 2
+
+
+
+
+
+
+ Pol.
+ True
+
+
+
+ 3
+
+
+
+
+
+
+ Fec.
+ True
+
+
+
+ 4
+
+
+
+
+
+
+ System
+ True
+
+
+
+ 5
+
+
+
+
+
+
+ Mod.
+ True
+
+
+
+ 6
+
+
+
+
+
+
+ Pls mode
+ True
+
+
+
+ 7
+
+
+
+
+
+
+ Pls code
+ True
+
+
+
+ 8
+
+
+
+
+
+
+ Is ID
+ True
+
+
+
+ 9
+
+
+
+
+
+
+
+
+ True
+ True
+ 2
+
+
+
+
+ True
+ True
+ 1
+
+
+
+
+
+ sat_ed_cancel_button
+
+
False
Options
False
True
+ preferences-desktop
dialog
main_window
diff --git a/main/eparser/__init__.py b/main/eparser/__init__.py
index 63a8596e..79a78a6c 100644
--- a/main/eparser/__init__.py
+++ b/main/eparser/__init__.py
@@ -1,6 +1,6 @@
from .lamedb import get_channels
from .bouquets import get_bouquets, get_bouquet
-from .satxml import get_transponders
+from .satxml import get_satellites
if __name__ == "__main__":
diff --git a/main/eparser/satxml.py b/main/eparser/satxml.py
index b1e7cbf9..e228598d 100644
--- a/main/eparser/satxml.py
+++ b/main/eparser/satxml.py
@@ -24,8 +24,8 @@ Transponder = namedtuple("Transponder", ["frequency", "symbol_rate", "polarizati
"system", "modulation", "pls_mode", "pls_code", "is_id"])
-def get_transponders(path):
- return parse_satellites(path)
+def get_satellites(path):
+ return parse_satellites(path + "satellites.xml")
def parse_transponders(elem):
diff --git a/main/ui.py b/main/ui.py
index df8f88bd..dccba632 100644
--- a/main/ui.py
+++ b/main/ui.py
@@ -1,11 +1,12 @@
-import gi
import os
from ftplib import FTP
-
from threading import Thread
+
+import gi
+
+from main.eparser import get_channels, get_satellites, get_bouquets, get_bouquet
from main.eparser.__constants import SERVICE_TYPE
from main.properties import get_config, write_config
-from main.eparser import get_channels, get_transponders, get_bouquets, get_bouquet
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
@@ -37,10 +38,32 @@ def get_handlers():
"on_data_dir_field_icon_press": on_path_open,
"on_data_open": on_data_open,
"on_tree_view_key_release": on_tree_view_key_release,
- "on_bouquets_selection": on_bouquets_selection
+ "on_bouquets_selection": on_bouquets_selection,
+ "on_satellite_editor_show": on_satellite_editor_show,
+ "on_satellites_list_load": on_satellites_list_load
}
+def on_satellite_editor_show(model):
+ """ Shows satellites editor dialog """
+ builder = Gtk.Builder()
+ builder.add_from_file("editor_ui.glade")
+ builder.connect_signals(get_handlers())
+ dialog = builder.get_object("satellites_editor_dialog")
+ dialog.run()
+ dialog.destroy()
+
+
+def on_satellites_list_load(model):
+ """ Load satellites data into model """
+ satellites = get_satellites(__options["data_dir_path"])
+ model.clear()
+ for name, flags, pos, transponders in satellites:
+ parent = model.append(None, [name, *[None for x in range(9)]])
+ for transponder in transponders:
+ model.append(parent, ["Transponder:", *transponder])
+
+
def data_open(model):
try:
model.clear()