diff --git a/app/connections.py b/app/connections.py index c4eee707..2b14b38c 100644 --- a/app/connections.py +++ b/app/connections.py @@ -712,7 +712,7 @@ def test_http(host, port, user, password, timeout=5, use_ssl=False, skip_message try: return get_response(HttpAPI.Request.TEST, "{}/web/{}".format(base_url, params), data).get("e2statetext", "") - except (RemoteDisconnected, URLError, HTTPError) as e: + except (URLError, HTTPError) as e: raise TestException(e) diff --git a/app/tools/media.py b/app/tools/media.py index db4cedb7..2c32894e 100644 --- a/app/tools/media.py +++ b/app/tools/media.py @@ -53,7 +53,7 @@ class Player: self._player.set_property("uri", mrl) - log("Setting the URL for playback: : {}".format(mrl)) + log("Setting the URL for playback: {}".format(mrl)) ret = self._player.set_state(self.STATE.PLAYING) if ret == self.STAT_RETURN.FAILURE: @@ -79,7 +79,7 @@ class Player: self.__INSTANCE = None def set_xwindow(self, xid): - self._player.set_xwindow(xid) + self._player.set_window_handle(xid) def set_handle(self, widget): """ Used on Windows to set window pointer. diff --git a/app/ui/control.py b/app/ui/control.py index 6f9e6904..2bb73261 100644 --- a/app/ui/control.py +++ b/app/ui/control.py @@ -6,6 +6,7 @@ from urllib.parse import quote from gi.repository import GLib +from app.settings import IS_WIN from .dialogs import get_dialogs_string, show_dialog, DialogType, get_message from .uicommons import Gtk, Gdk, UI_RESOURCES_PATH, Column from ..commons import run_task, run_with_delay, log, run_idle @@ -313,18 +314,17 @@ class ControlBox(Gtk.HBox): img = data.get("img_data", None) if img: - is_darwin = self._settings.is_darwin - GLib.idle_add(self._screenshot_button_box.set_sensitive, is_darwin) - path = os.path.expanduser("~/Desktop") if is_darwin else None + GLib.idle_add(self._screenshot_button_box.set_sensitive, IS_WIN) + path = os.path.expanduser("~/Desktop") if IS_WIN else None try: import tempfile import subprocess - with tempfile.NamedTemporaryFile(mode="wb", suffix=".jpg", dir=path, delete=not is_darwin) as tf: + with tempfile.NamedTemporaryFile(mode="wb", suffix=".jpg", dir=path, delete=not IS_WIN) as tf: tf.write(img) - cmd = ["open" if is_darwin else "xdg-open", tf.name] - subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + f_name = tf.name + subprocess.Popen([f_name], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate() finally: GLib.idle_add(self._screenshot_button_box.set_sensitive, True) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index de2d4472..23aabfdc 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -261,7 +261,7 @@ class Application(Gtk.Application): self._radio_count_label = builder.get_object("radio_count_label") self._data_count_label = builder.get_object("data_count_label") self._signal_level_bar.bind_property("visible", builder.get_object("play_current_service_button"), "visible") - self._signal_level_bar.bind_property("visible", builder.get_object("record_button"), "visible") + # self._signal_level_bar.bind_property("visible", builder.get_object("record_button"), "visible") self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4) self._receiver_info_box.bind_property("visible", self._signal_box, "visible") # Alternatives @@ -2453,16 +2453,15 @@ class Application(Gtk.Application): def on_player_previous(self, item): if self._fav_view.do_move_cursor(self._fav_view, Gtk.MovementStep.DISPLAY_LINES, -1): - self._fav_view.set_sensitive(False) self.set_player_action() def on_player_next(self, item): if self._fav_view.do_move_cursor(self._fav_view, Gtk.MovementStep.DISPLAY_LINES, 1): - self._fav_view.set_sensitive(False) self.set_player_action() @run_with_delay(1) def set_player_action(self): + self._fav_view.set_sensitive(False) if self._fav_click_mode is FavClickMode.PLAY: self.on_stream() elif self._fav_click_mode is FavClickMode.ZAP_PLAY: @@ -2529,7 +2528,7 @@ class Application(Gtk.Application): error_cb=self.on_player_error, playing_cb=self.set_playback_elms_active) except (ImportError, NameError, AttributeError): - self.show_error_dialog("No VLC is found. Check that it is installed!") + self.show_error_dialog("No GStreamer is found. Check that it is installed!") return True else: if IS_WIN: @@ -2540,6 +2539,7 @@ class Application(Gtk.Application): finally: if self._settings.play_streams_mode is PlayStreamsMode.BUILT_IN: self.set_player_area_size(widget) + self._fav_view.do_grab_focus(self._fav_view) @run_idle def set_player_area_size(self, widget): @@ -2699,7 +2699,7 @@ class Application(Gtk.Application): """ Switch to the channel and watch in the player """ if not self._app_info_box.get_visible() and self._settings.play_streams_mode is PlayStreamsMode.BUILT_IN: self.set_player_area_size(self._player_box) - self._player_box.set_visible(True) + GLib.idle_add(self._player_box.set_visible, True) GLib.idle_add(self._app_info_box.set_visible, False) self._http_api.send(HttpAPI.Request.STREAM_CURRENT, None, self.watch) diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 9240658d..412af280 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -1,5 +1,5 @@ - - - + + @@ -1017,9 +1017,9 @@ Author: Dmitriy Yefremov True False + False Profile 0 - False @@ -1520,11 +1520,11 @@ Author: Dmitriy Yefremov 28 False + False True Play center center - False @@ -1602,6 +1602,8 @@ Author: Dmitriy Yefremov 1 + 320 + 240 True False @@ -2978,9 +2980,10 @@ Author: Dmitriy Yefremov True False label + end - False + True True 2 diff --git a/app/ui/satellites_dialog.glade b/app/ui/satellites_dialog.glade index 60e4d87c..5d0341e0 100644 --- a/app/ui/satellites_dialog.glade +++ b/app/ui/satellites_dialog.glade @@ -1490,7 +1490,6 @@ Author: Dmitriy Yefremov True True Cancel - center sat_update_cancel_image True @@ -1566,13 +1565,11 @@ Author: Dmitriy Yefremov True False - center expand True False - center update_source_store 0 @@ -1595,7 +1592,6 @@ Author: Dmitriy Yefremov True True Update - center sat_update_image True diff --git a/app/ui/service_details_dialog.glade b/app/ui/service_details_dialog.glade index b6b47e74..f865fa8a 100644 --- a/app/ui/service_details_dialog.glade +++ b/app/ui/service_details_dialog.glade @@ -1568,7 +1568,7 @@ Author: Dmitriy Yefremov - True + False False 10 document-edit-symbolic diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index 04e79a52..a3878e8b 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -716,7 +716,6 @@ class SettingsDialog: log("Unpacking end.") finally: self.update_theme_button(button, dst) - self._appearance_box.set_sensitive(True) @run_idle def update_theme_button(self, button, dst): @@ -729,6 +728,7 @@ class SettingsDialog: button.append(theme, theme) button.set_active_id(theme) self.show_info_message("Done!", Gtk.MessageType.INFO) + self._appearance_box.set_sensitive(True) @run_idle def remove_theme(self, button, path): diff --git a/start.py b/start.py index 6de68136..b2b5ce0f 100755 --- a/start.py +++ b/start.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 if __name__ == "__main__": + from multiprocessing import freeze_support from app.ui.main_app_window import start_app + freeze_support() start_app()