| 113 | } |
| 114 | |
| 115 | void PanelMainProperties::notifyActionSkin(std::string_view /*_type*/, std::string_view _value, bool _final) |
| 116 | { |
| 117 | if (_final) |
| 118 | { |
| 119 | WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget); |
| 120 | |
| 121 | widgetContainer->setSkin(_value); |
| 122 | if (isSkinExist(widgetContainer->getSkin()) || widgetContainer->getSkin().empty()) |
| 123 | { |
| 124 | WidgetSelectorManager::getInstance().saveSelectedWidget(); |
| 125 | |
| 126 | MyGUI::xml::Document* savedDoc = EditorWidgets::getInstance().savexmlDocument(); |
| 127 | EditorWidgets::getInstance().clear(); |
| 128 | EditorWidgets::getInstance().loadxmlDocument(savedDoc); |
| 129 | delete savedDoc; |
| 130 | |
| 131 | WidgetSelectorManager::getInstance().restoreSelectedWidget(); |
| 132 | } |
| 133 | else |
| 134 | { |
| 135 | std::string mess = MyGUI::utility::toString( |
| 136 | "Skin '", |
| 137 | widgetContainer->getSkin(), |
| 138 | "' not found. This value will be saved."); |
| 139 | GroupMessage::getInstance().addMessage(mess, MyGUI::LogLevel::Error); |
| 140 | } |
| 141 | |
| 142 | UndoManager::getInstance().addValue(PR_PROPERTIES); |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | bool PanelMainProperties::isSkinExist(std::string_view _skinName) |
| 147 | { |
nothing calls this directly
no test coverage detected