X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferencesthread.C;h=dbda188f782fa605f920ad5f76e8d7dd9b4dd7c0;hp=50dfc6cfde6664a34d02a4594eb0aff0bf68ef97;hb=b5c58822be78c8820692c916e296a2230bb2b9e2;hpb=3b4d085f4235e6313c25871877180a1a989e5b9f diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index 50dfc6cf..dbda188f 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -20,9 +20,11 @@ */ #include "aboutprefs.h" +#include "appearanceprefs.h" #include "asset.h" #include "audiodevice.inc" #include "bcsignals.h" +#include "bctrace.h" #include "cache.h" #include "cplayback.h" #include "cwindow.h" @@ -61,8 +63,8 @@ -#define WIDTH 770 -#define HEIGHT 690 +#define WIDTH 800 +#define HEIGHT 700 PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) @@ -127,10 +129,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,10 +209,12 @@ 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 + if( strcmp(preferences->plugin_icons, mwindow->preferences->plugin_icons) != 0 ) + mwindow->restart_status = -1; mwindow->edl->copy_session(edl, 1); mwindow->preferences->copy_from(preferences); @@ -211,15 +222,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()->grab_input_focus = mwindow->preferences->grab_input_focus; + 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 ? - _("Try FFMpeg first") : _("Try FFMpeg last") ); + 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 ? + FFMPEG_EARLY_TIP : FFMPEG_LATE_TIP); mwindow->gui->mainshbtns->load(mwindow->preferences); - double tc_position = - mwindow->edl->session->get_frame_offset() / mwindow->edl->session->frame_rate; - mwindow->gui->mainclock->set_position_offset(tc_position); //edl->session->recording_format->dump(); //mwindow->edl->session->recording_format->dump(); @@ -244,9 +262,9 @@ int PreferencesThread::apply_settings() - for(int i = 0; i < mwindow->vwindows.size(); i++) - { + for(int i = 0; i < mwindow->vwindows.size(); i++) { VWindow *vwindow = mwindow->vwindows.get(i); + if( !vwindow->is_running() ) continue; vwindow->gui->lock_window("PreferencesThread::apply_settings"); vwindow->gui->meters->change_format(edl->session->meter_format, edl->session->min_meter_db, @@ -325,6 +343,8 @@ const char* PreferencesThread::category_to_text(int category) return _("Performance"); case INTERFACE: return _("Interface"); + case APPEARANCE: + return _("Appearance"); case ABOUT: return _("About"); } @@ -356,11 +376,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; @@ -396,11 +413,7 @@ void PreferencesWindow::create_objects() for(int i = 0; i < CATEGORIES; i++) { add_subwindow(category_button[i] = new PreferencesButton(mwindow, - thread, - x, - y, - i, - thread->category_to_text(i), + thread, x, y, i, thread->category_to_text(i), (i == thread->current_dialog) ? mwindow->theme->get_image_set("category_button_checked") : mwindow->theme->get_image_set("category_button"))); @@ -506,6 +519,10 @@ int PreferencesWindow::set_current_dialog(int number) add_subwindow(dialog = new InterfacePrefs(mwindow, this)); break; + case PreferencesThread::APPEARANCE: + add_subwindow(dialog = new AppearancePrefs(mwindow, this)); + break; + case PreferencesThread::ABOUT: add_subwindow(dialog = new AboutPrefs(mwindow, this)); break; @@ -518,6 +535,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 +615,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 +637,6 @@ PreferencesOK::PreferencesOK(MWindow *mwindow, PreferencesThread *thread) this->mwindow = mwindow; this->thread = thread; } - int PreferencesOK::keypress_event() { if(get_keypress() == RETURN) @@ -630,6 +651,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 +676,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; +}