mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
NO-OP: whitespace
This commit is contained in:
parent
6616330531
commit
75773a43d4
2 changed files with 108 additions and 108 deletions
|
|
@ -33,33 +33,33 @@ using namespace ARDOUR;
|
||||||
using namespace PBD;
|
using namespace PBD;
|
||||||
|
|
||||||
MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataType type)
|
MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataType type)
|
||||||
: ArdourDialog (_("Missing File"), true, false)
|
: ArdourDialog (_("Missing File"), true, false)
|
||||||
, filetype (type)
|
, filetype (type)
|
||||||
, chooser (_("Select a folder to search"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
, chooser (_("Select a folder to search"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
|
||||||
, use_chosen (_("Add chosen folder to search path, and try again"))
|
, use_chosen (_("Add chosen folder to search path, and try again"))
|
||||||
, choice_group (use_chosen.get_group())
|
, choice_group (use_chosen.get_group())
|
||||||
, stop_loading_button (choice_group, _("Stop loading this session"), false)
|
, stop_loading_button (choice_group, _("Stop loading this session"), false)
|
||||||
, all_missing_ok (choice_group, _("Skip all missing files"), false)
|
, all_missing_ok (choice_group, _("Skip all missing files"), false)
|
||||||
, this_missing_ok (choice_group, _("Skip this file"), false)
|
, this_missing_ok (choice_group, _("Skip this file"), false)
|
||||||
{
|
{
|
||||||
/* This dialog is always shown programatically. Center the window.*/
|
/* This dialog is always shown programatically. Center the window.*/
|
||||||
set_position (Gtk::WIN_POS_CENTER);
|
set_position (Gtk::WIN_POS_CENTER);
|
||||||
|
|
||||||
set_session (s);
|
set_session (s);
|
||||||
|
|
||||||
add_button (_("Done"), RESPONSE_OK);
|
add_button (_("Done"), RESPONSE_OK);
|
||||||
set_default_response (RESPONSE_OK);
|
set_default_response (RESPONSE_OK);
|
||||||
|
|
||||||
string typestr;
|
string typestr;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DataType::AUDIO:
|
case DataType::AUDIO:
|
||||||
typestr = _("audio");
|
typestr = _("audio");
|
||||||
break;
|
break;
|
||||||
case DataType::MIDI:
|
case DataType::MIDI:
|
||||||
typestr = _("MIDI");
|
typestr = _("MIDI");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> source_dirs = s->source_search_path (type);
|
vector<string> source_dirs = s->source_search_path (type);
|
||||||
vector<string>::iterator i = source_dirs.begin();
|
vector<string>::iterator i = source_dirs.begin();
|
||||||
|
|
@ -70,114 +70,114 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
|
||||||
oss << *i << endl;
|
oss << *i << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.set_justify (JUSTIFY_LEFT);
|
msg.set_justify (JUSTIFY_LEFT);
|
||||||
msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
|
msg.set_markup (string_compose (_("%1 cannot find the %2 file\n\n<i>%3</i>\n\nin any of these folders:\n\n\
|
||||||
<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Gtkmm2ext::markup_escape_text (path), Gtkmm2ext::markup_escape_text (oss.str())));
|
<tt>%4</tt>\n\n"), PROGRAM_NAME, typestr, Gtkmm2ext::markup_escape_text (path), Gtkmm2ext::markup_escape_text (oss.str())));
|
||||||
|
|
||||||
HBox* hbox = manage (new HBox);
|
HBox* hbox = manage (new HBox);
|
||||||
hbox->pack_start (msg, false, true);
|
hbox->pack_start (msg, false, true);
|
||||||
hbox->show ();
|
hbox->show ();
|
||||||
|
|
||||||
get_vbox()->pack_start (*hbox, false, false);
|
get_vbox()->pack_start (*hbox, false, false);
|
||||||
|
|
||||||
VBox* button_packer_box = manage (new VBox);
|
VBox* button_packer_box = manage (new VBox);
|
||||||
|
|
||||||
button_packer_box->set_spacing (6);
|
button_packer_box->set_spacing (6);
|
||||||
button_packer_box->set_border_width (12);
|
button_packer_box->set_border_width (12);
|
||||||
|
|
||||||
button_packer_box->pack_start (use_chosen, false, false);
|
button_packer_box->pack_start (use_chosen, false, false);
|
||||||
button_packer_box->pack_start (this_missing_ok, false, false);
|
button_packer_box->pack_start (this_missing_ok, false, false);
|
||||||
button_packer_box->pack_start (all_missing_ok, false, false);
|
button_packer_box->pack_start (all_missing_ok, false, false);
|
||||||
button_packer_box->pack_start (stop_loading_button, false, false);
|
button_packer_box->pack_start (stop_loading_button, false, false);
|
||||||
|
|
||||||
button_packer_box->show_all ();
|
button_packer_box->show_all ();
|
||||||
|
|
||||||
get_vbox()->set_spacing (6);
|
get_vbox()->set_spacing (6);
|
||||||
get_vbox()->set_border_width (25);
|
get_vbox()->set_border_width (25);
|
||||||
get_vbox()->set_homogeneous (false);
|
get_vbox()->set_homogeneous (false);
|
||||||
|
|
||||||
|
|
||||||
hbox = manage (new HBox);
|
hbox = manage (new HBox);
|
||||||
hbox->pack_start (*button_packer_box, false, true);
|
hbox->pack_start (*button_packer_box, false, true);
|
||||||
hbox->show ();
|
hbox->show ();
|
||||||
|
|
||||||
get_vbox()->pack_start (*hbox, false, false);
|
get_vbox()->pack_start (*hbox, false, false);
|
||||||
|
|
||||||
hbox = manage (new HBox);
|
hbox = manage (new HBox);
|
||||||
Label* label = manage (new Label);
|
Label* label = manage (new Label);
|
||||||
label->set_text (_("Click to choose an additional folder"));
|
label->set_text (_("Click to choose an additional folder"));
|
||||||
|
|
||||||
hbox->set_spacing (6);
|
hbox->set_spacing (6);
|
||||||
hbox->set_border_width (12);
|
hbox->set_border_width (12);
|
||||||
hbox->pack_start (*label, false, false);
|
hbox->pack_start (*label, false, false);
|
||||||
hbox->pack_start (chooser, true, true);
|
hbox->pack_start (chooser, true, true);
|
||||||
hbox->show_all ();
|
hbox->show_all ();
|
||||||
|
|
||||||
get_vbox()->pack_start (*hbox, true, true);
|
get_vbox()->pack_start (*hbox, true, true);
|
||||||
|
|
||||||
msg.show ();
|
msg.show ();
|
||||||
|
|
||||||
chooser.set_current_folder (Glib::get_home_dir());
|
chooser.set_current_folder (Glib::get_home_dir());
|
||||||
chooser.set_create_folders (false);
|
chooser.set_create_folders (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MissingFileDialog::add_chosen ()
|
MissingFileDialog::add_chosen ()
|
||||||
{
|
{
|
||||||
string str;
|
string str;
|
||||||
string newdir;
|
string newdir;
|
||||||
vector<string> dirs;
|
vector<string> dirs;
|
||||||
|
|
||||||
switch (filetype) {
|
switch (filetype) {
|
||||||
case DataType::AUDIO:
|
case DataType::AUDIO:
|
||||||
str = _session->config.get_audio_search_path();
|
str = _session->config.get_audio_search_path();
|
||||||
break;
|
break;
|
||||||
case DataType::MIDI:
|
case DataType::MIDI:
|
||||||
str = _session->config.get_midi_search_path();
|
str = _session->config.get_midi_search_path();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
split (str, dirs, G_SEARCHPATH_SEPARATOR);
|
split (str, dirs, G_SEARCHPATH_SEPARATOR);
|
||||||
|
|
||||||
newdir = chooser.get_filename ();
|
newdir = chooser.get_filename ();
|
||||||
|
|
||||||
for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); d++) {
|
for (vector<string>::iterator d = dirs.begin(); d != dirs.end(); d++) {
|
||||||
if (*d == newdir) {
|
if (*d == newdir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!str.empty()) {
|
if (!str.empty()) {
|
||||||
str += G_SEARCHPATH_SEPARATOR;
|
str += G_SEARCHPATH_SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
str += newdir;
|
str += newdir;
|
||||||
|
|
||||||
switch (filetype) {
|
switch (filetype) {
|
||||||
case DataType::AUDIO:
|
case DataType::AUDIO:
|
||||||
_session->config.set_audio_search_path (str);
|
_session->config.set_audio_search_path (str);
|
||||||
break;
|
break;
|
||||||
case DataType::MIDI:
|
case DataType::MIDI:
|
||||||
_session->config.set_midi_search_path (str);
|
_session->config.set_midi_search_path (str);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
MissingFileDialog::get_action ()
|
MissingFileDialog::get_action ()
|
||||||
{
|
{
|
||||||
if (use_chosen.get_active ()) {
|
if (use_chosen.get_active ()) {
|
||||||
add_chosen ();
|
add_chosen ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this_missing_ok.get_active()) {
|
if (this_missing_ok.get_active()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (all_missing_ok.get_active ()) {
|
if (all_missing_ok.get_active ()) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,24 +35,24 @@ namespace ARDOUR {
|
||||||
|
|
||||||
class MissingFileDialog : public ArdourDialog
|
class MissingFileDialog : public ArdourDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MissingFileDialog (ARDOUR::Session*, const std::string& path, ARDOUR::DataType type);
|
MissingFileDialog (ARDOUR::Session*, const std::string& path, ARDOUR::DataType type);
|
||||||
|
|
||||||
int get_action();
|
int get_action();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::DataType filetype;
|
ARDOUR::DataType filetype;
|
||||||
|
|
||||||
Gtk::FileChooserButton chooser;
|
Gtk::FileChooserButton chooser;
|
||||||
Gtk::RadioButton use_chosen;
|
Gtk::RadioButton use_chosen;
|
||||||
Gtk::RadioButton::Group choice_group;
|
Gtk::RadioButton::Group choice_group;
|
||||||
Gtk::RadioButton use_chosen_and_no_more_questions;
|
Gtk::RadioButton use_chosen_and_no_more_questions;
|
||||||
Gtk::RadioButton stop_loading_button;
|
Gtk::RadioButton stop_loading_button;
|
||||||
Gtk::RadioButton all_missing_ok;
|
Gtk::RadioButton all_missing_ok;
|
||||||
Gtk::RadioButton this_missing_ok;
|
Gtk::RadioButton this_missing_ok;
|
||||||
Gtk::Label msg;
|
Gtk::Label msg;
|
||||||
|
|
||||||
void add_chosen ();
|
void add_chosen ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk_ardour_missing_file_dialog_h__ */
|
#endif /* __gtk_ardour_missing_file_dialog_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue