From 36682ce78a9f0b496295a9d6f936ca65298779a0 Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Wed, 12 Feb 2014 03:34:17 -0300 Subject: [PATCH] gui2/tgame_paths, taddon_description: Hide browse buttons if unsupported Hide the URL/path browse buttons if we don't support the current target platform, they are wasting space otherwise since they only trigger a stderr error in that case. --- src/gui/dialogs/addon/description.cpp | 6 ++++++ src/gui/dialogs/game_paths.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/gui/dialogs/addon/description.cpp b/src/gui/dialogs/addon/description.cpp index 4ef1644d4ff5..2267a9ccb416 100644 --- a/src/gui/dialogs/addon/description.cpp +++ b/src/gui/dialogs/addon/description.cpp @@ -393,6 +393,12 @@ void taddon_description::pre_show(CVideo& /*video*/, twindow& window) url_copy_button.set_visible(tcontrol::tvisible::invisible); url_textbox.set_visible(tcontrol::tvisible::invisible); } + + if(!desktop::open_object_is_supported()) { + // No point in displaying the button on platforms that can't do + // open_object(). + url_go_button.set_visible(tcontrol::tvisible::invisible); + } } } // namespace gui2 diff --git a/src/gui/dialogs/game_paths.cpp b/src/gui/dialogs/game_paths.cpp index f11f896406a3..e7bfdd8c5d5f 100644 --- a/src/gui/dialogs/game_paths.cpp +++ b/src/gui/dialogs/game_paths.cpp @@ -105,6 +105,12 @@ void tgame_paths::pre_show(CVideo& /*video*/, twindow& window) boost::bind(&tgame_paths::browse_directory_callback, this, path_path)); + + if(!desktop::open_object_is_supported()) { + // No point in displaying these on platforms that can't do + // open_object(). + browse_w.set_visible(tcontrol::tvisible::invisible); + } } }