| 1035 | } |
| 1036 | |
| 1037 | void TOPPASBase::savePreferences() |
| 1038 | { |
| 1039 | // replace recent files |
| 1040 | param_.removeAll("preferences:RecentFiles"); |
| 1041 | param_.insert("preferences:RecentFiles:", recent_files_menu_.getAsParam()); |
| 1042 | |
| 1043 | //set version |
| 1044 | param_.setValue("preferences:version", VersionInfo::getVersion()); |
| 1045 | |
| 1046 | Param save_param = param_.copy("preferences:"); |
| 1047 | |
| 1048 | try |
| 1049 | { |
| 1050 | ParamXMLFile paramFile; |
| 1051 | // TODO: if closing multiple TOPPAS instances simultaneously, we might write to this file concurrently |
| 1052 | // thus destroying its integrity. Think about using boost filelocks |
| 1053 | // and also implement in TOPPView (and other GUI's which write to user directory) |
| 1054 | paramFile.store(string(param_.getValue("PreferencesFile")), save_param); |
| 1055 | } |
| 1056 | catch (Exception::UnableToCreateFile& /*e*/) |
| 1057 | { |
| 1058 | cerr << "Unable to create INI File: '" << string(param_.getValue("PreferencesFile")) << "'" << endl; |
| 1059 | } |
| 1060 | } |
| 1061 | |
| 1062 | void TOPPASBase::showAboutDialog() |
| 1063 | { |