X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fexportedl.C;h=73e51cf16167bc165afb9e6af5cca1df6dca459c;hb=7fa4ccc2c91d37f20f3618261e4cbaa9d5d3c740;hp=06982c95cd8eee07b6ed94ff2e062d9f7a8fcfac;hpb=4b6c39e6cf4a3fd9c1b347db6de686ab55d6cac8;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/exportedl.C b/cinelerra-5.1/cinelerra/exportedl.C index 06982c95..73e51cf1 100644 --- a/cinelerra-5.1/cinelerra/exportedl.C +++ b/cinelerra-5.1/cinelerra/exportedl.C @@ -26,12 +26,12 @@ #include "edits.h" #include "edl.h" #include "edlsession.h" -#include "errorbox.h" #include "file.h" #include "filesystem.h" #include "filexml.h" #include "language.h" #include "localsession.h" +#include "mainerror.h" #include "mainsession.h" #include "mutex.h" #include "mwindowgui.h" @@ -113,6 +113,10 @@ void ExportEDLAsset::export_it() { FILE *fh; fh = fopen(path, "w+"); + if( !fh ) { + eprintf("unable to open file: %s", path); + return; + } // We currently only support exporting one track at a time // Find the track... @@ -325,33 +329,31 @@ void ExportEDL::run() #define WIDTH 410 #define HEIGHT 400 -static const char *list_titles[] = +static const char *default_list_titles[] = { N_("No."), N_("Track name") }; - -static int list_widths[] = +static int default_list_widths[] = { 40, 200 }; + ExportEDLWindow::ExportEDLWindow(MWindow *mwindow, ExportEDL *exportedl, ExportEDLAsset *exportasset) : BC_Window(_(PROGRAM_NAME ": Export EDL"), mwindow->gui->get_screen_w(1, 0) / 2 - WIDTH / 2, mwindow->gui->get_root_h(1) / 2 - HEIGHT / 2, - WIDTH, - HEIGHT, - (int)BC_INFINITY, - (int)BC_INFINITY, - 0, - 0, - 1) + WIDTH, HEIGHT, (int)BC_INFINITY, (int)BC_INFINITY, 0, 0, 1) { this->mwindow = mwindow; this->exportasset = exportasset; + for( int i=0; i<2; ++i ) { + list_titles[i] = _(default_list_titles[i]); + list_widths[i] = default_list_widths[i]; + } } ExportEDLWindow::~ExportEDLWindow() @@ -364,9 +366,9 @@ ExportEDLWindow::~ExportEDLWindow() void ExportEDLWindow::create_objects() { + lock_window("ExportEDLWindow::create_objects"); int x = 5, y = 5; - add_subwindow(new BC_Title(x, - y, + add_subwindow(new BC_Title(x, y, _("Select a file to export to:"))); y += 25; @@ -399,7 +401,7 @@ void ExportEDLWindow::create_objects() track = track->next) { - char tmp[10]; + char tmp[16]; sprintf(tmp, "%i\n", serial+1); BC_ListBoxItem *listitem = new BC_ListBoxItem(tmp); @@ -412,7 +414,7 @@ void ExportEDLWindow::create_objects() } - add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200, items_tracks)); + add_subwindow(track_list = new ExportEDLWindowTrackList(this, x, y, 400, 200)); y += 5 + track_list->get_h(); add_subwindow(new BC_Title(x, y, _("Currently only CMX 3600 format is supported"))); @@ -421,6 +423,7 @@ void ExportEDLWindow::create_objects() add_subwindow(new BC_OKButton(this)); add_subwindow(new BC_CancelButton(this)); show_window(); + unlock_window(); } @@ -440,19 +443,11 @@ int ExportEDLPathText::handle_event() } ExportEDLWindowTrackList::ExportEDLWindowTrackList(ExportEDLWindow *window, - int x, - int y, - int w, - int h, - ArrayList *track_list) - : BC_ListBox(x, - y, - w, - h, - LISTBOX_TEXT, - track_list, - list_titles, - list_widths, + int x, int y, int w, int h) + : BC_ListBox(x, y, w, h, LISTBOX_TEXT, + window->items_tracks, + window->list_titles, + window->list_widths, 2) { this->window = window;