X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fconfirmsave.C;h=5fe6ab90baae8e4f811cbc6ad0f11d1fe3531d0e;hb=e919ce8a71cdc99bb7344cc192e13a2c2db9e1c0;hp=37f4a99a89eae6443c3a2ae43c7f1b6e95fe5372;hpb=2d99bb8ce591f05a31464b517d85dc2bc35b2abe;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/confirmsave.C b/cinelerra-5.0/cinelerra/confirmsave.C index 37f4a99a..5fe6ab90 100644 --- a/cinelerra-5.0/cinelerra/confirmsave.C +++ b/cinelerra-5.0/cinelerra/confirmsave.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 "asset.h" @@ -45,47 +45,39 @@ int ConfirmSave::test_file(MWindow *mwindow, char *path) return result; } -int ConfirmSave::test_files(MWindow *mwindow, - ArrayList *paths) +int ConfirmSave::test_files(MWindow *mwindow, ArrayList *paths) { FILE *file; ArrayList list; int result = 0; - for(int i = 0; i < paths->total; i++) - { + for(int i = 0; i < paths->size(); i++) { char *path = paths->values[i]; - if( (file=fopen(path, "r")) != 0 ) - { + if( (file=fopen(path, "r")) != 0 ) { fclose(file); list.append(new BC_ListBoxItem(path)); } } - if(list.total) - { - if(mwindow) - { + if(list.total) { + if(mwindow) { ConfirmSaveWindow window(mwindow, &list); window.create_objects(); window.raise_window(); result = window.run_window(); } - else - { - printf("The following files exist:\n"); - for(int i = 0; i < list.total; i++) - { + else { + printf(_("The following files exist:\n")); + for(int i = 0; i < list.total; i++) { printf(" %s\n", list.values[i]->get_text()); } - printf("Won't overwrite existing files.\n"); + printf(_("Won't overwrite existing files.\n")); result = 1; } list.remove_all_objects(); return result; } - else - { + else { list.remove_all_objects(); return 0; } @@ -101,12 +93,12 @@ int ConfirmSave::test_files(MWindow *mwindow, -ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow, +ConfirmSaveWindow::ConfirmSaveWindow(MWindow *mwindow, ArrayList *list) - : BC_Window(PROGRAM_NAME ": File Exists", - mwindow->gui->get_abs_cursor_x(1) - 160, - mwindow->gui->get_abs_cursor_y(1) - 120, - 320, + : BC_Window(_(PROGRAM_NAME ": File Exists"), + mwindow->gui->get_abs_cursor_x(1) - 160, + mwindow->gui->get_abs_cursor_y(1) - 120, + 320, 320) { this->list = list; @@ -124,12 +116,12 @@ void ConfirmSaveWindow::create_objects() add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); - add_subwindow(title = new BC_Title(x, - y, + add_subwindow(title = new BC_Title(x, + y, _("The following files exist. Overwrite them?"))); y += 30; - add_subwindow(listbox = new BC_ListBox(x, - y, + add_subwindow(listbox = new BC_ListBox(x, + y, get_w() - x - 10, get_h() - y - BC_OKButton::calculate_h() - 10, LISTBOX_TEXT,