7852: Rename family tree does not update the title of the parent window.
This commit is contained in:
parent
72e897b44b
commit
e54ed1254a
@ -179,6 +179,8 @@ class DbManager(CLIDbManager):
|
|||||||
self.__connect_signals()
|
self.__connect_signals()
|
||||||
self.__build_interface()
|
self.__build_interface()
|
||||||
self._populate_model()
|
self._populate_model()
|
||||||
|
self.before_change = ""
|
||||||
|
self.after_change = ""
|
||||||
|
|
||||||
def __connect_signals(self):
|
def __connect_signals(self):
|
||||||
"""
|
"""
|
||||||
@ -474,6 +476,13 @@ class DbManager(CLIDbManager):
|
|||||||
if len(new_text) > 0:
|
if len(new_text) > 0:
|
||||||
node = self.model.get_iter(path)
|
node = self.model.get_iter(path)
|
||||||
old_text = self.model.get_value(node, NAME_COL)
|
old_text = self.model.get_value(node, NAME_COL)
|
||||||
|
if self.model.get_value(node, ICON_COL) != None:
|
||||||
|
# this database is loaded. We must change the title
|
||||||
|
# in case we change the name several times before quitting,
|
||||||
|
# we save the first old name.
|
||||||
|
if self.before_change == "":
|
||||||
|
self.before_change = old_text
|
||||||
|
self.after_change = new_text
|
||||||
if not old_text.strip() == new_text.strip():
|
if not old_text.strip() == new_text.strip():
|
||||||
if len(path.get_indices()) > 1 :
|
if len(path.get_indices()) > 1 :
|
||||||
self.__rename_revision(path, new_text)
|
self.__rename_revision(path, new_text)
|
||||||
|
@ -1097,6 +1097,20 @@ class ViewManager(CLIManager):
|
|||||||
(filename, title) = value
|
(filename, title) = value
|
||||||
self.db_loader.read_file(filename)
|
self.db_loader.read_file(filename)
|
||||||
self._post_load_newdb(filename, 'x-directory/normal', title)
|
self._post_load_newdb(filename, 'x-directory/normal', title)
|
||||||
|
else:
|
||||||
|
if dialog.after_change != "":
|
||||||
|
# We change the title of the main window.
|
||||||
|
old_title = self.uistate.window.get_title()
|
||||||
|
delim = old_title.find(' - ')
|
||||||
|
tit1 = old_title[:delim]
|
||||||
|
tit2 = old_title[delim:]
|
||||||
|
if '<=' in tit2:
|
||||||
|
delim2 = tit2.find('<=') + 3
|
||||||
|
tit3 = tit2[delim2:-1]
|
||||||
|
new_title = dialog.after_change + tit2.replace(']', '') + ' => ' + tit1 + ']'
|
||||||
|
else:
|
||||||
|
new_title = dialog.after_change + tit2 + ' <= [' + tit1 + ']'
|
||||||
|
self.uistate.window.set_title(new_title)
|
||||||
|
|
||||||
def __post_load(self):
|
def __post_load(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user