PIPS
gtk_select.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "database.h"
#include "misc.h"
#include "pipsdbm.h"
#include "pipsmake.h"
#include "top-level.h"
#include "resources.h"
#include "preprocessor.h"
#include <gtk/gtk.h>
#include "gpips.h"
+ Include dependency graph for gtk_select.c:

Go to the source code of this file.

Enumerations

enum  { GPIPS_MAX_MODULE_MENU_SIZE = 50 }
 Maximum size of the module menu of the main frame: More...
 

Functions

success close_workspace_notify (GtkWidget *widget, gpointer data)
 
void select_a_module_by_default ()
 Try to select a main module (that is the PROGRAM in the Fortran stuff) if no one is selected: More...
 
success end_directory_notify (const char *dir)
 
void end_directory_text_notify (GtkWidget *text_item, gpointer data)
 
void direct_change_directory ()
 FC: uses an external wish script I do not know how to activate this function safely... More...
 
GtkWidget * generate_directory_menu ()
 
void prompt_user_not_allowed_to_change_directory (GtkWidget *widget, gpointer data)
 
void start_directory_notify (GtkWidget *widget, gpointer data)
 
void enable_change_directory ()
 
void disable_change_directory ()
 
static void restore_enable_change_directory_state ()
 
void disable_workspace_create_or_open ()
 
void enable_workspace_create_or_open ()
 
void disable_workspace_delete_or_open ()
 
void enable_workspace_delete_or_open ()
 
void disable_workspace_close ()
 
void enable_workspace_close ()
 
void restore_enable_workspace_close_state ()
 
void disable_module_selection ()
 
void enable_module_selection ()
 
void end_delete_workspace_notify (const char *name)
 
void cancel_delete_workspace_notify ()
 
void start_delete_workspace_notify (GtkWidget *widget, gpointer data)
 
void start_create_workspace_notify (GtkWidget *widget, gpointer data)
 
void cancel_create_workspace_notify (GtkWidget *widget, gpointer data)
 
success continue_create_workspace_notify (const char *name)
 
void user_prompt_not_a_valid_workspace_name (const char *workspace_name)
 
void end_create_workspace_notify (gen_array_t files)
 
void end_open_workspace_notify (const char *name)
 
void cancel_open_workspace_notify ()
 
void open_workspace_notify (GtkWidget *widget, gpointer data)
 
void open_or_create_workspace (const char *workspace_name_original)
 To be used with schoose_create_abbrev_menu_with_text from the main panel: More...
 
void select_workspace_notify (GtkWidget *w, gpointer data __attribute__((unused)))
 
GtkWidget * generate_workspace_menu ()
 To use with schoose_create_abbrev_menu_with_text: More...
 
void end_select_module_callback (const char *name)
 
void cancel_select_module_notify (void)
 
void select_module_from_menubar_callback (GtkWidget *widget, gpointer data)
 
static void select_module_from_status_menu_callback (GtkWidget *widget, gpointer data __attribute__((unused)))
 
GtkWidget * generate_module_menu ()
 participe à la génération du menu associés aux modules dans la fenetre principale More...
 
void create_select_menu ()
 

Variables

GtkWidget * directory_menu_item
 
static GtkWidget * create_menu_item
 
static GtkWidget * open_menu_item
 
static GtkWidget * close_menu_item
 
static GtkWidget * module_menu_item
 
bool gpips_close_workspace_menu_inactive
 To enable or disable the menu items generated by generate_module_menu(): More...
 
bool gpips_close_workspace_menu_inactive_old
 
bool gpips_create_workspace_menu_inactive
 
bool gpips_open_workspace_menu_inactive
 
bool gpips_delete_workspace_menu_inactive
 
bool gpips_change_directory_inactive
 
bool gpips_change_directory_inactive_old
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Maximum size of the module menu of the main frame:

Enumerator
GPIPS_MAX_MODULE_MENU_SIZE 

Definition at line 62 of file gtk_select.c.

62  {
64 };
@ GPIPS_MAX_MODULE_MENU_SIZE
Definition: gtk_select.c:63

Function Documentation

◆ cancel_create_workspace_notify()

void cancel_create_workspace_notify ( GtkWidget *  widget,
gpointer  data 
)

enable the rights (in the gui) to create or open a workspace :

Definition at line 357 of file gtk_select.c.

357  {
358  /* enable the rights (in the gui) to create or open a workspace : */
362  cancel_query_notify(widget, data);
363  show_workspace();
364 }
void cancel_query_notify(GtkWidget *widget, gpointer data)
hides a window...
Definition: gtk_query.c:118
void enable_workspace_create_or_open()
Definition: gtk_select.c:213
void enable_change_directory()
Definition: gtk_select.c:173
void enable_workspace_delete_or_open()
Definition: gtk_select.c:228
void show_workspace()
Definition: gtk_status.c:123

References cancel_query_notify(), enable_change_directory(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), and show_workspace().

Referenced by continue_create_workspace_notify(), and start_create_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel_delete_workspace_notify()

void cancel_delete_workspace_notify ( )

Nothing to do.

Definition at line 305 of file gtk_select.c.

305  {
306  /* Nothing to do. */
311 }
static void restore_enable_change_directory_state()
Definition: gtk_select.c:199
void restore_enable_workspace_close_state()
Definition: gtk_select.c:248

References enable_workspace_create_or_open(), enable_workspace_delete_or_open(), restore_enable_change_directory_state(), and restore_enable_workspace_close_state().

Referenced by start_delete_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel_open_workspace_notify()

void cancel_open_workspace_notify ( )

Definition at line 502 of file gtk_select.c.

502  {
505  show_workspace();
506 }

References enable_change_directory(), enable_workspace_create_or_open(), and show_workspace().

Referenced by open_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel_select_module_notify()

void cancel_select_module_notify ( void  )

Definition at line 720 of file gtk_select.c.

720  {
721 }

Referenced by select_module_from_menubar_callback().

+ Here is the caller graph for this function:

◆ close_workspace_notify()

success close_workspace_notify ( GtkWidget *  widget,
gpointer  data 
)

The close has been successful:

close_log_file();

It is the only place to enable a directory change, after a close workspace:

Definition at line 537 of file gtk_select.c.

537  {
538  success return_value;
539 
540  return_value = close_workspace(FALSE);
541  debug(1, "close_workspace_notify", "return_value = %d\n", return_value);
542 
543  if (return_value) {
544  /* The close has been successful: */
545  /* close_log_file(); */
547 
548  edit_close_notify(NULL, NULL);
549 
552 
553  /* It is the only place to enable a directory change, after a close
554  workspace: */
556 
558  }
559 
560  hide_window(schoose_window, NULL, NULL);
561  show_workspace();
562  show_module();
564 
565  return return_value;
566 }
bool close_workspace(bool is_quit)
Definition: dbm.c:346
GtkWidget * schoose_window
Definition: gpips-local.h:36
bool success
Definition: gpips-local.h:59
void initialize_gpips_hpfc_hack_for_fabien_and_from_fabien()
Definition: gtk_compile.c:154
void edit_close_notify(GtkWidget *widget, gpointer data)
Definition: gtk_edit2.c:436
void disable_module_selection()
Definition: gtk_select.c:253
void disable_workspace_close()
Definition: gtk_select.c:234
void display_memory_usage()
Definition: gtk_status.c:84
void show_module()
Definition: gtk_status.c:134
gint hide_window(GtkWidget *window, GdkEvent *ev __attribute__((unused)), gpointer data __attribute__((unused)))
Definition: gtk_utils.c:89
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189

References close_workspace(), debug(), disable_module_selection(), disable_workspace_close(), display_memory_usage(), edit_close_notify(), enable_change_directory(), enable_workspace_create_or_open(), hide_window(), initialize_gpips_hpfc_hack_for_fabien_and_from_fabien(), schoose_window, show_module(), and show_workspace().

Referenced by create_select_menu(), end_delete_workspace_notify(), generate_workspace_menu(), open_or_create_workspace(), and start_create_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ continue_create_workspace_notify()

success continue_create_workspace_notify ( const char *  name)

Is the name a valid workspace name?

Code added to confirm for a database destruction before opening a database with the same name. RK 18/05/1993.

Only one Fortran program: use it without user confirmation.

Memory leak if mchoose exit...

If it failed, cancel the creation:

Definition at line 366 of file gtk_select.c.

366  {
367  gen_array_t fortran_list;
368  int fortran_list_length = 0;
369 
370  /* Is the name a valid workspace name? */
371  if (!workspace_name_p(name)) {
373  } else {
374  fortran_list = gen_array_make(0);
375  pips_get_fortran_list(fortran_list);
376  fortran_list_length = gen_array_nitems(fortran_list);
377 
378  if (fortran_list_length == 0) {
379  prompt_user("No Fortran files in this directory");
380  } else {
381  /* Code added to confirm for a database destruction before
382  opening a database with the same name.
383  RK 18/05/1993. */
384  if (workspace_exists_p(name)) {
385  int result;
386 
387  GtkWidget * dialog = gtk_message_dialog_new(GTK_WINDOW(
388  log_window), GTK_DIALOG_DESTROY_WITH_PARENT,
389  GTK_MESSAGE_INFO, GTK_BUTTONS_YES_NO, "%s", concatenate(
390  "The database ", name, " already exists!\n",
391  "Do you really want to remove it ?", NULL));
392  result = gtk_dialog_run(GTK_DIALOG(dialog));
393  gtk_widget_destroy(dialog);
394 
395  if (result == GTK_RESPONSE_NO) {
396  goto continue_create_workspace_notify_failed;
397  }
398  }
399 
401 
402  // On enregistre le nom du workspace qui va être créé dans l'entry associée
403  gtk_entry_set_text(GTK_ENTRY(workspace_name_entry), name);
404 
405  if (fortran_list_length == 1) {
406  /* Only one Fortran program: use it without user
407  confirmation. */
408  user_log(
409  "There is only one Fortran program in the current directory.\n"
410  "\tCreating the workspace \"%s\" from the file \"%s\"...\n",
411  name, gen_array_item(fortran_list, 0));
412  end_create_workspace_notify(fortran_list);
413  } else {
414  mchoose("Create Workspace", fortran_list,
416  (void(*)(void)) cancel_create_workspace_notify);
417  }
418  /* Memory leak if mchoose exit... */
419  gen_array_full_free(fortran_list);
420 
421  return (TRUE);
422  }
423  }
424 
425  /* If it failed, cancel the creation: */
426  continue_create_workspace_notify_failed: cancel_create_workspace_notify(
427  NULL, NULL);
428 
429  return FALSE;
430 }
void user_log(const char *format,...)
Definition: message.c:234
size_t gen_array_nitems(const gen_array_t a)
Definition: array.c:131
void gen_array_full_free(gen_array_t a)
Definition: array.c:77
gen_array_t gen_array_make(size_t size)
declarations...
Definition: array.c:40
void * gen_array_item(const gen_array_t a, size_t i)
Definition: array.c:143
GtkWidget * log_window
Definition: gpips-local.h:36
void prompt_user(string a_printf_format,...)
Definition: gtk_log.c:66
void mchoose(char *title, gen_array_t array, void(*function_ok)(gen_array_t), void(*function_cancel)(void))
Definition: gtk_mchoose.c:212
void disable_workspace_create_or_open()
Definition: gtk_select.c:206
void end_create_workspace_notify(gen_array_t files)
Definition: gtk_select.c:440
void user_prompt_not_a_valid_workspace_name(const char *workspace_name)
Definition: gtk_select.c:432
void cancel_create_workspace_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:357
GtkWidget * workspace_name_entry
Definition: gtk_status.c:75
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
bool workspace_exists_p(const char *)
Definition: workspace.c:266
bool workspace_name_p(const char *)
workspace.c
Definition: workspace.c:46
void pips_get_fortran_list(gen_array_t)
Select the true file with names ending in ".[fF]" and return a sorted arg list:
Definition: source_file.c:89

References cancel_create_workspace_notify(), concatenate(), disable_workspace_create_or_open(), end_create_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), log_window, mchoose(), pips_get_fortran_list(), prompt_user(), user_log(), user_prompt_not_a_valid_workspace_name(), workspace_exists_p(), workspace_name_entry, and workspace_name_p().

Referenced by open_or_create_workspace(), and start_create_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_select_menu()

void create_select_menu ( )

Definition at line 788 of file gtk_select.c.

788  {
789  GtkWidget *menu, *menu_item, *pmenu, *pmenu_item;
790 
791  create_menu_item = gtk_menu_item_new_with_label("Create");
792  g_signal_connect(G_OBJECT(create_menu_item), "activate", G_CALLBACK(
794 
795  open_menu_item = gtk_menu_item_new_with_label("Open");
796  g_signal_connect(G_OBJECT(open_menu_item), "activate", G_CALLBACK(
797  open_workspace_notify), NULL);
798 
799  close_menu_item = gtk_menu_item_new_with_label("Close");
800  g_signal_connect(G_OBJECT(close_menu_item), "activate", G_CALLBACK(
801  close_workspace_notify), NULL);
802  gtk_widget_set_sensitive(GTK_WIDGET(close_menu_item), FALSE);
803 
804  pmenu = gtk_menu_new();
805  gtk_menu_append(GTK_MENU(pmenu), open_menu_item);
806  gtk_menu_append(GTK_MENU(pmenu), create_menu_item);
807  gtk_menu_append(GTK_MENU(pmenu), close_menu_item);
808 
809  pmenu_item = gtk_menu_item_new_with_label("Deal with workspaces");
810  gtk_menu_item_set_submenu(GTK_MENU_ITEM(pmenu_item), pmenu);
811 
812  module_menu_item = gtk_menu_item_new_with_label("Module");
813  g_signal_connect(G_OBJECT(module_menu_item), "activate", G_CALLBACK(
815  gtk_widget_set_sensitive(GTK_WIDGET(module_menu_item), FALSE);
816 
817  directory_menu_item = gtk_menu_item_new_with_label("Directory");
818  g_signal_connect(G_OBJECT(directory_menu_item), "activate", G_CALLBACK(
819  start_directory_notify), NULL);
820 
821  menu = gtk_menu_new();
822  gtk_menu_append(GTK_MENU(menu), module_menu_item);
823  gtk_menu_append(GTK_MENU(menu), pmenu_item);
824  gtk_menu_append(GTK_MENU(menu), directory_menu_item);
825 
826  menu_item = gtk_menu_item_new_with_label("Selection Menu");
827  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), menu);
828 
829  gtk_widget_show(menu_item);
830  gtk_widget_show_all(menu);
831 
832  gtk_menu_bar_append(GTK_MENU_BAR(main_window_menu_bar), menu_item);
833 }
GtkWidget * main_window_menu_bar
Definition: gpips.c:62
static GtkWidget * close_menu_item
Definition: gtk_select.c:68
static GtkWidget * create_menu_item
Definition: gtk_select.c:68
static GtkWidget * open_menu_item
Definition: gtk_select.c:68
void start_directory_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:165
GtkWidget * directory_menu_item
Definition: gtk_select.c:66
static GtkWidget * module_menu_item
Definition: gtk_select.c:69
success close_workspace_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:537
void start_create_workspace_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:337
void select_module_from_menubar_callback(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:723
void open_workspace_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:508

References close_menu_item, close_workspace_notify(), create_menu_item, directory_menu_item, main_window_menu_bar, module_menu_item, open_menu_item, open_workspace_notify(), select_module_from_menubar_callback(), start_create_workspace_notify(), and start_directory_notify().

Referenced by create_menus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ direct_change_directory()

void direct_change_directory ( )

FC: uses an external wish script I do not know how to activate this function safely...

no cd in this state!

last was

generate_workspace_menu();

Definition at line 126 of file gtk_select.c.

126  {
127  char newdir[MAXPATHLEN];
128  char * tmp = strdup("/tmp/gpips.dir.XXXXXX");
129  int i = 0, c;
130  FILE * tmph;
131 
132  (void) mkstemp(tmp);
133 
135  return; /* no cd in this state! */
136 
137  safe_system(concatenate("gpips-changedir -- ", get_cwd(), " > ", tmp, NULL));
138 
139  tmph = safe_fopen(tmp, "r");
140  while ((c = getc(tmph)) != EOF && i < MAXPATHLEN)
141  newdir[i++] = c;
142  newdir[i - 1] = '\0'; /* last was \n */
143  safe_fclose(tmph, tmp);
144 
145  end_directory_notify(newdir);
146 
147  unlink(tmp);
148  free(tmp);
149 
150  return /* generate_workspace_menu(); */;
151 }
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
char * get_cwd(void)
returns the current working directory name.
Definition: file.c:486
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
void free(void *)
bool gpips_change_directory_inactive
Definition: gtk_select.c:78
success end_directory_notify(const char *dir)
Definition: gtk_select.c:103
#define MAXPATHLEN
MAXPATHLEN is defined in <sys/param.h> for SunOS...
Definition: misc-local.h:203
void safe_system(string)
system.c
Definition: system.c:38
char * strdup()

References concatenate(), end_directory_notify(), free(), get_cwd(), gpips_change_directory_inactive, MAXPATHLEN, safe_fclose(), safe_fopen(), safe_system(), and strdup().

Referenced by cd_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disable_change_directory()

void disable_change_directory ( )

In order to warn the user as soon as possible that (s)he can't change the directory, notify for whatever character:

Definition at line 186 of file gtk_select.c.

186  {
187  gtk_widget_set_sensitive(GTK_WIDGET(directory_menu_item), FALSE);
188 
189  /* In order to warn the user as soon as possible that (s)he can't
190  change the directory, notify for whatever character: */
191  gtk_widget_set_sensitive(GTK_WIDGET(directory_name_entry), FALSE);
192  g_signal_connect(G_OBJECT(directory_name_entry), "activate", G_CALLBACK(
194 
197 }
void prompt_user_not_allowed_to_change_directory(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:157
bool gpips_change_directory_inactive_old
Definition: gtk_select.c:79
GtkWidget * directory_name_entry
Definition: gtk_status.c:74

References directory_menu_item, directory_name_entry, gpips_change_directory_inactive, gpips_change_directory_inactive_old, and prompt_user_not_allowed_to_change_directory().

Referenced by end_create_workspace_notify(), end_open_workspace_notify(), execute_workspace_creation_and_so_on_given_with_options(), open_or_create_workspace(), restore_enable_change_directory_state(), start_create_workspace_notify(), and start_delete_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disable_module_selection()

void disable_module_selection ( )

Definition at line 253 of file gtk_select.c.

253  {
254  gtk_widget_set_sensitive(GTK_WIDGET(module_menu_item), FALSE);
255  gtk_widget_set_sensitive(GTK_WIDGET(module_name_entry), FALSE);
260 }
void disable_compile_selection()
Definition: gtk_compile.c:74
void disable_view_selection()
Definition: gtk_edit2.c:505
void disable_option_selection()
Definition: gtk_props.c:130
GtkWidget * module_name_entry
Definition: gtk_status.c:76
void disable_transform_selection()
Definition: gtk_transform.c:91

References disable_compile_selection(), disable_option_selection(), disable_transform_selection(), disable_view_selection(), module_menu_item, and module_name_entry.

Referenced by close_workspace_notify(), gpips_main(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ disable_workspace_close()

void disable_workspace_close ( )

For generate_module_menu():

Definition at line 234 of file gtk_select.c.

234  {
235  gtk_widget_set_sensitive(GTK_WIDGET(close_menu_item), FALSE);
238  /* For generate_module_menu(): */
240 }
bool gpips_close_workspace_menu_inactive_old
Definition: gtk_select.c:75
bool gpips_close_workspace_menu_inactive
To enable or disable the menu items generated by generate_module_menu():
Definition: gtk_select.c:74

References close_menu_item, gpips_close_workspace_menu_inactive, and gpips_close_workspace_menu_inactive_old.

Referenced by close_workspace_notify(), gpips_main(), start_delete_workspace_notify(), user_prompt_not_a_valid_workspace_name(), and wpips_main().

+ Here is the caller graph for this function:

◆ disable_workspace_create_or_open()

void disable_workspace_create_or_open ( )

Definition at line 206 of file gtk_select.c.

206  {
207  gtk_widget_set_sensitive(GTK_WIDGET(create_menu_item), FALSE);
208  gtk_widget_set_sensitive(GTK_WIDGET(open_menu_item), FALSE);
209  gtk_widget_set_sensitive(GTK_WIDGET(workspace_name_entry), FALSE);
211 }
bool gpips_create_workspace_menu_inactive
Definition: gtk_select.c:76

References create_menu_item, gpips_create_workspace_menu_inactive, open_menu_item, and workspace_name_entry.

Referenced by continue_create_workspace_notify(), open_workspace_notify(), start_create_workspace_notify(), and start_delete_workspace_notify().

+ Here is the caller graph for this function:

◆ disable_workspace_delete_or_open()

void disable_workspace_delete_or_open ( )

Avoid also to delete a workspace during a creation in case the name of the workspace is the same...

Definition at line 220 of file gtk_select.c.

220  {
221  /* Avoid also to delete a workspace during a creation in case the
222  name of the workspace is the same... */
225  gtk_widget_set_sensitive(GTK_WIDGET(workspace_name_entry), FALSE);
226 }
bool gpips_open_workspace_menu_inactive
Definition: gtk_select.c:77
bool gpips_delete_workspace_menu_inactive
Definition: gtk_select.c:78

References gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, and workspace_name_entry.

Referenced by start_create_workspace_notify(), and start_delete_workspace_notify().

+ Here is the caller graph for this function:

◆ enable_change_directory()

void enable_change_directory ( )

Enable the normal notify mode: notify when return and so is typed:

Definition at line 173 of file gtk_select.c.

173  {
174  gtk_widget_set_sensitive(GTK_WIDGET(directory_menu_item), TRUE);
175 
176  /* Enable the normal notify mode: notify when return and so is
177  typed: */
178  gtk_widget_set_sensitive(GTK_WIDGET(directory_name_entry), TRUE);
179  g_signal_connect(G_OBJECT(directory_name_entry), "activate", G_CALLBACK(
181 
184 }
void end_directory_text_notify(GtkWidget *text_item, gpointer data)
Definition: gtk_select.c:119

References directory_menu_item, directory_name_entry, end_directory_text_notify(), gpips_change_directory_inactive, and gpips_change_directory_inactive_old.

Referenced by cancel_create_workspace_notify(), cancel_open_workspace_notify(), close_workspace_notify(), end_create_workspace_notify(), gpips_main(), restore_enable_change_directory_state(), user_prompt_not_a_valid_workspace_name(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enable_module_selection()

void enable_module_selection ( )

Well, after a workspace creation without automatic module selection successful, there is no module selected and thus the following menus are not very interestiong, except for the option part of the option selection. Anyway, there is a guard in each of these menu, so, just do nothing... :-)

Definition at line 262 of file gtk_select.c.

262  {
263  gtk_widget_set_sensitive(GTK_WIDGET(module_menu_item), TRUE);
264  gtk_widget_set_sensitive(GTK_WIDGET(module_name_entry), TRUE);
265  /* Well, after a workspace creation without automatic module
266  selection successful, there is no module selected and thus the
267  following menus are not very interestiong, except for the option
268  part of the option selection. Anyway, there is a guard in each
269  of these menu, so, just do nothing... :-) */
274 }
void enable_compile_selection()
Definition: gtk_compile.c:78
void enable_view_selection()
Definition: gtk_edit2.c:509
void enable_option_selection()
Definition: gtk_props.c:134
void enable_transform_selection()
Definition: gtk_transform.c:95

References enable_compile_selection(), enable_option_selection(), enable_transform_selection(), enable_view_selection(), module_menu_item, and module_name_entry.

Referenced by end_create_workspace_notify(), end_open_workspace_notify(), and execute_workspace_creation_and_so_on_given_with_options().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enable_workspace_close()

void enable_workspace_close ( )

For generate_module_menu():

Definition at line 242 of file gtk_select.c.

242  {
243  gtk_widget_set_sensitive(GTK_WIDGET(close_menu_item), TRUE);
244  /* For generate_module_menu(): */
246 }

References close_menu_item, and gpips_close_workspace_menu_inactive.

Referenced by end_create_workspace_notify(), end_open_workspace_notify(), and execute_workspace_creation_and_so_on_given_with_options().

+ Here is the caller graph for this function:

◆ enable_workspace_create_or_open()

void enable_workspace_create_or_open ( )

◆ enable_workspace_delete_or_open()

void enable_workspace_delete_or_open ( )

Definition at line 228 of file gtk_select.c.

228  {
231  gtk_widget_set_sensitive(GTK_WIDGET(workspace_name_entry), TRUE);
232 }

References gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, and workspace_name_entry.

Referenced by cancel_create_workspace_notify(), cancel_delete_workspace_notify(), end_create_workspace_notify(), and end_delete_workspace_notify().

+ Here is the caller graph for this function:

◆ end_create_workspace_notify()

void end_create_workspace_notify ( gen_array_t  files)

If the user click quickly on OK, be sure end_create_workspace_notify() is not reentrant by verifying something as not been opened already:

Is the name a valid workspace name?

The create workspace has been successful:

open_log_file();

The processing of user files has been successful:

close_log_file();

The creation failed:

Definition at line 440 of file gtk_select.c.

440  {
441  /* If the user click quickly on OK, be sure
442  end_create_workspace_notify() is not reentrant by verifying
443  something as not been opened already: */
444  const char* workspace_name_to_create = gtk_entry_get_text(GTK_ENTRY(
446  if (db_get_current_workspace_name() == NULL) {
447  /* Is the name a valid workspace name? */
450  /* The create workspace has been successful: */
451  /* open_log_file(); */
453 
454  if (create_workspace(files)) {
455  /* The processing of user files has been successful: */
457 
458  show_workspace();
462 
465 
467 
468  return;
469  } else
470  /* close_log_file(); */
471  ;
472  }
473  } else
475 
476  /* The creation failed: */
480 
482  }
483 }
bool create_workspace(gen_array_t files)
FI: should be called "initialize_workspace()"; a previous call to db_create_workspace() is useful to ...
Definition: dbm.c:180
void enable_module_selection()
Definition: gtk_select.c:262
void disable_change_directory()
Definition: gtk_select.c:186
void enable_workspace_close()
Definition: gtk_select.c:242
void select_a_module_by_default()
Try to select a main module (that is the PROGRAM in the Fortran stuff) if no one is selected:
Definition: gtk_select.c:83
bool db_create_workspace(const char *)
Definition: workspace.c:282
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...
Definition: workspace.c:82
static char * workspace_name_to_create
Definition: xv_select.c:70

References create_workspace(), db_create_workspace(), db_get_current_workspace_name(), disable_change_directory(), display_memory_usage(), enable_change_directory(), enable_module_selection(), enable_workspace_close(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), select_a_module_by_default(), show_workspace(), user_prompt_not_a_valid_workspace_name(), workspace_name_entry, workspace_name_p(), and workspace_name_to_create.

Referenced by continue_create_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_delete_workspace_notify()

void end_delete_workspace_notify ( const char *  name)

Definition at line 276 of file gtk_select.c.

276  {
277  schoose_close();
278 
279  if (db_get_current_workspace_name() != NULL && strcmp(
280  db_get_current_workspace_name(), name) == 0) {
281  int result;
282 
283  GtkWidget * dialog = gtk_message_dialog_new(GTK_WINDOW(log_window),
284  GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,
285  GTK_BUTTONS_YES_NO, "%s", concatenate("The workspace ", name,
286  " is currently opened!\n",
287  "Do you really want to close and remove it ?", NULL));
288  result = gtk_dialog_run(GTK_DIALOG(dialog));
289  gtk_widget_destroy(dialog);
290 
291  if (result == GTK_RESPONSE_NO || !close_workspace_notify(NULL, NULL))
292  goto do_not_delete_the_workspace;
293  }
294 
295  (void) delete_workspace(name);
296 
297  do_not_delete_the_workspace: enable_workspace_delete_or_open();
301 
303 }
bool delete_workspace(const char *wname)
Definition: dbm.c:368
void schoose_close()
schoose_close() can be called even when schoose window is already closed.
Definition: gtk_schoose2.c:113

References close_workspace_notify(), concatenate(), db_get_current_workspace_name(), delete_workspace(), display_memory_usage(), enable_workspace_create_or_open(), enable_workspace_delete_or_open(), log_window, restore_enable_change_directory_state(), restore_enable_workspace_close_state(), and schoose_close().

Referenced by start_delete_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_directory_notify()

success end_directory_notify ( const char *  dir)

if (dir != NULL) {

Definition at line 103 of file gtk_select.c.

103  {
104  char *s;
105 
106  /* if (dir != NULL) {*/
107  if ((s = pips_change_directory(dir)) == NULL) {
108  user_log("Directory \"%s\" does not exist\n", dir);
109  prompt_user("Directory \"%s\" does not exist\n", dir);
110  show_directory();
111  return FALSE;
112  } else {
113  user_log("Directory \"%s\" selected\n", dir);
114  show_directory();
115  return TRUE;
116  }
117 }
void show_directory()
Definition: gtk_status.c:118
string pips_change_directory(const char *)
Change to the given directory if it exists and return a canonical name.
Definition: source_file.c:142

References pips_change_directory(), prompt_user(), show_directory(), and user_log().

Referenced by create_status_subwindow(), direct_change_directory(), end_directory_notify_callback(), end_directory_text_notify(), generate_a_directory_menu_notify(), and start_directory_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_directory_text_notify()

void end_directory_text_notify ( GtkWidget *  text_item,
gpointer  data 
)

Definition at line 119 of file gtk_select.c.

119  {
120  (void) end_directory_notify(gtk_entry_get_text(GTK_ENTRY(text_item)));
121 }

References end_directory_notify().

Referenced by enable_change_directory().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_open_workspace_notify()

void end_open_workspace_notify ( const char *  name)

open_log_file();

Definition at line 485 of file gtk_select.c.

485  {
486  schoose_close();
487 
488  if (open_workspace(name)) {
489  /* open_log_file(); */
491  show_workspace();
495  }
496 
498 
500 }
bool open_workspace(const char *name)
should be: success (cf wpips.h)
Definition: dbm.c:309

References disable_change_directory(), display_memory_usage(), enable_module_selection(), enable_workspace_close(), enable_workspace_create_or_open(), open_workspace(), schoose_close(), select_a_module_by_default(), and show_workspace().

Referenced by open_or_create_workspace(), and open_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_select_module_callback()

void end_select_module_callback ( const char *  name)

Definition at line 691 of file gtk_select.c.

691  {
692  gen_array_t module_list = db_get_module_list();
693  int module_list_length = gen_array_nitems(module_list);
694 
695  if (module_list_length == 0) {
696  prompt_user("No module available in this workspace.");
697  } else {
698  bool module_found = FALSE;
699  int i;
700 
701  for (i = 0; i < module_list_length; i++) {
702  string mn = gen_array_item(module_list, i);
703  if (strcmp(name, mn) == 0) {
704  module_found = TRUE;
705  break;
706  }
707  }
708  if (module_found)
709  lazy_open_module(name);
710  else
711  prompt_user("The module \"%s\" does not exist in this workspace.",
712  name);
713  }
714 
715  show_module();
717  gen_array_full_free(module_list);
718 }
bool lazy_open_module(const char *name)
Do not open a module already opened :
Definition: dbm.c:289
gen_array_t db_get_module_list(void)
Get an array of all the modules (functions, procedures and compilation units) of a workspace.
Definition: database.c:1266

References db_get_module_list(), display_memory_usage(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), lazy_open_module(), prompt_user(), and show_module().

Referenced by create_module_entry(), execute_workspace_creation_and_so_on_given_with_options(), select_a_module_by_default(), select_module_from_menubar_callback(), and select_module_from_status_menu_callback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_directory_menu()

GtkWidget* generate_directory_menu ( )

Definition at line 153 of file gtk_select.c.

153  {
155 }
GtkWidget * generate_a_directory_menu(char *directory)

References generate_a_directory_menu(), and get_cwd().

Referenced by create_status_subwindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_module_menu()

GtkWidget* generate_module_menu ( )

participe à la génération du menu associés aux modules dans la fenetre principale

Definition at line 749 of file gtk_select.c.

749  {
750  GtkWidget * menu;
751  int i;
752 
753  menu = gtk_menu_new();
754 
755  if (db_get_current_workspace_name() == NULL) {
756  GtkWidget * no_workspace_menu_item;
757  no_workspace_menu_item = gtk_menu_item_new_with_label(
758  "* No workspace yet! *");
759  gtk_widget_set_sensitive(no_workspace_menu_item, FALSE);
760  gtk_menu_append(GTK_MENU(menu), no_workspace_menu_item);
761  } else {
762  gen_array_t module_list = db_get_module_list();
763  int module_list_length = gen_array_nitems(module_list);
764 
765  if (module_list_length == 0) {
766  GtkWidget * no_workspace_menu_item;
767  no_workspace_menu_item = gtk_menu_item_new_with_label(
768  "* No module available in this workspace *");
769  gtk_widget_set_sensitive(no_workspace_menu_item, FALSE);
770  gtk_menu_append(GTK_MENU(menu), no_workspace_menu_item);
771  } else {
772  GtkWidget * module_menu_item;
773  for (i = 0; i < module_list_length; i++) {
774  string mn = gen_array_item(module_list, i);
775  module_menu_item = gtk_menu_item_new_with_label(mn);
776  gtk_menu_append(GTK_MENU(menu), module_menu_item);
777  g_signal_connect(G_OBJECT(module_menu_item), "activate",
778  G_CALLBACK(select_module_from_status_menu_callback), NULL);
779  }
780  }
781  gen_array_full_free(module_list);
782  }
783 
784  gtk_widget_show_all(menu);
785  return menu;
786 }
static void select_module_from_status_menu_callback(GtkWidget *widget, gpointer data __attribute__((unused)))
Definition: gtk_select.c:741

References db_get_current_workspace_name(), db_get_module_list(), gen_array_full_free(), gen_array_item(), gen_array_nitems(), module_menu_item, and select_module_from_status_menu_callback().

Referenced by create_status_subwindow(), and regenerate_module_menu_callback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generate_workspace_menu()

GtkWidget* generate_workspace_menu ( )

To use with schoose_create_abbrev_menu_with_text:

Replace the Select Workspace menu from the status window with the following items:

Now complete with the list of the workspaces:

Well, since there is no workspace, there is nothing to delete...

Definition at line 625 of file gtk_select.c.

625  {
626  GtkWidget * menu;
627 
628  GtkWidget * delete_menu_item;
629  int i;
630  gen_array_t workspace_list;
631  int workspace_list_length = 0;
632 
633  workspace_list = gen_array_make(0);
634  pips_get_workspace_list(workspace_list);
635  workspace_list_length = gen_array_nitems(workspace_list);
636 
637  menu = gtk_menu_new();
638 
639  /* Replace the Select Workspace menu from the status window with
640  the following items: */
641  GtkWidget * temp_item;
642 
643  temp_item = gtk_menu_item_new_with_label("Create Workspace");
644  g_signal_connect(G_OBJECT(temp_item), "activate",
645  G_CALLBACK(start_create_workspace_notify), NULL);
646  gtk_menu_append(GTK_MENU(menu), temp_item);
647  gtk_widget_set_sensitive(temp_item, !gpips_create_workspace_menu_inactive);
648 
649  temp_item = gtk_menu_item_new_with_label("Close Workspace");
650  g_signal_connect(G_OBJECT(temp_item), "activate", G_CALLBACK(close_workspace_notify),
651  NULL);
652  gtk_menu_append(GTK_MENU(menu), temp_item);
653  gtk_widget_set_sensitive(temp_item, !gpips_close_workspace_menu_inactive);
654 
655  delete_menu_item = gtk_menu_item_new_with_label("Delete Workspace");
656  g_signal_connect(G_OBJECT(delete_menu_item), "activate",
657  G_CALLBACK(start_delete_workspace_notify), NULL);
658  gtk_menu_append(GTK_MENU(menu), delete_menu_item);
659  gtk_widget_set_sensitive(delete_menu_item,
661 
662  /* Now complete with the list of the workspaces: */
663  if (workspace_list_length == 0) {
664  temp_item = gtk_menu_item_new_with_label(
665  "* No workspace available in this directory *");
666  gtk_menu_append(GTK_MENU(menu), temp_item);
667  gtk_widget_set_sensitive(temp_item, FALSE);
668  /* Well, since there is no workspace, there is nothing to
669  delete... */
670  gtk_widget_set_sensitive(delete_menu_item, FALSE);
671  } else {
672  gtk_menu_append(GTK_MENU(menu), gtk_separator_menu_item_new());
673  for (i = 0; i < workspace_list_length; i++) {
674  string name = gen_array_item(workspace_list, i);
675  temp_item = gtk_menu_item_new_with_label(name);
676  gtk_menu_append(GTK_MENU(menu), temp_item);
677  g_signal_connect(G_OBJECT(temp_item), "activate",
678  G_CALLBACK(select_workspace_notify), NULL);
679  gtk_widget_set_sensitive(temp_item,
681  }
682  }
683 
684  gen_array_full_free(workspace_list);
685 
686  gtk_widget_show_all(menu);
687 
688  return menu;
689 }
void start_delete_workspace_notify(GtkWidget *widget, gpointer data)
Definition: gtk_select.c:313
void select_workspace_notify(GtkWidget *w, gpointer data __attribute__((unused)))
Definition: gtk_select.c:618
void pips_get_workspace_list(gen_array_t)
cproto-generated files
Definition: source_file.c:74

References close_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), gpips_close_workspace_menu_inactive, gpips_create_workspace_menu_inactive, gpips_delete_workspace_menu_inactive, gpips_open_workspace_menu_inactive, pips_get_workspace_list(), select_workspace_notify(), start_create_workspace_notify(), and start_delete_workspace_notify().

Referenced by create_status_subwindow(), and regenerate_workspace_menu_callback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_or_create_workspace()

void open_or_create_workspace ( const char *  workspace_name_original)

To be used with schoose_create_abbrev_menu_with_text from the main panel:

If close_workspace_notify() is called below, show_workspace() will set the name to "(* none *)" in the panel and workspace_name_original is directly a pointer to it !

Prompt the warning and restore the menu enable state:

There is an open workspace: close it first:

To choose between open or create, look for the an existing workspace with the same name:

OK, the workspace exists, open it:

The workspace does not exist, create it:

Definition at line 570 of file gtk_select.c.

570  {
571  int i;
572  gen_array_t workspace_list;
573  int workspace_list_length = 0;
574  char workspace_name[SMALL_BUFFER_LENGTH];
575 
576  /* If close_workspace_notify() is called below, show_workspace() will
577  set the name to "(* none *)" in the panel and
578  workspace_name_original is directly a pointer to it ! */
579  (void) strncpy(workspace_name, workspace_name_original,
580  sizeof(workspace_name) - 1);
581 
582  if (!workspace_name_p(workspace_name)) {
583  /* Prompt the warning and restore the menu enable state: */
585  show_workspace();
586  return;
587  }
588 
589  if (db_get_current_workspace_name() != NULL)
590  /* There is an open workspace: close it first: */
591  if (!close_workspace_notify(NULL, NULL))
592  return;
593 
594  /* To choose between open or create, look for the an existing
595  workspace with the same name: */
596  workspace_list = gen_array_make(0);
597  pips_get_workspace_list(workspace_list);
598  workspace_list_length = gen_array_nitems(workspace_list);
599 
600  for (i = 0; i < workspace_list_length; i++) {
601  string name = gen_array_item(workspace_list, i);
602  if (strcmp(workspace_name, name) == 0) {
603  /* OK, the workspace exists, open it: */
604  end_open_workspace_notify(workspace_name);
605  return;
606  }
607  }
608  /* The workspace does not exist, create it: */
610  gen_array_full_free(workspace_list);
611  (void) continue_create_workspace_notify(workspace_name);
612 }
#define SMALL_BUFFER_LENGTH
Definition: gpips-local.h:24
void end_open_workspace_notify(const char *name)
Definition: gtk_select.c:485
success continue_create_workspace_notify(const char *name)
Definition: gtk_select.c:366

References close_workspace_notify(), continue_create_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), end_open_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), show_workspace(), SMALL_BUFFER_LENGTH, user_prompt_not_a_valid_workspace_name(), and workspace_name_p().

Referenced by create_status_subwindow(), and open_or_create_workspace_callback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_workspace_notify()

void open_workspace_notify ( GtkWidget *  widget,
gpointer  data 
)

There is only workspace: open it without asking confirmation to the user:

Choix initial sur le workspace courant si possible :

Definition at line 508 of file gtk_select.c.

508  {
509  gen_array_t workspace_list;
510  int workspace_list_length = 0;
511 
512  workspace_list = gen_array_make(0);
513  pips_get_workspace_list(workspace_list);
514  workspace_list_length = gen_array_nitems(workspace_list);
515 
516  if (workspace_list_length == 0) {
517  prompt_user("No workspace available in this directory.");
518  } else if (workspace_list_length == 1) {
519  /* There is only workspace: open it without asking confirmation
520  to the user: */
521  user_log("There is only one workspace in the current directory.\n"
522  "\tOpening the workspace \"%s\"...\n", gen_array_item(
523  workspace_list, 0));
524  end_open_workspace_notify(gen_array_item(workspace_list, 0));
525  } else {
527 
528  schoose("Select Workspace", workspace_list,
529  /* Choix initial sur le workspace courant si
530  possible : */
533  }
534  gen_array_full_free(workspace_list);
535 }
void schoose(char *title, gen_array_t array, char *initial_choice, void(*function_for_ok)(const char *), void(*function_for_cancel)(void))
Definition: gtk_schoose2.c:150
void cancel_open_workspace_notify()
Definition: gtk_select.c:502

References cancel_open_workspace_notify(), db_get_current_workspace_name(), disable_workspace_create_or_open(), end_open_workspace_notify(), gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), prompt_user(), schoose(), and user_log().

Referenced by create_select_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prompt_user_not_allowed_to_change_directory()

void prompt_user_not_allowed_to_change_directory ( GtkWidget *  widget,
gpointer  data 
)

First untype whatever the user typed:

Definition at line 157 of file gtk_select.c.

158  {
159  /* First untype whatever the user typed: */
160  show_directory();
161  prompt_user("You have to close the current workspace"
162  " before changing directory.");
163 }

References prompt_user(), and show_directory().

Referenced by disable_change_directory(), and start_directory_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restore_enable_change_directory_state()

static void restore_enable_change_directory_state ( )
static

Definition at line 199 of file gtk_select.c.

199  {
202  else
204 }

References disable_change_directory(), enable_change_directory(), and gpips_change_directory_inactive_old.

Referenced by cancel_delete_workspace_notify(), and end_delete_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restore_enable_workspace_close_state()

void restore_enable_workspace_close_state ( )

◆ select_a_module_by_default()

void select_a_module_by_default ( )

Try to select a main module (that is the PROGRAM in the Fortran stuff) if no one is selected:

Ok, no current module, then find a main module (PROGRAM):

Ok, we got it ! Now we select it:

GO: show_module() has already been called so return now

Refresh the module name on the status window:

Definition at line 83 of file gtk_select.c.

83  {
85 
86  if (module_name == NULL) {
87  /* Ok, no current module, then find a main module (PROGRAM): */
88  string main_module_name = get_first_main_module();
89 
90  if (!string_undefined_p(main_module_name)) {
91  /* Ok, we got it ! Now we select it: */
92  module_name = main_module_name;
93  user_log("Main module PROGRAM \"%s\" found.\n", module_name);
95  /* GO: show_module() has already been called so return now */
96  return;
97  }
98  }
99  /* Refresh the module name on the status window: */
100  show_module();
101 }
string db_get_current_module_name(void)
Also used to check whether set...
Definition: database.c:1059
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
void end_select_module_callback(const char *name)
Definition: gtk_select.c:691
#define string_undefined_p(s)
Definition: newgen_types.h:41
string get_first_main_module(void)
Should be able to handle Fortran applications, C applications and mixed Fortran/C applications.
Definition: pipsmake.c:1525

References db_get_current_module_name(), end_select_module_callback(), get_first_main_module(), module_name(), show_module(), string_undefined_p, and user_log().

Referenced by end_create_workspace_notify(), and end_open_workspace_notify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select_module_from_menubar_callback()

void select_module_from_menubar_callback ( GtkWidget *  widget,
gpointer  data 
)

If there is no module... RK, 23/1/1993.

Affiche comme choix courant le module courant (c'est utile si on ferme la fenï¿œtre module entre temps) :

Definition at line 723 of file gtk_select.c.

723  {
724  gen_array_t module_list = db_get_module_list();
725  int module_list_length = gen_array_nitems(module_list);
726 
727  if (module_list_length == 0) {
728  /* If there is no module... RK, 23/1/1993. */
729  prompt_user("No module available in this workspace.");
730  } else
731  schoose("Select Module", module_list,
732  /* Affiche comme choix courant le module
733  courant (c'est utile si on ferme la fenï¿œtre
734  module entre temps) : */
737 
738  gen_array_full_free(module_list);
739 }
void cancel_select_module_notify(void)
Definition: gtk_select.c:720

References cancel_select_module_notify(), db_get_current_module_name(), db_get_module_list(), end_select_module_callback(), gen_array_full_free(), gen_array_nitems(), prompt_user(), and schoose().

Referenced by create_select_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select_module_from_status_menu_callback()

static void select_module_from_status_menu_callback ( GtkWidget *  widget,
gpointer data   __attribute__(unused) 
)
static

Definition at line 741 of file gtk_select.c.

742 {
743  const char * module_name = gpips_gtk_menu_item_get_label(widget);
744  gtk_entry_set_text(GTK_ENTRY(module_name_entry), module_name);
746 }
const char * gpips_gtk_menu_item_get_label(GtkWidget *w)
Definition: gtk_utils.c:43

References end_select_module_callback(), gpips_gtk_menu_item_get_label(), module_name(), and module_name_entry.

Referenced by generate_module_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select_workspace_notify()

void select_workspace_notify ( GtkWidget *  w,
gpointer data   __attribute__(unused) 
)

Definition at line 618 of file gtk_select.c.

618  {
619  gtk_entry_set_text(GTK_ENTRY(workspace_name_entry),
621  g_signal_emit_by_name(workspace_name_entry, "activate");
622 }

References gpips_gtk_menu_item_get_label(), and workspace_name_entry.

Referenced by generate_workspace_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_create_workspace_notify()

void start_create_workspace_notify ( GtkWidget *  widget,
gpointer  data 
)

There is an open workspace: close it first:

If it fails:

Pas la peine de faire quelque chose si on appuie sur cancel :

Definition at line 337 of file gtk_select.c.

337  {
341 
342  if (db_get_current_workspace_name() != NULL)
343  /* There is an open workspace: close it first: */
344  if (!close_workspace_notify(NULL, NULL)) {
345  /* If it fails: */
346  cancel_create_workspace_notify(NULL, NULL);
347  return;
348  }
349 
350  start_query("Create Workspace", "Enter workspace name: ",
351  "CreateWorkspace", continue_create_workspace_notify,
352  /* Pas la peine de faire quelque chose si on appuie
353  sur cancel : */
355 }
void start_query(char *window_title, char *query_title, char *help_topic, success(*ok_func)(const char *), void(*cancel_func)(GtkWidget *, gpointer))
Definition: gtk_query.c:47
void disable_workspace_delete_or_open()
Definition: gtk_select.c:220

References cancel_create_workspace_notify(), close_workspace_notify(), continue_create_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), disable_workspace_create_or_open(), disable_workspace_delete_or_open(), and start_query().

Referenced by create_select_menu(), and generate_workspace_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_delete_workspace_notify()

void start_delete_workspace_notify ( GtkWidget *  widget,
gpointer  data 
)

current workspace as default choice :

Definition at line 313 of file gtk_select.c.

313  {
314  gen_array_t workspace_list;
315  int workspace_list_length = 0;
316 
317  workspace_list = gen_array_make(0);
318  pips_get_workspace_list(workspace_list);
319  workspace_list_length = gen_array_nitems(workspace_list);
320 
321  if (workspace_list_length == 0) {
322  prompt_user("No workspace available in this directory.");
323  } else {
328 
329  schoose("Select the Workspace to Delete", workspace_list,
330  /* current workspace as default choice : */
333  }
334  gen_array_full_free(workspace_list);
335 }
void end_delete_workspace_notify(const char *name)
Definition: gtk_select.c:276
void cancel_delete_workspace_notify()
Definition: gtk_select.c:305

References cancel_delete_workspace_notify(), db_get_current_workspace_name(), disable_change_directory(), disable_workspace_close(), disable_workspace_create_or_open(), disable_workspace_delete_or_open(), end_delete_workspace_notify(), gen_array_full_free(), gen_array_make(), gen_array_nitems(), pips_get_workspace_list(), prompt_user(), and schoose().

Referenced by generate_workspace_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_directory_notify()

void start_directory_notify ( GtkWidget *  widget,
gpointer  data 
)

Definition at line 165 of file gtk_select.c.

165  {
168  else
169  start_query("Change Directory", "Enter directory path: ",
170  "ChangeDirectory", end_directory_notify, cancel_query_notify);
171 }

References cancel_query_notify(), db_get_current_workspace_name(), end_directory_notify(), prompt_user_not_allowed_to_change_directory(), and start_query().

Referenced by create_select_menu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ user_prompt_not_a_valid_workspace_name()

void user_prompt_not_a_valid_workspace_name ( const char *  workspace_name)

Definition at line 432 of file gtk_select.c.

432  {
433  prompt_user("The name \"%s\" is not a valid workspace name!\n",
434  workspace_name);
438 }

References disable_workspace_close(), enable_change_directory(), enable_workspace_create_or_open(), and prompt_user().

Referenced by continue_create_workspace_notify(), end_create_workspace_notify(), and open_or_create_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ close_menu_item

GtkWidget * close_menu_item
static

◆ create_menu_item

GtkWidget* create_menu_item
static

◆ directory_menu_item

GtkWidget* directory_menu_item

◆ gpips_change_directory_inactive

bool gpips_change_directory_inactive

◆ gpips_change_directory_inactive_old

bool gpips_change_directory_inactive_old

◆ gpips_close_workspace_menu_inactive

bool gpips_close_workspace_menu_inactive

To enable or disable the menu items generated by generate_module_menu():

Definition at line 74 of file gtk_select.c.

Referenced by disable_workspace_close(), enable_workspace_close(), generate_workspace_menu(), and restore_enable_workspace_close_state().

◆ gpips_close_workspace_menu_inactive_old

bool gpips_close_workspace_menu_inactive_old

Definition at line 75 of file gtk_select.c.

Referenced by disable_workspace_close(), and restore_enable_workspace_close_state().

◆ gpips_create_workspace_menu_inactive

bool gpips_create_workspace_menu_inactive

◆ gpips_delete_workspace_menu_inactive

bool gpips_delete_workspace_menu_inactive

◆ gpips_open_workspace_menu_inactive

bool gpips_open_workspace_menu_inactive

◆ module_menu_item

GtkWidget * module_menu_item
static

◆ open_menu_item

GtkWidget * open_menu_item
static