Commit 67645423 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Save/restore the geometry and layout of the mainwindow

parent 30c05428
......@@ -55,6 +55,7 @@ void DockWidgetManager::addDockedWidget( QWidget *widget,
dock->setWidget( widget );
dock->setAllowedAreas( areas );
dock->setFeatures( features );
dock->setObjectName( qs_name );
m_mainWin->addDockWidget( startArea, dock );
m_mainWin->registerWidgetInWindowMenu( dock );
widget->show();
......
......@@ -30,6 +30,7 @@
#include <QMessageBox>
#include <QDesktopServices>
#include <QUrl>
#include <QSettings>
#include "MainWindow.h"
#include "MediaListWidget.h"
......@@ -72,10 +73,23 @@ MainWindow::MainWindow( QWidget *parent ) :
this, SLOT( zoomOut() ) );
connect( this, SIGNAL( toolChanged( ToolButtons ) ),
m_timeline, SLOT( setTool( ToolButtons ) ) );
QSettings s;
// Restore the geometry
restoreGeometry( s.value( "MainWindowGeometry" ).toByteArray() );
// Restore the layout
restoreState( s.value( "MainWindowState" ).toByteArray() );
}
MainWindow::~MainWindow()
{
QSettings s;
// Save the current geometry
s.setValue( "MainWindowGeometry", saveGeometry() );
// Save the current layout
s.setValue( "MainWindowState", saveState() );
s.sync();
if ( m_renderer )
delete m_renderer;
MetaDataManager::destroyInstance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment