@@ -286,19 +286,16 @@ static void default_setup(ezgl::application* app) {
286286 search_setup (app);
287287}
288288
289+ // Initial Setup functions run default setup if they are a new window. Then, they will run
290+ // the specific hiding/showing functions that separate them from the other init. setup functions
291+
289292/* function below intializes the interface window with a set of buttons and links
290293 * signals to corresponding functions for situation where the window is opened from
291294 * NO_PICTURE_to_PLACEMENT */
292295static void initial_setup_NO_PICTURE_to_PLACEMENT (ezgl::application* app,
293296 bool is_new_window) {
294- if (!is_new_window)
295- return ;
296-
297- // Configuring visible buttons
298- default_setup (app);
299-
300- // THIS WILL BE CHANGED SOON IGNORE
301- load_block_names (app);
297+ if (is_new_window)
298+ default_setup (app);
302299
303300 // Hiding unused functionality
304301 hide_widget (" RoutingMenuButton" , app);
@@ -311,9 +308,10 @@ static void initial_setup_NO_PICTURE_to_PLACEMENT(ezgl::application* app,
311308static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path (
312309 ezgl::application* app,
313310 bool is_new_window) {
314- if (!is_new_window)
315- return ;
316- default_setup (app);
311+ if (is_new_window)
312+ default_setup (app);
313+
314+ // Showing given functionality
317315 crit_path_button_setup (app);
318316
319317 // Hiding unused routing menu
@@ -325,11 +323,10 @@ static void initial_setup_NO_PICTURE_to_PLACEMENT_with_crit_path(
325323 * PLACEMENT_to_ROUTING */
326324static void initial_setup_PLACEMENT_to_ROUTING (ezgl::application* app,
327325 bool is_new_window) {
328- if (!is_new_window)
329- return ;
330- default_setup (app);
331- routing_button_setup (app);
326+ if (is_new_window)
327+ default_setup (app);
332328
329+ routing_button_setup (app);
333330 hide_crit_path_button (app);
334331}
335332
@@ -338,9 +335,8 @@ static void initial_setup_PLACEMENT_to_ROUTING(ezgl::application* app,
338335 * ROUTING_to_PLACEMENT */
339336static void initial_setup_ROUTING_to_PLACEMENT (ezgl::application* app,
340337 bool is_new_window) {
341- if (!is_new_window)
342- return ;
343- default_setup (app);
338+ if (is_new_window)
339+ default_setup (app);
344340
345341 // Hiding unused functionality
346342 hide_widget (" RoutingMenuButton" , app);
@@ -352,9 +348,9 @@ static void initial_setup_ROUTING_to_PLACEMENT(ezgl::application* app,
352348 * NO_PICTURE_to_ROUTING */
353349static void initial_setup_NO_PICTURE_to_ROUTING (ezgl::application* app,
354350 bool is_new_window) {
355- if (! is_new_window)
356- return ;
357- default_setup (app);
351+ if (is_new_window)
352+ default_setup (app) ;
353+
358354 routing_button_setup (app);
359355 hide_crit_path_button (app);
360356}
@@ -365,9 +361,9 @@ static void initial_setup_NO_PICTURE_to_ROUTING(ezgl::application* app,
365361static void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path (
366362 ezgl::application* app,
367363 bool is_new_window) {
368- if (! is_new_window)
369- return ;
370- default_setup (app);
364+ if (is_new_window)
365+ default_setup (app) ;
366+
371367 routing_button_setup (app);
372368 crit_path_button_setup (app);
373369}
@@ -379,7 +375,6 @@ void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type
379375 /* Updates the screen if the user has requested graphics. The priority *
380376 * value controls whether or not the Proceed button must be clicked to *
381377 * continue. Saves the pic_on_screen_val to allow pan and zoom redraws. */
382-
383378 t_draw_state* draw_state = get_draw_state_vars ();
384379
385380 if (!draw_state->show_graphics )
0 commit comments