diff --git a/src/dialog.cpp b/src/dialog.cpp index 006ba7d..dbb302e 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -22,16 +22,8 @@ namespace dialog bool has_event = false; const char *filename = nullptr; - void showFileOpen(IGUIEnvironment *env, s32 id, const char *caption, - const char **filters, const int filter_count) - { - std::thread thread(fileOpen, env, id, caption, filters, - filter_count); - thread.detach(); - } - - void fileOpen(IGUIEnvironment *env, s32 id, const char *caption, - const char **filters, const int filter_count) + static inline void fileOpen(IGUIEnvironment *env, s32 id, + const char *caption, const char **filters, const int filter_count) { IGUIWindow *window = env->addWindow(rect(0,0,0,0), true); window->setVisible(false); @@ -64,11 +56,19 @@ namespace dialog std::cout << except.what() << std::endl; } } -} -static inline void open_url(std::string url) -{ - system((std::string("xdg-open \"") + url + std::string("\"")).c_str()); + void showFileOpen(IGUIEnvironment *env, s32 id, const char *caption, + const char **filters, const int filter_count) + { + std::thread thread(fileOpen, env, id, caption, filters, + filter_count); + thread.detach(); + } + + void openBrowser(std::string url) + { + system((std::string("xdg-open \"") + url + std::string("\"")).c_str()); + } } HyperlinkCtrl::HyperlinkCtrl(IGUIEnvironment *env, IGUIElement *parent, s32 id, @@ -108,7 +108,7 @@ bool HyperlinkCtrl::OnEvent(const SEvent &event) else if (is_active && event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event == EMIE_LMOUSE_PRESSED_DOWN) { - open_url(url); + dialog::openBrowser(url); } return IGUIElement::OnEvent(event); } diff --git a/src/dialog.h b/src/dialog.h index d8aac7f..f4f0d32 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -64,9 +64,6 @@ namespace dialog void showFileOpen(IGUIEnvironment *env, s32 id, const char *caption, const char **filters, const int filter_count); - - void fileOpen(IGUIEnvironment *env, s32 id, const char *caption, - const char **filters, const int filter_count); } class Config;