diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | appveyor.yml | 2 | ||||
-rw-r--r-- | components/chatmessage.cpp | 2 | ||||
-rw-r--r-- | util.hpp | 15 |
4 files changed, 8 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2452ead..94414f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ find_library(GTKMM_LIBRARY gtkmm) include_directories(${GTKMM_INCLUDE_DIRS}) find_library(GLIB_LIBRARY glib-2.0) +find_library(GTK_LIBRARY gtk-3.0) find_path(GLIBMM_INCLUDE_DIRS glibmm.h) find_library(GLIBMM_LIBRARY glibmm) @@ -91,6 +92,7 @@ target_link_libraries(abaddon ${ATKMM_LIBRARY}) target_link_libraries(abaddon ${CURL_LIBRARY}) target_link_libraries(abaddon ${CPR_LIBRARY}) target_link_libraries(abaddon ${ZLIB_LIBRARY}) +target_link_libraries(abaddon ${GTK_LIBRARY}) if(NOT DISABLE_MBEDTLS) target_link_libraries(abaddon ${MBEDTLS_TLS_LIBRARY}) target_link_libraries(abaddon ${MBEDTLS_X509_LIBRARY}) diff --git a/appveyor.yml b/appveyor.yml index 7f0929a..1adcdb1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,6 +39,8 @@ for: after_build: - cmd: | + copy "c:\tools\vcpkg\installed\x64-windows\tools\glib\gspawn-win64-helper.exe" "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\gspawn-win64-helper.exe" + copy "c:\tools\vcpkg\installed\x64-windows\tools\glib\gspawn-win64-helper-console.exe" "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\gspawn-win64-helper-console.exe" xcopy /E /I %APPVEYOR_BUILD_FOLDER%\css "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\css\" xcopy /E /I %APPVEYOR_BUILD_FOLDER%\res "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%\res\" 7z a %APPVEYOR_BUILD_FOLDER%\out\abaddon.zip "%APPVEYOR_BUILD_FOLDER%\build\%CONFIGURATION%" diff --git a/components/chatmessage.cpp b/components/chatmessage.cpp index 5a883b7..796c468 100644 --- a/components/chatmessage.cpp +++ b/components/chatmessage.cpp @@ -768,8 +768,6 @@ bool ChatMessageItemContainer::OnLinkClick(GdkEventButton *ev) { } return false; - - return false; } void ChatMessageItemContainer::ShowMenu(GdkEvent *event) { @@ -54,17 +54,10 @@ private: #include <shellapi.h> #endif -inline void LaunchBrowser(std::string url) { -#if defined(_WIN32) - // wtf i love the win32 api now ??? - ShellExecuteA(NULL, "open", url.c_str(), NULL, NULL, SW_SHOWNORMAL); -#elif defined(__APPLE__) - std::system(("open " + url).c_str()); -#elif defined(__linux__) - std::system(("xdg-open " + url).c_str()); -#else - printf("can't open url on this platform\n"); -#endif +inline void LaunchBrowser(Glib::ustring url) { + GError *err = nullptr; + if (!gtk_show_uri_on_window(nullptr, url.c_str(), GDK_CURRENT_TIME, &err)) + printf("failed to open uri: %s\n", err->message); } inline void GetImageDimensions(int inw, int inh, int &outw, int &outh, int clampw = 400, int clamph = 300) { |