Always show console warning and popup when saving options file fails, #3975

This commit is contained in:
Morgan Hardwood
2017-07-19 17:48:02 +02:00
parent 0987e4d5a3
commit ca9e28fea7
2 changed files with 8 additions and 5 deletions

View File

@@ -229,7 +229,7 @@ if((WIN32) AND NOT(UPPER_CMAKE_BUILD_TYPE STREQUAL "DEBUG"))
set_target_properties(rth PROPERTIES LINK_FLAGS "-mwindows")
endif()
set_target_properties(rth PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee)
set_target_properties(rth-cli PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS}" OUTPUT_NAME rawtherapee-cli)
set_target_properties(rth-cli PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -DRAWTHERAPEE_CLI" OUTPUT_NAME rawtherapee-cli)
# Add linked libraries dependencies to executables targets
target_link_libraries(rth rtengine

View File

@@ -2229,10 +2229,13 @@ int Options::saveToFile (Glib::ustring fname)
FILE *f = g_fopen (fname.c_str (), "wt");
if (f == nullptr) {
if (options.rtSettings.verbose) {
printf ("Options::saveToFile / Error: unable to open file \"%s\" with write access!\n", fname.c_str());
}
std::cout << "Warning! Unable to save your preferences to: " << fname << std::endl;
#ifndef RAWTHERAPEE_CLI
Glib::ustring msg_ = Glib::ustring::compose(M("MAIN_MSG_WRITEFAILED"), fname.c_str());
//writeFailed (getToplevelWindow (this), msg_);
Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true);
msgd.run ();
#endif
return 1;
} else {
fprintf (f, "%s", keyData.c_str ());