alt transport keys, snap editing, grab focus, inv hilight clr, subtitle fix
[goodguy/history.git] / cinelerra-5.1 / cinelerra / preferencesthread.C
index d02f9ad44304704bfd90990a42367a9295ede31c..dbda188f782fa605f920ad5f76e8d7dd9b4dd7c0 100644 (file)
  */
 
 #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)
@@ -207,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);
@@ -219,15 +223,21 @@ 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();
@@ -333,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");
        }
@@ -365,7 +377,7 @@ SET_TRACE
 
 PreferencesWindow::PreferencesWindow(MWindow *mwindow,
        PreferencesThread *thread, int x, int y, int w, int h)
- : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h, 1,0,1)
+ : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h,w,h, 1)
 {
        this->mwindow = mwindow;
        this->thread = thread;
@@ -401,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")));
@@ -511,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;