X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fnag.cc;h=d553efd1979220bf97629d596ad98e4a75ddaca5;hb=2c7cb9065f6303c64baf4eb5dbb64db56a587d40;hp=8d9d75538ff300e0517340866af936e0b3c014fb;hpb=ed626628b54e67dd9621c08d82a42afaed00c7ac;p=ardour.git diff --git a/gtk2_ardour/nag.cc b/gtk2_ardour/nag.cc index 8d9d75538f..d553efd197 100644 --- a/gtk2_ardour/nag.cc +++ b/gtk2_ardour/nag.cc @@ -1,17 +1,36 @@ +/* + Copyright (C) 2012 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + #ifdef WAF_BUILD #include "gtk2ardour-config.h" #endif -#include +#include "pbd/gstdio_compat.h" #include #include "pbd/openuri.h" -#include "ardour/ardour.h" #include "ardour/filesystem_paths.h" +#include "ardour/rc_configuration.h" #include "nag.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace ARDOUR; using namespace std; @@ -19,7 +38,7 @@ using namespace Glib; using namespace Gtk; NagScreen::NagScreen (std::string /*context*/, bool maybe_sub) - : ArdourDialog (_("Support Ardour Development"), true) + : ArdourDialog (string_compose (_("Support %1 Development"), PROGRAM_NAME), 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")) , existing_button (button_group, _("I'm already a subscriber!")) @@ -95,7 +114,7 @@ NagScreen::maybe_nag (std::string why) bool really_subscribed; bool maybe_subscribed; - path = Glib::build_filename (user_config_directory().to_string(), ".nevernag"); + path = Glib::build_filename (user_config_directory(), ".nevernag"); if (Glib::file_test (path, Glib::FILE_TEST_EXISTS)) { return 0; @@ -115,9 +134,9 @@ NagScreen::mark_never_again () { std::string path; - path = Glib::build_filename (user_config_directory().to_string(), ".nevernag"); + path = Glib::build_filename (user_config_directory(), ".nevernag"); - ofstream nagfile (path.c_str()); + g_file_set_contents (path.c_str(), "", -1, NULL); } void @@ -125,9 +144,9 @@ NagScreen::mark_subscriber () { std::string path; - path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub"); + path = Glib::build_filename (user_config_directory(), ".askedaboutsub"); - ofstream subsfile (path.c_str()); + g_file_set_contents (path.c_str(), "", -1, NULL); } void @@ -135,9 +154,9 @@ NagScreen::mark_affirmed_subscriber () { std::string path; - path = Glib::build_filename (user_config_directory().to_string(), ".isubscribe"); + path = Glib::build_filename (user_config_directory(), ".isubscribe"); - ofstream subsfile (path.c_str()); + g_file_set_contents (path.c_str(), "", -1, NULL); } bool @@ -153,13 +172,13 @@ NagScreen::is_subscribed (bool& really) subscribed. we try to trust our users :) */ - path = Glib::build_filename (user_config_directory().to_string(), ".isubscribe"); + path = Glib::build_filename (user_config_directory(), ".isubscribe"); if (file_test (path, FILE_TEST_EXISTS)) { really = true; return true; } - path = Glib::build_filename (user_config_directory().to_string(), ".askedaboutsub"); + path = Glib::build_filename (user_config_directory(), ".askedaboutsub"); if (file_test (path, FILE_TEST_EXISTS)) { /* they never said they were subscribed but they did once express an interest in it. @@ -174,11 +193,9 @@ NagScreen::is_subscribed (bool& really) void NagScreen::offer_to_donate () { - const char* uri = "http://ardour.org/donate"; - /* we don't care if it fails */ - PBD::open_uri (uri); + PBD::open_uri (Config->get_donate_url()); } void