restore (14087) save/load geometry logic of qt3

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14140 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-06-18 09:05:41 +00:00
parent dde45f75da
commit 1ec4d26038
2 changed files with 6 additions and 10 deletions

View File

@ -58,6 +58,8 @@ int const statusbar_timer_value = 3000;
QtView::QtView(unsigned int width, unsigned int height)
: QMainWindow(), LyXView(), commandbuffer_(0)
{
resize(width, height);
qApp->setMainWidget(this);
bufferview_.reset(new BufferView(this, width, height));
@ -160,8 +162,6 @@ void QtView::closeEvent(QCloseEvent *)
{
Session & session = LyX::ref().session();
session.saveSessionInfo("WindowIsMaximized", (isMaximized() ? "yes" : "no"));
// don't save maximized values
showNormal();
// save windows size and position
session.saveSessionInfo("WindowWidth", convert<string>(width()));
session.saveSessionInfo("WindowHeight", convert<string>(height()));

View File

@ -222,7 +222,7 @@ void parse_lyxrc()
void start(string const & batch, vector<string> const & files,
unsigned int width, unsigned int height, int posx, int posy, bool maximize)
unsigned int width, unsigned int height, int posx, int posy, bool)
{
// this can't be done before because it needs the Languages object
initEncodings();
@ -232,15 +232,11 @@ void start(string const & batch, vector<string> const & files,
QtView & view = *view_ptr.get();
view.init();
if (posx != -1 && posy != -1) {
view.setGeometry(posx, posy, width, height);
if (maximize)
view.setWindowState(Qt::WindowMaximized);
}
if (posx != -1 && posy != -1)
view.move(QPoint(posx, posy));
view.show();
view.init();
// FIXME: some code below needs moving