mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 19:40:21 +01:00
* Added trees and lists refresh after remove of some branches or leafs.
This commit is contained in:
@@ -150,6 +150,7 @@ class MainModel(ModelMT):
|
|||||||
# - #rgb
|
# - #rgb
|
||||||
# - #rrggbb
|
# - #rrggbb
|
||||||
self.tag_cloud = []
|
self.tag_cloud = []
|
||||||
|
self.new()
|
||||||
return
|
return
|
||||||
|
|
||||||
def add_search_history(self, txt):
|
def add_search_history(self, txt):
|
||||||
@@ -511,6 +512,7 @@ class MainModel(ModelMT):
|
|||||||
def new(self):
|
def new(self):
|
||||||
"""create new project"""
|
"""create new project"""
|
||||||
self.unsaved_project = False
|
self.unsaved_project = False
|
||||||
|
self.filename = None
|
||||||
self.__create_internal_dirname()
|
self.__create_internal_dirname()
|
||||||
self.__connect_to_db()
|
self.__connect_to_db()
|
||||||
self.__create_database()
|
self.__create_database()
|
||||||
@@ -1050,6 +1052,27 @@ class MainModel(ModelMT):
|
|||||||
parent_id = False
|
parent_id = False
|
||||||
|
|
||||||
db_connection.commit()
|
db_connection.commit()
|
||||||
|
|
||||||
|
# part two: remove items from treestore/liststores
|
||||||
|
def foreach_treestore(model, path, iterator, d):
|
||||||
|
if d[0] == model.get_value(iterator, 0):
|
||||||
|
d[1].append(path)
|
||||||
|
return False
|
||||||
|
|
||||||
|
paths = []
|
||||||
|
self.discs_tree.foreach(foreach_treestore, (root_id, paths))
|
||||||
|
for path in paths:
|
||||||
|
self.discs_tree.remove(self.discs_tree.get_iter(path))
|
||||||
|
|
||||||
|
paths = []
|
||||||
|
self.files_list.foreach(foreach_treestore, (root_id, paths))
|
||||||
|
for path in paths:
|
||||||
|
self.files_list.remove(self.files_list.get_iter(path))
|
||||||
|
|
||||||
|
paths = []
|
||||||
|
self.search_list.foreach(foreach_treestore, (root_id, paths))
|
||||||
|
for path in paths:
|
||||||
|
self.search_list.remove(self.search_list.get_iter(path))
|
||||||
return
|
return
|
||||||
|
|
||||||
def get_stats(self, selected_id):
|
def get_stats(self, selected_id):
|
||||||
|
|||||||
Reference in New Issue
Block a user