mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-22 08:29:41 +01:00
redesigned network settings
This commit is contained in:
@@ -370,7 +370,7 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if s_type is SettingsType.ENIGMA_2 and use_http:
|
if s_type is SettingsType.ENIGMA_2 and use_http:
|
||||||
ht = http(settings.http_user, settings.http_password, base_url, callback, settings.http_use_ssl)
|
ht = http(settings.user, settings.password, base_url, callback, settings.http_use_ssl)
|
||||||
next(ht)
|
next(ht)
|
||||||
message = ""
|
message = ""
|
||||||
if download_type is DownloadType.BOUQUETS:
|
if download_type is DownloadType.BOUQUETS:
|
||||||
@@ -393,8 +393,8 @@ def upload_data(*, settings, download_type=DownloadType.ALL, remove_unused=False
|
|||||||
if download_type is not DownloadType.PICONS:
|
if download_type is not DownloadType.PICONS:
|
||||||
# telnet
|
# telnet
|
||||||
tn = telnet(host=host,
|
tn = telnet(host=host,
|
||||||
user=settings.telnet_user,
|
user=settings.user,
|
||||||
password=settings.telnet_password,
|
password=settings.password,
|
||||||
timeout=settings.telnet_timeout)
|
timeout=settings.telnet_timeout)
|
||||||
next(tn)
|
next(tn)
|
||||||
# terminate enigma or neutrino
|
# terminate enigma or neutrino
|
||||||
@@ -599,7 +599,7 @@ class HttpAPI:
|
|||||||
|
|
||||||
@run_task
|
@run_task
|
||||||
def init(self):
|
def init(self):
|
||||||
user, password = self._settings.http_user, self._settings.http_password
|
user, password = self._settings.user, self._settings.password
|
||||||
use_ssl = self._settings.http_use_ssl
|
use_ssl = self._settings.http_use_ssl
|
||||||
self._main_url = "http{}://{}:{}".format("s" if use_ssl else "", self._settings.host, self._settings.http_port)
|
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)
|
self._base_url = "{}/web/".format(self._main_url)
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ class SettingsType(IntEnum):
|
|||||||
""" Returns default settings for current type """
|
""" Returns default settings for current type """
|
||||||
if self is self.ENIGMA_2:
|
if self is self.ENIGMA_2:
|
||||||
return {"setting_type": self.value,
|
return {"setting_type": self.value,
|
||||||
"host": "127.0.0.1", "port": "21", "user": "root", "password": "root", "timeout": 5,
|
"host": "127.0.0.1", "port": "21", "timeout": 5,
|
||||||
"http_user": "root", "http_password": "", "http_port": "80",
|
"user": "root", "password": "root",
|
||||||
"http_timeout": 5, "http_use_ssl": False,
|
"http_port": "80", "http_timeout": 5, "http_use_ssl": False,
|
||||||
"telnet_user": "root", "telnet_password": "", "telnet_port": "23", "telnet_timeout": 5,
|
"telnet_port": "23", "telnet_timeout": 5,
|
||||||
"services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/",
|
"services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/",
|
||||||
"satellites_xml_path": "/etc/tuxbox/", "data_local_path": DATA_PATH + "enigma2/",
|
"satellites_xml_path": "/etc/tuxbox/", "data_local_path": DATA_PATH + "enigma2/",
|
||||||
"picons_path": "/usr/share/enigma2/picon/",
|
"picons_path": "/usr/share/enigma2/picon/",
|
||||||
@@ -110,9 +110,10 @@ class SettingsType(IntEnum):
|
|||||||
"backup_local_path": DATA_PATH + "enigma2/backup/"}
|
"backup_local_path": DATA_PATH + "enigma2/backup/"}
|
||||||
elif self is self.NEUTRINO_MP:
|
elif self is self.NEUTRINO_MP:
|
||||||
return {"setting_type": self,
|
return {"setting_type": self,
|
||||||
"host": "127.0.0.1", "port": "21", "user": "root", "password": "root", "timeout": 5,
|
"host": "127.0.0.1", "port": "21", "timeout": 5,
|
||||||
"http_user": "", "http_password": "", "http_port": "80", "http_timeout": 2, "http_use_ssl": False,
|
"user": "root", "password": "root",
|
||||||
"telnet_user": "root", "telnet_password": "", "telnet_port": "23", "telnet_timeout": 1,
|
"http_port": "80", "http_timeout": 2, "http_use_ssl": False,
|
||||||
|
"telnet_port": "23", "telnet_timeout": 1,
|
||||||
"services_path": "/var/tuxbox/config/zapit/", "user_bouquet_path": "/var/tuxbox/config/zapit/",
|
"services_path": "/var/tuxbox/config/zapit/", "user_bouquet_path": "/var/tuxbox/config/zapit/",
|
||||||
"satellites_xml_path": "/var/tuxbox/config/", "data_local_path": DATA_PATH + "neutrino/",
|
"satellites_xml_path": "/var/tuxbox/config/", "data_local_path": DATA_PATH + "neutrino/",
|
||||||
"picons_path": "/usr/share/tuxbox/neutrino/icons/logo/",
|
"picons_path": "/usr/share/tuxbox/neutrino/icons/logo/",
|
||||||
@@ -279,22 +280,6 @@ class Settings:
|
|||||||
def password(self, value):
|
def password(self, value):
|
||||||
self._cp_settings["password"] = value
|
self._cp_settings["password"] = value
|
||||||
|
|
||||||
@property
|
|
||||||
def http_user(self):
|
|
||||||
return self._cp_settings.get("http_user", self.get_default("http_user"))
|
|
||||||
|
|
||||||
@http_user.setter
|
|
||||||
def http_user(self, value):
|
|
||||||
self._cp_settings["http_user"] = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def http_password(self):
|
|
||||||
return self._cp_settings.get("http_password", self.get_default("http_password"))
|
|
||||||
|
|
||||||
@http_password.setter
|
|
||||||
def http_password(self, value):
|
|
||||||
self._cp_settings["http_password"] = value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def http_port(self):
|
def http_port(self):
|
||||||
return self._cp_settings.get("http_port", self.get_default("http_port"))
|
return self._cp_settings.get("http_port", self.get_default("http_port"))
|
||||||
@@ -319,22 +304,6 @@ class Settings:
|
|||||||
def http_use_ssl(self, value):
|
def http_use_ssl(self, value):
|
||||||
self._cp_settings["http_use_ssl"] = value
|
self._cp_settings["http_use_ssl"] = value
|
||||||
|
|
||||||
@property
|
|
||||||
def telnet_user(self):
|
|
||||||
return self._cp_settings.get("telnet_user", self.get_default("telnet_user"))
|
|
||||||
|
|
||||||
@telnet_user.setter
|
|
||||||
def telnet_user(self, value):
|
|
||||||
self._cp_settings["telnet_user"] = value
|
|
||||||
|
|
||||||
@property
|
|
||||||
def telnet_password(self):
|
|
||||||
return self._cp_settings.get("telnet_password", self.get_default("telnet_password"))
|
|
||||||
|
|
||||||
@telnet_password.setter
|
|
||||||
def telnet_password(self, value):
|
|
||||||
self._cp_settings["telnet_password"] = value
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def telnet_port(self):
|
def telnet_port(self):
|
||||||
return self._cp_settings.get("telnet_port", self.get_default("telnet_port"))
|
return self._cp_settings.get("telnet_port", self.get_default("telnet_port"))
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.22.1
|
<!-- Generated with glade 3.22.2
|
||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ Author: Dmitriy Yefremov
|
|||||||
<!-- interface-copyright 2018 Dmitriy Yefremov -->
|
<!-- interface-copyright 2018 Dmitriy Yefremov -->
|
||||||
<!-- interface-authors Dmitriy Yefremov -->
|
<!-- interface-authors Dmitriy Yefremov -->
|
||||||
<object class="GtkWindow" id="download_dialog_window">
|
<object class="GtkWindow" id="download_dialog_window">
|
||||||
<property name="width_request">500</property>
|
<property name="width_request">550</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="resizable">False</property>
|
<property name="resizable">False</property>
|
||||||
<property name="modal">True</property>
|
<property name="modal">True</property>
|
||||||
@@ -217,7 +217,7 @@ Author: Dmitriy Yefremov
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox" id="profile_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">center</property>
|
<property name="halign">center</property>
|
||||||
@@ -264,6 +264,7 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_left">5</property>
|
<property name="margin_left">5</property>
|
||||||
<property name="margin_right">5</property>
|
<property name="margin_right">5</property>
|
||||||
|
<property name="margin_bottom">5</property>
|
||||||
<property name="label_xalign">0.019999999552965164</property>
|
<property name="label_xalign">0.019999999552965164</property>
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<child>
|
<child>
|
||||||
@@ -423,201 +424,6 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkFrame" id="settings_frame">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_left">5</property>
|
|
||||||
<property name="margin_right">5</property>
|
|
||||||
<property name="margin_top">5</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<property name="label_xalign">0.019999999552965164</property>
|
|
||||||
<property name="shadow_type">in</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="settings_grid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_left">5</property>
|
|
||||||
<property name="margin_right">5</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<property name="row_spacing">2</property>
|
|
||||||
<property name="column_spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="login_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Login:</property>
|
|
||||||
<property name="xalign">0.10000000149011612</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="login_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="editable">False</property>
|
|
||||||
<property name="text">root</property>
|
|
||||||
<property name="caps_lock_warning">False</property>
|
|
||||||
<property name="primary_icon_name">avatar-default-symbolic</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="password_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Password:</property>
|
|
||||||
<property name="xalign">0.10000000149011612</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="password_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="editable">False</property>
|
|
||||||
<property name="visibility">False</property>
|
|
||||||
<property name="invisible_char">●</property>
|
|
||||||
<property name="text">root</property>
|
|
||||||
<property name="primary_icon_name">emblem-readonly</property>
|
|
||||||
<property name="input_purpose">password</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="port_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Port:</property>
|
|
||||||
<property name="xalign">0.10000000149011612</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="port_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="editable">False</property>
|
|
||||||
<property name="width_chars">8</property>
|
|
||||||
<property name="max_width_chars">8</property>
|
|
||||||
<property name="text" translatable="yes">21</property>
|
|
||||||
<property name="caps_lock_warning">False</property>
|
|
||||||
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="timeout_entry">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="editable">False</property>
|
|
||||||
<property name="width_chars">8</property>
|
|
||||||
<property name="max_width_chars">8</property>
|
|
||||||
<property name="caps_lock_warning">False</property>
|
|
||||||
<property name="primary_icon_name">alarm-symbolic</property>
|
|
||||||
<property name="input_purpose">digits</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">3</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="timeout_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Timeout:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">3</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="label">
|
|
||||||
<object class="GtkBox" id="settings_buttons_box">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkRadioButton" id="ftp_radio_button">
|
|
||||||
<property name="label" translatable="yes">FTP</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="active">True</property>
|
|
||||||
<property name="draw_indicator">False</property>
|
|
||||||
<property name="group">telnet_radio_button</property>
|
|
||||||
<signal name="toggled" handler="on_settings_button" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkRadioButton" id="http_radio_button">
|
|
||||||
<property name="label" translatable="yes">HTTP</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="draw_indicator">False</property>
|
|
||||||
<property name="group">telnet_radio_button</property>
|
|
||||||
<signal name="toggled" handler="on_settings_button" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkRadioButton" id="telnet_radio_button">
|
|
||||||
<property name="label" translatable="yes">Telnet</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">False</property>
|
|
||||||
<property name="draw_indicator">False</property>
|
|
||||||
<property name="group">ftp_radio_button</property>
|
|
||||||
<signal name="toggled" handler="on_settings_button" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<style>
|
|
||||||
<class name="group"/>
|
|
||||||
</style>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkExpander" id="expander">
|
<object class="GtkExpander" id="expander">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -713,17 +519,7 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="position">5</property>
|
<property name="position">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkSizeGroup" id="settings_size_group">
|
|
||||||
<widgets>
|
|
||||||
<widget name="ftp_radio_button"/>
|
|
||||||
<widget name="http_radio_button"/>
|
|
||||||
<widget name="telnet_radio_button"/>
|
|
||||||
</widgets>
|
|
||||||
</object>
|
|
||||||
</interface>
|
</interface>
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ class DownloadDialog:
|
|||||||
|
|
||||||
handlers = {"on_receive": self.on_receive,
|
handlers = {"on_receive": self.on_receive,
|
||||||
"on_send": self.on_send,
|
"on_send": self.on_send,
|
||||||
"on_settings_button": self.on_settings_button,
|
|
||||||
"on_settings": self.on_settings,
|
"on_settings": self.on_settings,
|
||||||
"on_profile_changed": self.on_profile_changed,
|
"on_profile_changed": self.on_profile_changed,
|
||||||
"on_use_http_state_set": self.on_use_http_state_set,
|
"on_use_http_state_set": self.on_use_http_state_set,
|
||||||
@@ -32,7 +31,6 @@ class DownloadDialog:
|
|||||||
builder.add_from_file(UI_RESOURCES_PATH + "download_dialog.glade")
|
builder.add_from_file(UI_RESOURCES_PATH + "download_dialog.glade")
|
||||||
builder.connect_signals(handlers)
|
builder.connect_signals(handlers)
|
||||||
|
|
||||||
self._current_property = "FTP"
|
|
||||||
self._dialog_window = builder.get_object("download_dialog_window")
|
self._dialog_window = builder.get_object("download_dialog_window")
|
||||||
self._dialog_window.set_transient_for(transient)
|
self._dialog_window.set_transient_for(transient)
|
||||||
self._info_bar = builder.get_object("info_bar")
|
self._info_bar = builder.get_object("info_bar")
|
||||||
@@ -46,12 +44,6 @@ class DownloadDialog:
|
|||||||
self._bouquets_radio_button = builder.get_object("bouquets_radio_button")
|
self._bouquets_radio_button = builder.get_object("bouquets_radio_button")
|
||||||
self._satellites_radio_button = builder.get_object("satellites_radio_button")
|
self._satellites_radio_button = builder.get_object("satellites_radio_button")
|
||||||
self._webtv_radio_button = builder.get_object("webtv_radio_button")
|
self._webtv_radio_button = builder.get_object("webtv_radio_button")
|
||||||
self._login_entry = builder.get_object("login_entry")
|
|
||||||
self._password_entry = builder.get_object("password_entry")
|
|
||||||
self._host_entry = builder.get_object("host_entry")
|
|
||||||
self._port_entry = builder.get_object("port_entry")
|
|
||||||
self._timeout_entry = builder.get_object("timeout_entry")
|
|
||||||
self._settings_buttons_box = builder.get_object("settings_buttons_box")
|
|
||||||
self._use_http_switch = builder.get_object("use_http_switch")
|
self._use_http_switch = builder.get_object("use_http_switch")
|
||||||
self._http_radio_button = builder.get_object("http_radio_button")
|
self._http_radio_button = builder.get_object("http_radio_button")
|
||||||
self._use_http_box = builder.get_object("use_http_box")
|
self._use_http_box = builder.get_object("use_http_box")
|
||||||
@@ -71,7 +63,6 @@ class DownloadDialog:
|
|||||||
self._data_path_entry.set_text(self._settings.data_local_path)
|
self._data_path_entry.set_text(self._settings.data_local_path)
|
||||||
is_enigma = self._s_type is SettingsType.ENIGMA_2
|
is_enigma = self._s_type is SettingsType.ENIGMA_2
|
||||||
self._webtv_radio_button.set_visible(not is_enigma)
|
self._webtv_radio_button.set_visible(not is_enigma)
|
||||||
self._http_radio_button.set_visible(is_enigma)
|
|
||||||
self._use_http_box.set_visible(is_enigma)
|
self._use_http_box.set_visible(is_enigma)
|
||||||
self._use_http_switch.set_active(is_enigma and self._settings.use_http)
|
self._use_http_switch.set_active(is_enigma and self._settings.use_http)
|
||||||
self._remove_unused_check_button.set_active(self._settings.remove_unused_bouquets)
|
self._remove_unused_check_button.set_active(self._settings.remove_unused_bouquets)
|
||||||
@@ -104,26 +95,6 @@ class DownloadDialog:
|
|||||||
def destroy(self):
|
def destroy(self):
|
||||||
self._dialog_window.destroy()
|
self._dialog_window.destroy()
|
||||||
|
|
||||||
def on_settings_button(self, button):
|
|
||||||
if button.get_active():
|
|
||||||
label = button.get_label()
|
|
||||||
if label == "Telnet":
|
|
||||||
self._login_entry.set_text(self._settings.telnet_user)
|
|
||||||
self._password_entry.set_text(self._settings.telnet_password)
|
|
||||||
self._port_entry.set_text(self._settings.telnet_port)
|
|
||||||
self._timeout_entry.set_text(str(self._settings.telnet_timeout))
|
|
||||||
elif label == "HTTP":
|
|
||||||
self._login_entry.set_text(self._settings.http_user)
|
|
||||||
self._password_entry.set_text(self._settings.http_password)
|
|
||||||
self._port_entry.set_text(self._settings.http_port)
|
|
||||||
self._timeout_entry.set_text(str(self._settings.http_timeout))
|
|
||||||
elif label == "FTP":
|
|
||||||
self._login_entry.set_text(self._settings.user)
|
|
||||||
self._password_entry.set_text(self._settings.password)
|
|
||||||
self._port_entry.set_text(self._settings.port)
|
|
||||||
self._timeout_entry.set_text("")
|
|
||||||
self._current_property = label
|
|
||||||
|
|
||||||
def on_settings(self, item):
|
def on_settings(self, item):
|
||||||
response = show_settings_dialog(self._dialog_window, self._settings)
|
response = show_settings_dialog(self._dialog_window, self._settings)
|
||||||
if response != Gtk.ResponseType.CANCEL:
|
if response != Gtk.ResponseType.CANCEL:
|
||||||
@@ -132,11 +103,6 @@ class DownloadDialog:
|
|||||||
gen = self._update_settings_callback()
|
gen = self._update_settings_callback()
|
||||||
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW)
|
||||||
|
|
||||||
for button in self._settings_buttons_box.get_children():
|
|
||||||
if button.get_active():
|
|
||||||
self.on_settings_button(button)
|
|
||||||
break
|
|
||||||
|
|
||||||
def on_profile_changed(self, box):
|
def on_profile_changed(self, box):
|
||||||
active = box.get_active_text()
|
active = box.get_active_text()
|
||||||
if active in self._settings.profiles:
|
if active in self._settings.profiles:
|
||||||
|
|||||||
@@ -1279,7 +1279,7 @@ class Application(Gtk.Application):
|
|||||||
use_http = profile is SettingsType.ENIGMA_2
|
use_http = profile is SettingsType.ENIGMA_2
|
||||||
|
|
||||||
if profile is SettingsType.ENIGMA_2:
|
if profile is SettingsType.ENIGMA_2:
|
||||||
host, port, user, password = opts.host, opts.http_port, opts.http_user, opts.http_password
|
host, port, user, password = opts.host, opts.http_port, opts.user, opts.password
|
||||||
try:
|
try:
|
||||||
test_http(host, port, user, password, use_ssl=opts.http_use_ssl, skip_message=True)
|
test_http(host, port, user, password, use_ssl=opts.http_use_ssl, skip_message=True)
|
||||||
except (TestException, HttpApiException):
|
except (TestException, HttpApiException):
|
||||||
|
|||||||
@@ -226,29 +226,6 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="position">5</property>
|
<property name="position">5</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkButton" id="reset_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="receives_default">True</property>
|
|
||||||
<property name="tooltip_text" translatable="yes">Reset profile</property>
|
|
||||||
<property name="halign">end</property>
|
|
||||||
<property name="valign">center</property>
|
|
||||||
<property name="always_show_image">True</property>
|
|
||||||
<signal name="clicked" handler="on_reset" swapped="no"/>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage" id="reset_image">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="stock">gtk-revert-to-saved</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child internal-child="vbox">
|
<child internal-child="vbox">
|
||||||
@@ -311,7 +288,6 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="profile_box">
|
<object class="GtkBox" id="profile_box">
|
||||||
<property name="width_request">155</property>
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
@@ -382,6 +358,7 @@ Author: Dmitriy Yefremov
|
|||||||
<object class="GtkToolbar" id="profile_tool_bar">
|
<object class="GtkToolbar" id="profile_tool_bar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="show_arrow">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkToolButton" id="profile_add_button">
|
<object class="GtkToolButton" id="profile_add_button">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -430,19 +407,6 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="homogeneous">True</property>
|
<property name="homogeneous">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
|
||||||
<object class="GtkToolItem">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<child>
|
|
||||||
<placeholder/>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="homogeneous">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkToolButton" id="profile_set_default_button">
|
<object class="GtkToolButton" id="profile_set_default_button">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -460,6 +424,21 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="homogeneous">True</property>
|
<property name="homogeneous">True</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkToolButton" id="profile_reset_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Reset profile</property>
|
||||||
|
<property name="label" translatable="yes">Reset</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="stock_id">gtk-revert-to-saved</property>
|
||||||
|
<signal name="clicked" handler="on_reset" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="homogeneous">True</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@@ -467,32 +446,13 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child type="label">
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Profile:</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="resize">True</property>
|
|
||||||
<property name="shrink">False</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkBox" id="prifile_box">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="orientation">vertical</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="settings_type_frame">
|
<object class="GtkFrame" id="settings_type_frame">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_left">5</property>
|
<property name="margin_left">5</property>
|
||||||
<property name="margin_right">5</property>
|
<property name="margin_right">5</property>
|
||||||
|
<property name="margin_top">5</property>
|
||||||
<property name="margin_bottom">5</property>
|
<property name="margin_bottom">5</property>
|
||||||
<property name="label_xalign">0.019999999552965164</property>
|
<property name="label_xalign">0.019999999552965164</property>
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
@@ -548,9 +508,29 @@ Author: Dmitriy Yefremov
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">0</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child type="label">
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Profile:</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="resize">True</property>
|
||||||
|
<property name="shrink">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkBox" id="prifile_box">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="orientation">vertical</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkFrame" id="network_settings_frame">
|
<object class="GtkFrame" id="network_settings_frame">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -561,25 +541,39 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="label_xalign">0.019999999552965164</property>
|
<property name="label_xalign">0.019999999552965164</property>
|
||||||
<property name="shadow_type">in</property>
|
<property name="shadow_type">in</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkBox" id="network_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_left">5</property>
|
<property name="margin_left">5</property>
|
||||||
<property name="margin_right">5</property>
|
<property name="margin_right">5</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">2</property>
|
<property name="spacing">5</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkGrid" id="main_network_box">
|
<object class="GtkGrid">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_bottom">5</property>
|
<property name="margin_bottom">5</property>
|
||||||
<property name="row_spacing">2</property>
|
<property name="row_spacing">2</property>
|
||||||
<property name="column_spacing">2</property>
|
<property name="column_spacing">5</property>
|
||||||
<property name="column_homogeneous">True</property>
|
<child>
|
||||||
|
<object class="GtkLabel" id="label4">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="margin_left">5</property>
|
||||||
|
<property name="label" translatable="yes">Host:</property>
|
||||||
|
<property name="xalign">0.019999999552965164</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkEntry" id="host_field">
|
<object class="GtkEntry" id="host_field">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
<property name="text">127.0.0.1</property>
|
<property name="text">127.0.0.1</property>
|
||||||
<property name="primary_icon_name">network-transmit-receive-symbolic</property>
|
<property name="primary_icon_name">network-transmit-receive-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
@@ -589,52 +583,241 @@ Author: Dmitriy Yefremov
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox">
|
<object class="GtkLabel" id="label13">
|
||||||
<property name="height_request">22</property>
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label4">
|
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="valign">end</property>
|
<property name="valign">end</property>
|
||||||
<property name="margin_left">5</property>
|
<property name="label" translatable="yes">Login:</property>
|
||||||
<property name="label" translatable="yes">Host:</property>
|
<property name="xalign">0.019999999552965164</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="fill">True</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="position">0</property>
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="login_field">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="text">root</property>
|
||||||
|
<property name="primary_icon_name">avatar-default-symbolic</property>
|
||||||
|
<property name="primary_icon_activatable">False</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="label14">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="label" translatable="yes">Password:</property>
|
||||||
|
<property name="xalign">0.019999999552965164</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="password_field">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="hexpand">False</property>
|
||||||
|
<property name="visibility">False</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="text">root</property>
|
||||||
|
<property name="primary_icon_name">emblem-readonly</property>
|
||||||
|
<property name="primary_icon_activatable">False</property>
|
||||||
|
<property name="input_purpose">password</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="port_field">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Default 21</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="width_chars">6</property>
|
||||||
|
<property name="max_width_chars">6</property>
|
||||||
|
<property name="text">21</property>
|
||||||
|
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
||||||
|
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="ftp_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">FTP:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="telnet_port_field">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Default 23</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="width_chars">6</property>
|
||||||
|
<property name="max_width_chars">6</property>
|
||||||
|
<property name="text" translatable="yes">23</property>
|
||||||
|
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
||||||
|
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSpinButton" id="telnet_timeout_spin_button">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Timeout between commands in seconds</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="max_length">2</property>
|
||||||
|
<property name="width_chars">6</property>
|
||||||
|
<property name="max_width_chars">6</property>
|
||||||
|
<property name="text" translatable="yes">1</property>
|
||||||
|
<property name="primary_icon_name">alarm-symbolic</property>
|
||||||
|
<property name="input_purpose">number</property>
|
||||||
|
<property name="adjustment">telnet_timeout_adjustment</property>
|
||||||
|
<property name="numeric">True</property>
|
||||||
|
<property name="value">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">3</property>
|
||||||
|
<property name="top_attach">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="http_port_field">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">Default 80</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
|
<property name="max_length">5</property>
|
||||||
|
<property name="width_chars">6</property>
|
||||||
|
<property name="max_width_chars">6</property>
|
||||||
|
<property name="text" translatable="yes">80</property>
|
||||||
|
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
||||||
|
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="http_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">HTTP:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="telnet_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="label" translatable="yes">Telnet:</property>
|
||||||
|
<property name="xalign">1</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">5</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="timeout_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="label" translatable="yes">Timeout:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">3</property>
|
||||||
|
<property name="top_attach">4</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="port_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="valign">end</property>
|
||||||
|
<property name="label" translatable="yes">Port:</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">2</property>
|
||||||
|
<property name="top_attach">0</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCheckButton" id="http_use_ssl_check_button">
|
<object class="GtkCheckButton" id="http_use_ssl_check_button">
|
||||||
<property name="label" translatable="yes">SSL/TSL</property>
|
<property name="label" translatable="yes">SSL/TSL</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="valign">end</property>
|
<property name="halign">start</property>
|
||||||
|
<property name="valign">center</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<signal name="toggled" handler="on_http_use_ssl_toggled" swapped="no"/>
|
<signal name="toggled" handler="on_http_use_ssl_toggled" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="left_attach">3</property>
|
||||||
<property name="fill">False</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="pack_type">end</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
<child>
|
||||||
<packing>
|
<placeholder/>
|
||||||
<property name="left_attach">0</property>
|
</child>
|
||||||
<property name="top_attach">0</property>
|
<child>
|
||||||
</packing>
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<placeholder/>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">0</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -643,11 +826,58 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="margin_bottom">5</property>
|
<property name="margin_bottom">5</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkStackSwitcher" id="stack_switcher">
|
<object class="GtkButtonBox" id="test_button_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">center</property>
|
<property name="layout_style">expand</property>
|
||||||
<property name="stack">settings_stack</property>
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="ftp_radio_button">
|
||||||
|
<property name="label" translatable="yes">FTP</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw_indicator">False</property>
|
||||||
|
<property name="group">telnet_radio_button</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">0</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="http_radio_button">
|
||||||
|
<property name="label" translatable="yes">HTTP</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw_indicator">False</property>
|
||||||
|
<property name="group">telnet_radio_button</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">1</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkRadioButton" id="telnet_radio_button">
|
||||||
|
<property name="label" translatable="yes">Telnet</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="active">True</property>
|
||||||
|
<property name="draw_indicator">False</property>
|
||||||
|
<property name="group">ftp_radio_button</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="fill">True</property>
|
||||||
|
<property name="position">2</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
@@ -714,323 +944,6 @@ Author: Dmitriy Yefremov
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
|
||||||
<property name="expand">False</property>
|
|
||||||
<property name="fill">True</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkStack" id="settings_stack">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="margin_bottom">5</property>
|
|
||||||
<signal name="notify::visible-child" handler="on_network_settings_visible" swapped="no"/>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="ftp_grid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="row_spacing">2</property>
|
|
||||||
<property name="column_spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label13">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Login:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="login_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="text">root</property>
|
|
||||||
<property name="primary_icon_name">avatar-default-symbolic</property>
|
|
||||||
<property name="primary_icon_activatable">False</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label14">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Password:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="password_field">
|
|
||||||
<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="text">root</property>
|
|
||||||
<property name="primary_icon_name">emblem-readonly</property>
|
|
||||||
<property name="primary_icon_activatable">False</property>
|
|
||||||
<property name="input_purpose">password</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="port_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="width_chars">6</property>
|
|
||||||
<property name="max_width_chars">6</property>
|
|
||||||
<property name="text">21</property>
|
|
||||||
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
|
||||||
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Port:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">ftp</property>
|
|
||||||
<property name="title" translatable="yes">FTP</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="http_grid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="row_spacing">2</property>
|
|
||||||
<property name="column_spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Login:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Password:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="http_login_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="primary_icon_name">avatar-default-symbolic</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Port:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="http_port_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="max_length">5</property>
|
|
||||||
<property name="width_chars">6</property>
|
|
||||||
<property name="max_width_chars">6</property>
|
|
||||||
<property name="text" translatable="yes">80</property>
|
|
||||||
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
|
||||||
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="http_password_field">
|
|
||||||
<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="text">root</property>
|
|
||||||
<property name="primary_icon_name">emblem-readonly</property>
|
|
||||||
<property name="primary_icon_activatable">False</property>
|
|
||||||
<property name="input_purpose">password</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">http</property>
|
|
||||||
<property name="title" translatable="yes">HTTP</property>
|
|
||||||
<property name="position">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkGrid" id="telnet_grid">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="row_spacing">2</property>
|
|
||||||
<property name="column_spacing">2</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label3">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Port:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="telnet_port_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="width_chars">6</property>
|
|
||||||
<property name="max_width_chars">6</property>
|
|
||||||
<property name="text" translatable="yes">23</property>
|
|
||||||
<property name="primary_icon_name">network-workgroup-symbolic</property>
|
|
||||||
<signal name="changed" handler="on_digit_entry_changed" swapped="no"/>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label16">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Login:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="telnet_login_field">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="width_chars">12</property>
|
|
||||||
<property name="max_width_chars">15</property>
|
|
||||||
<property name="primary_icon_name">avatar-default-symbolic</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">0</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label17">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Password:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkEntry" id="telnet_password_field">
|
|
||||||
<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>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="label19">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">False</property>
|
|
||||||
<property name="label" translatable="yes">Timeout:</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">3</property>
|
|
||||||
<property name="top_attach">0</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSpinButton" id="telnet_timeout_spin_button">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="can_focus">True</property>
|
|
||||||
<property name="tooltip_text" translatable="yes">Timeout between commands in seconds</property>
|
|
||||||
<property name="max_length">2</property>
|
|
||||||
<property name="width_chars">6</property>
|
|
||||||
<property name="max_width_chars">6</property>
|
|
||||||
<property name="text" translatable="yes">1</property>
|
|
||||||
<property name="primary_icon_name">alarm-symbolic</property>
|
|
||||||
<property name="input_purpose">number</property>
|
|
||||||
<property name="adjustment">telnet_timeout_adjustment</property>
|
|
||||||
<property name="numeric">True</property>
|
|
||||||
<property name="value">1</property>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">3</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
|
||||||
<property name="name">telnet</property>
|
|
||||||
<property name="title" translatable="yes">Telnet</property>
|
|
||||||
<property name="position">2</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</object>
|
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
@@ -1048,7 +961,7 @@ Author: Dmitriy Yefremov
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">True</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">True</property>
|
<property name="fill">True</property>
|
||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
@@ -1075,7 +988,7 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">Services and Bouquets files:</property>
|
<property name="label" translatable="yes">Services and Bouquets files:</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0.019999999552965164</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
@@ -1098,7 +1011,7 @@ Author: Dmitriy Yefremov
|
|||||||
<object class="GtkLabel" id="user_bouquet_label">
|
<object class="GtkLabel" id="user_bouquet_label">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">User bouquet files:</property>
|
<property name="label" translatable="yes">User bouquet files:</property>
|
||||||
<property name="xalign">2.2351741291171123e-10</property>
|
<property name="xalign">0.019999999552965164</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from enum import Enum
|
|
||||||
|
|
||||||
from app.commons import run_task, run_idle, log
|
from app.commons import run_task, run_idle, log
|
||||||
from app.connections import test_telnet, test_ftp, TestException, test_http, HttpApiException
|
from app.connections import test_telnet, test_ftp, TestException, test_http, HttpApiException
|
||||||
@@ -14,12 +13,6 @@ def show_settings_dialog(transient, options):
|
|||||||
return SettingsDialog(transient, options).show()
|
return SettingsDialog(transient, options).show()
|
||||||
|
|
||||||
|
|
||||||
class Property(Enum):
|
|
||||||
FTP = "ftp"
|
|
||||||
HTTP = "http"
|
|
||||||
TELNET = "telnet"
|
|
||||||
|
|
||||||
|
|
||||||
class SettingsDialog:
|
class SettingsDialog:
|
||||||
_DIGIT_ENTRY_NAME = "digit-entry"
|
_DIGIT_ENTRY_NAME = "digit-entry"
|
||||||
_DIGIT_PATTERN = re.compile("(?:^[\\s]*$|\\D)")
|
_DIGIT_PATTERN = re.compile("(?:^[\\s]*$|\\D)")
|
||||||
@@ -50,7 +43,6 @@ class SettingsDialog:
|
|||||||
"on_profile_set_default": self.on_profile_set_default,
|
"on_profile_set_default": self.on_profile_set_default,
|
||||||
"on_lang_changed": self.on_lang_changed,
|
"on_lang_changed": self.on_lang_changed,
|
||||||
"on_main_settings_visible": self.on_main_settings_visible,
|
"on_main_settings_visible": self.on_main_settings_visible,
|
||||||
"on_network_settings_visible": self.on_network_settings_visible,
|
|
||||||
"on_http_use_ssl_toggled": self.on_http_use_ssl_toggled,
|
"on_http_use_ssl_toggled": self.on_http_use_ssl_toggled,
|
||||||
"on_click_mode_togged": self.on_click_mode_togged,
|
"on_click_mode_togged": self.on_click_mode_togged,
|
||||||
"on_play_mode_changed": self.on_play_mode_changed,
|
"on_play_mode_changed": self.on_play_mode_changed,
|
||||||
@@ -84,15 +76,13 @@ class SettingsDialog:
|
|||||||
self._port_field = builder.get_object("port_field")
|
self._port_field = builder.get_object("port_field")
|
||||||
self._login_field = builder.get_object("login_field")
|
self._login_field = builder.get_object("login_field")
|
||||||
self._password_field = builder.get_object("password_field")
|
self._password_field = builder.get_object("password_field")
|
||||||
self._http_login_field = builder.get_object("http_login_field")
|
|
||||||
self._http_password_field = builder.get_object("http_password_field")
|
|
||||||
self._http_port_field = builder.get_object("http_port_field")
|
self._http_port_field = builder.get_object("http_port_field")
|
||||||
self._http_use_ssl_check_button = builder.get_object("http_use_ssl_check_button")
|
self._http_use_ssl_check_button = builder.get_object("http_use_ssl_check_button")
|
||||||
self._telnet_login_field = builder.get_object("telnet_login_field")
|
|
||||||
self._telnet_password_field = builder.get_object("telnet_password_field")
|
|
||||||
self._telnet_port_field = builder.get_object("telnet_port_field")
|
self._telnet_port_field = builder.get_object("telnet_port_field")
|
||||||
self._telnet_timeout_spin_button = builder.get_object("telnet_timeout_spin_button")
|
self._telnet_timeout_spin_button = builder.get_object("telnet_timeout_spin_button")
|
||||||
self._settings_stack = builder.get_object("settings_stack")
|
# Test
|
||||||
|
self._ftp_radio_button = builder.get_object("ftp_radio_button")
|
||||||
|
self._http_radio_button = builder.get_object("http_radio_button")
|
||||||
# Paths
|
# Paths
|
||||||
self._services_field = builder.get_object("services_field")
|
self._services_field = builder.get_object("services_field")
|
||||||
self._user_bouquet_field = builder.get_object("user_bouquet_field")
|
self._user_bouquet_field = builder.get_object("user_bouquet_field")
|
||||||
@@ -176,7 +166,6 @@ class SettingsDialog:
|
|||||||
self._profile_remove_button = builder.get_object("profile_remove_button")
|
self._profile_remove_button = builder.get_object("profile_remove_button")
|
||||||
self._apply_profile_button = builder.get_object("apply_profile_button")
|
self._apply_profile_button = builder.get_object("apply_profile_button")
|
||||||
self._apply_profile_button.bind_property("visible", header_separator, "visible")
|
self._apply_profile_button.bind_property("visible", header_separator, "visible")
|
||||||
self._apply_profile_button.bind_property("visible", builder.get_object("reset_button"), "visible")
|
|
||||||
# Style
|
# Style
|
||||||
self._style_provider = Gtk.CssProvider()
|
self._style_provider = Gtk.CssProvider()
|
||||||
self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css")
|
self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css")
|
||||||
@@ -209,7 +198,6 @@ class SettingsDialog:
|
|||||||
is_enigma_profile = s_type is SettingsType.ENIGMA_2
|
is_enigma_profile = s_type is SettingsType.ENIGMA_2
|
||||||
self._neutrino_radio_button.set_active(s_type is SettingsType.NEUTRINO_MP)
|
self._neutrino_radio_button.set_active(s_type is SettingsType.NEUTRINO_MP)
|
||||||
self.update_header_bar()
|
self.update_header_bar()
|
||||||
self._settings_stack.get_child_by_name(Property.HTTP.value).set_visible(is_enigma_profile)
|
|
||||||
http_active = self._support_http_api_switch.get_active()
|
http_active = self._support_http_api_switch.get_active()
|
||||||
self._click_mode_zap_button.set_sensitive(is_enigma_profile and http_active)
|
self._click_mode_zap_button.set_sensitive(is_enigma_profile and http_active)
|
||||||
self._lang_combo_box.set_active_id(self._ext_settings.language)
|
self._lang_combo_box.set_active_id(self._ext_settings.language)
|
||||||
@@ -265,12 +253,8 @@ class SettingsDialog:
|
|||||||
self._port_field.set_text(self._settings.port)
|
self._port_field.set_text(self._settings.port)
|
||||||
self._login_field.set_text(self._settings.user)
|
self._login_field.set_text(self._settings.user)
|
||||||
self._password_field.set_text(self._settings.password)
|
self._password_field.set_text(self._settings.password)
|
||||||
self._http_login_field.set_text(self._settings.http_user)
|
|
||||||
self._http_password_field.set_text(self._settings.http_password)
|
|
||||||
self._http_port_field.set_text(self._settings.http_port)
|
self._http_port_field.set_text(self._settings.http_port)
|
||||||
self._http_use_ssl_check_button.set_active(self._settings.http_use_ssl)
|
self._http_use_ssl_check_button.set_active(self._settings.http_use_ssl)
|
||||||
self._telnet_login_field.set_text(self._settings.telnet_user)
|
|
||||||
self._telnet_password_field.set_text(self._settings.telnet_password)
|
|
||||||
self._telnet_port_field.set_text(self._settings.telnet_port)
|
self._telnet_port_field.set_text(self._settings.telnet_port)
|
||||||
self._telnet_timeout_spin_button.set_value(self._settings.telnet_timeout)
|
self._telnet_timeout_spin_button.set_value(self._settings.telnet_timeout)
|
||||||
self._services_field.set_text(self._settings.services_path)
|
self._services_field.set_text(self._settings.services_path)
|
||||||
@@ -326,12 +310,8 @@ class SettingsDialog:
|
|||||||
self._settings.port = self._port_field.get_text()
|
self._settings.port = self._port_field.get_text()
|
||||||
self._settings.user = self._login_field.get_text()
|
self._settings.user = self._login_field.get_text()
|
||||||
self._settings.password = self._password_field.get_text()
|
self._settings.password = self._password_field.get_text()
|
||||||
self._settings.http_user = self._http_login_field.get_text()
|
|
||||||
self._settings.http_password = self._http_password_field.get_text()
|
|
||||||
self._settings.http_port = self._http_port_field.get_text()
|
self._settings.http_port = self._http_port_field.get_text()
|
||||||
self._settings.http_use_ssl = self._http_use_ssl_check_button.get_active()
|
self._settings.http_use_ssl = self._http_use_ssl_check_button.get_active()
|
||||||
self._settings.telnet_user = self._telnet_login_field.get_text()
|
|
||||||
self._settings.telnet_password = self._telnet_password_field.get_text()
|
|
||||||
self._settings.telnet_port = self._telnet_port_field.get_text()
|
self._settings.telnet_port = self._telnet_port_field.get_text()
|
||||||
self._settings.telnet_timeout = int(self._telnet_timeout_spin_button.get_value())
|
self._settings.telnet_timeout = int(self._telnet_timeout_spin_button.get_value())
|
||||||
self._settings.services_path = self._services_field.get_text()
|
self._settings.services_path = self._services_field.get_text()
|
||||||
@@ -391,16 +371,15 @@ class SettingsDialog:
|
|||||||
if self._test_spinner.get_state() is Gtk.StateType.ACTIVE:
|
if self._test_spinner.get_state() is Gtk.StateType.ACTIVE:
|
||||||
return
|
return
|
||||||
self.show_spinner(True)
|
self.show_spinner(True)
|
||||||
current_property = Property(self._settings_stack.get_visible_child_name())
|
if self._ftp_radio_button.get_active():
|
||||||
if current_property is Property.HTTP:
|
|
||||||
self.test_http()
|
|
||||||
elif current_property is Property.TELNET:
|
|
||||||
self.test_telnet()
|
|
||||||
elif current_property is Property.FTP:
|
|
||||||
self.test_ftp()
|
self.test_ftp()
|
||||||
|
elif self._http_radio_button.get_active():
|
||||||
|
self.test_http()
|
||||||
|
else:
|
||||||
|
self.test_telnet()
|
||||||
|
|
||||||
def test_http(self):
|
def test_http(self):
|
||||||
user, password = self._http_login_field.get_text(), self._http_password_field.get_text()
|
user, password = self._login_field.get_text(), self._password_field.get_text()
|
||||||
host, port = self._host_field.get_text(), self._http_port_field.get_text()
|
host, port = self._host_field.get_text(), self._http_port_field.get_text()
|
||||||
use_ssl = self._http_use_ssl_check_button.get_active()
|
use_ssl = self._http_use_ssl_check_button.get_active()
|
||||||
try:
|
try:
|
||||||
@@ -415,7 +394,7 @@ class SettingsDialog:
|
|||||||
def test_telnet(self):
|
def test_telnet(self):
|
||||||
timeout = int(self._telnet_timeout_spin_button.get_value())
|
timeout = int(self._telnet_timeout_spin_button.get_value())
|
||||||
host, port = self._host_field.get_text(), self._telnet_port_field.get_text()
|
host, port = self._host_field.get_text(), self._telnet_port_field.get_text()
|
||||||
user, password = self._telnet_login_field.get_text(), self._telnet_password_field.get_text()
|
user, password = self._login_field.get_text(), self._password_field.get_text()
|
||||||
try:
|
try:
|
||||||
self.show_info_message(test_telnet(host, port, user, password, timeout), Gtk.MessageType.INFO)
|
self.show_info_message(test_telnet(host, port, user, password, timeout), Gtk.MessageType.INFO)
|
||||||
self.show_spinner(False)
|
self.show_spinner(False)
|
||||||
@@ -581,9 +560,6 @@ class SettingsDialog:
|
|||||||
self._apply_profile_button.set_visible(name == "profiles")
|
self._apply_profile_button.set_visible(name == "profiles")
|
||||||
self._apply_presets_button.set_visible(name == "streaming")
|
self._apply_presets_button.set_visible(name == "streaming")
|
||||||
|
|
||||||
def on_network_settings_visible(self, stack, param):
|
|
||||||
self._http_use_ssl_check_button.set_visible(Property(stack.get_visible_child_name()) is Property.HTTP)
|
|
||||||
|
|
||||||
def on_http_use_ssl_toggled(self, button):
|
def on_http_use_ssl_toggled(self, button):
|
||||||
active = button.get_active()
|
active = button.get_active()
|
||||||
self._settings.http_use_ssl = active
|
self._settings.http_use_ssl = active
|
||||||
|
|||||||
Reference in New Issue
Block a user