mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-24 07:27:44 +01:00
[Summary] Implemented WavesEntryDialog. Changed ardour-style dialog for Region Name Edit on new style dialog
[Feature reviewed] Igor Maximenko, MKosharnyy [Reviewed] YPozdnyakov
This commit is contained in:
parent
ff8b4693bf
commit
f461eb4699
6 changed files with 215 additions and 31 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 = "<group>"; };
|
||||
95A134DD1A0239080008E3D6 /* license_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = license_dialog.cc; path = ../license_dialog.cc; sourceTree = "<group>"; };
|
||||
95A134DF1A02391F0008E3D6 /* license_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = license_dialog.h; path = ../license_dialog.h; sourceTree = "<group>"; };
|
||||
95D1C51A1A78ED1100BE28DB /* waves_edit_dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = waves_edit_dialog.h; path = ../waves_edit_dialog.h; sourceTree = "<group>"; };
|
||||
95D1C51E1A78ED2100BE28DB /* waves_edit_dialog.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = waves_edit_dialog.cc; path = ../waves_edit_dialog.cc; sourceTree = "<group>"; };
|
||||
95D1C5201A78ED3A00BE28DB /* waves_edit_dialog.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = waves_edit_dialog.xml; sourceTree = "<group>"; };
|
||||
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 = "<group>"; };
|
||||
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 = "<group>"; };
|
||||
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 = "<group>"; };
|
||||
|
|
@ -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 */,
|
||||
|
|
|
|||
63
gtk2_ardour/ui/waves_edit_dialog.xml
Normal file
63
gtk2_ardour/ui/waves_edit_dialog.xml
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Dialog title="Tracks Live" resizeable="False">
|
||||
<style name="generic_control"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#BFBFBF"
|
||||
bgnormal="#6C6C6C"
|
||||
fgactive="#BFBFBF"
|
||||
bgactive="#454545"
|
||||
fghover="#CCCCCC"
|
||||
bghover="#898989"/>
|
||||
|
||||
<style name="generic_button"
|
||||
winfont ="Arial Bold 12"
|
||||
macfont ="Helvetica Bold 12"
|
||||
fgnormal="#6D6E72"
|
||||
bgnormal="#CACAC5"
|
||||
fgactive="#EDECE8"
|
||||
bgactive="#6D6E72"
|
||||
visible="false"
|
||||
noshowall="true"
|
||||
width="80"
|
||||
height="22"/>
|
||||
|
||||
<EventBox bgnormal="#EDECE8"
|
||||
width="300">
|
||||
<VBox borderwidth="10"
|
||||
spacing="15">
|
||||
<Label id="message_label"
|
||||
style="generic_control"
|
||||
fgnormal="#6D6E72"
|
||||
horzalignment="center"
|
||||
justify="center"/>
|
||||
|
||||
<HBox spacing="10">
|
||||
<Label style="generic_control"
|
||||
fgnormal="#6D6E72"
|
||||
text="New name"
|
||||
box.pack="start"/>
|
||||
<Entry style="generic_control"
|
||||
id="name_entry"
|
||||
text="???"
|
||||
width="170"
|
||||
height="23"
|
||||
box.pack="start"/>
|
||||
</HBox>
|
||||
|
||||
<HBox spacing="10">
|
||||
<Button id="ok_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="ok"
|
||||
visible="true"/>
|
||||
<Button id="cancel_button"
|
||||
style="generic_button"
|
||||
box.pack="end"
|
||||
text="Cancel"
|
||||
visible="true"/>
|
||||
</HBox>
|
||||
</VBox>
|
||||
</EventBox>
|
||||
|
||||
</Dialog>
|
||||
84
gtk2_ardour/waves_edit_dialog.cc
Normal file
84
gtk2_ardour/waves_edit_dialog.cc
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
Copyright (C) 2014 Waves Audio Ltd.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "waves_edit_dialog.h"
|
||||
WavesEditDialog::WavesEditDialog(const std::string& layout_script_file,
|
||||
const std::string& title,
|
||||
const std::string& message)
|
||||
: WavesDialog (layout_script_file, true, false )
|
||||
, _ok_button (get_waves_button ("ok_button"))
|
||||
, _cancel_button (get_waves_button ("cancel_button"))
|
||||
, _message_label (get_label("message_label"))
|
||||
, _name_entry (get_entry("name_entry"))
|
||||
{
|
||||
init (title, message);
|
||||
}
|
||||
|
||||
WavesEditDialog::WavesEditDialog (const std::string& title,
|
||||
const std::string& message)
|
||||
: WavesDialog ("waves_edit_dialog.xml", true, false )
|
||||
, _ok_button (get_waves_button ("ok_button"))
|
||||
, _cancel_button (get_waves_button ("cancel_button"))
|
||||
, _message_label (get_label("message_label"))
|
||||
, _name_entry (get_entry("name_entry"))
|
||||
{
|
||||
init (title, message);
|
||||
}
|
||||
|
||||
void WavesEditDialog::init(const std::string& title,
|
||||
const std::string& message)
|
||||
{
|
||||
set_modal (true);
|
||||
set_resizable (false);
|
||||
set_keep_above (true);
|
||||
|
||||
_ok_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesEditDialog::_on_button_clicked));
|
||||
_cancel_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesEditDialog::_on_button_clicked));
|
||||
_message_label.set_text (message);
|
||||
|
||||
set_title (title);
|
||||
show_all ();
|
||||
}
|
||||
|
||||
void
|
||||
WavesEditDialog::_on_button_clicked (WavesButton* clicked_button)
|
||||
{
|
||||
hide ();
|
||||
if (clicked_button == &_ok_button) {
|
||||
response (RESPONSE_DEFAULT);
|
||||
} else if (clicked_button == &_cancel_button) {
|
||||
response (Gtk::RESPONSE_CANCEL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WavesEditDialog::set_entry_text (const std::string& message)
|
||||
{
|
||||
_name_entry.set_text (message);
|
||||
_name_entry.select_region (0, -1);
|
||||
_name_entry.grab_focus();
|
||||
}
|
||||
|
||||
std::string
|
||||
WavesEditDialog::get_entry_text ()
|
||||
{
|
||||
return _name_entry.get_text ();
|
||||
}
|
||||
|
||||
|
||||
50
gtk2_ardour/waves_edit_dialog.h
Normal file
50
gtk2_ardour/waves_edit_dialog.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Copyright (C) 2014 Waves Audio Ltd.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __waves_edit_dialog_h__
|
||||
#define __waves_edit_dialog_h__
|
||||
|
||||
#include "waves_dialog.h"
|
||||
|
||||
class WavesEditDialog : public WavesDialog
|
||||
{
|
||||
public:
|
||||
WavesEditDialog(const std::string& layout_script_file,
|
||||
const std::string& title,
|
||||
const std::string& message);
|
||||
WavesEditDialog(const std::string& title,
|
||||
const std::string& message);
|
||||
|
||||
void set_entry_text (const std::string& message);
|
||||
std::string get_entry_text ();
|
||||
|
||||
protected:
|
||||
void init (const std::string& title,
|
||||
const std::string& message);
|
||||
|
||||
private:
|
||||
void _on_button_clicked (WavesButton*);
|
||||
|
||||
WavesButton& _ok_button;
|
||||
WavesButton& _cancel_button;
|
||||
Gtk::Label& _message_label;
|
||||
Gtk::Entry& _name_entry;
|
||||
};
|
||||
|
||||
#endif /* __waves_edit_dialog_h__ */
|
||||
|
|
@ -45,6 +45,7 @@ gtk2_ardour_sources = [
|
|||
'waves_zoom_control.cc',
|
||||
'waves_ui.cc',
|
||||
'waves_grid.cc',
|
||||
'waves_edit_dialog.cc',
|
||||
'about_dialog.cc',
|
||||
'actions.cc',
|
||||
'add_route_dialog.cc',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue