+#ifdef WAF_BUILD
+#include "gtk2ardour-config.h"
+#endif
+
#include <fstream>
#include <gtkmm/stock.h>
-#include <ardour/ardour.h>
-#include <ardour/filesystem_paths.h>
+#include "pbd/openuri.h"
+
+#include "ardour/ardour.h"
+#include "ardour/filesystem_paths.h"
#include "nag.h"
#include "i18n.h"
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"))
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);
}
maybe_subscribed = is_subscribed (really_subscribed);
-
+
if (really_subscribed) {
return 0;
}
Glib::ustring path;
path = Glib::build_filename (user_config_directory().to_string(), ".nevernag");
-
+
ofstream nagfile (path.c_str());
}
Glib::ustring path;
path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub");
-
+
ofstream subsfile (path.c_str());
}
Glib::ustring path;
path = Glib::build_filename (user_config_directory().to_string(), ".isubscribe");
-
+
ofstream subsfile (path.c_str());
}
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 :)
/* 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
-}