Some more fixes to multi-windows.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25327 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-19 17:30:30 +00:00
parent 4441cd8a4a
commit 65b37dfbb8
2 changed files with 9 additions and 4 deletions

View File

@ -324,8 +324,8 @@ GuiView::GuiView(int id)
if (lyxrc.allow_geometry_session) {
// Now take care of session management.
restoreLayout();
return;
if (restoreLayout())
return;
}
// No session handling, default to a sane size.
@ -358,10 +358,13 @@ void GuiView::saveLayout() const
}
void GuiView::restoreLayout()
bool GuiView::restoreLayout()
{
QSettings settings;
QString const key = "view-" + QString::number(id_);
if (!settings.contains(key))
return false;
setIconSize(settings.value(key + "/icon_size").toSize());
#ifdef Q_WS_X11
QPoint pos = settings.value(key + "/pos", QPoint(50, 50)).toPoint();
@ -377,6 +380,7 @@ void GuiView::restoreLayout()
find_or_build("view-source");
if (!restoreState(settings.value(key + "/layout").toByteArray(), 0))
initToolbars();
return true;
}
@ -739,6 +743,7 @@ bool GuiView::event(QEvent * e)
return QMainWindow::event(e);
}
guiApp->setCurrentView(this);
theLyXFunc().setLyXView(this);
if (d.current_work_area_) {
BufferView & bv = d.current_work_area_->bufferView();
connectBufferView(bv);

View File

@ -248,7 +248,7 @@ private:
///
void saveLayout() const;
///
void restoreLayout();
bool restoreLayout();
///
GuiToolbar * toolbar(std::string const & name);
///