forward port 2.X changes up to and including rev 6767

git-svn-id: svn://localhost/ardour2/branches/3.0@7636 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-08-17 00:28:20 +00:00
parent a4d9d09af5
commit f5c4c8a293
23 changed files with 147 additions and 69 deletions

View File

@ -43,7 +43,7 @@ AddMidiCCTrackDialog::AddMidiCCTrackDialog ()
, _cc_num_spinner (_cc_num_adjustment)
{
set_name ("AddMidiCCTrackDialog");
set_wmclass (X_("ardour_add_track_bus"), "Ardour");
set_wmclass (X_("ardour_add_track_bus"), PROGRAM_NAME);
set_position (Gtk::WIN_POS_MOUSE);
set_resizable (false);

View File

@ -272,7 +272,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
SessionEvent::create_per_thread_pool ("GUI", 512);
} catch (failed_constructor& err) {
error << _("could not initialize Ardour.") << endmsg;
error << string_compose (_("could not initialize %1."), PROGRAM_NAME) << endmsg;
// pass it on up
throw;
}
@ -1302,10 +1302,10 @@ ARDOUR_UI::session_add_midi_route (bool disk, RouteGroup* route_group, uint32_t
catch (...) {
MessageDialog msg (*editor,
_("There are insufficient JACK ports available\n\
string_compose (_("There are insufficient JACK ports available\n\
to create a new track or bus.\n\
You should save Ardour, exit and\n\
restart JACK with more ports."));
You should save %1, exit and\n\
restart JACK with more ports."), PROGRAM_NAME));
msg.run ();
}
}
@ -1351,10 +1351,10 @@ ARDOUR_UI::session_add_audio_route (bool track, bool aux, int32_t input_channels
catch (...) {
MessageDialog msg (*editor,
_("There are insufficient JACK ports available\n\
string_compose (_("There are insufficient JACK ports available\n\
to create a new track or bus.\n\
You should save Ardour, exit and\n\
restart JACK with more ports."));
You should save %1, exit and\n\
restart JACK with more ports."), PROGRAM_NAME));
pop_back_splash ();
msg.run ();
}
@ -1881,11 +1881,11 @@ ARDOUR_UI::engine_halted (const char* reason, bool free_reason)
if (strlen (reason)) {
msgstr = string_compose (_("The audio backend (JACK) was shutdown because:\n\n%1"), reason);
} else {
msgstr = _("\
msgstr = string_compose (_("\
JACK has either been shutdown or it\n\
disconnected Ardour because Ardour\n\
disconnected %1 because %1\n\
was not fast enough. Try to restart\n\
JACK, reconnect and save the session.");
JACK, reconnect and save the session."), PROGRAM_NAME);
}
MessageDialog msg (*editor, msgstr);
@ -2203,12 +2203,12 @@ ARDOUR_UI::fontconfig_dialog ()
if (!Glib::file_test (fontconfig, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_DIR)) {
MessageDialog msg (*_startup,
_("Welcome to Ardour.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"),
true,
string_compose (_("Welcome to %1.\n\n"
"The program will take a bit longer to start up\n"
"while the system fonts are checked.\n\n"
"This will only be done once, and you will\n"
"not see this message again\n"), PROGRAM_NAME),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);
pop_back_splash ();
@ -2301,7 +2301,7 @@ ARDOUR_UI::ask_about_loading_existing_session (const Glib::ustring& session_path
msg.set_name (X_("OpenExistingDialog"));
msg.set_title (_("Open Existing Session"));
msg.set_wmclass (X_("existing_session"), "Ardour");
msg.set_wmclass (X_("existing_session"), PROGRAM_NAME);
msg.set_position (Gtk::WIN_POS_MOUSE);
pop_back_splash ();
@ -2939,7 +2939,7 @@ After cleanup, unused audio files will be moved to a \
checker.set_default_response (RESPONSE_CANCEL);
checker.set_name (_("CleanupDialog"));
checker.set_wmclass (X_("ardour_cleanup"), "Ardour");
checker.set_wmclass (X_("ardour_cleanup"), PROGRAM_NAME);
checker.set_position (Gtk::WIN_POS_MOUSE);
switch (checker.run()) {
@ -3185,12 +3185,12 @@ ARDOUR_UI::disk_overrun_handler ()
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor, _("\
MessageDialog* msg = new MessageDialog (*editor, string_compose (_("\
The disk system on your computer\n\
was not able to keep up with Ardour.\n\
was not able to keep up with %1.\n\
\n\
Specifically, it failed to write data to disk\n\
quickly enough to keep up with recording.\n"));
quickly enough to keep up with recording.\n"), PROGRAM_NAME));
msg->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::disk_speed_dialog_gone), msg));
msg->show ();
}
@ -3204,11 +3204,11 @@ ARDOUR_UI::disk_underrun_handler ()
if (!have_disk_speed_dialog_displayed) {
have_disk_speed_dialog_displayed = true;
MessageDialog* msg = new MessageDialog (*editor,
_("The disk system on your computer\n\
was not able to keep up with Ardour.\n\
string_compose (_("The disk system on your computer\n\
was not able to keep up with %1.\n\
\n\
Specifically, it failed to read data from disk\n\
quickly enough to keep up with playback.\n"));
quickly enough to keep up with playback.\n"), PROGRAM_NAME));
msg->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::disk_speed_dialog_gone), msg));
msg->show ();
}
@ -3557,3 +3557,39 @@ ARDOUR_UI::setup_profile ()
}
}
void
ARDOUR_UI::toggle_translations ()
{
using namespace Glib;
RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("EnableTranslation"));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
string i18n_killer = ARDOUR::translation_kill_path();
bool already_enabled = !ARDOUR::translations_are_disabled ();
if (ract->get_active ()) {
/* we don't care about errors */
int fd = ::open (i18n_killer.c_str(), O_RDONLY|O_CREAT, 0644);
close (fd);
} else {
/* we don't care about errors */
unlink (i18n_killer.c_str());
}
if (already_enabled != ract->get_active()) {
MessageDialog win (already_enabled ? _("Translations disabled") : _("Translations enabled"),
false,
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_OK);
win.set_secondary_text (string_compose (_("You must restart %1 for this to take effect."), PROGRAM_NAME));
win.set_position (Gtk::WIN_POS_CENTER);
win.present ();
win.run ();
}
}
}
}

View File

@ -695,6 +695,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void platform_specific ();
void platform_setup ();
void fontconfig_dialog ();
void toggle_translations ();
PBD::ScopedConnectionList forever_connections;

View File

@ -413,6 +413,17 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (option_actions, X_("SendMIDIfeedback"), _("Send MIDI Feedback"), sigc::mem_fun (*this, &ARDOUR_UI::toggle_send_midi_feedback));
ActionManager::session_sensitive_actions.push_back (act);
if (getenv ("ARDOUR_BUNDLED")) {
act = ActionManager::register_toggle_action (main_actions, X_("EnableTranslation"), _("Enable Translations"), mem_fun (*this, &ARDOUR_UI::toggle_translations));
if (act) {
RefPtr<ToggleAction> ract = RefPtr<ToggleAction>::cast_dynamic (act);
if (ract) {
ract->set_active (!ARDOUR::translations_are_disabled());
}
}
}
ActionManager::add_action_group (shuttle_actions);
ActionManager::add_action_group (option_actions);
ActionManager::add_action_group (jack_actions);

View File

@ -101,7 +101,7 @@ CrossfadeEditor::CrossfadeEditor (Session* s, boost::shared_ptr<Crossfade> xf, d
{
set_session (s);
set_wmclass (X_("ardour_automationedit"), "Ardour");
set_wmclass (X_("ardour_automationedit"), PROGRAM_NAME);
set_name ("CrossfadeEditWindow");
set_position (Gtk::WIN_POS_MOUSE);

View File

@ -711,7 +711,7 @@ Editor::Editor ()
WindowTitle title(Glib::get_application_name());
title += _("Editor");
set_title (title.get_string());
set_wmclass (X_("ardour_editor"), "Ardour");
set_wmclass (X_("ardour_editor"), PROGRAM_NAME);
add (vpacker);
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);

View File

@ -6470,16 +6470,17 @@ edit your ardour.rc file to set the\n\
if (nbusses) {
prompt = string_compose (_("Do you really want to remove %1 %2 and %3 %4?\n"
"(You may also lose the playlists associated with the %2)\n\n"
"This action cannot be undone!"),
"This action cannot be undone, and the session file will be overwritten!"),
ntracks, trackstr, nbusses, busstr);
} else {
prompt = string_compose (_("Do you really want to remove %1 %2?\n"
"(You may also lose the playlists associated with the %2)\n\n"
"This action cannot be undone!"),
"This action cannot be undone, and the session file will be overwritten!"),
ntracks, trackstr);
}
} else if (nbusses) {
prompt = string_compose (_("Do you really want to remove %1 %2?"),
prompt = string_compose (_("Do you really want to remove %1 %2?\n\n"
"This action cannot be undon, and the session file will be overwritten"),
nbusses, busstr);
}

View File

@ -1023,7 +1023,7 @@ LocationEditRow::set_clock_sensitivity ()
LocationUIWindow::LocationUIWindow ()
: ArdourDialog (_("Locations"))
{
set_wmclass(X_("ardour_locations"), "Ardour");
set_wmclass(X_("ardour_locations"), PROGRAM_NAME);
set_name ("LocationWindow");
get_vbox()->pack_start (_ui);

View File

@ -100,6 +100,8 @@ Please consider the possibilities, and perhaps (re)start JACK."));
#include <sys/param.h>
#include <fstream>
extern void set_language_preference (); // cocoacarbon.mm
void
fixup_bundle_environment ()
{
@ -107,6 +109,8 @@ fixup_bundle_environment ()
return;
}
set_language_preference ();
char execpath[MAXPATHLEN+1];
uint32_t pathsz = sizeof (execpath);
@ -208,13 +212,17 @@ fixup_bundle_environment ()
setenv ("GTK_PATH", path.c_str(), 1);
path = dir_path;
path += "/../Resources/locale";
if (!ARDOUR::translations_are_disabled ()) {
localedir = strdup (path.c_str());
path = dir_path;
path += "/../Resources/locale";
localedir = strdup (path.c_str());
setenv ("GTK_LOCALEDIR", localedir, 1);
}
/* write a pango.rc file and tell pango to use it. we'd love
to put this into the Ardour.app bundle and leave it there,
to put this into the PROGRAM_NAME.app bundle and leave it there,
but the user may not have write permission. so ...
we also have to make sure that the user ardour directory
@ -288,12 +296,12 @@ tell_about_jack_death (void* /* ignored */)
/* died during startup */
MessageDialog msg (_("JACK exited"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK);
msg.set_position (Gtk::WIN_POS_CENTER);
msg.set_secondary_text (_(
"JACK exited unexpectedly, and without notifying Ardour.\n\
msg.set_secondary_text (string_compose (_(
"JACK exited unexpectedly, and without notifying %1.\n\
\n\
This could be due to misconfiguration or to an error inside JACK.\n\
\n\
Click OK to exit Ardour."));
Click OK to exit %1."), PROGRAM_NAME));
msg.run ();
_exit (0);
@ -303,12 +311,12 @@ Click OK to exit Ardour."));
/* engine has already run, so this is a mid-session JACK death */
MessageDialog* msg = manage (new MessageDialog (_("JACK exited"), false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_NONE));
msg->set_secondary_text (_(
"JACK exited unexpectedly, and without notifying Ardour.\n\
msg->set_secondary_text (string_compose (_(
"JACK exited unexpectedly, and without notifying %1.\n\
\n\
This is probably due to an error inside JACK. You should restart JACK\n\
and reconnect Ardour to it, or exit Ardour now. You cannot save your\n\
session at this time, because we would lose your connection information.\n"));
and reconnect %1 to it, or exit %1 now. You cannot save your\n\
session at this time, because we would lose your connection information.\n"), PROGRAM_NAME));
msg->present ();
}
return false; /* do not call again */

View File

@ -213,7 +213,7 @@ Mixer_UI::Mixer_UI ()
title += _("Mixer");
set_title (title.get_string());
set_wmclass (X_("ardour_mixer"), "Ardour");
set_wmclass (X_("ardour_mixer"), PROGRAM_NAME);
add_accel_group (ActionManager::ui_manager->get_accel_group());

View File

@ -211,7 +211,7 @@ OptionEditor::OptionEditor (Configuration* c, std::string const & t)
using namespace Notebook_Helpers;
set_default_size (300, 300);
set_wmclass (X_("ardour_preferences"), "Ardour");
set_wmclass (X_("ardour_preferences"), PROGRAM_NAME);
set_name ("Preferences");
add_events (Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK);

View File

@ -131,7 +131,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
add (*manage(hbox));
*/
set_wmclass (X_("ardour_plugin_editor"), "Ardour");
set_wmclass (X_("ardour_plugin_editor"), PROGRAM_NAME);
signal_map_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::start_updating));
signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating));

View File

@ -331,7 +331,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
boost::shared_ptr<PortGroup> bus (new PortGroup (_("Bus")));
boost::shared_ptr<PortGroup> track (new PortGroup (_("Track")));
boost::shared_ptr<PortGroup> system (new PortGroup (_("System")));
boost::shared_ptr<PortGroup> ardour (new PortGroup (_("Ardour")));
boost::shared_ptr<PortGroup> ardour (new PortGroup (PROGRAM_NAME));
boost::shared_ptr<PortGroup> other (new PortGroup (_("Other")));
/* Find the IOs which have bundles for routes and their processors. We store

View File

@ -142,7 +142,7 @@ RouteParams_UI::RouteParams_UI ()
set_name ("RouteParamsWindow");
set_default_size (620,370);
set_wmclass (X_("ardour_route_parameters"), "Ardour");
set_wmclass (X_("ardour_route_parameters"), PROGRAM_NAME);
// events
route_display.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &RouteParams_UI::route_selected));

View File

@ -1276,7 +1276,8 @@ RouteTimeAxisView::name_entry_changed ()
ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
name_entry.set_text (_route->name());
} else if (_session->route_name_internal (x)) {
ARDOUR_UI::instance()->popup_error (_("You cannot create a track with that name as it is reserved for Ardour"));
ARDOUR_UI::instance()->popup_error (string_compose (_("You cannot create a track with that name as it is reserved for %1"),
PROGRAM_NAME));
name_entry.set_text (_route->name());
} else {
_route->set_name (x);

View File

@ -1340,9 +1340,9 @@ edit your ardour.rc file to set the\n\
string prompt;
if (is_track()) {
prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n(this cannot be undone)"), _route->name());
prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), _route->name());
} else {
prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(this cannot be undone)"), _route->name());
prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), _route->name());
}
choices.push_back (_("No, do nothing."));

View File

@ -423,12 +423,11 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
resetting_ourselves = false;
gm = 0;
if (ARDOUR::Profile->get_sae()) {
chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
}
#ifdef GTKOSX
chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
chooser.add_shortcut_folder_uri("file:///Library/Audio/Apple Loops");
chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
chooser.add_shortcut_folder_uri("file:///Volumes");
#endif
@ -1079,7 +1078,7 @@ bool
SoundFileOmega::bad_file_message()
{
MessageDialog msg (*this,
_("One or more of the selected files\ncannot be used by Ardour"),
string_compose (_("One or more of the selected files\ncannot be used by %1"), PROGRAM_NAME),
true,
Gtk::MESSAGE_INFO,
Gtk::BUTTONS_OK);

View File

@ -294,7 +294,7 @@ using the program.</span>\
new_user_page_index = append_page (*vbox);
set_page_type (*vbox, ASSISTANT_PAGE_INTRO);
set_page_title (*vbox, _("Welcome to Ardour"));
set_page_title (*vbox, string_compose (_("Welcome to %1"), PROGRAM_NAME));
set_page_header_image (*vbox, icon_pixbuf);
set_page_complete (*vbox, true);
}
@ -321,12 +321,12 @@ ArdourStartup::setup_first_time_config_page ()
HBox* hbox = manage (new HBox);
VBox* vbox = manage (new VBox);
txt->set_markup (_("\
Each project that you work on with Ardour has its own folder.\n\
txt->set_markup (string_compose (_("\
Each project that you work on with %1 has its own folder.\n\
These can require a lot of disk space if you are recording audio.\n\
\n\
Where would you like new Ardour sessions to be stored by default?\n\n\
<i>(You can put new sessions anywhere, this is just a default)</i>"));
Where would you like new %1 sessions to be stored by default?\n\n\
<i>(You can put new sessions anywhere, this is just a default)</i>"), PROGRAM_NAME));
txt->set_alignment (0.0, 0.0);
vbox->set_spacing (18);
@ -681,6 +681,10 @@ ArdourStartup::setup_new_session_page ()
}
new_folder_chooser.set_title (_("Select folder for session"));
#ifdef GTKOSX
new_folder_chooser->add_shortcut_folder_uri("file:///Volumes");
#endif
vbox1->pack_start (*hbox2, false, false);
session_new_vbox.pack_start (*vbox1, false, false);

View File

@ -83,12 +83,12 @@ UIConfiguration::load_defaults ()
info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
if (!tree.read (rcfile.c_str())) {
error << string_compose(_("Ardour: cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
error << string_compose(_("cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
if (set_state (*tree.root(), Stateful::loading_state_version)) {
error << string_compose(_("Ardour: default ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
error << string_compose(_("default ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
@ -114,12 +114,12 @@ UIConfiguration::load_state ()
info << string_compose (_("Loading default ui configuration file %1"), rcfile) << endl;
if (!tree.read (rcfile.c_str())) {
error << string_compose(_("Ardour: cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
error << string_compose(_("cannot read default ui configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
if (set_state (*tree.root(), Stateful::loading_state_version)) {
error << string_compose(_("Ardour: default ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
error << string_compose(_("default ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
@ -137,18 +137,18 @@ UIConfiguration::load_state ()
info << string_compose (_("Loading user ui configuration file %1"), rcfile) << endl;
if (!tree.read (rcfile)) {
error << string_compose(_("Ardour: cannot read ui configuration file \"%1\""), rcfile) << endmsg;
error << string_compose(_("cannot read ui configuration file \"%1\""), rcfile) << endmsg;
return -1;
}
if (set_state (*tree.root(), Stateful::loading_state_version)) {
error << string_compose(_("Ardour: user ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
error << string_compose(_("user ui configuration file \"%1\" not loaded successfully."), rcfile) << endmsg;
return -1;
}
}
if (!found)
error << "Ardour: could not find any ui configuration file, canvas will look broken." << endmsg;
error << _("could not find any ui configuration file, canvas will look broken.") << endmsg;
pack_canvasvars();
return 0;

View File

@ -260,7 +260,7 @@ VisualTimeAxis::remove_this_time_axis(void* src)
{
vector<string> choices;
std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n(cannot be undone)"), time_axis_name);
std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n\n(This action cannot be undone, and the session file will be overwritten)"), time_axis_name);
choices.push_back (_("No, do nothing."));
choices.push_back (_("Yes, remove it."));

View File

@ -62,6 +62,9 @@ namespace ARDOUR {
void find_bindings_files (std::map<std::string,std::string>&);
std::string translation_kill_path ();
bool translations_are_disabled ();
const layer_t max_layer = UCHAR_MAX;
static inline microseconds_t get_microseconds () {

View File

@ -526,3 +526,15 @@ ARDOUR::coverage (framepos_t sa, framepos_t ea,
return OverlapNone;
}
string
ARDOUR::translation_kill_path ()
{
return Glib::build_filename (user_config_directory().to_string(), ".love_is_the_language_of_audio");
}
bool
ARDOUR::translations_are_disabled ()
{
/* if file does not exist, we don't translate (bundled ardour only) */
return Glib::file_test (translation_kill_path(), Glib::FILE_TEST_EXISTS) == false;
}

View File

@ -2107,6 +2107,8 @@ Session::remove_route (shared_ptr<Route> route)
return;
}
route->set_solo (false, this);
{
RCUWriter<RouteList> writer (routes);
shared_ptr<RouteList> rs = writer.get_copy ();