diff --git a/app/ui/app_menu_bar.ui b/app/ui/app_menu_bar.ui index 00371fa8..cb770e21 100644 --- a/app/ui/app_menu_bar.ui +++ b/app/ui/app_menu_bar.ui @@ -23,6 +23,8 @@ File + app.hide_menu_bar + action-disabled
Import @@ -69,6 +71,8 @@ Edit + app.hide_menu_bar + action-disabled
Lock @@ -82,6 +86,8 @@ View + app.hide_menu_bar + action-disabled
Search @@ -95,6 +101,8 @@ Tools + app.hide_menu_bar + action-disabled
Satellites editor @@ -114,6 +122,8 @@ IPTV + app.hide_menu_bar + action-disabled Add IPTV or stream service app.on_iptv @@ -147,5 +157,14 @@
+ + FTP client + app.show_ftp_menu + action-disabled + + Close + app.on_ftp_client_close + +
\ No newline at end of file diff --git a/app/ui/ftp.glade b/app/ui/ftp.glade index 525a47e5..16336104 100644 --- a/app/ui/ftp.glade +++ b/app/ui/ftp.glade @@ -93,27 +93,97 @@ Author: Dmitriy Yefremov 0 in - - 320 - 240 + True - True - 5 - 5 - 5 - 5 + False vertical - True + 2 - + True False - vertical + 10 + 10 + 5 + 5 2 - + True False + True + Connect + + + + True + False + gtk-connect + + + + + False + True + 0 + + + + + False + True + Disconnect + + + + True + False + gtk-disconnect + + + + + False + True + 1 + + + + + False + bookmarks_list_store + 0 + + + False + True + 2 + + + + + False + True + 0 + + + + + 320 + 240 + True + True + 5 + 5 + 5 + 5 + True + + + True + False + vertical + 2 True @@ -123,9 +193,7 @@ Author: Dmitriy Yefremov True False - 10 FTP: - 1 @@ -141,7 +209,7 @@ Author: Dmitriy Yefremov True False end - 25 + 75 1 @@ -158,24 +226,158 @@ Author: Dmitriy Yefremov - + True - False - 2 + True + in + 100 - + True - False - True - Connect - - - - True - False - gtk-connect + True + ftp_list_store + 1 + True + + + + + + + + + + + + multiple + + + True + 100 + Name + True + 0.5 + 1 + + + 0.019999999552965164 + + + 0 + + + + + 0.019999999552965164 + end + + + + 1 + + + + + + + fixed + 75 + Size + 0.5 + 2 + + + 0.94999998807907104 + + + 2 + + + + + + + 75 + Date + 0.5 + 3 + + + + 3 + + + + + + + fixed + 75 + Attr. + 0.5 + 4 + + + 0.50999999046325684 + end + + + 4 + + + + + + + False + Extra + + + + 5 + + + + + + + + + True + True + 2 + + + + + True + True + + + + + True + False + vertical + 2 + + + True + False + 5 + 5 + + + True + False + start + 10 + PC: + + + False @@ -184,18 +386,11 @@ Author: Dmitriy Yefremov - + + True False - True - Disconnect - - - - True - False - gtk-disconnect - - + end + 75 False @@ -203,189 +398,6 @@ Author: Dmitriy Yefremov 1 - - - False - bookmarks_list_store - 0 - - - False - True - end - 2 - - - - - False - True - end - 1 - - - - - - - - False - True - 1 - - - - - True - True - in - 100 - - - True - True - ftp_list_store - 1 - True - - - - - - - - - - - - multiple - - - - - True - 100 - Name - True - 0.5 - 1 - - - 0.019999999552965164 - - - 0 - - - - - 0.019999999552965164 - end - - - - 1 - - - - - - - fixed - 75 - Size - 0.5 - 2 - - - 0.94999998807907104 - - - 2 - - - - - - - 75 - Date - 0.5 - 3 - - - - 3 - - - - - - - fixed - 50 - Attr. - 0.5 - 4 - - - 0.50999999046325684 - end - - - 4 - - - - - - - False - Extra - - - - 5 - - - - - - - - - True - True - 2 - - - - - True - True - - - - - True - False - vertical - 2 - - - True - False - 5 - - - True - False - start - 10 - PC: - - - False @@ -394,150 +406,137 @@ Author: Dmitriy Yefremov - + True - False - end - 32 + True + in + 100 + + + True + True + file_list_store + 1 + True + + + + + + + + + + + + multiple + + + + + True + 100 + Name + True + 0.5 + 1 + + + 0.20000000298023224 + + + 0 + + + + + end + + + + 1 + + + + + + + fixed + 75 + Size + 0.5 + 2 + + + 0.94999998807907104 + + + 2 + + + + + + + 75 + Date + 0.5 + 3 + + + + 3 + + + + + + + False + fixed + 50 + Path + 0.5 + + + + 4 + + + + + + + False + Extra + + + + 5 + + + + + + - False + True True 1 - False - True - 0 - - - - - True - True - in - 100 - - - True - True - file_list_store - 1 - True - - - - - - - - - - - - multiple - - - - - True - 100 - Name - True - 0.5 - 1 - - - 0.20000000298023224 - - - 0 - - - - - end - - - - 1 - - - - - - - fixed - 75 - Size - 0.5 - 2 - - - 0.94999998807907104 - - - 2 - - - - - - - 75 - Date - 0.5 - 3 - - - - 3 - - - - - - - False - fixed - 50 - Path - 0.5 - - - - 4 - - - - - - - False - Extra - - - - 5 - - - - - - - - - True - True - 1 + True + True - True - True + True + True + 1 diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index c8f6096a..fdb8820a 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -243,12 +243,18 @@ class Application(Gtk.Application): self._add_bouquet_button = builder.get_object("add_bouquet_tool_button") # Setting custom sort function for position column. self._services_view.get_model().set_sort_func(Column.SRV_POS, self.position_sort_func, Column.SRV_POS) + # Tool bar elements. + self._main_box = builder.get_object("main_box") + self._toolbar_search_box = builder.get_object("toolbar_search_box") + toolbar_tools_box = builder.get_object("toolbar_tools_box") + self._toolbar_search_box.bind_property("visible", toolbar_tools_box, "visible") + self._toolbar_search_box.bind_property("visible", self._toolbar_extra_tools_box, "visible") # App info self._app_info_box = builder.get_object("app_info_box") self._app_info_box.bind_property("visible", builder.get_object("main_paned"), "visible", 4) - self._app_info_box.bind_property("visible", builder.get_object("toolbar_search_box"), "visible", 4) + self._app_info_box.bind_property("visible", self._toolbar_search_box, "visible", 4) self._app_info_box.bind_property("visible", self._toolbar_extra_tools_box, "visible", 4) - self._app_info_box.bind_property("visible", builder.get_object("toolbar_tools_box"), "visible", 4) + self._app_info_box.bind_property("visible", toolbar_tools_box, "visible", 4) self._app_info_box.bind_property("visible", builder.get_object("save_tool_button"), "visible", 4) self._app_info_box.bind_property("visible", self._add_bouquet_button, "visible", 4) # Status bar @@ -284,6 +290,9 @@ class Application(Gtk.Application): self._ftp_button = builder.get_object("ftp_button") self._ftp_revealer = builder.get_object("ftp_revealer") self._ftp_button.bind_property("active", self._ftp_revealer, "visible") + self._ftp_revealer.bind_property("visible", self._main_box, "visible", 4) + self._ftp_revealer.bind_property("visible", builder.get_object("toolbar_main_box"), "visible", 4) + self._ftp_button.connect("toggled", self.on_ftp_toggle) # 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) @@ -352,21 +361,21 @@ class Application(Gtk.Application): extra_box = builder.get_object("toolbar_extra_box") extra_box.set_child_packing(self._toolbar_extra_tools_box, False, True, 0, Gtk.PackType.END) - search_box = builder.get_object("toolbar_search_box") - search_box.reorder_child(builder.get_object("search_tool_button"), 0) + self._toolbar_search_box.reorder_child(builder.get_object("search_tool_button"), 0) self._top_box.set_child_packing(extra_box, False, True, 0, Gtk.PackType.START) - self._top_box.set_child_packing(search_box, False, True, 0, Gtk.PackType.END) + self._top_box.set_child_packing(self._toolbar_search_box, False, True, 0, Gtk.PackType.END) self._top_box.reorder_child(extra_box, 0) center_box = builder.get_object("center_box") - center_box.reorder_child(self._ftp_revealer, 0) - center_box.reorder_child(self._control_revealer, 1) - center_box.reorder_child(builder.get_object("main_box"), 2) + center_box.reorder_child(self._control_revealer, 0) + center_box.reorder_child(self._ftp_revealer, 1) + center_box.reorder_child(self._main_box, 2) + center_box.set_child_packing(self._control_revealer, False, True, 0, Gtk.PackType.START) builder.get_object("fs_box").set_child_packing(self._filter_box, False, True, 0, Gtk.PackType.END) top_toolbar = builder.get_object("top_toolbar") - top_toolbar.set_child_packing(builder.get_object("toolbar_search_box"), False, True, 0, Gtk.PackType.END) + top_toolbar.set_child_packing(self._toolbar_search_box, False, True, 0, Gtk.PackType.END) services_box = self._main_paned.get_child1() self._main_paned.remove(services_box) @@ -476,6 +485,16 @@ class Application(Gtk.Application): 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) + # FTP client. Hiding the app menu bar when the client is shown. + # We are working with the "hidden-when" submenu attribute. See 'app_menu_bar.ui' file. + hide_bar_action = Gio.SimpleAction.new("hide_menu_bar", None) + self._ftp_revealer.bind_property("visible", hide_bar_action, "enabled", 4) + self.add_action(hide_bar_action) + show_ftp_menu_action = Gio.SimpleAction.new("show_ftp_menu", None) + show_ftp_menu_action.set_enabled(False) + self._ftp_revealer.bind_property("visible", show_ftp_menu_action, "enabled") + self.add_action(show_ftp_menu_action) + self.set_action("on_ftp_client_close", lambda a, v: self._ftp_button.set_active(False)) # Layout self.set_action("on_switch_fav_position", self.on_switch_fav_position) @@ -2957,6 +2976,10 @@ class Application(Gtk.Application): # ****************** FTP client ********************* # + def on_ftp_toggle(self, button): + if not self._app_info_box.get_visible(): + self._toolbar_search_box.set_visible(not button.get_active()) + def on_ftp_realize(self, revealer): if not self._ftp_client: from app.ui.ftp import FtpClientBox diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index bde4c938..e0ce9579 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -184,6 +184,11 @@ Author: Dmitriy Yefremov + + True + False + input-gaming-symbolic + @@ -703,6 +708,11 @@ Author: Dmitriy Yefremov edit-find-symbolic 1 + + True + False + network-server-symbolic + True False @@ -1126,12 +1136,13 @@ Author: Dmitriy Yefremov False center center - 20 - 20 + 15 + 15 True expand + Filter True False True @@ -1149,6 +1160,7 @@ Author: Dmitriy Yefremov + Search True True True @@ -1177,11 +1189,11 @@ Author: Dmitriy Yefremov False center center - 10 - 10 + 5 + 5 10 10 - 10 + 5 True @@ -1411,14 +1423,14 @@ Author: Dmitriy Yefremov False center center - 20 - 20 + 15 + 15 False center - 10 - 10 + 5 + 5 True expand @@ -1503,13 +1515,8 @@ Author: Dmitriy Yefremov True Control app.on_remote - - - True - False - input-gaming-symbolic - - + control_image + True @@ -1520,19 +1527,14 @@ Author: Dmitriy Yefremov + FTP 32 True True True + FTP client + ftp_client_image True - - - True - False - FTP client - network-server-symbolic - - True @@ -3520,6 +3522,7 @@ Author: Dmitriy Yefremov False True + end 1 @@ -3534,7 +3537,7 @@ Author: Dmitriy Yefremov - False + True True 2