Skip to content

Commit

Permalink
W Plug saved searches
Browse files Browse the repository at this point in the history
  • Loading branch information
diegogangl committed Jul 24, 2022
1 parent 0e3c0bd commit ce62f95
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions GTG/gtk/browser/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import datetime
import logging
import ast
import re
#import liblarch_gtk # Just for types

from gi.repository import GObject, Gtk, Gdk, Gio, GLib
Expand Down Expand Up @@ -557,15 +558,10 @@ def on_search(self, data):

def on_save_search(self, action, param):
query = self.search_entry.get_text()
name = re.sub(r'!(?=\w)+', '', query)

# Try if this is a new search tag and save it correctly
tag_id = self.req.new_search_tag(query)
self.app.ds.saved_searches.new(name, query)

# Apply new search right now
if self.tagtreeview is not None:
self.select_search_tag(tag_id)
else:
self.get_selected_tree().apply_filter(tag_id)

def select_search_tag(self, tag_id):
tag = self.req.get_tag(tag_id)
Expand Down

0 comments on commit ce62f95

Please sign in to comment.