X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=gui%2Fmainwin.cpp;h=66b575480c506218af69440e1d1b18af53cb80f5;hp=ec6d8d47b7339ffec7de694dcce1576438b2ad00;hb=a7afccdbf779b959a4ce3fe88ec42590e3df6cfe;hpb=04e21ce26ebabdde9586ca9d2a3168431e448df5 diff --git a/gui/mainwin.cpp b/gui/mainwin.cpp index ec6d8d47..66b57548 100644 --- a/gui/mainwin.cpp +++ b/gui/mainwin.cpp @@ -19,8 +19,9 @@ ***************************************************************************/ #include +#include -#include "quassel.h" +#include "global.h" #include "mainwin.h" #include "channelwidget.h" @@ -32,6 +33,13 @@ MainWin::MainWin() : QMainWindow() { setWindowTitle("Quassel IRC"); setWindowIcon(QIcon(":/qirc-icon.png")); setWindowIconText("Quassel IRC"); + + QSettings s; + s.beginGroup("Geometry"); + resize(s.value("MainWinSize", QSize(500, 400)).toSize()); + move(s.value("MainWinPos", QPoint(50, 50)).toPoint()); + s.endGroup(); + //workspace = new QWorkspace(this); //setCentralWidget(workspace); //ChannelWidget *cw = new ChannelWidget(this); @@ -115,3 +123,16 @@ void MainWin::showServerList() { serverListDlg->show(); } +void MainWin::closeEvent(QCloseEvent *event) +{ + //if (userReallyWantsToQuit()) { + QSettings s; + s.beginGroup("Geometry"); + s.setValue("MainWinSize", size()); + s.setValue("MainWinPos", pos()); + s.endGroup(); + event->accept(); + //} else { + //event->ignore(); + //} +}