X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Fmainerror.C;h=61ffa7c46b433c09611844598cd704b87cd70115;hb=702161ddaf384a773831f1643fca0a54133625b2;hp=4dc01aece5b42b5bb4ff20df29c910c2f86b7757;hpb=ce9d2233f4653ae54ee7bdfa4a7313326a9d8240;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mainerror.C b/cinelerra-5.1/cinelerra/mainerror.C index 4dc01aec..61ffa7c4 100644 --- a/cinelerra-5.1/cinelerra/mainerror.C +++ b/cinelerra-5.1/cinelerra/mainerror.C @@ -64,27 +64,26 @@ MainErrorGUI::~MainErrorGUI() void MainErrorGUI::create_objects() { - + lock_window("MainErrorGUI::create_objects"); BC_Button *button; add_subwindow(button = new BC_OKButton(this)); int x = 10, y = 10; add_subwindow(title = new BC_Title(x, y, _("The following errors occurred:"))); y += title->get_h() + 5; - add_subwindow(list = new BC_ListBox(x, - y, - get_w() - 20, - button->get_y() - y - 5, - LISTBOX_TEXT, // Display text list or icons - &thread->errors, // Each column has an ArrayList of BC_ListBoxItems. - 0, // Titles for columns. Set to 0 for no titles - 0, // width of each column - 1, // Total columns. Only 1 in icon mode - 0, // Pixel of top of window. - 0, // If this listbox is a popup window with a button - LISTBOX_SINGLE, // Select one item or multiple items - ICON_LEFT, // Position of icon relative to text of each item + add_subwindow(list = new BC_ListBox(x, y, + get_w() - 20, button->get_y() - y - 5, + LISTBOX_TEXT, // Display text list or icons + &thread->errors, // Each column has an ArrayList of BC_ListBoxItems. + 0, // Titles for columns. Set to 0 for no titles + 0, // width of each column + 1, // Total columns. Only 1 in icon mode + 0, // Pixel of top of window. + 0, // If this listbox is a popup window with a button + LISTBOX_SINGLE, // Select one item or multiple items + ICON_LEFT, // Position of icon relative to text of each item 0)); show_window(); + unlock_window(); } int MainErrorGUI::resize_event(int w, int h) @@ -193,13 +192,9 @@ void MainError::show_error_local(const char *string) void MainError::show_error(const char *string) { - if( main_error ) - main_error->show_error_local(string); - else { - printf("%s", string); - if( string[strlen(string) - 1] != '\n' ) - printf("\n"); - } + if( main_error ) main_error->show_error_local(string); + int len = strlen(string); + printf("%s%s", string, len>0 && string[len-1] == '\n' ? "" : "\n"); }