diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 8196d60f..68233d4d 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -140,9 +140,6 @@ class Application(Gtk.Application): "on_player_close": self.on_player_close, "on_player_press": self.on_player_press, "on_full_screen": self.on_full_screen, - "on_drawing_area_realize": self.on_drawing_area_realize, - "on_player_drawing_area_draw": self.on_player_drawing_area_draw, - "on_main_window_state": self.on_main_window_state, "on_remove_all_unavailable": self.on_remove_all_unavailable, "on_new_bouquet": self.on_new_bouquet, "on_bouquets_edit": self.on_bouquets_edit, @@ -173,7 +170,6 @@ class Application(Gtk.Application): # Player self._player = None self._full_screen = False - self._drawing_area_xid = None # http api self._http_api = None self._fav_click_mode = None @@ -206,7 +202,7 @@ class Application(Gtk.Application): # App info self._app_info_box = builder.get_object("app_info_box") self._app_info_box.bind_property("visible", self._status_bar_box, "visible", 4) - self._app_info_box.bind_property("visible", builder.get_object("main_paned"), "visible", 4) + self._app_info_box.bind_property("visible", self._main_data_box, "visible", 4) # Status bar self._ip_label = builder.get_object("ip_label") self._ip_label.set_text(self._options.get(self._profile).get("host")) @@ -244,15 +240,12 @@ class Application(Gtk.Application): self._player_full_time_label = builder.get_object("player_full_time_label") self._player_current_time_label = builder.get_object("player_current_time_label") self._player_rewind_box = builder.get_object("player_rewind_box") - self._player_drawing_area = builder.get_object("player_drawing_area") self._player_tool_bar = builder.get_object("player_tool_bar") self._player_prev_button = builder.get_object("player_prev_button") self._player_next_button = builder.get_object("player_next_button") self._player_box.bind_property("visible", self._services_main_box, "visible", 4) self._player_box.bind_property("visible", self._bouquets_main_box, "visible", 4) - # Enabling events for the drawing area - self._player_drawing_area.set_events(Gdk.ModifierType.BUTTON1_MASK) - self._player_frame = builder.get_object("player_frame") + self._player_box.bind_property("visible", builder.get_object("fav_pos_column"), "visible", 4) # Search self._search_bar = builder.get_object("search_bar") self._search_provider = SearchProvider((self._services_view, self._fav_view, self._bouquets_view), @@ -1571,11 +1564,6 @@ class Application(Gtk.Application): except (NameError, AttributeError): self.show_error_dialog("No VLC is found. Check that it is installed!") return - else: - if self._drawing_area_xid: - self._player.set_xwindow(self._drawing_area_xid) - w, h = self._main_window.get_size() - self._player_box.set_size_request(w * 0.6, -1) self._player_box.set_visible(True) GLib.idle_add(self._player.play, url, priority=GLib.PRIORITY_LOW) @@ -1624,7 +1612,7 @@ class Application(Gtk.Application): GLib.idle_add(self._player_full_time_label.set_text, self.get_time_str(duration)) def on_player_time_changed(self, t): - if not self._full_screen and self._player_rewind_box.get_visible(): + if self._player_rewind_box.get_visible(): GLib.idle_add(self._player_current_time_label.set_text, self.get_time_str(t), priority=GLib.PRIORITY_LOW) def get_time_str(self, duration): @@ -1633,26 +1621,6 @@ class Application(Gtk.Application): h, m = divmod(m, 60) return "{}{:02d}:{:02d}".format(str(h) + ":" if h else "", m, s) - def on_drawing_area_realize(self, widget): - self._drawing_area_xid = widget.get_window().get_xid() - self._player.set_xwindow(self._drawing_area_xid) - - def on_player_drawing_area_draw(self, widget, cr): - """ Used for black background drawing in the player drawing area. - - Required for Gtk >= 3.20. - More info: https://developer.gnome.org/gtk3/stable/ch32s10.html, - https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-render-background - """ - context = widget.get_style_context() - width = widget.get_allocated_width() - height = widget.get_allocated_height() - Gtk.render_background(context, cr, 0, 0, width, height) - r, g, b, a = 0, 0, 0, 1 # black color - cr.set_source_rgba(r, g, b, a) - cr.rectangle(0, 0, width, height) - cr.fill() - def on_player_press(self, area, event): if event.button == Gdk.BUTTON_PRIMARY: if event.type == Gdk.EventType.DOUBLE_BUTTON_PRESS: @@ -1662,12 +1630,6 @@ class Application(Gtk.Application): self._full_screen = not self._full_screen self._main_window.fullscreen() if self._full_screen else self._main_window.unfullscreen() - def on_main_window_state(self, window, event): - full = not event.new_window_state & Gdk.WindowState.FULLSCREEN - self._main_data_box.set_visible(full) - self._player_tool_bar.set_visible(full) - self._status_bar_box.set_visible(full and not self._app_info_box.get_visible()) - # ************************ HTTP API ****************************# @run_task diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index fa8b3b27..2547f371 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -681,8 +681,7 @@ Author: Dmitriy Yefremov DemonEditor - - + @@ -691,23 +690,1181 @@ Author: Dmitriy Yefremov False vertical - + False + vertical + + + True + False + + + True + False + 1 + + + 32 + True + True + gtk-find + False + False + + + + False + True + 0 + + + + + True + False + False + True + half + + + + True + False + center + down + + + + + False + False + 1 + + + + + True + False + False + True + half + + + + True + False + center + up + + + + + False + False + 2 + + + + + + + False + True + 0 + + + + + False + + + True + False + 2 + + + Only free + True + True + True + + + + False + False + 0 + + + + + 32 + True + True + gtk-spell-check + False + False + + + + False + True + 1 + + + + + True + False + filter_types_list_store + 0 + 0 + + + + + 0 + + + + + False + True + 2 + + + + + True + False + filter_sat_positions_list_store + 0 + 0 + + + + + 0 + + + + + False + True + 3 + + + + + + + False + True + 1 + + + + + True + False + 2 + + + False + True + 2 + + + + + 250 + True + True + 1 + 1 + True + + + True + False + vertical + + + True + False + Services + + + + + + False + True + 0 + + + + + True + False + in + + + True + True + services_model_tree_model_sort + 3 + True + both + 20 + True + + + + + + + + + + + multiple + + + + + False + CAS + + + + 0 + + + + + + + False + Type + + + + 1 + + + + + + + True + 50 + Service + True + 0.5 + True + 3 + + + 2 + + + 21 + 2 + + + + + end + 25 + + + 21 + 3 + + + + + 2 + + + 21 + 4 + + + + + 2 + + + 21 + 5 + + + + + + + True + 50 + Package + True + True + 6 + + + end + 15 + + + 21 + 6 + + + + + + + True + 25 + Type + True + True + 7 + + + 0.51999998092651367 + + + 21 + 7 + + + + + + + Picon + True + 9 + + + + 21 + 8 + + + + + + + False + fixed + Picon ID + + + + 9 + + + + + + + True + 25 + SID + True + True + 10 + + + 0.50999999046325684 + + + 21 + 10 + + + + + + + True + 25 + Freq + True + True + 11 + + + 0.50999999046325684 + + + 21 + 11 + + + + + + + True + 25 + Rate + True + True + 12 + + + 0.50999999046325684 + + + 21 + 12 + + + + + + + True + 25 + Pol + True + True + 13 + + + 0.50999999046325684 + + + 21 + 13 + + + + + + + True + 25 + FEC + True + True + 14 + + + 0.50999999046325684 + + + 21 + 14 + + + + + + + True + 25 + System + True + True + 15 + + + 0.50999999046325684 + + + 21 + 15 + + + + + + + True + 25 + Pos + True + 16 + + + 0.50999999046325684 + + + 21 + 16 + + + + + + + False + data_id + + + + 17 + + + + + + + False + fav_id + + + + 18 + + + + + + + False + transponder + + + + 19 + + + + + + + False + extra + + + + 20 + + + + + + + + + + + + True + True + 1 + + + + + 26 + True + False + queue + 2 + + + True + False + 5 + emblem-readonly + + + False + True + 0 + + + + + True + False + CAS + 20 + 20 + 0 + + + False + True + 2 + 1 + + + + + True + False + vertical + + + False + True + 5 + 2 + + + + + True + False + tv-symbolic + + + False + True + 3 + + + + + True + False + TV + 5 + 0 + + + False + True + 4 + + + + + True + False + network-wireless-symbolic + + + False + True + 5 + + + + + True + False + Radio + 5 + 0 + + + False + True + 6 + + + + + True + False + system-run + + + False + True + 7 + + + + + True + False + Data + 0 + + + False + True + 8 + + + + + True + False + vertical + + + False + True + 5 + 9 + + + + + False + True + 3 + + + + + True + False + + + + + True + True + True + + + True + False + vertical + + + True + False + Bouquet details + + + + + + False + True + 0 + + + + + True + False + 2 + in + + + True + True + fav_list_store + 2 + True + both + True + + + + + + + + + + + multiple + + + + + True + 25 + Num + + + 0.20000000298023224 + 5 + 5 + + + 10 + 0 + + + + + + + True + 50 + Service + True + 0.5 + + + 2 + + + 10 + 8 + + + + + 2 + + + 10 + 1 + + + + + end + 25 + + + 10 + 2 + + + + + 2 + + + 10 + 3 + + + + + 2 + + + 10 + 4 + + + + + + + True + 70 + Type + 0.5 + + + 0.50999999046325684 + + + 10 + 5 + + + + + + + 70 + Pos + 0.5 + + + 0.50999999046325684 + + + 10 + 6 + + + + + + + False + fav_id + + + + 7 + + + + + + + False + extra + + + + 9 + + + + + + + + + + + + True + True + 1 + + + + + 24 + True + False + 2 + + + True + False + document-properties + + + False + True + 0 + + + + + True + False + 0 + 4 + 4 + 0 + + + False + True + 1 + + + + + True + False + + + False + True + 2 + + + + + True + False + center + + + True + False + True + end + 12 + 20 + + + + + True + True + 3 + + + + + False + True + 4 + + + + + True + False + + + + + True + False + vertical + + + True + False + Bouquets + + + + + + False + True + 0 + + + + + True + False + 2 + in + + + True + True + bouquets_tree_store + False + 0 + True + True + True + + + + + + + + + + + + multiple + + + + + True + 2 + autosize + Name + True + 0.5 + + + + 0 + + + + + + 1 + + + + + 0 + + + 2 + + + + + + + False + True + autosize + Type + + + + 3 + + + + + + + + + True + True + 1 + + + + + 24 + True + False + 2 + + + True + False + document-properties + + + False + True + 0 + + + + + True + False + 0 + 10 + 10 + 0 + + + False + True + 1 + + + + + + + + False + True + 2 + + + + + True + False + + + + + True + False + + + + + True + True + 1 + 3 + + 320 False vertical + 1 - + True False - - - - True + False True 0 @@ -716,8 +1873,6 @@ Author: Dmitriy Yefremov True False - 15 - 15 True @@ -780,13 +1935,13 @@ Author: Dmitriy Yefremov False - 15 - 15 2 True False + 5 + 5 0 @@ -799,12 +1954,9 @@ Author: Dmitriy Yefremov True True - 5 - 5 player_scale_adjustment False 0 - 1 False False @@ -819,6 +1971,8 @@ Author: Dmitriy Yefremov True False + 5 + 5 0 @@ -867,1193 +2021,26 @@ Author: Dmitriy Yefremov False True - end 1 - True - False + False + True + 4 - + True False - vertical - - - True - False - - - True - False - 1 - - - 32 - True - True - gtk-find - False - False - - - - False - True - 0 - - - - - True - False - False - True - half - - - - True - False - center - down - - - - - False - False - 1 - - - - - True - False - False - True - half - - - - True - False - center - up - - - - - False - False - 2 - - - - - - - False - True - 0 - - - - - False - - - True - False - 2 - - - Only free - True - True - True - - - - False - False - 0 - - - - - 32 - True - True - gtk-spell-check - False - False - - - - False - True - 1 - - - - - True - False - filter_types_list_store - 0 - 0 - - - - - 0 - - - - - False - True - 2 - - - - - True - False - filter_sat_positions_list_store - 0 - 0 - - - - - 0 - - - - - False - True - 3 - - - - - - - False - True - 1 - - - - - True - False - 2 - - - False - True - 2 - - - - - 250 - True - True - 1 - 1 - True - - - True - False - vertical - - - True - False - Services - - - - - - False - True - 0 - - - - - True - False - in - - - True - True - services_model_tree_model_sort - 3 - True - both - 20 - True - - - - - - - - - - - multiple - - - - - False - CAS - - - - 0 - - - - - - - False - Type - - - - 1 - - - - - - - True - 50 - Service - True - True - 3 - - - 2 - - - 21 - 2 - - - - - end - 25 - - - 21 - 3 - - - - - 2 - - - 21 - 4 - - - - - 2 - - - 21 - 5 - - - - - - - True - 50 - Package - True - True - 6 - - - end - 15 - - - 21 - 6 - - - - - - - True - 25 - Type - True - True - 7 - - - 0.51999998092651367 - - - 21 - 7 - - - - - - - Picon - True - 9 - - - - 21 - 8 - - - - - - - False - fixed - Picon ID - - - - 9 - - - - - - - True - 25 - SID - True - True - 10 - - - 0.50999999046325684 - - - 21 - 10 - - - - - - - True - 25 - Freq - True - True - 11 - - - 0.50999999046325684 - - - 21 - 11 - - - - - - - True - 25 - Rate - True - True - 12 - - - 0.50999999046325684 - - - 21 - 12 - - - - - - - True - 25 - Pol - True - True - 13 - - - 0.50999999046325684 - - - 21 - 13 - - - - - - - True - 25 - FEC - True - True - 14 - - - 0.50999999046325684 - - - 21 - 14 - - - - - - - True - 25 - System - True - True - 15 - - - 0.50999999046325684 - - - 21 - 15 - - - - - - - True - 25 - Pos - True - 16 - - - 0.50999999046325684 - - - 21 - 16 - - - - - - - False - data_id - - - - 17 - - - - - - - False - fav_id - - - - 18 - - - - - - - False - transponder - - - - 19 - - - - - - - False - extra - - - - 20 - - - - - - - - - - - - True - True - 1 - - - - - 26 - True - False - queue - 2 - - - True - False - 5 - emblem-readonly - - - False - True - 0 - - - - - True - False - CAS - 20 - 20 - 0 - - - False - True - 2 - 1 - - - - - True - False - vertical - - - False - True - 5 - 2 - - - - - True - False - tv-symbolic - - - False - True - 3 - - - - - True - False - TV - 5 - 0 - - - False - True - 4 - - - - - True - False - network-wireless-symbolic - - - False - True - 5 - - - - - True - False - Radio - 5 - 0 - - - False - True - 6 - - - - - True - False - system-run - - - False - True - 7 - - - - - True - False - Data - 0 - - - False - True - 8 - - - - - True - False - vertical - - - False - True - 5 - 9 - - - - - False - True - 3 - - - - - True - False - - - - - True - True - True - - - True - False - vertical - - - True - False - Bouquet details - - - - - - False - True - 0 - - - - - True - False - 2 - in - - - True - True - fav_list_store - 2 - True - both - True - - - - - - - - - - - multiple - - - - - True - 25 - Num - - - 0.20000000298023224 - 5 - 5 - - - 10 - 0 - - - - - - - True - 50 - Service - True - - - 2 - - - 10 - 8 - - - - - 2 - - - 10 - 1 - - - - - end - 25 - - - 10 - 2 - - - - - 2 - - - 10 - 3 - - - - - 2 - - - 10 - 4 - - - - - - - True - 25 - Type - True - - - 0.50999999046325684 - - - 10 - 5 - - - - - - - 25 - Pos - True - - - 0.50999999046325684 - - - 10 - 6 - - - - - - - False - fav_id - - - - 7 - - - - - - - False - extra - - - - 9 - - - - - - - - - - - - True - True - 1 - - - - - 24 - True - False - 2 - - - True - False - document-properties - - - False - True - 0 - - - - - True - False - 0 - 4 - 4 - 0 - - - False - True - 1 - - - - - True - False - - - False - True - 2 - - - - - True - False - center - - - True - False - True - end - 12 - 20 - - - - - True - True - 3 - - - - - False - True - 4 - - - - - True - False - - - - - True - False - vertical - - - True - False - Bouquets - - - - - - False - True - 0 - - - - - True - False - 2 - in - - - True - True - bouquets_tree_store - False - 0 - True - True - True - - - - - - - - - - - - multiple - - - - - True - 2 - autosize - Bouquets - True - - - - 0 - - - - - - 1 - - - - - 0 - - - 2 - - - - - - - False - True - autosize - Type - - - - 3 - - - - - - - - - True - True - 1 - - - - - 24 - True - False - 2 - - - True - False - document-properties - - - False - True - 0 - - - - - True - False - 0 - 10 - 10 - 0 - - - False - True - 1 - - - - - - - - False - True - 2 - - - - - True - False - - - - - True - False - - - - - True - True - 1 - 4 - - - - - True - False - 2 - - - False - True - 5 - - + 2 - True - True + False + True + 5 @@ -2124,6 +2111,7 @@ Author: Dmitriy Yefremov 24 + True False