merge: fix loadfile rm dup create_objects, fix put_title
authorGood Guy <good1.2guy@gmail.com>
Mon, 21 Mar 2016 17:26:33 +0000 (11:26 -0600)
committerGood Guy <good1.2guy@gmail.com>
Mon, 21 Mar 2016 17:26:33 +0000 (11:26 -0600)
cinelerra-5.1/cinelerra/loadfile.C
cinelerra-5.1/guicast/bcfilebox.C
cinelerra-5.1/guicast/bcwindowbase.C

index a43778e1a024f35b5334ed1d4510ae5cdc97af66..4143449777390743b644fc2921616ba3ba16c5a1 100644 (file)
@@ -194,8 +194,6 @@ void LoadFileWindow::create_objects()
        lock_window("LoadFileWindow::create_objects");
        BC_FileBox::create_objects();
 
-       BC_FileBox::create_objects();
-
        int x = get_w() / 2 -
                LoadMode::calculate_w(this, mwindow->theme) / 2;
        int y = get_cancel_button()->get_y() -
index 21898b87a02694a91ce7917ff92de4bf710e9780..8e5a1e547aa5969d68b26e7f8e1b4bc5a6238a30 100644 (file)
@@ -751,22 +751,15 @@ int BC_FileBox::resize_event(int w, int h)
                w - (get_w() - listbox->get_w()),
                h - (get_h() - listbox->get_h()),
                0);
-       icon_button->reposition_window(w - (get_w() - icon_button->get_x()),
-               icon_button->get_y());
-       text_button->reposition_window(w - (get_w() - text_button->get_x()),
-               text_button->get_y());
-       folder_button->reposition_window(w - (get_w() - folder_button->get_x()),
-               folder_button->get_y());
-       rename_button->reposition_window(w - (get_w() - rename_button->get_x()),
-               rename_button->get_y());
-       reload_button->reposition_window(w - (get_w() - reload_button->get_x()),
-               reload_button->get_y());
-       delete_button->reposition_window(w - (get_w() - delete_button->get_x()),
-               delete_button->get_y());
-       updir_button->reposition_window(w - (get_w() - updir_button->get_x()),
-               updir_button->get_y());
-       set_w(w);
-       set_h(h);
+       int dx = w - get_w();
+       icon_button->reposition_window(icon_button->get_x()+dx, icon_button->get_y());
+       text_button->reposition_window(text_button->get_x()+dx, text_button->get_y());
+       folder_button->reposition_window(folder_button->get_x()+dx, folder_button->get_y());
+       rename_button->reposition_window(rename_button->get_x()+dx, rename_button->get_y());
+       reload_button->reposition_window(reload_button->get_x()+dx, reload_button->get_y());
+       delete_button->reposition_window(delete_button->get_x()+dx, delete_button->get_y());
+       updir_button->reposition_window(updir_button->get_x()+dx, updir_button->get_y());
+       set_w(w);  set_h(h);
        get_resources()->filebox_w = get_w();
        get_resources()->filebox_h = get_h();
        flush();
index 0c34217adfa474ea83cb4912001c0489e74260b4..c61691f2ffc9bf80c60c143cc3b6e5206a0c9a88 100644 (file)
@@ -4029,17 +4029,10 @@ void BC_WindowBase::set_background(VFrame *bitmap)
 
 void BC_WindowBase::put_title(const char *text)
 {
-       if( BC_Resources::locale_utf8 ) {
-               char *bp=this->title, *ep = bp+sizeof(this->title)-1;
-               for( const char *cp=text; *cp!=0 && bp<ep; ) {
-                       if( *cp < 0 ) { do { *bp++ = *cp++; } while( *cp < 0 );  continue; }
-                       if( *cp < ' ' ) { *bp++ = ' ';  ++cp;  continue; }
-                       *bp++ = *cp++;
-               }
-               *bp = 0;
-       }
-       else
-               strcpy(this->title, text);
+       char *cp = this->title, *ep = cp+sizeof(this->title)-1;
+       for( const unsigned char *bp = (const unsigned char *)text; *bp && cp<ep; ++bp )
+               *cp++ = *bp >= ' ' ? *bp : ' ';
+       *cp = 0;
 }
 
 void BC_WindowBase::set_title(const char *text)