Remember geometry of LogBrowser

This commit is contained in:
Daniel Molkentin 2013-07-10 09:22:20 +02:00
parent d2657bc154
commit 25065c4151
2 changed files with 15 additions and 3 deletions

View file

@ -28,6 +28,7 @@
#include <QMessageBox>
#include <QCoreApplication>
#include <QDebug>
#include <QSettings>
#include "mirall/mirallconfigfile.h"
#include "mirall/logger.h"
@ -115,6 +116,10 @@ LogBrowser::LogBrowser(QWidget *parent) :
// Direct connection for log comming from this thread, and queued for the one in a different thread
connect(Logger::instance(), SIGNAL(newLog(QString)),this,SLOT(slotNewLog(QString)), Qt::AutoConnection);
MirallConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
restoreGeometry(settings.value("LogBrowser/geometry").toByteArray());
}
LogBrowser::~LogBrowser()
@ -211,4 +216,12 @@ void LogBrowser::slotClearLog()
_logWidget->clear();
}
void LogBrowser::closeEvent(QCloseEvent *event)
{
MirallConfigFile cfg;
QSettings settings(cfg.configFile(), QSettings::IniFormat);
settings.setValue("LogBrowser/geometry", saveGeometry());
QWidget::closeEvent(event);
}
} // namespace

View file

@ -47,9 +47,8 @@ public:
void setLogFile(const QString& , bool );
signals:
public slots:
protected:
void closeEvent(QCloseEvent *event);
protected slots:
void slotNewLog( const QString &msg );