summaryrefslogtreecommitdiff
path: root/gtk2_ardour/save_as_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-05-07 22:36:32 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-05-07 22:36:32 -0400
commit4c92de0159d5d4ed2a815a55d5756a56ff0326d0 (patch)
tree578e7abfda0df5dedec3d2cc8cbc46ca66d36305 /gtk2_ardour/save_as_dialog.cc
parent318c919c41b2a1bc77e0e851dc3ada72606f67e6 (diff)
extend save-as dialog to allow crude but functional save-as-to-empty-session
Diffstat (limited to 'gtk2_ardour/save_as_dialog.cc')
-rw-r--r--gtk2_ardour/save_as_dialog.cc38
1 files changed, 36 insertions, 2 deletions
diff --git a/gtk2_ardour/save_as_dialog.cc b/gtk2_ardour/save_as_dialog.cc
index b537f85c1a..f696d131eb 100644
--- a/gtk2_ardour/save_as_dialog.cc
+++ b/gtk2_ardour/save_as_dialog.cc
@@ -34,6 +34,7 @@ SaveAsDialog::SaveAsDialog ()
, switch_to_button (_("Switch to newly-saved version"))
, copy_media_button (_("Copy media to new session"))
, copy_external_button (_("Copy external media into new session"))
+ , no_include_media_button (_("Newly-saved session should be empty"))
{
VBox* vbox = get_vbox();
@@ -57,9 +58,22 @@ SaveAsDialog::SaveAsDialog ()
vbox->pack_start (*hbox, false, false);
vbox->pack_start (switch_to_button, false, false);
- vbox->pack_start (copy_media_button, false, false);
- vbox->pack_start (copy_external_button, false, false);
+ VBox* sub_vbox = manage (new VBox);
+ HBox* sub_hbox = manage (new HBox);
+ HBox* empty = manage (new HBox);
+
+ sub_vbox->pack_start (copy_media_button, false, false);
+ sub_vbox->pack_start (copy_external_button, false, false);
+
+ /* indent the two media-related buttons by some amount */
+ sub_hbox->set_spacing (24);
+ sub_hbox->pack_start (*empty, false, false);
+ sub_hbox->pack_start (*sub_vbox, false, false);
+
+ vbox->pack_start (no_include_media_button, false, false);
+ vbox->pack_start (*sub_hbox, false, false);
+
switch_to_button.set_active (true);
copy_media_button.set_active (true);
@@ -68,6 +82,8 @@ SaveAsDialog::SaveAsDialog ()
add_button (Stock::CANCEL, RESPONSE_CANCEL);
add_button (Stock::OK, RESPONSE_OK);
+ no_include_media_button.signal_toggled ().connect (sigc::mem_fun (*this, &SaveAsDialog::no_include_toggled));
+
new_parent_folder_selector.set_action (FILE_CHOOSER_ACTION_SELECT_FOLDER);
new_parent_folder_selector.set_current_folder (Glib::get_home_dir());
new_name_entry.signal_changed().connect (sigc::mem_fun (*this, &SaveAsDialog::name_entry_changed));
@@ -75,6 +91,18 @@ SaveAsDialog::SaveAsDialog ()
}
void
+SaveAsDialog::no_include_toggled ()
+{
+ if (no_include_media_button.get_active()) {
+ copy_media_button.set_sensitive (false);
+ copy_external_button.set_sensitive (false);
+ } else {
+ copy_media_button.set_sensitive (true);
+ copy_external_button.set_sensitive (true);
+ }
+}
+
+void
SaveAsDialog::name_entry_changed ()
{
if (!new_name_entry.get_text().empty()) {
@@ -118,3 +146,9 @@ SaveAsDialog::clear_name ()
new_name_entry.set_text ("");
set_response_sensitive (RESPONSE_OK, false);
}
+
+bool
+SaveAsDialog::include_media () const
+{
+ return !no_include_media_button.get_active ();
+}