void get_exe_path(char *result)
{
// Get executable path
- int len = readlink("/proc/self/exe", result, BCTEXTLEN);
+ int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
if( len >= 0 ) {
result[len] = 0;
char *ptr = strrchr(result, '/');
char exe_path[BCTEXTLEN];
char env_path[BCTEXTLEN];
int nice_value = 20;
- int start_remote_control = 0;
config_path[0] = 0;
batch_path[0] = 0;
deamon_path[0] = 0;
int load_backup = 0;
+ int start_remote_control = 0;
for(int i = 1; i < argc; i++)
{
case DO_GUI:
{
- int done = 0;
+ int restart = 0, done = 0;
while( !done ) {
BC_WindowBase::get_resources()->vframe_shm = 0;
MWindow mwindow;
mwindow.start();
mwindow.run();
//PRINT_TRACE
- if( mwindow.reload() )
- start_remote_control =
- mwindow.gui->remote_control->is_active();
- else
- done = 1;
- if( !done ) {
+ restart = mwindow.restart();
+ if( restart ) {
mwindow.save_backup();
load_backup = 1;
+ start_remote_control =
+ mwindow.gui->remote_control->is_active();
}
+ if( restart <= 0 )
+ done = 1;
mwindow.save_defaults();
//PRINT_TRACE
filenames.remove_all_objects();
-#if 1
- if( !mwindow.reload() ) break;
-// due to leaks and munges in x fonts, this loop has to be
-// executed via a total program restart 2/18/2016
+ }
+
+ if( restart < 0 ) {
char exe_path[BCTEXTLEN];
- if( readlink("/proc/self/exe", exe_path, sizeof(exe_path)) < 0 ) break;
- char *const av[3] = { exe_path, (char*)(load_backup? "-x" : 0), 0 };
+ int len = readlink("/proc/self/exe", exe_path, sizeof(exe_path)-1);
+ if( len < 0 ) break;
+ exe_path[len] = 0;
+ char *av[4] = { 0, }; int ac = 0;
+ av[ac++] = exe_path;
+ if( load_backup ) av[ac++] = (char*) "-x";
+ if( start_remote_control ) av[ac++] = (char*) "-z";
+ av[ac++] = 0;
execv(exe_path, av);
-#endif
}
+ }
//SET_TRACE
DISABLE_BUFFER
- break;
- }
+ break;
}
return 0;
int window_config = config >= 0 ? config :
mwindow->session->window_config;
if( mwindow->tile_windows(window_config) ) {
- mwindow->reload_status = 1;
- mwindow->quit(1);
+ mwindow->restart_status = 1;
+ mwindow->gui->set_done(0);
}
return 1;
}
wwindow = 0;
lwindow = 0;
sighandler = 0;
- reload_status = 0;
+ restart_status = 0;
screens = 1;
in_destructor = 0;
}
save_defaults();
// Give up and go to a movie
// cant run valgrind if this is used
-// if( !reload_status ) exit(0);
gui->del_keyboard_listener(
(int (BC_WindowBase::*)(BC_WindowBase *))
int new_project();
int delete_project(int flash = 1);
void quit(int unlock);
- int reload() { return reload_status; }
+ int restart() { return restart_status; }
int load_defaults();
int save_defaults();
void clean_indexes();
// TimeBomb timebomb;
SigHandler *sighandler;
- int reload_status;
+ int restart_status;
int screens;
int in_destructor;
};
edl = 0;
mwindow->defaults->update("DEFAULTPREF", current_dialog);
- if( mwindow->reload_status )
+ if( mwindow->restart() )
mwindow->gui->set_done(0);
}
!preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1);
if( strcmp(preferences->theme, mwindow->preferences->theme) != 0 )
- mwindow->reload_status = 1;
+ mwindow->restart_status = -1; // reload, need new bcresources
mwindow->edl->copy_session(edl, 1);
mwindow->preferences->copy_from(preferences);
}
else {
unlock_window();
- mwindow->reload_status = 1;
+ mwindow->restart_status = 1;
mwindow->quit(0);
}
}
#include "bcsignals.h"
#include "clip.h"
+#include "cstrdup.h"
#include "cwindowgui.h"
#include "blondcvtheme.h"
#include "edl.h"
title_color = WHITE;
recordgui_fixed_color = YELLOW;
recordgui_variable_color = RED;
- resources->medium_font = "-*-helvetica-bold-r-normal-*-14-*";
+
+ int font_size = (int)(14*resources->font_scale + 0.5);
+ char string[BCTEXTLEN];
+ sprintf(string,"-*-helvetica-bold-r-normal-*-%d-*", font_size);
+ delete [] resources->medium_font;
+ resources->medium_font = cstrdup(string);
channel_position_color = MEYELLOW;
resources->meter_title_w = 25;
#include "bcsignals.h"
#include "clip.h"
+#include "cstrdup.h"
#include "cwindowgui.h"
#include "bluedottheme.h"
#include "edl.h"
title_color = BLACK;
recordgui_fixed_color = BLACK;
recordgui_variable_color = RED;
- resources->medium_font = "-*-helvetica-medium-r-normal-*-14-*";
+
+ int font_size = (int)(14*resources->font_scale + 0.5);
+ char string[BCTEXTLEN];
+ sprintf(string,"-*-helvetica-medium-r-normal-*-%d-*", font_size);
+ delete [] resources->medium_font;
+ resources->medium_font = cstrdup(string);
channel_position_color = MEYELLOW;
resources->meter_title_w = 25;