Ask for confirmation when overwriting saved search
This commit is contained in:
parent
6930ea24a9
commit
4ab9e6caef
@ -21,6 +21,7 @@ browsing-change-note-type2 = Change Note Type...
|
|||||||
browsing-change-to = Change { $val } to:
|
browsing-change-to = Change { $val } to:
|
||||||
browsing-clear-unused = Clear Unused
|
browsing-clear-unused = Clear Unused
|
||||||
browsing-clear-unused-tags = Clear Unused Tags
|
browsing-clear-unused-tags = Clear Unused Tags
|
||||||
|
browsing-confirm-saved-search-overwrite = A saved search with the name { $name } already exists. Do you want to overwrite it?
|
||||||
browsing-confirm-saved-searches-deletion =
|
browsing-confirm-saved-searches-deletion =
|
||||||
{ $count ->
|
{ $count ->
|
||||||
[one] Are you sure you want to delete the selected saved search?
|
[one] Are you sure you want to delete the selected saved search?
|
||||||
|
@ -1279,6 +1279,10 @@ class SidebarTreeView(QTreeView):
|
|||||||
filt = conf[old_name]
|
filt = conf[old_name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return
|
return
|
||||||
|
if new_name in conf and not askUser(
|
||||||
|
tr(TR.BROWSING_CONFIRM_SAVED_SEARCH_OVERWRITE, name=new_name)
|
||||||
|
):
|
||||||
|
return
|
||||||
conf[new_name] = filt
|
conf[new_name] = filt
|
||||||
del conf[old_name]
|
del conf[old_name]
|
||||||
self._set_saved_searches(conf)
|
self._set_saved_searches(conf)
|
||||||
@ -1294,11 +1298,15 @@ class SidebarTreeView(QTreeView):
|
|||||||
)
|
)
|
||||||
except InvalidInput as e:
|
except InvalidInput as e:
|
||||||
show_invalid_search_error(e)
|
show_invalid_search_error(e)
|
||||||
else:
|
return
|
||||||
name = getOnlyText(tr(TR.BROWSING_PLEASE_GIVE_YOUR_FILTER_A_NAME))
|
name = getOnlyText(tr(TR.BROWSING_PLEASE_GIVE_YOUR_FILTER_A_NAME))
|
||||||
if not name:
|
if not name:
|
||||||
return
|
return
|
||||||
conf = self._get_saved_searches()
|
conf = self._get_saved_searches()
|
||||||
|
if name in conf and not askUser(
|
||||||
|
tr(TR.BROWSING_CONFIRM_SAVED_SEARCH_OVERWRITE, name=name)
|
||||||
|
):
|
||||||
|
return
|
||||||
conf[name] = filt
|
conf[name] = filt
|
||||||
self._set_saved_searches(conf)
|
self._set_saved_searches(conf)
|
||||||
self.refresh(
|
self.refresh(
|
||||||
|
Loading…
Reference in New Issue
Block a user