|
@@ -231,7 +231,7 @@ void MainWindow::onConfigureUpdate(const QString &filename)
|
|
|
|
|
|
|
|
LOG_INFO("start reload monitor configure");
|
|
LOG_INFO("start reload monitor configure");
|
|
|
canvasCount = projectMgr.canvasCount();
|
|
canvasCount = projectMgr.canvasCount();
|
|
|
- int index = -1;
|
|
|
|
|
|
|
+ int index = 0;
|
|
|
for(int i = 0; i < canvasCount; i++)
|
|
for(int i = 0; i < canvasCount; i++)
|
|
|
{
|
|
{
|
|
|
LOG_DEBUG("----------------canvas {}----------------", i);
|
|
LOG_DEBUG("----------------canvas {}----------------", i);
|
|
@@ -244,12 +244,12 @@ void MainWindow::onConfigureUpdate(const QString &filename)
|
|
|
}
|
|
}
|
|
|
LOG_INFO("reload monitor configure complete");
|
|
LOG_INFO("reload monitor configure complete");
|
|
|
|
|
|
|
|
- if(index > 0 && index < canvasCount) {
|
|
|
|
|
- m_pStackedWidget->setCurrentIndex(index);
|
|
|
|
|
- LOG_INFO("update: default canvas index is {}", index);
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- m_pStackedWidget->setCurrentIndex(0);
|
|
|
|
|
- LOG_INFO("update: not set default canvas index, set index 0");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ m_pStackedWidget->setCurrentIndex(index);
|
|
|
|
|
+ LOG_INFO("update: default canvas index is {}", index);
|
|
|
|
|
+
|
|
|
|
|
+ QSettings settings("settings.ini", QSettings::IniFormat);
|
|
|
|
|
+ settings.setIniCodec("UTF-8");
|
|
|
|
|
+ settings.beginGroup("CANVAS");
|
|
|
|
|
+ settings.setValue("INDEX", index);
|
|
|
|
|
+ settings.endGroup();
|
|
|
}
|
|
}
|