@LiquidCake commented on this pull request.
> + g_free(tmp);
+ }
+
+ tmp = utils_get_setting_string(config, "untitled_document_save",
"persistent_untitled_documents_target_dir", NULL);
+ SETPTR(tmp, utils_get_locale_from_utf8(tmp));
+ /* Set target dir variable with value from config, regardless if dir is
valid or not */
+ SETPTR(persistent_docs_target_dir, g_strdup(tmp));
+
+ if (enable_persistent_docs && ! is_directory_accessible(tmp))
+ {
+ /* switch functionality off, so invalid target directory cannot
be actually used */
+ enable_persistent_docs = FALSE;
+ g_key_file_set_boolean(config, "saveactions",
"enable_persistent_untitled_documents", FALSE);
+
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pref_widgets.untitled_doc_disabled_radio),
TRUE);
+
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pref_widgets.untitled_doc_persistent_radio),
FALSE);
same - each one launches its own handler which disabled ui elements of unused
features - `radio_toggled_cb()`
This code could be written in some other way but existing repeats existing
handling for checkboxes and is generally ok
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3911#discussion_r1854400883
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/pull/3911/review/[email protected]>