X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferencesthread.C;h=9393d4359f7158802ffe3c9eab8f84096863e4a0;hb=4b6c39e6cf4a3fd9c1b347db6de686ab55d6cac8;hp=8d8e22c79bc2aafe8e16d177ad1b113c21ccf660;hpb=5a7faba81bcd03755bfe651bacbc5980171fe9de;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 8d8e22c7..9393d435 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -23,6 +23,7 @@ #include "asset.h" #include "audiodevice.inc" #include "bcsignals.h" +#include "bctrace.h" #include "cache.h" #include "cplayback.h" #include "cwindow.h" @@ -62,7 +63,7 @@ #define WIDTH 770 -#define HEIGHT 690 +#define HEIGHT 720 PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) @@ -127,10 +128,17 @@ BC_Window* PreferencesThread::new_gui() int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); - int x = scr_x + scr_w / 2 - WIDTH / 2; - int y = scr_h / 2 - HEIGHT / 2; + int w = WIDTH, h = HEIGHT; + int min_w = mwindow->theme->preferencescategory_x; + for(int i = 0; i < CATEGORIES; i++) { + min_w += PreferencesButton::calculate_w(mwindow->gui, category_to_text(i)) - + mwindow->theme->preferences_category_overlap; + } + if( w < min_w ) w = min_w; + int x = scr_x + scr_w / 2 - w / 2; + int y = scr_h / 2 - h / 2; - window = new PreferencesWindow(mwindow, this, x, y); + window = new PreferencesWindow(mwindow, this, x, y, w, h); window->create_objects(); mwindow->gui->unlock_window(); @@ -200,7 +208,7 @@ int PreferencesThread::apply_settings() (preferences->force_uniprocessor != mwindow->preferences->force_uniprocessor) || this_playback_config->active_config != playback_config->active_config || (*this_aconfig != *aconfig) || (*this_vconfig != *vconfig) || - !preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1); + !preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1, edl); if( strcmp(preferences->theme, mwindow->preferences->theme) != 0 ) mwindow->restart_status = -1; // reload, need new bcresources @@ -211,13 +219,22 @@ int PreferencesThread::apply_settings() BC_Signals::set_catch_segv(mwindow->preferences->trap_sigsegv); BC_Signals::set_catch_intr(mwindow->preferences->trap_sigintr); + BC_WindowBase::get_resources()->popupmenu_btnup = mwindow->preferences->popupmenu_btnup; + BC_WindowBase::get_resources()->textbox_focus_policy = mwindow->preferences->textbox_focus_policy; + if( mwindow->preferences->trap_sigsegv || mwindow->preferences->trap_sigintr ) { + BC_Trace::enable_locks(); + } + else { + BC_Trace::disable_locks(); + } mwindow->reset_android_remote(); - mwindow->gui->ffmpeg_toggle->update(mwindow->preferences->ffmpeg_early_probe); - mwindow->gui->ffmpeg_toggle->set_tooltip( mwindow->preferences->ffmpeg_early_probe ? + int ffmpeg_early_probe = mwindow->preferences->get_file_probe_armed("FFPMEG_Early"); + mwindow->gui->ffmpeg_toggle->update(ffmpeg_early_probe); + mwindow->gui->ffmpeg_toggle->set_tooltip(ffmpeg_early_probe ? _("Try FFMpeg first") : _("Try FFMpeg last") ); mwindow->gui->mainshbtns->load(mwindow->preferences); - double tc_position = + double tc_position = mwindow->edl->session->get_frame_offset() / mwindow->edl->session->frame_rate; mwindow->gui->mainclock->set_position_offset(tc_position); @@ -356,11 +373,8 @@ SET_TRACE PreferencesWindow::PreferencesWindow(MWindow *mwindow, - PreferencesThread *thread, - int x, - int y) - : BC_Window(_(PROGRAM_NAME ": Preferences"), - x,y, WIDTH,HEIGHT, WIDTH,HEIGHT, 1,0,1) + PreferencesThread *thread, int x, int y, int w, int h) + : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h,w,h, 1) { this->mwindow = mwindow; this->thread = thread; @@ -518,6 +532,7 @@ int PreferencesWindow::set_current_dialog(int number) //printf("PreferencesWindow::set_current_dialog %d\n", __LINE__); dialog->create_objects(); //printf("PreferencesWindow::set_current_dialog %d\n", __LINE__); + dialog->lower_window(); dialog->show_window(0); } @@ -597,12 +612,16 @@ PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread) this->mwindow = mwindow; this->thread = thread; } - int PreferencesApply::handle_event() { thread->apply_settings(); return 1; } +int PreferencesApply::resize_event(int w, int h) +{ + reposition_window(w/2 - get_w()/2, h-get_h()-10); + return 1; +} @@ -615,7 +634,6 @@ PreferencesOK::PreferencesOK(MWindow *mwindow, PreferencesThread *thread) this->mwindow = mwindow; this->thread = thread; } - int PreferencesOK::keypress_event() { if(get_keypress() == RETURN) @@ -630,6 +648,11 @@ int PreferencesOK::handle_event() thread->window->set_done(0); return 1; } +int PreferencesOK::resize_event(int w, int h) +{ + reposition_window(10, h-get_h()-10); + return 1; +} @@ -650,12 +673,16 @@ int PreferencesCancel::keypress_event() } return 0; } - int PreferencesCancel::handle_event() { thread->window->set_done(1); return 1; } +int PreferencesCancel::resize_event(int w, int h) +{ + reposition_window(w-get_w()-10, h-get_h()-10); + return 1; +}