From 1c390befb45d4186c5f3043b0b5faf18d61402a3 Mon Sep 17 00:00:00 2001 From: rdbende Date: Sun, 10 Dec 2023 20:41:59 +0100 Subject: [PATCH] nice try, but I obviously messed up everything I could --- cozy/ui/main_view.py | 8 +++----- cozy/ui/search_view.py | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cozy/ui/main_view.py b/cozy/ui/main_view.py index 72f51f9d..45a186ce 100644 --- a/cozy/ui/main_view.py +++ b/cozy/ui/main_view.py @@ -1,9 +1,9 @@ import logging import os -import webbrowser from threading import Thread +from typing import Callable -from gi.repository import Adw, Gtk, Gio, Gdk, GLib, GObject +from gi.repository import Adw, Gdk, Gio, GLib, Gtk import cozy.control.filesystem_monitor as fs_monitor import cozy.ext.inject as inject @@ -12,15 +12,13 @@ from cozy.architecture.event_sender import EventSender from cozy.architecture.singleton import Singleton from cozy.control.db import books, close_db -from cozy.db.storage import Storage from cozy.media.files import Files from cozy.media.importer import Importer, ScanStatus from cozy.media.player import Player from cozy.model.settings import Settings as SettingsModel -from cozy.view_model.settings_view_model import SettingsViewModel -from cozy.open_view import OpenView from cozy.ui.library_view import LibraryView from cozy.ui.preferences_view import PreferencesView +from cozy.view_model.settings_view_model import SettingsViewModel log = logging.getLogger("ui") diff --git a/cozy/ui/search_view.py b/cozy/ui/search_view.py index 495c9c1e..377e13e9 100644 --- a/cozy/ui/search_view.py +++ b/cozy/ui/search_view.py @@ -50,10 +50,11 @@ def __init__(self, main_window_builder: Gtk.Builder, headerbar: Headerbar) -> No self.search_thread_stop = threading.Event() self.view_model.bind_to("close", self.close) - self.main_window.create_action("search", self.open, ["f"]) + self.main_view.create_action("search", self.open, ["f"]) - def open(self) -> None: + def open(self, *_) -> None: self.library_stack.set_visible_child(self) + self.search_bar.set_search_mode(True) self.main_view.play_pause_action.set_enabled(False) def close(self) -> None: