#include "gui_thread.h"
#include "simplerect.h"
#include "actions.h"
+#include "prompter.h"
#include "i18n.h"
using namespace std;
using namespace sigc;
using namespace ARDOUR;
+using namespace PBD;
using namespace Gtk;
void
}
}
else {
- if (!selection->audio_regions.empty()) {
- l->set_start (selection->audio_regions.start());
- l->set_end (selection->audio_regions.end_frame());
+ if (!selection->regions.empty()) {
+ l->set_start (selection->regions.start());
+ l->set_end (selection->regions.end_frame());
}
}
}
if (!loc) return;
- Dialog dialog;
- Entry entry;
- HBox dhbox;
- Label dlabel (_("New Name:"));
+ ArdourPrompter dialog (true);
+ string txt;
+
+ dialog.set_prompt (_("New Name:"));
if (loc->is_mark()) {
dialog.set_title (_("ardour: rename mark"));
dialog.set_name ("MarkRenameWindow");
dialog.set_size_request (250, -1);
dialog.set_position (Gtk::WIN_POS_MOUSE);
- dialog.set_modal (true);
- dhbox.pack_start (dlabel, true, false, 10);
- dhbox.pack_start (entry, true, false, 10);
- dialog.get_vbox()->pack_start (dhbox, true, false, 10);
- dialog.add_button (Stock::CANCEL, RESPONSE_CANCEL);
dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
- dialog.set_default_response (RESPONSE_ACCEPT);
-
- entry.set_text (loc->name());
- entry.set_name ("MarkerNameDisplay");
+ dialog.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
+ dialog.set_initial_text (loc->name());
- dialog.show_all ();
- entry.grab_focus ();
+ dialog.show ();
switch (dialog.run ()) {
case RESPONSE_ACCEPT:
begin_reversible_command ( _("rename marker") );
session->add_undo( session->locations()->get_memento() );
- loc->set_name (entry.get_text());
+ dialog.get_result(txt);
+ loc->set_name (txt);
session->add_redo_no_execute( session->locations()->get_memento() );
commit_reversible_command ();