properly track step edit status in editor & mixer windows
[ardour.git] / gtk2_ardour / nag.cc
index c8f6c35c17077f1b6e268cd78d61845634f6652e..7a7a4aadbb8cc92106d735adc4d77164db5f74f6 100644 (file)
@@ -5,6 +5,8 @@
 #include <fstream>
 #include <gtkmm/stock.h>
 
+#include "pbd/openuri.h"
+
 #include "ardour/ardour.h"
 #include "ardour/filesystem_paths.h"
 
@@ -40,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);
@@ -100,7 +102,7 @@ NagScreen::maybe_nag (std::string why)
        }
 
        maybe_subscribed = is_subscribed (really_subscribed);
-       
+
        if (really_subscribed) {
                return 0;
        }
@@ -114,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());
 }
 
@@ -124,7 +126,7 @@ NagScreen::mark_subscriber ()
        Glib::ustring path;
 
        path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub");
-       
+
        ofstream subsfile (path.c_str());
 }
 
@@ -134,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());
 }
 
@@ -145,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 :)
@@ -176,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
-}