[Github-comments] [geany/geany] Add new API function to open a project file (#1222)

Colomban Wendling notifications at xxxxx
Sat Oct 29 13:41:45 UTC 2016


b4n commented on this pull request.



> + * This is done as if the user had done it using the `Project->Open`
+ * menu item (ie. it will confirm closing the current project). Any
+ * files in the project's session will be re-opened.
+ *
+ * @param project_locale_fn The filename of the project file in locale
+ * filename encoding.
+ *
+ * @return @c TRUE if the project was opened, @c FALSE otherwise.
+ *
+ * @since 1.29 (API 230)
+ */
+GEANY_API_SYMBOL
+gboolean project_open_file(const gchar *project_locale_fn)
+{
+	return (project_ask_close() &&
+		project_load_file_with_session(project_locale_fn));

Well maybe it doesn't matter much and maybe should not be in the generic function, but e.g. for OSX opening I would think it indeed makes sense not to ask again if the user wants to open the already opened project: raising the window is good enough to do what the user wanted, and closing and reopening the project will just lose the undo buffers and alike for no reason.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1222
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20161029/ebca5224/attachment.html>


More information about the Github-comments mailing list