752 |
filter.add_pattern("*.gig"); |
filter.add_pattern("*.gig"); |
753 |
dialog.set_filter(filter); |
dialog.set_filter(filter); |
754 |
|
|
755 |
if (Glib::path_is_absolute(filename)) { |
// set initial dir and filename of the Save As dialog |
756 |
dialog.set_filename(filename); |
// and prepare that initial filename as a copy of the gig |
757 |
} else if (current_dir != "") { |
{ |
758 |
dialog.set_current_folder(current_dir); |
std::string basename = Glib::path_get_basename(filename); |
759 |
|
std::string dir = Glib::path_get_dirname(filename); |
760 |
|
basename = std::string("copy_of_") + basename; |
761 |
|
Glib::ustring copyFileName = Glib::build_filename(dir, basename); |
762 |
|
if (Glib::path_is_absolute(filename)) { |
763 |
|
dialog.set_filename(copyFileName); |
764 |
|
} else { |
765 |
|
if (current_dir != "") dialog.set_current_folder(current_dir); |
766 |
|
} |
767 |
|
dialog.set_current_name(Glib::filename_display_basename(copyFileName)); |
768 |
} |
} |
769 |
dialog.set_current_name(Glib::filename_display_basename(filename)); |
|
770 |
|
// show warning in the dialog |
771 |
|
Gtk::HBox descriptionArea; |
772 |
|
descriptionArea.set_spacing(15); |
773 |
|
Gtk::Image warningIcon(Gtk::Stock::DIALOG_WARNING, Gtk::IconSize(Gtk::ICON_SIZE_DIALOG)); |
774 |
|
descriptionArea.pack_start(warningIcon, Gtk::PACK_SHRINK); |
775 |
|
warningIcon.show(); |
776 |
|
Gtk::Label description; |
777 |
|
description.set_markup( |
778 |
|
_("\n<b>CAUTION:</b> You <b>MUST</b> use the " |
779 |
|
"<span style=\"italic\">\"Save\"</span> dialog instead of " |
780 |
|
"<span style=\"italic\">\"Save As...\"</span> if you want to save " |
781 |
|
"to the same .gig file. Using " |
782 |
|
"<span style=\"italic\">\"Save As...\"</span> for writing to the " |
783 |
|
"same .gig file will end up in corrupted sample wave data!\n") |
784 |
|
); |
785 |
|
description.set_line_wrap(true); |
786 |
|
descriptionArea.pack_start(description, Gtk::PACK_SHRINK); |
787 |
|
description.show(); |
788 |
|
dialog.get_vbox()->pack_start(descriptionArea, Gtk::PACK_SHRINK); |
789 |
|
descriptionArea.show(); |
790 |
|
|
791 |
if (dialog.run() == Gtk::RESPONSE_OK) { |
if (dialog.run() == Gtk::RESPONSE_OK) { |
792 |
file_structure_to_be_changed_signal.emit(this->file); |
file_structure_to_be_changed_signal.emit(this->file); |