X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fnag.cc;h=7a7a4aadbb8cc92106d735adc4d77164db5f74f6;hb=6ef5d85ae1f2c500c4163cd1df580b3f26991c1e;hp=d239d850c73164d44a9ca88f95b6eec759e02a7f;hpb=c5f9501e501f7444060d1b4a4fb368336ff697be;p=ardour.git diff --git a/gtk2_ardour/nag.cc b/gtk2_ardour/nag.cc index d239d850c7..7a7a4aadbb 100644 --- a/gtk2_ardour/nag.cc +++ b/gtk2_ardour/nag.cc @@ -1,8 +1,14 @@ +#ifdef WAF_BUILD +#include "gtk2ardour-config.h" +#endif + #include #include -#include -#include +#include "pbd/openuri.h" + +#include "ardour/ardour.h" +#include "ardour/filesystem_paths.h" #include "nag.h" #include "i18n.h" @@ -12,7 +18,7 @@ using namespace std; using namespace Glib; using namespace Gtk; -NagScreen::NagScreen (std::string context, bool maybe_sub) +NagScreen::NagScreen (std::string /*context*/, bool maybe_sub) : ArdourDialog (_("Support Ardour Development"), true) , donate_button (button_group, _("I'd like to make a one-time donation")) , subscribe_button (button_group, _("Tell me more about becoming a subscriber")) @@ -36,13 +42,13 @@ its development with either a one-time donation or subscription. Nothing\n\ will happen if you choose not to do so. However Ardour's continuing development\n\ relies on a stable, sustainable income stream. Thanks for using Ardour!")); } - + button_box.pack_start (donate_button); button_box.pack_start (subscribe_button); button_box.pack_start (existing_button); button_box.pack_start (next_time_button); button_box.pack_start (never_again_button); - + get_vbox()->set_spacing (12); get_vbox()->pack_start (message); get_vbox()->pack_start (button_box); @@ -96,7 +102,7 @@ NagScreen::maybe_nag (std::string why) } maybe_subscribed = is_subscribed (really_subscribed); - + if (really_subscribed) { return 0; } @@ -110,7 +116,7 @@ NagScreen::mark_never_again () Glib::ustring path; path = Glib::build_filename (user_config_directory().to_string(), ".nevernag"); - + ofstream nagfile (path.c_str()); } @@ -120,7 +126,7 @@ NagScreen::mark_subscriber () Glib::ustring path; path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub"); - + ofstream subsfile (path.c_str()); } @@ -130,7 +136,7 @@ NagScreen::mark_affirmed_subscriber () Glib::ustring path; path = Glib::build_filename (user_config_directory().to_string(), ".isubscribe"); - + ofstream subsfile (path.c_str()); } @@ -141,7 +147,7 @@ NagScreen::is_subscribed (bool& really) really = false; - /* what we'd really like here is a way to query paypal + /* what we'd really like here is a way to query paypal for someone's subscription status. thats a bit complicated so for now, just see if they ever told us they were subscribed. we try to trust our users :) @@ -172,35 +178,16 @@ NagScreen::offer_to_donate () /* we don't care if it fails */ - open_uri (uri); + PBD::open_uri (uri); } void NagScreen::offer_to_subscribe () { const char* uri = "http://ardour.org/subscribe"; - - if (open_uri (uri)) { + + if (PBD::open_uri (uri)) { mark_subscriber (); } } -bool -NagScreen::open_uri (const char* uri) -{ -#ifdef HAVE_GTK_OPEN_URI - GError* err; - return gtk_open_uri (0, uri, GDK_CURRENT_TIME, &err); -#else -#ifdef GTKOSX - extern bool cocoa_open_url (const char*); - return cocoa_open_url (uri); -#else - std::string command = "xdg-open "; - command += uri; - spawn_command_line_async (command); - - return true; -#endif -#endif -}