summaryrefslogtreecommitdiff
path: root/gtk2_ardour/visual_time_axis.cc
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2006-01-13 22:46:04 +0000
committerTaybin Rutkin <taybin@taybin.com>2006-01-13 22:46:04 +0000
commit9747fa891093251d1c828cd9acadebc4a432d6cf (patch)
tree36d348cd9fe8d37858fa008c5b59a8a6cfb94f72 /gtk2_ardour/visual_time_axis.cc
parent6817b59169b2c334245f8018d7e3f2235e195aa0 (diff)
All useage of ArdourPrompter checks for a valid result.
Gtkmm2ext::Prompter set as WINDOW_TYPE_HINT_DIALOG. Adding fields to the sfdb works. git-svn-id: svn://localhost/trunk/ardour2@271 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/visual_time_axis.cc')
-rw-r--r--gtk2_ardour/visual_time_axis.cc38
1 files changed, 12 insertions, 26 deletions
diff --git a/gtk2_ardour/visual_time_axis.cc b/gtk2_ardour/visual_time_axis.cc
index b282b239e9..3dbdf10898 100644
--- a/gtk2_ardour/visual_time_axis.cc
+++ b/gtk2_ardour/visual_time_axis.cc
@@ -91,7 +91,6 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se
size_button (_("h"))
{
time_axis_name = name ;
- name_prompter = 0 ;
_color = unique_random_color() ;
_marked_for_display = true;
@@ -130,11 +129,6 @@ VisualTimeAxis::VisualTimeAxis(const string & name, PublicEditor& ed, ARDOUR::Se
*/
VisualTimeAxis::~VisualTimeAxis()
{
- if(name_prompter)
- {
- delete name_prompter ;
- name_prompter = 0 ;
- }
}
@@ -350,33 +344,25 @@ VisualTimeAxis::idle_remove_this_time_axis(VisualTimeAxis* ta, void* src)
void
VisualTimeAxis::start_time_axis_rename()
{
- if(name_prompter)
- {
- delete name_prompter ;
- name_prompter = 0 ;
- }
-
- name_prompter = new ArdourPrompter() ;
+ ArdourPrompter name_prompter;
- name_prompter->set_prompt (_("new name: ")) ;
- name_prompter->show_all() ;
+ name_prompter.set_prompt (_("new name: ")) ;
+ name_prompter.show_all() ;
- switch (name_prompter->run ()) {
+ switch (name_prompter.run ()) {
case Gtk::RESPONSE_ACCEPT:
string result;
- name_prompter->get_result (result);
- if (editor.get_named_time_axis(result) != 0) {
- ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
- return ;
- }
+ name_prompter.get_result (result);
+ if (result.length()) {
+ if (editor.get_named_time_axis(result) != 0) {
+ ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
+ return ;
+ }
- set_time_axis_name(result, this) ;
+ set_time_axis_name(result, this) ;
+ }
}
- delete name_prompter ;
- name_prompter = 0 ;
label_view() ;
-
-
}
/**