| 140 | |
| 141 | |
| 142 | void Manager::saveDialog() { |
| 143 | if (path == "") { |
| 144 | saveAsDialog(); |
| 145 | return; |
| 146 | } |
| 147 | |
| 148 | // Note: If save() fails below, this should probably be reset. But we need it so toJson() doesn't set the "unsaved" property. |
| 149 | APP->history->setSaved(); |
| 150 | |
| 151 | try { |
| 152 | save(path); |
| 153 | } |
| 154 | catch (Exception& e) { |
| 155 | std::string message = string::f(string::translate("patch.saveFailed"), e.what()); |
| 156 | osdialog_message(OSDIALOG_INFO, OSDIALOG_OK, message.c_str()); |
| 157 | return; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | |
| 162 | void Manager::saveAsDialog(bool setPath) { |