2 Unix SMB/CIFS implementation.
5 Copyright (C) Jelmer Vernooij 2004
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "gtk/common/gtk-smb.h"
27 create_user_edit_dialog (void)
29 GtkWidget *user_edit_dialog;
30 GtkWidget *dialog_vbox1;
38 GtkWidget *chk_mustchange;
39 GtkWidget *entry_fullname;
40 GtkWidget *entry_description;
41 GtkWidget *lbl_username;
42 GtkWidget *entry_password;
43 GtkWidget *entry_confirm_password;
44 GtkWidget *chk_cannotchange;
45 GtkWidget *chk_cannotexpire;
46 GtkWidget *chk_disabled;
47 GtkWidget *chk_lockedout;
50 GtkWidget *scrolledwindow3;
53 GtkWidget *btn_groupadd;
54 GtkWidget *btn_groupdel;
55 GtkWidget *scrolledwindow4;
63 GtkWidget *entry_profilepath;
64 GtkWidget *entry_scriptname;
69 GtkWidget *entry_homedir;
70 GtkWidget *chk_mapdrive;
71 GtkWidget *combo_homedrive;
74 GtkWidget *dialog_action_area1;
75 GtkWidget *cancelbutton1;
76 GtkWidget *applybutton1;
79 user_edit_dialog = gtk_dialog_new ();
80 gtk_window_set_title (GTK_WINDOW (user_edit_dialog), "Edit User");
82 dialog_vbox1 = GTK_DIALOG (user_edit_dialog)->vbox;
83 gtk_widget_show (dialog_vbox1);
85 notebook = gtk_notebook_new ();
86 gtk_widget_show (notebook);
87 gtk_box_pack_start (GTK_BOX (dialog_vbox1), notebook, TRUE, TRUE, 0);
89 table1 = gtk_table_new (10, 2, FALSE);
90 gtk_widget_show (table1);
91 gtk_container_add (GTK_CONTAINER (notebook), table1);
93 label4 = gtk_label_new ("Username");
94 gtk_widget_show (label4);
95 gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 0, 1,
96 (GtkAttachOptions) (GTK_FILL),
97 (GtkAttachOptions) (0), 0, 0);
98 gtk_misc_set_alignment (GTK_MISC (label4), 0, 0.5);
100 label5 = gtk_label_new ("Full name");
101 gtk_widget_show (label5);
102 gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 1, 2,
103 (GtkAttachOptions) (GTK_FILL),
104 (GtkAttachOptions) (0), 0, 0);
105 gtk_misc_set_alignment (GTK_MISC (label5), 0, 0.5);
107 label6 = gtk_label_new ("Description");
108 gtk_widget_show (label6);
109 gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 2, 3,
110 (GtkAttachOptions) (GTK_FILL),
111 (GtkAttachOptions) (0), 0, 0);
112 gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
114 label7 = gtk_label_new ("Password");
115 gtk_widget_show (label7);
116 gtk_table_attach (GTK_TABLE (table1), label7, 0, 1, 3, 4,
117 (GtkAttachOptions) (GTK_FILL),
118 (GtkAttachOptions) (0), 0, 0);
119 gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
121 label8 = gtk_label_new ("Confirm password");
122 gtk_widget_show (label8);
123 gtk_table_attach (GTK_TABLE (table1), label8, 0, 1, 4, 5,
124 (GtkAttachOptions) (GTK_FILL),
125 (GtkAttachOptions) (0), 0, 0);
126 gtk_misc_set_alignment (GTK_MISC (label8), 0, 0.5);
128 chk_mustchange = gtk_check_button_new_with_mnemonic ("_User Must Change Password at Next Logon");
129 gtk_widget_show (chk_mustchange);
130 gtk_table_attach (GTK_TABLE (table1), chk_mustchange, 1, 2, 5, 6,
131 (GtkAttachOptions) (GTK_FILL),
132 (GtkAttachOptions) (0), 0, 0);
134 entry_fullname = gtk_entry_new ();
135 gtk_widget_show (entry_fullname);
136 gtk_table_attach (GTK_TABLE (table1), entry_fullname, 1, 2, 1, 2,
137 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
138 (GtkAttachOptions) (0), 0, 0);
140 entry_description = gtk_entry_new ();
141 gtk_widget_show (entry_description);
142 gtk_table_attach (GTK_TABLE (table1), entry_description, 1, 2, 2, 3,
143 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
144 (GtkAttachOptions) (0), 0, 0);
146 lbl_username = gtk_label_new ("");
147 gtk_widget_show (lbl_username);
148 gtk_table_attach (GTK_TABLE (table1), lbl_username, 1, 2, 0, 1,
149 (GtkAttachOptions) (GTK_FILL),
150 (GtkAttachOptions) (0), 0, 0);
151 gtk_misc_set_alignment (GTK_MISC (lbl_username), 0, 0.5);
153 entry_password = gtk_entry_new ();
154 gtk_widget_show (entry_password);
155 gtk_table_attach (GTK_TABLE (table1), entry_password, 1, 2, 3, 4,
156 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
157 (GtkAttachOptions) (0), 0, 0);
159 entry_confirm_password = gtk_entry_new ();
160 gtk_widget_show (entry_confirm_password);
161 gtk_table_attach (GTK_TABLE (table1), entry_confirm_password, 1, 2, 4, 5,
162 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
163 (GtkAttachOptions) (0), 0, 0);
165 chk_cannotchange = gtk_check_button_new_with_mnemonic ("User Cannot Change Password");
166 gtk_widget_show (chk_cannotchange);
167 gtk_table_attach (GTK_TABLE (table1), chk_cannotchange, 1, 2, 6, 7,
168 (GtkAttachOptions) (GTK_FILL),
169 (GtkAttachOptions) (0), 0, 0);
171 chk_cannotexpire = gtk_check_button_new_with_mnemonic ("Password Never Expires");
172 gtk_widget_show (chk_cannotexpire);
173 gtk_table_attach (GTK_TABLE (table1), chk_cannotexpire, 1, 2, 7, 8,
174 (GtkAttachOptions) (GTK_FILL),
175 (GtkAttachOptions) (0), 0, 0);
177 chk_disabled = gtk_check_button_new_with_mnemonic ("Account Disabled");
178 gtk_widget_show (chk_disabled);
179 gtk_table_attach (GTK_TABLE (table1), chk_disabled, 1, 2, 8, 9,
180 (GtkAttachOptions) (GTK_FILL),
181 (GtkAttachOptions) (0), 0, 0);
183 chk_lockedout = gtk_check_button_new_with_mnemonic ("Account Locked Out");
184 gtk_widget_show (chk_lockedout);
185 gtk_table_attach (GTK_TABLE (table1), chk_lockedout, 1, 2, 9, 10,
186 (GtkAttachOptions) (GTK_FILL),
187 (GtkAttachOptions) (0), 0, 0);
189 label1 = gtk_label_new ("Main");
190 gtk_widget_show (label1);
191 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0), label1);
193 hbox1 = gtk_hbox_new (FALSE, 0);
194 gtk_widget_show (hbox1);
195 gtk_container_add (GTK_CONTAINER (notebook), hbox1);
197 scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
198 gtk_widget_show (scrolledwindow3);
199 gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow3, TRUE, TRUE, 0);
201 treeview3 = gtk_tree_view_new ();
202 gtk_widget_show (treeview3);
203 gtk_container_add (GTK_CONTAINER (scrolledwindow3), treeview3);
205 vbox2 = gtk_vbox_new (TRUE, 0);
206 gtk_widget_show (vbox2);
207 gtk_box_pack_start (GTK_BOX (hbox1), vbox2, TRUE, TRUE, 0);
209 btn_groupadd = gtk_button_new_from_stock ("gtk-add");
210 gtk_widget_show (btn_groupadd);
211 gtk_box_pack_start (GTK_BOX (vbox2), btn_groupadd, FALSE, FALSE, 0);
213 btn_groupdel = gtk_button_new_from_stock ("gtk-remove");
214 gtk_widget_show (btn_groupdel);
215 gtk_box_pack_start (GTK_BOX (vbox2), btn_groupdel, FALSE, FALSE, 0);
217 scrolledwindow4 = gtk_scrolled_window_new (NULL, NULL);
218 gtk_widget_show (scrolledwindow4);
219 gtk_box_pack_start (GTK_BOX (hbox1), scrolledwindow4, TRUE, TRUE, 0);
221 treeview4 = gtk_tree_view_new ();
222 gtk_widget_show (treeview4);
223 gtk_container_add (GTK_CONTAINER (scrolledwindow4), treeview4);
225 label2 = gtk_label_new ("Groups");
226 gtk_widget_show (label2);
227 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 1), label2);
229 vbox3 = gtk_vbox_new (FALSE, 0);
230 gtk_widget_show (vbox3);
231 gtk_container_add (GTK_CONTAINER (notebook), vbox3);
233 frame1 = gtk_frame_new (NULL);
234 gtk_widget_show (frame1);
235 gtk_box_pack_start (GTK_BOX (vbox3), frame1, TRUE, TRUE, 0);
237 table2 = gtk_table_new (2, 2, FALSE);
238 gtk_widget_show (table2);
239 gtk_container_add (GTK_CONTAINER (frame1), table2);
241 label12 = gtk_label_new ("User Profile Path:");
242 gtk_widget_show (label12);
243 gtk_table_attach (GTK_TABLE (table2), label12, 0, 1, 0, 1,
244 (GtkAttachOptions) (GTK_FILL),
245 (GtkAttachOptions) (0), 0, 0);
246 gtk_misc_set_alignment (GTK_MISC (label12), 0, 0.5);
248 label13 = gtk_label_new ("Logon Script Name:");
249 gtk_widget_show (label13);
250 gtk_table_attach (GTK_TABLE (table2), label13, 0, 1, 1, 2,
251 (GtkAttachOptions) (GTK_FILL),
252 (GtkAttachOptions) (0), 0, 0);
253 gtk_misc_set_alignment (GTK_MISC (label13), 0, 0.5);
255 entry_profilepath = gtk_entry_new ();
256 gtk_widget_show (entry_profilepath);
257 gtk_table_attach (GTK_TABLE (table2), entry_profilepath, 1, 2, 0, 1,
258 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
259 (GtkAttachOptions) (0), 0, 0);
261 entry_scriptname = gtk_entry_new ();
262 gtk_widget_show (entry_scriptname);
263 gtk_table_attach (GTK_TABLE (table2), entry_scriptname, 1, 2, 1, 2,
264 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
265 (GtkAttachOptions) (0), 0, 0);
267 label10 = gtk_label_new ("User Profiles");
268 gtk_widget_show (label10);
269 gtk_frame_set_label_widget (GTK_FRAME (frame1), label10);
271 frame2 = gtk_frame_new (NULL);
272 gtk_widget_show (frame2);
273 gtk_box_pack_start (GTK_BOX (vbox3), frame2, TRUE, TRUE, 0);
275 table3 = gtk_table_new (2, 2, FALSE);
276 gtk_widget_show (table3);
277 gtk_container_add (GTK_CONTAINER (frame2), table3);
279 label14 = gtk_label_new ("Path");
280 gtk_widget_show (label14);
281 gtk_table_attach (GTK_TABLE (table3), label14, 0, 1, 0, 1,
282 (GtkAttachOptions) (GTK_FILL),
283 (GtkAttachOptions) (0), 0, 0);
284 gtk_misc_set_alignment (GTK_MISC (label14), 0, 0.5);
286 entry_homedir = gtk_entry_new ();
287 gtk_widget_show (entry_homedir);
288 gtk_table_attach (GTK_TABLE (table3), entry_homedir, 1, 2, 0, 1,
289 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
290 (GtkAttachOptions) (0), 0, 0);
292 chk_mapdrive = gtk_check_button_new_with_mnemonic ("Map homedir to drive");
293 gtk_widget_show (chk_mapdrive);
294 gtk_table_attach (GTK_TABLE (table3), chk_mapdrive, 0, 1, 1, 2,
295 (GtkAttachOptions) (GTK_FILL),
296 (GtkAttachOptions) (0), 0, 0);
298 combo_homedrive = gtk_combo_box_entry_new_text ();
299 gtk_widget_show (combo_homedrive);
300 gtk_table_attach (GTK_TABLE (table3), combo_homedrive, 1, 2, 1, 2,
301 (GtkAttachOptions) (GTK_FILL),
302 (GtkAttachOptions) (GTK_FILL), 0, 0);
303 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "C:");
304 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "D:");
305 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "E:");
306 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "F:");
307 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "G:");
308 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "H:");
309 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "I:");
310 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "J:");
311 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "K");
312 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "L:");
313 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "M:");
314 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "N:");
315 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "O:");
316 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "P:");
317 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Q:");
318 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "R:");
319 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "S:");
320 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "T:");
321 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "U:");
322 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "V:");
323 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "W:");
324 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "X:");
325 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Y:");
326 gtk_combo_box_append_text (GTK_COMBO_BOX (combo_homedrive), "Z:");
328 label11 = gtk_label_new ("Home Directory");
329 gtk_widget_show (label11);
330 gtk_frame_set_label_widget (GTK_FRAME (frame2), label11);
332 label3 = gtk_label_new ("Profile");
333 gtk_widget_show (label3);
334 gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 2), label3);
336 dialog_action_area1 = GTK_DIALOG (user_edit_dialog)->action_area;
337 gtk_widget_show (dialog_action_area1);
338 gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
340 cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
341 gtk_widget_show (cancelbutton1);
342 gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), cancelbutton1, GTK_RESPONSE_CANCEL);
343 GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
345 applybutton1 = gtk_button_new_from_stock ("gtk-apply");
346 gtk_widget_show (applybutton1);
347 gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), applybutton1, GTK_RESPONSE_APPLY);
348 GTK_WIDGET_SET_FLAGS (applybutton1, GTK_CAN_DEFAULT);
350 okbutton1 = gtk_button_new_from_stock ("gtk-ok");
351 gtk_widget_show (okbutton1);
352 gtk_dialog_add_action_widget (GTK_DIALOG (user_edit_dialog), okbutton1, GTK_RESPONSE_OK);
353 GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
355 return user_edit_dialog;