fix search issuses

This commit is contained in:
Jonas Weinz 2020-10-19 21:28:49 +02:00
parent 8903eae460
commit 505b2c67a9
4 changed files with 9 additions and 6 deletions

View File

@ -58,7 +58,6 @@ class GstWidget(Gtk.Box):
def load_from_uri(self, url:str) -> None: def load_from_uri(self, url:str) -> None:
self.stop()
self._player.set_property("uri", url) self._player.set_property("uri", url)
def play(self): def play(self):

View File

@ -45,12 +45,12 @@ class MainApp(Gtk.Window):
def on_search(self, _ = None): def on_search(self, _ = None):
if self.get_active_pane() == "player": if self.get_active_pane() == "player":
self._player_widget.stop() self._player_widget.pause()
self.set_active_pane("search") self.set_active_pane("search")
def _create_context_switch(self): def _create_context_switch(self):
self._search_radio = new_button_with_icon("system-search") self._search_radio = new_button_with_icon("edit-find")
self._search_radio.connect("clicked", self.on_search) self._search_radio.connect("clicked", self.on_search)
@ -107,4 +107,9 @@ class MainApp(Gtk.Window):
def start_player(self, uri: str): def start_player(self, uri: str):
if self.get_active_pane() != "player": if self.get_active_pane() != "player":
self.set_active_pane("player") self.set_active_pane("player")
self._player_widget.play_from_uri(uri)
self._player_widget.stop()
self._player_widget.play_from_uri(uri)
self._player_widget.play()

View File

@ -92,7 +92,6 @@ class PlayerWidget(Gtk.Overlay):
def play_from_uri(self, uri: str): def play_from_uri(self, uri: str):
self._videoarea.load_from_uri(uri) self._videoarea.load_from_uri(uri)
self.play()
def play(self, _=None): def play(self, _=None):
if self.get_state() != Gst.State.PLAYING: if self.get_state() != Gst.State.PLAYING:

View File

@ -37,7 +37,7 @@ class SearchWidget(Gtk.Box):
widget.destroy() widget.destroy()
def display_warning(self, message): def display_warning(self, message):
messagedialog = Gtk.MessageDialog(parent=self, messagedialog = Gtk.MessageDialog(parent=self._main_window,
flags=Gtk.DialogFlags.MODAL, flags=Gtk.DialogFlags.MODAL,
type=Gtk.MessageType.WARNING, type=Gtk.MessageType.WARNING,
buttons=Gtk.ButtonsType.OK, buttons=Gtk.ButtonsType.OK,