X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fsavefile.C;h=b38aec142c4ec8e4d49aba1f97535354de22f191;hb=803cf48f8f7ee246eb5473e55fc2125e8b398250;hp=3d15ea4590b1cf824b1e4a6c11866f4ae6d8938c;hpb=64ee854bdef9fb08e6fec938aa0519715f724b99;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/savefile.C b/cinelerra-5.1/cinelerra/savefile.C index 3d15ea45..b38aec14 100644 --- a/cinelerra-5.1/cinelerra/savefile.C +++ b/cinelerra-5.1/cinelerra/savefile.C @@ -2,21 +2,21 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "confirmsave.h" @@ -46,7 +46,7 @@ SaveBackup::SaveBackup(MWindow *mwindow) - : BC_MenuItem(_("Save backup")) + : BC_MenuItem(_("Save backup"), "b", 'b') { this->mwindow = mwindow; } @@ -68,9 +68,9 @@ int SaveBackup::handle_event() Save::Save(MWindow *mwindow) : BC_MenuItem(_("Save"), "s", 's') -{ - this->mwindow = mwindow; - quit_now = 0; +{ + this->mwindow = mwindow; + quit_now = 0; } void Save::create_objects(SaveAs *saveas) @@ -80,7 +80,7 @@ void Save::create_objects(SaveAs *saveas) int Save::handle_event() { - if(mwindow->session->filename[0] == 0) + if(mwindow->session->filename[0] == 0) { saveas->start(); } @@ -89,10 +89,7 @@ int Save::handle_event() // save it // TODO: Move this into mwindow. FileXML file; - mwindow->edl->save_xml(&file, - mwindow->session->filename, - 0, - 0); + mwindow->edl->save_xml(&file, mwindow->session->filename); file.terminate_string(); if(file.write_to_file(mwindow->session->filename)) @@ -105,7 +102,7 @@ int Save::handle_event() error.create_objects(string2); error.raise_window(); error.run_window(); - return 1; + return 1; } else { @@ -130,9 +127,10 @@ int Save::save_before_quit() } SaveAs::SaveAs(MWindow *mwindow) - : BC_MenuItem(_("Save as..."), ""), Thread() -{ - this->mwindow = mwindow; + : BC_MenuItem(_("Save as..."), "Shift-S", 'S'), Thread() +{ + set_shift(1); + this->mwindow = mwindow; quit_now = 0; } @@ -142,8 +140,8 @@ int SaveAs::set_mainmenu(MainMenu *mmenu) return 0; } -int SaveAs::handle_event() -{ +int SaveAs::handle_event() +{ quit_now = 0; start(); return 1; @@ -172,7 +170,7 @@ void SaveAs::run() delete window; // Extend the filename with .xml - if(strlen(filename) < 4 || + if(strlen(filename) < 4 || strcasecmp(&filename[strlen(filename) - 4], ".xml")) { strcat(filename, ".xml"); @@ -193,11 +191,8 @@ void SaveAs::run() FileXML file; mwindow->gui->lock_window("SaveAs::run 1"); // update the project name - mwindow->set_filename(filename); - mwindow->edl->save_xml(&file, - filename, - 0, - 0); + mwindow->set_filename(filename); + mwindow->edl->save_xml(&file, filename); mwindow->gui->unlock_window(); file.terminate_string(); @@ -212,7 +207,7 @@ void SaveAs::run() error.create_objects(string2); error.raise_window(); error.run_window(); - return; + return; } else { @@ -242,11 +237,11 @@ void SaveAs::run() SaveFileWindow::SaveFileWindow(MWindow *mwindow, char *init_directory) : BC_FileBox(mwindow->gui->get_abs_cursor_x(1), mwindow->gui->get_abs_cursor_y(1) - BC_WindowBase::get_resources()->filebox_h / 2, - init_directory, - _(PROGRAM_NAME ": Save"), + init_directory, + _(PROGRAM_NAME ": Save"), _("Enter a filename to save as")) -{ - this->mwindow = mwindow; +{ + this->mwindow = mwindow; } SaveFileWindow::~SaveFileWindow() {}