From b3648a2dae7dee2f53b4b0cb615d21c4f420ccd8 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Mon, 29 Oct 2018 21:49:31 +0300 Subject: [PATCH] updating elements for download dialog --- app/ui/new_download_dialog.glade | 149 +++++-------------------------- app/ui/new_download_dialog.py | 22 +++++ 2 files changed, 46 insertions(+), 125 deletions(-) diff --git a/app/ui/new_download_dialog.glade b/app/ui/new_download_dialog.glade index 72c28d90..2a3df17a 100644 --- a/app/ui/new_download_dialog.glade +++ b/app/ui/new_download_dialog.glade @@ -38,21 +38,6 @@ Author: Dmitriy Yefremov False gtk-connect - - True - False - gtk-jump-to - - - True - False - gtk-refresh - - - True - False - gtk-convert - 560 False @@ -362,7 +347,7 @@ Author: Dmitriy Yefremov - + True False 2 @@ -439,13 +424,13 @@ Author: Dmitriy Yefremov False - center 5 5 + 5 2 2 - + True False Login: @@ -457,12 +442,13 @@ Author: Dmitriy Yefremov - + True True + 15 root + False avatar-default-symbolic - False 0 @@ -470,7 +456,7 @@ Author: Dmitriy Yefremov - + True False Port: @@ -482,7 +468,7 @@ Author: Dmitriy Yefremov - + True True False @@ -497,7 +483,7 @@ Author: Dmitriy Yefremov - + True False Password: @@ -509,14 +495,14 @@ Author: Dmitriy Yefremov - + True True False + 15 root emblem-readonly - False password @@ -525,31 +511,24 @@ Author: Dmitriy Yefremov - - True - False - Timeout: - 0.10000000149011612 - - - 3 - 0 - - - - + + Test True True - False - 8 - False - alarm-symbolic + True + Test connection + True + connection_image + True 3 1 + + + False @@ -557,83 +536,6 @@ Author: Dmitriy Yefremov 0 - - - True - False - 5 - 5 - 5 - 5 - 5 - True - - - Reload data - True - True - True - reload_image - True - - - False - True - 0 - - - - - Reload bouquets - True - True - True - reload_bouquet_image - True - - - False - True - 1 - - - - - Test connection - True - True - connection_image - True - - - False - True - 2 - - - - - Reboot - True - True - True - Reboot the receiver - reboot_image - True - - - False - True - 3 - - - - - False - True - 1 - - @@ -649,6 +551,7 @@ Author: Dmitriy Yefremov True False telnet_radio_button + False @@ -664,6 +567,7 @@ Author: Dmitriy Yefremov False False ftp_radio_button + False @@ -679,6 +583,7 @@ Author: Dmitriy Yefremov False False http_radio_button + False @@ -790,10 +695,4 @@ Author: Dmitriy Yefremov - - 1 - 11 - 1 - 10 - diff --git a/app/ui/new_download_dialog.py b/app/ui/new_download_dialog.py index b5c81d6f..abc52856 100644 --- a/app/ui/new_download_dialog.py +++ b/app/ui/new_download_dialog.py @@ -15,6 +15,7 @@ class DownloadDialog: handlers = {"on_receive": self.on_receive, "on_send": self.on_send, + "on_settings_button": self.on_settings_button, "on_info_bar_close": self.on_info_bar_close} builder = Gtk.Builder() @@ -33,9 +34,14 @@ class DownloadDialog: self._bouquets_radio_button = builder.get_object("bouquets_radio_button") self._satellites_radio_button = builder.get_object("satellites_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._port_entry = builder.get_object("port_entry") if profile is Profile.NEUTRINO_MP: self._webtv_radio_button.set_visible(True) + builder.get_object("http_radio_button").set_visible(False) + builder.get_object("use_http_box").set_visible(False) def show(self): self._dialog_window.show() @@ -62,6 +68,22 @@ class DownloadDialog: def destroy(self): 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._properties.get("telnet_user", "")) + self._password_entry.set_text(self._properties.get("telnet_password", "")) + self._port_entry.set_text(self._properties.get("telnet_port", "23")) + elif label == "HTTP": + self._login_entry.set_text(self._properties.get("user", "root")) + self._password_entry.set_text(self._properties.get("password", "root")) + self._port_entry.set_text("80") + elif label == "FTP": + self._login_entry.set_text(self._properties.get("user", "root")) + self._password_entry.set_text(self._properties.get("password", "root")) + self._port_entry.set_text(self._properties.get("port", "21")) + def on_info_bar_close(self, bar=None, resp=None): self._info_bar.set_visible(False)