summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2006-04-22 15:28:59 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2006-04-22 15:28:59 +0000
commitdcd4c89f34f51e3a65f01584f79d6569ccc3b1b1 (patch)
tree592436821dcd315f0709b7fad071b367226c260f /gtk2_ardour/editor_markers.cc
parentf81f877adffccffd5ada8431faa567db81122fee (diff)
Prompter now prevents blank strings or unaltered names & now has a horizontal orientation. Rename marker now uses the ArdourPrompter.
git-svn-id: svn://localhost/trunk/ardour2@463 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc26
1 files changed, 10 insertions, 16 deletions
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index cafe1cec0c..df64b9ed43 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -34,6 +34,7 @@
#include "gui_thread.h"
#include "simplerect.h"
#include "actions.h"
+#include "prompter.h"
#include "i18n.h"
@@ -807,10 +808,10 @@ Editor::marker_menu_rename ()
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"));
@@ -821,20 +822,12 @@ Editor::marker_menu_rename ()
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:
@@ -846,7 +839,8 @@ Editor::marker_menu_rename ()
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 ();