Skip to content

Commit

Permalink
nice try, but I obviously messed up everything I could
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 10, 2023
1 parent 0aec725 commit 1c390be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions cozy/ui/main_view.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")

Expand Down
5 changes: 3 additions & 2 deletions cozy/ui/search_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ["<primary>f"])
self.main_view.create_action("search", self.open, ["<primary>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:
Expand Down

0 comments on commit 1c390be

Please sign in to comment.