예제 #1
0
void Render::handle_close_event(int result)
{
	int format_error = 0;
	const int debug = 0;

	if(!result)
	{
		if(debug) printf("Render::handle_close_event %d\n", __LINE__);
// Check the asset format for errors.
		FormatCheck format_check(asset);
		if(debug) printf("Render::handle_close_event %d\n", __LINE__);
		format_error = format_check.check_format();
		if(debug) printf("Render::handle_close_event %d\n", __LINE__);
	}

PRINT_TRACE

	save_defaults(asset);
PRINT_TRACE
	mwindow->save_defaults();
PRINT_TRACE

	if(!format_error && !result)
	{
		if(debug) printf("Render::handle_close_event %d\n", __LINE__);

		if(!result) start_render();
		if(debug) printf("Render::handle_close_event %d\n", __LINE__);

	}
PRINT_TRACE
}
예제 #2
0
void BatchRenderThread::start_rendering()
{
	if(is_rendering) return;

	is_rendering = 1;
	char path[BCTEXTLEN];
	path[0] = 0;
	save_jobs(path);
	save_defaults(mwindow->defaults);
	gui->button_disable();

// Test EDL files for existence
	if(test_edl_files()) return;

// Predict all destination paths
	ArrayList<char*> paths;
	calculate_dest_paths(&paths,
		mwindow->preferences);

// Test destination files for overwrite
	int result = ConfirmSave::test_files(mwindow, &paths);
	paths.remove_all_objects();

// User cancelled
	if(result)
	{
		is_rendering = 0;
		gui->button_enable();
		return;
	}

	mwindow->render->start_batches(&jobs);
}
예제 #3
0
void BatchRenderThread::start_rendering(char *config_path,
	char *batch_path)
{
	BC_Hash *boot_defaults;
	Preferences *preferences;
	Render *render;
	BC_Signals *signals = new BC_Signals;
	// XXX the above stuff is leaked,
//PRINT_TRACE
// Initialize stuff which MWindow does.
	signals->initialize();
	MWindow::init_defaults(boot_defaults, config_path);
	load_defaults(boot_defaults);
	preferences = new Preferences;
	preferences->load_defaults(boot_defaults);
	MWindow::init_plugins(0, preferences);
	char font_path[BCTEXTLEN];
	strcpy(font_path, preferences->plugin_dir);
	strcat(font_path, "/fonts");
	BC_Resources::init_fontconfig(font_path);
	BC_WindowBase::get_resources()->vframe_shm = 1;
	MWindow::init_fileserver(preferences);

//PRINT_TRACE
	load_jobs(batch_path, preferences);
	save_jobs(batch_path);
	save_defaults(boot_defaults);

//PRINT_TRACE
// Test EDL files for existence
	if(test_edl_files()) return;

//PRINT_TRACE

// Predict all destination paths
	ArrayList<char*> paths;
	paths.set_array_delete();
	calculate_dest_paths(&paths, preferences);

//PRINT_TRACE
	int result = ConfirmSave::test_files(0, &paths);
	paths.remove_all_objects();
// Abort on any existing file because it's so hard to set this up.
	if(result) return;

//PRINT_TRACE
	render = new Render(0);
//PRINT_TRACE
	render->start_batches(&jobs, 
		boot_defaults,
		preferences);
//PRINT_TRACE
}
예제 #4
0
BlurZoomMain::~BlurZoomMain()
{
	if(thread)
	{
// Set result to 0 to indicate a server side close
		thread->window->set_done(0);
		thread->completion.lock();
		delete thread;
	}

	save_defaults();
	if(defaults) delete defaults;
}
예제 #5
0
파일: sview.c 프로젝트: artpol84/slurm
static void _persist_dynamics(void)
{

	gint g_x;
	gint g_y;

	gtk_window_get_size(GTK_WINDOW(main_window), &g_x, &g_y);

	default_sview_config.main_width = g_x;
	default_sview_config.main_height = g_y;

	save_defaults(true);
}
예제 #6
0
void  set_footers( void )
{
	BOOLEAN done = FALSE ;
	short button ;
	short old_footer_lines = footer_lines() ;
	
	copy_footers_to_form() ;
	app_modal_init( footers_ptr, footer_help, TITLED ) ;

	while( !done )
	{
		button = app_modal_do() ;
		button &= ~DOUBLE_CLICK ;

		if( button && button != APP_MODAL_TERM )
		{
			footers_ptr[button].ob_state &= ~SELECTED ;
			objc_draw( footers_ptr, button, 0, PTRS( app_modal_box() ) ) ;
		}

		switch( button )
		{
			case FOOTER_OK :
				copy_form_to_footers() ;
				done = TRUE ;
				break ;
			case FOOTER_CANCEL :
			case APP_MODAL_TERM :
				done = TRUE ;
				break ;
			case FOOTER_SAVE :
				copy_form_to_footers() ;
				saved_footers = footers ;
				save_defaults() ;
				done = TRUE ;
				break ;
			case FOOTER_HELP :
				help( footer_help ) ;
				break ;
			default :
				break ; 
		}
	}

	if( footer_lines() != old_footer_lines )  gdos_params_valid = FALSE ;
							/* This will force draw_custom_pages	*/
							/* to get a correct value				*/

	app_modal_end() ;
}
예제 #7
0
void BatchRenderThread::handle_close_event(int result)
{
// Save settings
	char path[BCTEXTLEN];
	path[0] = 0;
	save_jobs(path);
	save_defaults(mwindow->defaults);
	delete default_job;
	default_job = 0;
	jobs.remove_all_objects();
	if(file_entries)
	{
		file_entries->remove_all_objects();
		delete file_entries;
		file_entries = 0;
	}
}
예제 #8
0
void BatchRenderThread::handle_close_event(int result)
{
// Save settings
TRACE("BatchRenderThread::handle_close_event 1");
	char path[BCTEXTLEN];
TRACE("BatchRenderThread::handle_close_event 1");
	path[0] = 0;
TRACE("BatchRenderThread::handle_close_event 1");
	save_jobs(path);
TRACE("BatchRenderThread::handle_close_event 1");
	save_defaults(mwindow->defaults);
TRACE("BatchRenderThread::handle_close_event 1");
	delete default_job;
TRACE("BatchRenderThread::handle_close_event 1");
	default_job = 0;
TRACE("BatchRenderThread::handle_close_event 1");
	jobs.remove_all_objects();
TRACE("BatchRenderThread::handle_close_event 100");
}
예제 #9
0
void BatchRenderThread::start_rendering(char *config_path,
	char *batch_path)
{
	BC_Hash *boot_defaults;
	Preferences *preferences;
	Render *render;
	ArrayList<PluginServer*> *plugindb;

// Initialize stuff which MWindow does.
	MWindow::init_defaults(boot_defaults, config_path);
	load_defaults(boot_defaults);
	preferences = new Preferences;
	preferences->load_defaults(boot_defaults);
	MWindow::init_plugins(preferences, plugindb, 0);

	load_jobs(batch_path, preferences);
	save_jobs(batch_path);
	save_defaults(boot_defaults);

// Test EDL files for existence
	if(test_edl_files()) return;


// Predict all destination paths
	ArrayList<char*> paths;
	calculate_dest_paths(&paths,
		preferences,
		plugindb);

	int result = ConfirmSave::test_files(0, &paths);
	paths.remove_all_objects();

// Abort on any existing file because it's so hard to set this up.
	if(result) return;

	render = new Render(0);
	render->start_batches(&jobs, 
		boot_defaults,
		preferences,
		plugindb);
}
예제 #10
0
short  get_transfer_file_name( short transfer_type )

{
	short button ;

	switch( transfer_type )
	{
		case FAMTREE_TYPE :
			fsel_geninput( transfer_file, NULL, &button, SELECT_TRANSFER ) ;
			break ;
		case GEDCOM_TYPE :
			fsel_geninput( gedcom_transfer_file, NULL, &button, SELECT_TRANSFER ) ;
			break ;
		case CSV_TYPE :
			fsel_geninput( csv_transfer_file, NULL, &button, SELECT_TRANSFER ) ;
			break ;
	}
	if( button )  save_defaults() ;

	return button ;
}
예제 #11
0
ReFrame::~ReFrame()
{
	save_defaults();
	delete defaults;
}
예제 #12
0
// Non realtime parameters
int PluginClient::plugin_get_parameters()
{
	int result = get_parameters();
	if(defaults) save_defaults();
	return result;
}
예제 #13
0
NormalizeMain::~NormalizeMain()
{
	save_defaults();
	delete defaults;
}
예제 #14
0
void Render::run()
{
	int format_error;


	result = 0;

	if(mode == Render::INTERACTIVE)
	{
// Fix the asset for rendering
printf("Render::run 1\n");
		Asset *asset = new Asset;
		load_defaults(asset);
printf("Render::run 2\n");
		check_asset(mwindow->edl, *asset);
printf("Render::run 3\n");

// Get format from user
		if(!result)
		{
printf("Render::run 4\n");
			do
			{
				format_error = 0;
				result = 0;

				{
printf("Render::run 5\n");
					RenderWindow window(mwindow, this, asset);
printf("Render::run 6\n");
					window.create_objects();
printf("Render::run 7\n");
					result = window.run_window();
printf("Render::run 8\n");
					if (! result) {
						// add to recentlist only on OK
						window.format_tools->path_recent->add_item(FILE_FORMAT_PREFIX(asset->format), asset->path);
					}
				}

				if(!result)
				{
printf("Render::run 8.1\n");
// Check the asset format for errors.
					FormatCheck format_check(asset);
printf("Render::run 8.2\n");
					format_error = format_check.check_format();
printf("Render::run 8.3\n");
				}
			}while(format_error && !result);
		}
printf("Render::run 9\n");

		save_defaults(asset);
		mwindow->save_defaults();
printf("Render::run 10\n");

		if(!result) render(1, asset, mwindow->edl, strategy, range_type);
printf("Render::run 11\n");

		Garbage::delete_object(asset);
printf("Render::run 12\n");
	}
	else
	if(mode == Render::BATCH)
	{
		for(int i = 0; i < jobs->total && !result; i++)
		{
			BatchRenderJob *job = jobs->values[i];
			if(job->enabled)
			{
				if(mwindow)
				{
					mwindow->batch_render->update_active(i);
				}
				else
				{
					printf("Render::run: %s\n", job->edl_path);
				}


				FileXML *file = new FileXML;
				EDL *edl = new EDL;
				edl->create_objects();
				file->read_from_file(job->edl_path);
				if(!plugindb && mwindow)
					plugindb = mwindow->plugindb;
				edl->load_xml(plugindb, file, LOAD_ALL);

				check_asset(edl, *job->asset);
				render(0, job->asset, edl, job->strategy, RANGE_BACKCOMPAT);

				delete edl;
				delete file;
				if(!result)
				{
					if(mwindow)
						mwindow->batch_render->update_done(i, 1, elapsed_time);
					else
					{
						char string[BCTEXTLEN];
						elapsed_time = 
							(double)progress_timer->get_scaled_difference(1);
						Units::totext(string,
							elapsed_time,
							TIME_HMS2);
						printf("Render::run: done in %s\n", string);
					}
				}
				else
				{
					if(mwindow)
						mwindow->batch_render->update_active(-1);
					else
						printf("Render::run: failed\n");
				}
			}
		}

		if(mwindow)
		{
			mwindow->batch_render->update_active(-1);
			mwindow->batch_render->update_done(-1, 0, 0);
		}
	}
printf("Render::run 100\n");
}
예제 #15
0
G_MODULE_EXPORT gboolean leave(GtkWidget * widget, gpointer data)
{
	save_defaults();
	gtk_main_quit();
	return FALSE;
}
예제 #16
0
CDRipMain::~CDRipMain()
{
	save_defaults();
	delete defaults;
}
예제 #17
0
파일: defaults.c 프로젝트: FredHutch/slurm
extern int configure_defaults(void)
{
	GtkScrolledWindow *window = create_scrolled_window();
	GtkWidget *popup = gtk_dialog_new_with_buttons(
		"Sview Defaults",
		GTK_WINDOW(main_window),
		GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
		NULL);
	GtkWidget *label = gtk_dialog_add_button(GTK_DIALOG(popup),
						 GTK_STOCK_OK, GTK_RESPONSE_OK);
	GtkBin *bin = NULL;
	GtkViewport *view = NULL;
	GtkTable *table = NULL;
	int i = 0, row = 0;
	char tmp_char[100];
	char *tmp_char_ptr;
	display_data_t *display_data = display_data_defaults;
	sview_config_t tmp_config;
	int response = 0;
	int rc = SLURM_SUCCESS;
	uint32_t width = 150;
	uint32_t height = 700;

	apply_hidden_change = TRUE;

	memcpy(&tmp_config, &default_sview_config, sizeof(sview_config_t));
	gtk_window_set_default(GTK_WINDOW(popup), label);
	gtk_dialog_add_button(GTK_DIALOG(popup),
			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);

	/*
	  for(i=0;; i++) {
	  if (main_popup_positioner[i].width == -1)
	  break;
	  if (strstr("Sview Defaults", main_popup_positioner[i].name)) {
	  pos_x = main_popup_positioner[i].width;
	  pos_y = main_popup_positioner[i].height;
	  break;
	  }
	  }
	*/

	gtk_window_set_default_size(GTK_WINDOW(popup), width, height);
	snprintf(tmp_char, sizeof(tmp_char),
		 "Default Settings for Sview");
	label = gtk_label_new(tmp_char);

	gtk_scrolled_window_set_policy(window,
				       GTK_POLICY_NEVER,
				       GTK_POLICY_AUTOMATIC);
	bin = GTK_BIN(&window->container);
	view = GTK_VIEWPORT(bin->child);
	bin = GTK_BIN(&view->bin);
	table = GTK_TABLE(bin->child);
	gtk_table_resize(table, SORTID_CNT, 2);

	gtk_table_set_homogeneous(table, FALSE);

	for (i = 0; i < SORTID_CNT; i++) {
		while (display_data++) {
			if (display_data->id == -1)
				break;
			if (!display_data->name)
				continue;
			if (display_data->id != i)
				continue;

			_local_display_admin_edit(
				table, &tmp_config, &row,
				display_data);
			break;
		}
		display_data = display_data_defaults;
	}
	gtk_table_resize(table, row, 2);

	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(popup)->vbox),
			   label, FALSE, FALSE, 0);
	if (window)
		gtk_box_pack_start(GTK_BOX(GTK_DIALOG(popup)->vbox),
				   GTK_WIDGET(window), TRUE, TRUE, 0);
	gtk_widget_show_all(popup);
	response = gtk_dialog_run (GTK_DIALOG(popup));
	if (response == GTK_RESPONSE_OK) {
		tmp_char_ptr = g_strdup_printf(
			"Defaults updated successfully");
		if (global_edit_error)
			tmp_char_ptr = global_edit_error_msg;
		else if (!global_send_update_msg)
			tmp_char_ptr = g_strdup_printf(
				"No change detected.");
		else {
			int action = 0;
			gdk_window_set_cursor(main_window->window,
					      in_process_cursor);
			if (tmp_config.ruled_treeview
			    != working_sview_config.ruled_treeview) {
				/* get rid of each existing table */
				cluster_change_block();
				cluster_change_resv();
				cluster_change_part();
				cluster_change_job();
				cluster_change_node();
				cluster_change_front_end();
			} else if (tmp_config.grid_topological !=
				   working_sview_config.grid_topological) {
				apply_hidden_change = FALSE;
				if (tmp_config.grid_topological) {
					default_sview_config.grid_topological =
						tmp_config.grid_topological;
					if (!g_switch_nodes_maps)
						rc = get_topo_conf();
					if (rc != SLURM_SUCCESS) {
						/*denied*/
						tmp_char_ptr = g_strdup_printf(
							"Valid topology not "
							"detected");
						tmp_config.grid_topological =
							FALSE;
						goto denied_change;
					}
				}
				/*force fresh grid and
				 * node state check
				 * */
				FREE_NULL_LIST(grid_button_list);
				slurm_free_node_info_msg(g_node_info_ptr);
				g_node_info_ptr = NULL;
			}


			/*apply change*/

			memcpy(&default_sview_config, &tmp_config,
			       sizeof(sview_config_t));
			memcpy(&working_sview_config, &tmp_config,
			       sizeof(sview_config_t));

			/* set the current display to the default */
			gtk_toggle_action_set_active(
				default_sview_config.action_admin,
				working_sview_config.admin_mode);
			gtk_toggle_action_set_active(
				default_sview_config.action_ruled,
				working_sview_config.ruled_treeview);
			gtk_toggle_action_set_active(
				default_sview_config.action_grid,
				working_sview_config.show_grid);
			gtk_toggle_action_set_active(
				default_sview_config.action_hidden,
				working_sview_config.show_hidden);
			apply_hidden_change = TRUE;
			gtk_toggle_action_set_active(
				default_sview_config.action_page_opts,
				working_sview_config.save_page_opts);
#ifdef GTK2_USE_RADIO_SET
			/* Since this value isn't a simple 0->n we
			   need to translate if we don't have the
			   newer gtk.
			*/
			action = working_sview_config.tab_pos;
#else
			/* If using older gtk we need to translate the
			   tab position to that of the position in the
			   radio list.
			*/
			action = _trans_tab_pos(working_sview_config.tab_pos);
#endif

			sview_radio_action_set_current_value(
				default_sview_config.action_tab, action);


			for (i=0; i<PAGE_CNT; i++) {
				if (main_display_data[i].id == -1)
					break;

				if (!main_display_data[i].name
				    || (i == TAB_PAGE))
					continue;

				toggle_tab_visiblity(NULL, main_display_data+i);
			}
			get_system_stats(main_grid_table);
			/******************************************/
			save_defaults(false);
		}
	denied_change:
		display_edit_note(tmp_char_ptr);
		g_free(tmp_char_ptr);
	}

	global_entry_changed = 0;

	gtk_widget_destroy(popup);

	if (main_window && main_window->window)
		gdk_window_set_cursor(main_window->window, NULL);

	return rc;
}