25 #include "pips_config.h"
30 #include <sys/resource.h>
46 #define QUICK_QUIT "Quit without saving"
47 #define CLOSE_QUIT "Close (save) the Workspace & Quit"
48 #define DELETE_QUIT "Delete the Workspace & Quit"
49 #define CD_HACK_QUIT "Change Directory (tcl/tk hack)"
62 string fmt =
"Workspace %s not closed";
65 const char *menu_string;
67 str2 =
"Do you really want to quit PIPS?";
72 str1 =
"-=< Resources can get lost! >=-";
74 sprintf(str, fmt, pn);
76 GtkWidget * dialog = gtk_message_dialog_new(GTK_WINDOW(
main_window),
77 GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO,
78 GTK_BUTTONS_YES_NO,
"%s%s%s",str,str1,str2);
79 result = gtk_dialog_run(GTK_DIALOG(dialog));
81 if (result == GTK_RESPONSE_NO)
109 GtkWidget * quit_menu;
111 quit_menu = gtk_menu_new();
113 gtk_menu_item_set_submenu(GTK_MENU_ITEM(
quit_menu_item), quit_menu);
115 GtkWidget * menu_item;
117 menu_item = gtk_menu_item_new_with_label(
CLOSE_QUIT);
118 g_signal_connect(G_OBJECT(menu_item),
"activate", G_CALLBACK(
quit_notify),
120 gtk_menu_append(GTK_MENU(quit_menu), menu_item);
122 menu_item = gtk_menu_item_new_with_label(
QUICK_QUIT);
123 g_signal_connect(G_OBJECT(menu_item),
"activate", G_CALLBACK(
quit_notify),
125 gtk_menu_append(GTK_MENU(quit_menu), menu_item);
127 menu_item = gtk_menu_item_new_with_label(
DELETE_QUIT);
128 g_signal_connect(G_OBJECT(menu_item),
"activate", G_CALLBACK(
quit_notify),
130 gtk_menu_append(GTK_MENU(quit_menu), menu_item);
133 g_signal_connect(G_OBJECT(menu_item),
"activate", G_CALLBACK(
cd_notify),
135 gtk_menu_append(GTK_MENU(quit_menu), menu_item);
138 gtk_widget_show_all(quit_menu);
bool close_workspace(bool is_quit)
bool check_delete_workspace(const char *wname, bool check)
GtkWidget * edit_window[MAX_NUMBER_OF_GPIPS_WINDOWS]
int number_of_gpips_windows
#define SMALL_BUFFER_LENGTH
GtkWidget * main_window_menu_bar
void quit_notify(GtkWidget *widget, gpointer data)
void cd_notify(GtkWidget *widget, gpointer data)
void create_quit_button()
GtkWidget * quit_menu_item
void direct_change_directory()
FC: uses an external wish script I do not know how to activate this function safely....
const char * gpips_gtk_menu_item_get_label(GtkWidget *w)
string db_get_current_workspace_name(void)
the function is used to check that there is some current workspace...