mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Moved setting for main windows geometry and toolbar state to RiuMainWindowBase
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user