File: selection.c

package info (click to toggle)
evms 1.0.0-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,168 kB
  • ctags: 5,853
  • sloc: ansic: 87,317; makefile: 691; sh: 238
file content (279 lines) | stat: -rw-r--r-- 16,610 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>

#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>

#include "selection_cb.h"
#include "selection.h"
#include "support.h"

GtkWidget*
create_selection_window (void)
{
  GtkWidget *selection_window;
  GtkWidget *selection_window_vbox;
  GtkWidget *selection_window_frame;
  GtkWidget *selection_window_scrolledwindow;
  GtkWidget *selection_window_clist;
  GtkWidget *selection_window_clist_label_1;
  GtkWidget *selection_window_clist_label_2;
  GtkWidget *selection_window_clist_label_3;
  GtkWidget *selection_window_clist_label_4;
  GtkWidget *selection_window_instruction_label;
  GtkWidget *selection_window_hseparator;
  GtkWidget *hbox1;
  GtkWidget *hbuttonbox1;
  GtkWidget *help_button;
  GtkWidget *selection_window_hbuttonbox;
  GtkWidget *selection_window_cancel_button;
  GtkWidget *selection_window_prev_button;
  GtkWidget *selection_window_prev_button_hbox;
  GtkWidget *selection_window_prev_button_arrow;
  GtkWidget *selection_window_prev_button_label;
  GtkWidget *selection_window_next_button;
  GtkWidget *selection_window_next_button_hbox;
  GtkWidget *selection_window_next_button_label;
  GtkWidget *selection_window_next_button_arrow;
  GtkTooltips *tooltips;

  tooltips = gtk_tooltips_new ();

  selection_window = gtk_window_new (GTK_WINDOW_DIALOG);
  gtk_widget_set_name (selection_window, "selection_window");
  gtk_object_set_data (GTK_OBJECT (selection_window), "selection_window", selection_window);
  gtk_widget_set_usize (selection_window, 630, 475);
  gtk_window_set_position (GTK_WINDOW (selection_window), GTK_WIN_POS_CENTER);
  gtk_window_set_policy (GTK_WINDOW (selection_window), FALSE, FALSE, FALSE);

  selection_window_vbox = gtk_vbox_new (FALSE, 0);
  gtk_widget_set_name (selection_window_vbox, "selection_window_vbox");
  gtk_widget_ref (selection_window_vbox);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_vbox", selection_window_vbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_vbox);
  gtk_container_add (GTK_CONTAINER (selection_window), selection_window_vbox);

  selection_window_frame = gtk_frame_new (NULL);
  gtk_widget_set_name (selection_window_frame, "selection_window_frame");
  gtk_widget_ref (selection_window_frame);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_frame", selection_window_frame,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_frame);
  gtk_box_pack_start (GTK_BOX (selection_window_vbox), selection_window_frame, TRUE, TRUE, 0);
  gtk_widget_set_usize (selection_window_frame, 213, 300);
  gtk_container_set_border_width (GTK_CONTAINER (selection_window_frame), 3);

  selection_window_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
  gtk_widget_set_name (selection_window_scrolledwindow, "selection_window_scrolledwindow");
  gtk_widget_ref (selection_window_scrolledwindow);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_scrolledwindow", selection_window_scrolledwindow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_scrolledwindow);
  gtk_container_add (GTK_CONTAINER (selection_window_frame), selection_window_scrolledwindow);
  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (selection_window_scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

  selection_window_clist = gtk_clist_new (4);
  gtk_widget_set_name (selection_window_clist, "selection_window_clist");
  gtk_widget_ref (selection_window_clist);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_clist", selection_window_clist,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_clist);
  gtk_container_add (GTK_CONTAINER (selection_window_scrolledwindow), selection_window_clist);
  gtk_container_set_border_width (GTK_CONTAINER (selection_window_clist), 12);
  gtk_clist_set_column_width (GTK_CLIST (selection_window_clist), 0, 24);
  gtk_clist_set_column_width (GTK_CLIST (selection_window_clist), 1, 61);
  gtk_clist_set_column_width (GTK_CLIST (selection_window_clist), 2, 61);
  gtk_clist_set_column_width (GTK_CLIST (selection_window_clist), 3, 80);
  gtk_clist_column_titles_show (GTK_CLIST (selection_window_clist));

  selection_window_clist_label_1 = gtk_label_new ("");
  gtk_widget_set_name (selection_window_clist_label_1, "selection_window_clist_label_1");
  gtk_widget_ref (selection_window_clist_label_1);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_clist_label_1", selection_window_clist_label_1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_clist_label_1);
  gtk_clist_set_column_widget (GTK_CLIST (selection_window_clist), 0, selection_window_clist_label_1);
  gtk_widget_set_sensitive (selection_window_clist_label_1, FALSE);

  selection_window_clist_label_2 = gtk_label_new ("");
  gtk_widget_set_name (selection_window_clist_label_2, "selection_window_clist_label_2");
  gtk_widget_ref (selection_window_clist_label_2);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_clist_label_2", selection_window_clist_label_2,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_clist_label_2);
  gtk_clist_set_column_widget (GTK_CLIST (selection_window_clist), 1, selection_window_clist_label_2);
  gtk_widget_set_sensitive (selection_window_clist_label_2, FALSE);

  selection_window_clist_label_3 = gtk_label_new ("");
  gtk_widget_set_name (selection_window_clist_label_3, "selection_window_clist_label_3");
  gtk_widget_ref (selection_window_clist_label_3);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_clist_label_3", selection_window_clist_label_3,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_clist_label_3);
  gtk_clist_set_column_widget (GTK_CLIST (selection_window_clist), 2, selection_window_clist_label_3);
  gtk_widget_set_sensitive (selection_window_clist_label_3, FALSE);

  selection_window_clist_label_4 = gtk_label_new ("");
  gtk_widget_set_name (selection_window_clist_label_4, "selection_window_clist_label_4");
  gtk_widget_ref (selection_window_clist_label_4);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_clist_label_4", selection_window_clist_label_4,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_clist_label_4);
  gtk_clist_set_column_widget (GTK_CLIST (selection_window_clist), 3, selection_window_clist_label_4);
  gtk_widget_set_sensitive (selection_window_clist_label_4, FALSE);

  selection_window_instruction_label = gtk_label_new (_("Make a selection from the list shown above and then choose Next to continue"));
  gtk_widget_set_name (selection_window_instruction_label, "selection_window_instruction_label");
  gtk_widget_ref (selection_window_instruction_label);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_instruction_label", selection_window_instruction_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_instruction_label);
  gtk_box_pack_start (GTK_BOX (selection_window_vbox), selection_window_instruction_label, FALSE, FALSE, 11);
  gtk_misc_set_padding (GTK_MISC (selection_window_instruction_label), 20, 0);

  selection_window_hseparator = gtk_hseparator_new ();
  gtk_widget_set_name (selection_window_hseparator, "selection_window_hseparator");
  gtk_widget_ref (selection_window_hseparator);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_hseparator", selection_window_hseparator,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_hseparator);
  gtk_box_pack_start (GTK_BOX (selection_window_vbox), selection_window_hseparator, FALSE, TRUE, 17);

  hbox1 = gtk_hbox_new (FALSE, 0);
  gtk_widget_set_name (hbox1, "hbox1");
  gtk_widget_ref (hbox1);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "hbox1", hbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbox1);
  gtk_box_pack_start (GTK_BOX (selection_window_vbox), hbox1, FALSE, TRUE, 0);

  hbuttonbox1 = gtk_hbutton_box_new ();
  gtk_widget_set_name (hbuttonbox1, "hbuttonbox1");
  gtk_widget_ref (hbuttonbox1);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "hbuttonbox1", hbuttonbox1,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (hbuttonbox1);
  gtk_box_pack_start (GTK_BOX (hbox1), hbuttonbox1, FALSE, FALSE, 15);
  gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 15);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_START);
  gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 0);
  gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox1), 118, 47);

  help_button = gtk_button_new_with_label (_("Help"));
  gtk_widget_set_name (help_button, "help_button");
  gtk_widget_ref (help_button);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "help_button", help_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (help_button);
  gtk_container_add (GTK_CONTAINER (hbuttonbox1), help_button);
  GTK_WIDGET_SET_FLAGS (help_button, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, help_button, _("Get help on this dialog window"), NULL);

  selection_window_hbuttonbox = gtk_hbutton_box_new ();
  gtk_widget_set_name (selection_window_hbuttonbox, "selection_window_hbuttonbox");
  gtk_widget_ref (selection_window_hbuttonbox);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_hbuttonbox", selection_window_hbuttonbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_hbuttonbox);
  gtk_box_pack_start (GTK_BOX (hbox1), selection_window_hbuttonbox, TRUE, TRUE, 0);
  gtk_container_set_border_width (GTK_CONTAINER (selection_window_hbuttonbox), 15);
  gtk_button_box_set_layout (GTK_BUTTON_BOX (selection_window_hbuttonbox), GTK_BUTTONBOX_END);
  gtk_button_box_set_spacing (GTK_BUTTON_BOX (selection_window_hbuttonbox), 9);
  gtk_button_box_set_child_size (GTK_BUTTON_BOX (selection_window_hbuttonbox), 118, 47);

  selection_window_cancel_button = gtk_button_new_with_label (_("Cancel"));
  gtk_widget_set_name (selection_window_cancel_button, "selection_window_cancel_button");
  gtk_widget_ref (selection_window_cancel_button);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_cancel_button", selection_window_cancel_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_cancel_button);
  gtk_container_add (GTK_CONTAINER (selection_window_hbuttonbox), selection_window_cancel_button);
  GTK_WIDGET_SET_FLAGS (selection_window_cancel_button, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, selection_window_cancel_button, _("Cancel the operation"), NULL);

  selection_window_prev_button = gtk_button_new ();
  gtk_widget_set_name (selection_window_prev_button, "selection_window_prev_button");
  gtk_widget_ref (selection_window_prev_button);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_prev_button", selection_window_prev_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_prev_button);
  gtk_container_add (GTK_CONTAINER (selection_window_hbuttonbox), selection_window_prev_button);
  GTK_WIDGET_SET_FLAGS (selection_window_prev_button, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, selection_window_prev_button, _("Move to the previous window"), NULL);

  selection_window_prev_button_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_set_name (selection_window_prev_button_hbox, "selection_window_prev_button_hbox");
  gtk_widget_ref (selection_window_prev_button_hbox);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_prev_button_hbox", selection_window_prev_button_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_prev_button_hbox);
  gtk_container_add (GTK_CONTAINER (selection_window_prev_button), selection_window_prev_button_hbox);

  selection_window_prev_button_arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_OUT);
  gtk_widget_set_name (selection_window_prev_button_arrow, "selection_window_prev_button_arrow");
  gtk_widget_ref (selection_window_prev_button_arrow);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_prev_button_arrow", selection_window_prev_button_arrow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_prev_button_arrow);
  gtk_box_pack_start (GTK_BOX (selection_window_prev_button_hbox), selection_window_prev_button_arrow, TRUE, TRUE, 0);

  selection_window_prev_button_label = gtk_label_new (_("Previous"));
  gtk_widget_set_name (selection_window_prev_button_label, "selection_window_prev_button_label");
  gtk_widget_ref (selection_window_prev_button_label);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_prev_button_label", selection_window_prev_button_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_prev_button_label);
  gtk_box_pack_start (GTK_BOX (selection_window_prev_button_hbox), selection_window_prev_button_label, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (selection_window_prev_button_label), 10, 0);

  selection_window_next_button = gtk_button_new ();
  gtk_widget_set_name (selection_window_next_button, "selection_window_next_button");
  gtk_widget_ref (selection_window_next_button);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_next_button", selection_window_next_button,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_next_button);
  gtk_container_add (GTK_CONTAINER (selection_window_hbuttonbox), selection_window_next_button);
  GTK_WIDGET_SET_FLAGS (selection_window_next_button, GTK_CAN_DEFAULT);
  gtk_tooltips_set_tip (tooltips, selection_window_next_button, _("Proceed to the next window"), NULL);

  selection_window_next_button_hbox = gtk_hbox_new (FALSE, 0);
  gtk_widget_set_name (selection_window_next_button_hbox, "selection_window_next_button_hbox");
  gtk_widget_ref (selection_window_next_button_hbox);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_next_button_hbox", selection_window_next_button_hbox,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_next_button_hbox);
  gtk_container_add (GTK_CONTAINER (selection_window_next_button), selection_window_next_button_hbox);

  selection_window_next_button_label = gtk_label_new (_("Next"));
  gtk_widget_set_name (selection_window_next_button_label, "selection_window_next_button_label");
  gtk_widget_ref (selection_window_next_button_label);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_next_button_label", selection_window_next_button_label,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_next_button_label);
  gtk_box_pack_start (GTK_BOX (selection_window_next_button_hbox), selection_window_next_button_label, FALSE, FALSE, 0);
  gtk_misc_set_padding (GTK_MISC (selection_window_next_button_label), 25, 0);

  selection_window_next_button_arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
  gtk_widget_set_name (selection_window_next_button_arrow, "selection_window_next_button_arrow");
  gtk_widget_ref (selection_window_next_button_arrow);
  gtk_object_set_data_full (GTK_OBJECT (selection_window), "selection_window_next_button_arrow", selection_window_next_button_arrow,
                            (GtkDestroyNotify) gtk_widget_unref);
  gtk_widget_show (selection_window_next_button_arrow);
  gtk_box_pack_start (GTK_BOX (selection_window_next_button_hbox), selection_window_next_button_arrow, TRUE, TRUE, 0);

  gtk_object_set_data (GTK_OBJECT (selection_window), "tooltips", tooltips);

  return selection_window;
}