Bug Fix: Window title was not updated in new window.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15750 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2006-11-05 15:34:18 +00:00
parent 691ca4c0a4
commit 18ec722cf2
3 changed files with 21 additions and 12 deletions

View File

@ -96,9 +96,6 @@ MULTIPLE WINDOWS / DOCUMENTS
2) the easy way: disable the cursor on focus out event and re-enable it at
focus in event and jump the saved position (at focus out).
* The title bar does not contain the document name when a new window is opened
(Joost 4/11/06).
* There should be a close button on the tabs (Joost 3/11/06).
@ -240,12 +237,12 @@ CREDITS:
* Performance on Windows is bad. On my system, scrolling the User Guide takes
10 seconds with LyX 1.4 and more than 30 seconds with LyX 1.5.
FIXED (Abdel 04/10/06): This was due to spurious message in QLPainter.C,
FIXED (Abdel 04/11/06): This was due to spurious message in QLPainter.C,
* When I have the same document in two windows, only the last selected paragraph
in one of the windows gets updated.
FIXED (Abdel 04/10/06): This was due my singlePar optimization. With my last
FIXED (Abdel 04/11/06): This was due my singlePar optimization. With my last
commit, the optimization is enabled only if the WorkArea has the focus.
* No icon for "note-next" in the "review" toolbar.
@ -255,3 +252,11 @@ CREDITS:
* Branches gui broken (buttons do nothing).
FIXED (JSpitzm 2006-11-04).
* The title bar does not contain the document name when a new window is opened
(Joost 4/11/06).
FIXED (Abdel 05/11/06): This was due to "last_title" being a static variable
in LyXView::updateWindowTitle() and also due to a potential bug in Qt:
an update command to the window title seems to be ignored up until the window
is shown.

View File

@ -375,7 +375,6 @@ void LyXView::updateLayoutChoice()
void LyXView::updateWindowTitle()
{
static docstring last_title = lyx::from_ascii("LyX");
docstring maximize_title = lyx::from_ascii("LyX");
docstring minimize_title = lyx::from_ascii("LyX");
@ -393,10 +392,7 @@ void LyXView::updateWindowTitle()
}
}
if (maximize_title != last_title) {
setWindowTitle(maximize_title, minimize_title);
last_title = maximize_title;
}
setWindowTitle(maximize_title, minimize_title);
}

View File

@ -220,6 +220,10 @@ void GuiView::setGeometry(unsigned int width,
}
show();
// For an unknown reason, the Window title update is not effective for
// the second windows up until it is shown on screen (Qt bug?).
updateWindowTitle();
}
@ -231,8 +235,12 @@ void GuiView::updateMenu(QAction * /*action*/)
void GuiView::setWindowTitle(docstring const & t, docstring const & it)
{
QMainWindow::setWindowTitle(toqstr(t));
QMainWindow::setWindowIconText(toqstr(it));
QString title = windowTitle();
QString new_title = toqstr(t);
if (title != new_title) {
QMainWindow::setWindowTitle(new_title);
QMainWindow::setWindowIconText(toqstr(it));
}
}