Moved setting for main windows geometry and toolbar state to RiuMainWindowBase

This commit is contained in:
Magne Sjaastad
2016-06-24 15:53:04 +02:00
parent aef466087d
commit e92624a862
8 changed files with 145 additions and 133 deletions

View File

@@ -143,10 +143,8 @@ RiuMainPlotWindow::RiuMainPlotWindow()
// When enableUndoCommandSystem is set false, all commands are executed and deleted immediately
//caf::CmdExecCommandManager::instance()->enableUndoCommandSystem(true);
// if (sm_mainWindowInstance->isVisible())
{
QString platform = cvf::System::is64Bit() ? "(64bit)" : "(32bit)";
setWindowTitle("ResInsight " + platform);
setWindowTitle("Summary Plots for ResInsight");
setDefaultWindowSize();
loadWinGeoAndDockToolBarLayout();
showWindow();
@@ -649,64 +647,6 @@ void RiuMainPlotWindow::createDockPanels()
setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::saveWinGeoAndDockToolBarLayout()
{
// Company and appname set through QCoreApplication
QSettings settings;
QByteArray winGeo = saveGeometry();
settings.setValue("winGeometry", winGeo);
QByteArray layout = saveState(0);
settings.setValue("dockAndToolBarLayout", layout);
settings.setValue("isMaximized", isMaximized());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::loadWinGeoAndDockToolBarLayout()
{
// Company and appname set through QCoreApplication
QSettings settings;
QVariant winGeo = settings.value("winGeometry");
QVariant layout = settings.value("dockAndToolBarLayout");
if (winGeo.isValid())
{
if (restoreGeometry(winGeo.toByteArray()))
{
if (layout.isValid())
{
restoreState(layout.toByteArray(), 0);
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainPlotWindow::showWindow()
{
// Company and appname set through QCoreApplication
QSettings settings;
showNormal();
QVariant isMax = settings.value("isMaximized", false);
if (isMax.toBool())
{
showMaximized();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------