diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 58a7b43..a3f30dc 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -146,13 +146,15 @@ void MainWindow::ReplaceObject(si::Object *obj) { QString s = QFileDialog::getOpenFileName(this, tr("Replace Object")); if (!s.isEmpty()) { - if (!obj->ReplaceWithFile( + if (obj->ReplaceWithFile( #ifdef Q_OS_WINDOWS s.toStdWString().c_str() #else s.toUtf8() #endif )) { + static_cast(config_stack_->currentWidget())->ResetData(); + } else { QMessageBox::critical(this, QString(), tr("Failed to open to file \"%1\".").arg(s)); } } diff --git a/app/panel.cpp b/app/panel.cpp index a0d5c92..1659efa 100644 --- a/app/panel.cpp +++ b/app/panel.cpp @@ -23,6 +23,11 @@ void Panel::SetData(void *data) } } +void Panel::ResetData() +{ + SetData(data_); +} + void Panel::FinishLayout() { outer_layout_->addStretch(); diff --git a/app/panel.h b/app/panel.h index 1c60694..944fe9c 100644 --- a/app/panel.h +++ b/app/panel.h @@ -13,6 +13,8 @@ public: void *GetData() const { return data_; } void SetData(void *data); + void ResetData(); + signals: protected: