return false;
}
- preview_label.set_markup (string_compose ("<b>%1</b>", Glib::path_get_basename (filename)));
+ preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename))));
std::string n = sf_info.format_name;
if (n.substr (0, 8) == X_("Format: ")) {
n = n.substr (8);
notebook.set_size_request (500, -1);
+ notebook.signal_switch_page().connect (
+ sigc::hide_return (sigc::hide (sigc::hide (sigc::mem_fun (*this, &SoundFileBrowser::reset_options))))
+ );
set_session (s);
void
SoundFileBrowser::update_preview ()
{
- if (preview.setup_labels (chooser.get_filename())) {
+ if (preview.setup_labels (chooser.get_preview_filename())) {
if (preview.autoplay()) {
Glib::signal_idle().connect (sigc::mem_fun (preview, &SoundFileBox::audition_oneshot));
}
channel_combo.set_sensitive (false);
action_combo.set_sensitive (false);
where_combo.set_sensitive (false);
+ copy_files_btn.set_active (true);
copy_files_btn.set_sensitive (false);
return false;
/* if we get through this function successfully, this may be
reset at the end, once we know if we can use hard links
- to do embedding
+ to do embedding (or if we are importing a MIDI file).
*/
if (Config->get_only_copy_imported_files()) {
bool selection_can_be_embedded_with_links = check_link_status (_session, paths);
ImportMode mode;
+ /* See if we are thinking about importing any MIDI files */
+ vector<string>::iterator i = paths.begin ();
+ while (i != paths.end() && SMFSource::safe_midi_file_extension (*i) == false) {
+ ++i;
+ }
+ bool const have_a_midi_file = (i != paths.end ());
+
if (check_info (paths, same_size, src_needed, selection_includes_multichannel)) {
Glib::signal_idle().connect (sigc::mem_fun (*this, &SoundFileOmega::bad_file_message));
return false;
src_combo.set_sensitive (false);
}
+ /* We must copy MIDI files or those from Freesound */
+ bool const must_copy = have_a_midi_file || notebook.get_current_page() == 2;
+
if (Config->get_only_copy_imported_files()) {
- if (selection_can_be_embedded_with_links) {
+ if (selection_can_be_embedded_with_links && !must_copy) {
copy_files_btn.set_sensitive (true);
} else {
+ if (must_copy) {
+ copy_files_btn.set_active (true);
+ }
copy_files_btn.set_sensitive (false);
}
} else {
- copy_files_btn.set_sensitive (true);
+ if (must_copy) {
+ copy_files_btn.set_active (true);
+ }
+ copy_files_btn.set_sensitive (!must_copy);
}
return true;
bool
SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths)
{
- sys::path path = s->session_directory().sound_path() / "linktest";
- string tmpdir = path.to_string();
+ std::string tmpdir(Glib::build_filename (s->session_directory().sound_path(), "linktest"));
bool ret = false;
if (mkdir (tmpdir.c_str(), 0744)) {
where_combo.set_active_text (str.front());
Label* l = manage (new Label);
- l->set_text (_("Add files:"));
+ l->set_markup (_("<b>Add files as ...</b>"));
- hbox = manage (new HBox);
- hbox->set_border_width (12);
- hbox->set_spacing (6);
- hbox->pack_start (*l, false, false);
- hbox->pack_start (action_combo, false, false);
vbox = manage (new VBox);
- vbox->pack_start (*hbox, false, false);
- options.pack_start (*vbox, false, false);
+ vbox->set_border_width (12);
+ vbox->set_spacing (6);
+ vbox->pack_start (*l, false, false);
+ vbox->pack_start (action_combo, false, false);
+ hbox = manage (new HBox);
+ hbox->pack_start (*vbox, false, false);
+ options.pack_start (*hbox, false, false);
/* dummy entry for action combo so that it doesn't look odd if we
come up with no tracks selected.
action_combo.set_sensitive (false);
l = manage (new Label);
- l->set_text (_("Insert at:"));
+ l->set_markup (_("<b>Insert at</b>"));
- hbox = manage (new HBox);
- hbox->set_border_width (12);
- hbox->set_spacing (6);
- hbox->pack_start (*l, false, false);
- hbox->pack_start (where_combo, false, false);
vbox = manage (new VBox);
- vbox->pack_start (*hbox, false, false);
- options.pack_start (*vbox, false, false);
+ vbox->set_border_width (12);
+ vbox->set_spacing (6);
+ vbox->pack_start (*l, false, false);
+ vbox->pack_start (where_combo, false, false);
+ hbox = manage (new HBox);
+ hbox->pack_start (*vbox, false, false);
+ options.pack_start (*hbox, false, false);
l = manage (new Label);
- l->set_text (_("Mapping:"));
+ l->set_markup (_("<b>Mapping</b>"));
- hbox = manage (new HBox);
- hbox->set_border_width (12);
- hbox->set_spacing (6);
- hbox->pack_start (*l, false, false);
- hbox->pack_start (channel_combo, false, false);
vbox = manage (new VBox);
- vbox->pack_start (*hbox, false, false);
- options.pack_start (*vbox, false, false);
+ vbox->set_border_width (12);
+ vbox->set_spacing (6);
+ vbox->pack_start (*l, false, false);
+ vbox->pack_start (channel_combo, false, false);
+ hbox = manage (new HBox);
+ hbox->pack_start (*vbox, false, false);
+ options.pack_start (*hbox, false, false);
str.clear ();
str.push_back (_("one track per file"));
channel_combo.set_sensitive (false);
l = manage (new Label);
- l->set_text (_("Conversion quality:"));
+ l->set_markup (_("<b>Conversion quality</b>"));
- hbox = manage (new HBox);
- hbox->set_border_width (12);
- hbox->set_spacing (6);
- hbox->pack_start (*l, false, false);
- hbox->pack_start (src_combo, false, false);
vbox = manage (new VBox);
- vbox->pack_start (*hbox, false, false);
- options.pack_start (*vbox, false, false);
+ vbox->set_border_width (12);
+ vbox->set_spacing (6);
+ vbox->pack_start (*l, false, false);
+ vbox->pack_start (src_combo, false, false);
+ hbox = manage (new HBox);
+ hbox->pack_start (*vbox, false, false);
+ options.pack_start (*hbox, false, false);
str.clear ();
str.push_back (_("Best"));
copy_files_btn.set_active (true);
+ Gtk::Label* copy_label = dynamic_cast<Gtk::Label*>(copy_files_btn.get_child());
+
+ if (copy_label) {
+ copy_label->set_size_request (175, -1);
+ copy_label->set_line_wrap (true);
+ }
+
block_four.pack_start (copy_files_btn, false, false);
options.pack_start (block_four, false, false);