void DialogShiftTimes::LoadHistory() { history_box->Clear(); history_box->Freeze(); try { std::unique_ptr<std::istream> file(agi::io::Open(history_filename)); json::UnknownElement root; json::Reader::Read(root, *file); *history = root; for (auto& history_entry : *history) history_box->Append(get_history_string(history_entry)); } catch (agi::fs::FileSystemError const& e) { LOG_D("dialog_shift_times/load_history") << "Cannot load shift times history: " << e.GetChainedMessage(); } catch (...) { history_box->Thaw(); throw; } history_box->Thaw(); }
void DialogShiftTimes::LoadHistory() { history_box->Clear(); history_box->Freeze(); try { agi::scoped_ptr<std::istream> file(agi::io::Open(history_filename)); json::UnknownElement root; json::Reader::Read(root, *file); *history = root; for (json::Array::iterator it = history->begin(); it != history->end(); ++it) history_box->Append(get_history_string(*it)); } catch (agi::FileSystemError const& e) { LOG_D("dialog_shift_times/load_history") << "Cannot load shift times history: " << e.GetChainedMessage(); } catch (...) { history_box->Thaw(); throw; } history_box->Thaw(); }