mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 21:46:03 +03:00
Remember geometry of LogBrowser
This commit is contained in:
parent
d2657bc154
commit
25065c4151
2 changed files with 15 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue