From f461eb46994c72f60f01c5378ec329b0936499d7 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Wed, 28 Jan 2015 13:52:04 +0200 Subject: [PATCH] [Summary] Implemented WavesEntryDialog. Changed ardour-style dialog for Region Name Edit on new style dialog [Feature reviewed] Igor Maximenko, MKosharnyy [Reviewed] YPozdnyakov --- gtk2_ardour/editor_ops.cc | 38 ++------- .../macosx/tracks.xcodeproj/project.pbxproj | 10 +++ gtk2_ardour/ui/waves_edit_dialog.xml | 63 ++++++++++++++ gtk2_ardour/waves_edit_dialog.cc | 84 +++++++++++++++++++ gtk2_ardour/waves_edit_dialog.h | 50 +++++++++++ gtk2_ardour/wscript | 1 + 6 files changed, 215 insertions(+), 31 deletions(-) create mode 100644 gtk2_ardour/ui/waves_edit_dialog.xml create mode 100644 gtk2_ardour/waves_edit_dialog.cc create mode 100644 gtk2_ardour/waves_edit_dialog.h diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index f627d818f3..098891d1e9 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -89,6 +89,7 @@ #include "strip_silence_dialog.h" #include "time_axis_view.h" #include "transpose_dialog.h" +#include "waves_edit_dialog.h" #include "i18n.h" #include "dbg_msg.h" @@ -2545,42 +2546,17 @@ Editor::rename_region () if (rs.empty()) { return; } + + WavesEditDialog waves_edit_dialog ("", "Rename region"); + waves_edit_dialog.set_entry_text (rs.front()->region()->name()); - ArdourDialog d (*this, _("Rename Region"), true, false); - Entry entry; - Label label (_("New name:")); - HBox hbox; + int const ret = waves_edit_dialog.run (); - hbox.set_spacing (6); - hbox.pack_start (label, false, false); - hbox.pack_start (entry, true, true); - - d.get_vbox()->set_border_width (12); - d.get_vbox()->pack_start (hbox, false, false); - - d.add_button("CANCEL", Gtk::RESPONSE_CANCEL); - d.add_button("OK", Gtk::RESPONSE_OK); - - d.set_size_request (300, -1); - - entry.set_text (rs.front()->region()->name()); - entry.select_region (0, -1); - - entry.signal_activate().connect (sigc::bind (sigc::mem_fun (d, &Dialog::response), RESPONSE_OK)); - - d.show_all (); - - entry.grab_focus(); - - int const ret = d.run(); - - d.hide (); - - if (ret != RESPONSE_OK) { + if (ret != WavesDialog::RESPONSE_DEFAULT) { return; } - std::string str = entry.get_text(); + std::string str = waves_edit_dialog.get_entry_text(); strip_whitespace_edges (str); if (!str.empty()) { rs.front()->region()->set_name (str); diff --git a/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj b/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj index ba50fc0cf8..44aad809e4 100644 --- a/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj +++ b/gtk2_ardour/macosx/tracks.xcodeproj/project.pbxproj @@ -283,6 +283,8 @@ 954DCFDE1A07A14E00B7160E /* read_only_session_dialog.xml in Resources */ = {isa = PBXBuildFile; fileRef = 954DCFDD1A07A14E00B7160E /* read_only_session_dialog.xml */; }; 957EF44B1A30BFB300F1500E /* waves_message_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 957EF44A1A30BFB300F1500E /* waves_message_dialog.cc */; }; 95A134DE1A0239080008E3D6 /* license_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95A134DD1A0239080008E3D6 /* license_dialog.cc */; }; + 95D1C51F1A78ED2100BE28DB /* waves_edit_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95D1C51E1A78ED2100BE28DB /* waves_edit_dialog.cc */; }; + 95D1C5211A78ED3A00BE28DB /* waves_edit_dialog.xml in Resources */ = {isa = PBXBuildFile; fileRef = 95D1C5201A78ED3A00BE28DB /* waves_edit_dialog.xml */; }; 95D71D551A4C66F600DE5B3B /* waves_track_color_dialog.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95D71D541A4C66F600DE5B3B /* waves_track_color_dialog.cc */; }; 95D71D581A4C69AE00DE5B3B /* waves_track_color_dialog.logic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 95D71D571A4C69AE00DE5B3B /* waves_track_color_dialog.logic.cc */; }; 95F9DFD71A35A8BD0007E953 /* waves_message_dialog.xml in Resources */ = {isa = PBXBuildFile; fileRef = 95F9DFD61A35A8BD0007E953 /* waves_message_dialog.xml */; }; @@ -1150,6 +1152,9 @@ 957EF44F1A30BFBF00F1500E /* waves_message_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waves_message_dialog.h; path = ../waves_message_dialog.h; sourceTree = ""; }; 95A134DD1A0239080008E3D6 /* license_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = license_dialog.cc; path = ../license_dialog.cc; sourceTree = ""; }; 95A134DF1A02391F0008E3D6 /* license_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = license_dialog.h; path = ../license_dialog.h; sourceTree = ""; }; + 95D1C51A1A78ED1100BE28DB /* waves_edit_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waves_edit_dialog.h; path = ../waves_edit_dialog.h; sourceTree = ""; }; + 95D1C51E1A78ED2100BE28DB /* waves_edit_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = waves_edit_dialog.cc; path = ../waves_edit_dialog.cc; sourceTree = ""; }; + 95D1C5201A78ED3A00BE28DB /* waves_edit_dialog.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = waves_edit_dialog.xml; sourceTree = ""; }; 95D71D501A4C66DF00DE5B3B /* waves_track_color_dialog.logic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waves_track_color_dialog.logic.h; path = ../waves_track_color_dialog.logic.h; sourceTree = ""; }; 95D71D541A4C66F600DE5B3B /* waves_track_color_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = waves_track_color_dialog.cc; path = ../waves_track_color_dialog.cc; sourceTree = ""; }; 95D71D561A4C697700DE5B3B /* waves_track_color_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waves_track_color_dialog.h; path = ../waves_track_color_dialog.h; sourceTree = ""; }; @@ -1251,6 +1256,7 @@ 43279040194EFF38003C9FEA /* source */ = { isa = PBXGroup; children = ( + 95D1C51E1A78ED2100BE28DB /* waves_edit_dialog.cc */, 95D71D571A4C69AE00DE5B3B /* waves_track_color_dialog.logic.cc */, 95D71D541A4C66F600DE5B3B /* waves_track_color_dialog.cc */, 5BC67E5E1A4090BD00F29ABA /* progress_dialog.cc */, @@ -1856,6 +1862,7 @@ 43279429194F0062003C9FEA /* ui */ = { isa = PBXGroup; children = ( + 95D1C5201A78ED3A00BE28DB /* waves_edit_dialog.xml */, 5BC67E581A408FCE00F29ABA /* progress_dialog.xml */, 95F9DFD81A35F3310007E953 /* waves_clean_up_dialog.xml */, 95F9DFD91A35F3310007E953 /* waves_connect_to_backend_error_dialog.xml */, @@ -1912,6 +1919,7 @@ 43279480194F00CB003C9FEA /* headers */ = { isa = PBXGroup; children = ( + 95D1C51A1A78ED1100BE28DB /* waves_edit_dialog.h */, 95D71D561A4C697700DE5B3B /* waves_track_color_dialog.h */, 95D71D501A4C66DF00DE5B3B /* waves_track_color_dialog.logic.h */, 5BC67E5D1A4090AA00F29ABA /* progress_dialog.h */, @@ -2479,6 +2487,7 @@ 432793BB194F003A003C9FEA /* step-editing.png in Resources */, 432793BC194F003A003C9FEA /* strip_width.png in Resources */, 954DCFC11A023AAB00B7160E /* about_dialog.xml in Resources */, + 95D1C5211A78ED3A00BE28DB /* waves_edit_dialog.xml in Resources */, 432793BD194F003A003C9FEA /* systemlock.png in Resources */, 432793BE194F003A003C9FEA /* tav_exp.png in Resources */, 432793BF194F003A003C9FEA /* tav_shrink.png in Resources */, @@ -2650,6 +2659,7 @@ CE1A907A199A37AE00ECA62B /* add_tracks_dialog.cc in Sources */, 95176F7A1A08E6E800E32046 /* file_sample_rate_mismatch_dialog.cc in Sources */, 95D71D551A4C66F600DE5B3B /* waves_track_color_dialog.cc in Sources */, + 95D1C51F1A78ED2100BE28DB /* waves_edit_dialog.cc in Sources */, CE294C7519CAD54500D12768 /* marker_io_dialog.cc in Sources */, 957EF44B1A30BFB300F1500E /* waves_message_dialog.cc in Sources */, CE294C7619CAD54500D12768 /* mixer_bridge_view.cc in Sources */, diff --git a/gtk2_ardour/ui/waves_edit_dialog.xml b/gtk2_ardour/ui/waves_edit_dialog.xml new file mode 100644 index 0000000000..8e4cbc8e3d --- /dev/null +++ b/gtk2_ardour/ui/waves_edit_dialog.xml @@ -0,0 +1,63 @@ + + +