mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-07 14:15:46 +01:00
Add a stock question image to the choices dialog, other general dialog love.. Forgot to mention that in the last commit the default snapshot name has been modified for slightly better alphabetical sorting goodness (year is now first, weekday last).
git-svn-id: svn://localhost/trunk/ardour2@459 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8ca561f8d3
commit
d7e728476a
9 changed files with 41 additions and 33 deletions
|
|
@ -229,29 +229,29 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
|
|||
if (check_sample_rate && (finfo.samplerate != (int) session->frame_rate())) {
|
||||
vector<string> choices;
|
||||
|
||||
choices.push_back (_("Embed it anyway"));
|
||||
|
||||
if (multiple_files) {
|
||||
choices.push_back (_("Cancel entire import"));
|
||||
choices.push_back (_("Don't embed it"));
|
||||
choices.push_back (_("Embed all without questions"));
|
||||
choices.push_back (_("Cancel entire import"));
|
||||
} else {
|
||||
choices.push_back (_("Cancel"));
|
||||
}
|
||||
|
||||
choices.push_back (_("Embed it anyway"));
|
||||
|
||||
Gtkmm2ext::Choice rate_choice (
|
||||
string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
|
||||
choices, false);
|
||||
|
||||
switch (rate_choice.run()) {
|
||||
case 0: /* do it */
|
||||
break;
|
||||
case 0: /* stop a multi-file import */
|
||||
case 1: /* don't import this one */
|
||||
return -1;
|
||||
case 2: /* do it, and the rest without asking */
|
||||
check_sample_rate = false;
|
||||
break;
|
||||
case 3: /* stop a multi-file import */
|
||||
case 3: /* do it */
|
||||
break;
|
||||
default:
|
||||
return -2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,17 +190,17 @@ Do you really want to destroy %1 ?"),
|
|||
(selected > 1 ?
|
||||
_("these regions") : _("this region")));
|
||||
|
||||
choices.push_back (_("No, do nothing."));
|
||||
|
||||
if (selected > 1) {
|
||||
choices.push_back (_("Yes, destroy them."));
|
||||
} else {
|
||||
choices.push_back (_("Yes, destroy it."));
|
||||
}
|
||||
|
||||
choices.push_back (_("No, do nothing."));
|
||||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
|
||||
if (prompter.run() != 0) { /* first choice */
|
||||
if (prompter.run() == 0) { /* first choice */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3226,12 +3226,12 @@ Editor::remove_last_capture ()
|
|||
prompt = _("Do you really want to destroy the last capture?"
|
||||
"\n(This is destructive and cannot be undone)");
|
||||
|
||||
choices.push_back (_("Yes, destroy it."));
|
||||
choices.push_back (_("No, do nothing."));
|
||||
choices.push_back (_("Yes, destroy it."));
|
||||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
|
||||
if (prompter.run () == 0) {
|
||||
if (prompter.run () == 1) {
|
||||
session->remove_last_capture ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,17 +97,17 @@ ExportDialog::ExportDialog(PublicEditor& e)
|
|||
: ArdourDialog ("export dialog"),
|
||||
editor (e),
|
||||
format_table (9, 2),
|
||||
format_frame (_("FORMAT")),
|
||||
cue_file_label (_("CD MARKER FILE TYPE"), 1.0, 0.5),
|
||||
channel_count_label (_("CHANNELS"), 1.0, 0.5),
|
||||
header_format_label (_("FILE TYPE"), 1.0, 0.5),
|
||||
bitdepth_format_label (_("SAMPLE FORMAT"), 1.0, 0.5),
|
||||
endian_format_label (_("SAMPLE ENDIANNESS"), 1.0, 0.5),
|
||||
sample_rate_label (_("SAMPLE RATE"), 1.0, 0.5),
|
||||
src_quality_label (_("CONVERSION QUALITY"), 1.0, 0.5),
|
||||
dither_type_label (_("DITHER TYPE"), 1.0, 0.5),
|
||||
cuefile_only_checkbox (_("EXPORT CD MARKER FILE ONLY")),
|
||||
file_frame (_("EXPORT TO FILE")),
|
||||
format_frame (_("Format")),
|
||||
cue_file_label (_("CD Marker File Type"), 1.0, 0.5),
|
||||
channel_count_label (_("Channels"), 1.0, 0.5),
|
||||
header_format_label (_("File Type"), 1.0, 0.5),
|
||||
bitdepth_format_label (_("Sample Format"), 1.0, 0.5),
|
||||
endian_format_label (_("Sample Endianness"), 1.0, 0.5),
|
||||
sample_rate_label (_("Sample Rate"), 1.0, 0.5),
|
||||
src_quality_label (_("Conversion Quality"), 1.0, 0.5),
|
||||
dither_type_label (_("Dither Type"), 1.0, 0.5),
|
||||
cuefile_only_checkbox (_("Export CD Marker File Only")),
|
||||
file_frame (_("Export to File")),
|
||||
file_browse_button (_("Browse")),
|
||||
track_selector_button (_("Specific tracks ..."))
|
||||
{
|
||||
|
|
@ -345,7 +345,7 @@ ExportDialog::ExportDialog(PublicEditor& e)
|
|||
|
||||
cancel_button = add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
||||
cancel_button->signal_clicked().connect (mem_fun(*this, &ExportDialog::end_dialog));
|
||||
ok_button = add_button (Stock::OK, RESPONSE_ACCEPT);
|
||||
ok_button = add_button (_("Export"), RESPONSE_ACCEPT);
|
||||
ok_button->signal_clicked().connect (mem_fun(*this, &ExportDialog::do_export));
|
||||
|
||||
file_browse_button.set_name ("EditorGTKButton");
|
||||
|
|
|
|||
|
|
@ -896,12 +896,12 @@ RedirectBox::clear_redirects()
|
|||
"(this cannot be undone)");
|
||||
}
|
||||
|
||||
choices.push_back (_("Yes, remove them all"));
|
||||
choices.push_back (_("Cancel"));
|
||||
choices.push_back (_("Yes, remove them all"));
|
||||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
|
||||
if (prompter.run () == 0) {
|
||||
if (prompter.run () == 1) {
|
||||
_route.clear_redirects (this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -692,17 +692,17 @@ RouteUI::remove_this_route ()
|
|||
string prompt;
|
||||
|
||||
if (is_audio_track()) {
|
||||
prompt = string_compose (_("Do you really want to remove track \"%1\" ?\nYou may also lose the playlist used by this track.\n(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(cannot be undone)"), _route.name());
|
||||
} else {
|
||||
prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
|
||||
}
|
||||
|
||||
choices.push_back (_("Yes, remove it."));
|
||||
choices.push_back (_("No, do nothing."));
|
||||
choices.push_back (_("Yes, remove it."));
|
||||
|
||||
Choice prompter (prompt, choices);
|
||||
|
||||
if (prompter.run () == 0) {
|
||||
if (prompter.run () == 1) {
|
||||
Glib::signal_idle().connect (bind (sigc::ptr_fun (&RouteUI::idle_remove_this_route), this));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ SoundFileBox::add_field_clicked ()
|
|||
string name;
|
||||
|
||||
prompter.set_prompt (_("Name for Field"));
|
||||
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
|
||||
prompter.add_button (Gtk::Stock::ADD, Gtk::RESPONSE_ACCEPT);
|
||||
|
||||
switch (prompter.run ()) {
|
||||
case Gtk::RESPONSE_ACCEPT:
|
||||
|
|
|
|||
|
|
@ -274,12 +274,12 @@ VisualTimeAxis::remove_this_time_axis(void* src)
|
|||
|
||||
std::string prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n(cannot be undone)"), time_axis_name);
|
||||
|
||||
choices.push_back (_("Yes, remove it."));
|
||||
choices.push_back (_("No, do nothing."));
|
||||
choices.push_back (_("Yes, remove it."));
|
||||
|
||||
Gtkmm2ext::Choice prompter (prompt, choices);
|
||||
|
||||
if (prompter.run () == 0) {
|
||||
if (prompter.run () == 1) {
|
||||
/*
|
||||
defer to idle loop, otherwise we'll delete this object
|
||||
while we're still inside this function ...
|
||||
|
|
|
|||
|
|
@ -39,13 +39,18 @@ Choice::Choice (string prompt, vector<string> choices, bool center)
|
|||
|
||||
set_name ("ChoiceWindow");
|
||||
|
||||
HBox* dhbox = manage (new HBox());
|
||||
Image* dimage = manage (new Gtk::Image(Stock::DIALOG_QUESTION, Gtk::ICON_SIZE_DIALOG));
|
||||
Label* label = manage (new Label (prompt));
|
||||
label->show ();
|
||||
|
||||
dhbox->pack_start (*dimage, true, false, 10);
|
||||
dhbox->pack_start (*label, true, false, 10);
|
||||
|
||||
get_vbox()->set_border_width (12);
|
||||
get_vbox()->pack_start (*label);
|
||||
get_vbox()->pack_start (*dhbox, true, false);
|
||||
|
||||
set_has_separator (false);
|
||||
show_all_children ();
|
||||
|
||||
for (n = 0, i = choices.begin(); i != choices.end(); ++i, ++n) {
|
||||
add_button (*i, n);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
#define __pbd_gtkmm_choice_h__
|
||||
|
||||
#include <gtkmm/dialog.h>
|
||||
#include <gtkmm/image.h>
|
||||
#include <gtkmm/stock.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue