diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-12-19 13:27:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-19 13:27:15 +0000 |
commit | 664f5ce9605b580b9500547fff1e54eac553f295 (patch) | |
tree | c1500f8d0110c9657d1a66c5ad9bad6a6acc16f4 /src/porting.h | |
parent | 025035db5c87e9eaa9f83859f860539fc4fb4dc0 (diff) | |
download | minetest-664f5ce9605b580b9500547fff1e54eac553f295.tar.gz minetest-664f5ce9605b580b9500547fff1e54eac553f295.tar.bz2 minetest-664f5ce9605b580b9500547fff1e54eac553f295.zip |
Add open user data button to main menu (#10579)
Diffstat (limited to 'src/porting.h')
-rw-r--r-- | src/porting.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/porting.h b/src/porting.h index c7adf12a2..e4ebe36fd 100644 --- a/src/porting.h +++ b/src/porting.h @@ -332,7 +332,25 @@ void attachOrCreateConsole(); int mt_snprintf(char *buf, const size_t buf_size, const char *fmt, ...); -bool openURL(const std::string &url); +/** + * Opens URL in default web browser + * + * Must begin with http:// or https://, and not contain any new lines + * + * @param url The URL + * @return true on success, false on failure + */ +bool open_url(const std::string &url); + +/** + * Opens a directory in the default file manager + * + * The directory must exist. + * + * @param path Path to directory + * @return true on success, false on failure + */ +bool open_directory(const std::string &path); } // namespace porting |