diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 03:22:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-07 03:22:35 +0000 |
commit | c2956012ff838644229e4c926f3bbb44e1d78892 (patch) | |
tree | 835bd3528055d8cc307608282810e238e5030e45 /gtk2_ardour/export_filename_selector.cc | |
parent | 94658aa66ef454c232973d35bf357308c6059ab0 (diff) |
add "enabled" column to editor route groups list and check logic
git-svn-id: svn://localhost/ardour2/branches/3.0@10928 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/export_filename_selector.cc')
-rw-r--r-- | gtk2_ardour/export_filename_selector.cc | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/gtk2_ardour/export_filename_selector.cc b/gtk2_ardour/export_filename_selector.cc index 2912ce75e6..789b7eb435 100644 --- a/gtk2_ardour/export_filename_selector.cc +++ b/gtk2_ardour/export_filename_selector.cc @@ -18,6 +18,8 @@ */ +#include <gtkmm/messagedialog.h> + #include "export_filename_selector.h" #include "ardour/export_handler.h" @@ -93,6 +95,7 @@ ExportFilenameSelector::ExportFilenameSelector () : label_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFilenameSelector::update_label)); path_entry.signal_changed().connect (sigc::mem_fun (*this, &ExportFilenameSelector::update_folder)); + path_entry.signal_activate().connect (sigc::mem_fun (*this, &ExportFilenameSelector::check_folder), false); session_checkbox.signal_toggled().connect (sigc::mem_fun (*this, &ExportFilenameSelector::change_session_selection)); @@ -226,6 +229,23 @@ ExportFilenameSelector::update_folder () } void +ExportFilenameSelector::check_folder () +{ + if (!filename) { + return; + } + + if (!Glib::file_test (path_entry.get_text(), Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) { + Gtk::MessageDialog msg (string_compose (_("%1: this is only the directory/folder name, not the filename.\n\ +The filename will be chosen from the information just above the folder selector."), path_entry.get_text())); + msg.run (); + path_entry.set_text (Glib::path_get_dirname (path_entry.get_text())); + filename->set_folder (path_entry.get_text()); + CriticalSelectionChanged(); + } +} + +void ExportFilenameSelector::change_date_format () { if (!filename) { @@ -295,13 +315,23 @@ ExportFilenameSelector::open_browse_dialog () dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); dialog.add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK); - int result = dialog.run(); - - if (result == Gtk::RESPONSE_OK) { - std::string filename = dialog.get_filename(); - - if (filename.length()) { - path_entry.set_text (filename); + while (true) { + int result = dialog.run(); + + if (result == Gtk::RESPONSE_OK) { + std::string filename = dialog.get_filename(); + + if (!Glib::file_test (filename, Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) { + Gtk::MessageDialog msg (string_compose (_("%1: this is only the directory/folder name, not the filename.\n\ +The filename will be chosen from the information just above the folder selector."), filename)); + msg.run (); + continue; + } + + if (filename.length()) { + path_entry.set_text (filename); + break; + } } } |