comparison src/ui_utildlg.c @ 1175:2518a4a73d89

Rename wmsubclass and name to role, which corresponds better to the purpose of the parameter as it ends to be passed to gtk_window_set_role().
author zas_
date Sun, 23 Nov 2008 16:16:09 +0000
parents 0bea79d87065
children 8b89e3ff286b
comparison
equal deleted inserted replaced
1174:0bea79d87065 1175:2518a4a73d89
206 return vbox; 206 return vbox;
207 } 207 }
208 208
209 static void generic_dialog_setup(GenericDialog *gd, 209 static void generic_dialog_setup(GenericDialog *gd,
210 const gchar *title, 210 const gchar *title,
211 const gchar *wmsubclass, 211 const gchar *role,
212 GtkWidget *parent, gint auto_close, 212 GtkWidget *parent, gint auto_close,
213 void (*cancel_cb)(GenericDialog *, gpointer), gpointer data) 213 void (*cancel_cb)(GenericDialog *, gpointer), gpointer data)
214 { 214 {
215 GtkWidget *vbox; 215 GtkWidget *vbox;
216 216
217 gd->auto_close = auto_close; 217 gd->auto_close = auto_close;
218 gd->data = data; 218 gd->data = data;
219 gd->cancel_cb = cancel_cb; 219 gd->cancel_cb = cancel_cb;
220 220
221 gd->dialog = window_new(GTK_WINDOW_TOPLEVEL, wmsubclass, NULL, NULL, title); 221 gd->dialog = window_new(GTK_WINDOW_TOPLEVEL, role, NULL, NULL, title);
222 gtk_window_set_type_hint(GTK_WINDOW(gd->dialog), GDK_WINDOW_TYPE_HINT_DIALOG); 222 gtk_window_set_type_hint(GTK_WINDOW(gd->dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
223 223
224 if (parent) 224 if (parent)
225 { 225 {
226 GtkWindow *window = NULL; 226 GtkWindow *window = NULL;
279 279
280 gd->default_cb = NULL; 280 gd->default_cb = NULL;
281 } 281 }
282 282
283 GenericDialog *generic_dialog_new(const gchar *title, 283 GenericDialog *generic_dialog_new(const gchar *title,
284 const gchar *wmsubclass, 284 const gchar *role,
285 GtkWidget *parent, gint auto_close, 285 GtkWidget *parent, gint auto_close,
286 void (*cancel_cb)(GenericDialog *, gpointer), gpointer data) 286 void (*cancel_cb)(GenericDialog *, gpointer), gpointer data)
287 { 287 {
288 GenericDialog *gd; 288 GenericDialog *gd;
289 289
290 gd = g_new0(GenericDialog, 1); 290 gd = g_new0(GenericDialog, 1);
291 generic_dialog_setup(gd, title, wmsubclass, 291 generic_dialog_setup(gd, title, role,
292 parent, auto_close, cancel_cb, data); 292 parent, auto_close, cancel_cb, data);
293 return gd; 293 return gd;
294 } 294 }
295 /* 295 /*
296 *----------------------------------------------------------------------------- 296 *-----------------------------------------------------------------------------
332 332
333 generic_dialog_close(GENERIC_DIALOG(fdlg)); 333 generic_dialog_close(GENERIC_DIALOG(fdlg));
334 } 334 }
335 335
336 FileDialog *file_dialog_new(const gchar *title, 336 FileDialog *file_dialog_new(const gchar *title,
337 const gchar *wmsubclass, 337 const gchar *role,
338 GtkWidget *parent, 338 GtkWidget *parent,
339 void (*cancel_cb)(FileDialog *, gpointer), gpointer data) 339 void (*cancel_cb)(FileDialog *, gpointer), gpointer data)
340 { 340 {
341 FileDialog *fdlg = NULL; 341 FileDialog *fdlg = NULL;
342 342
343 fdlg = g_new0(FileDialog, 1); 343 fdlg = g_new0(FileDialog, 1);
344 344
345 generic_dialog_setup(GENERIC_DIALOG(fdlg), title, 345 generic_dialog_setup(GENERIC_DIALOG(fdlg), title,
346 wmsubclass, parent, FALSE, 346 role, parent, FALSE,
347 (gpointer)cancel_cb, data); 347 (gpointer)cancel_cb, data);
348 348
349 return fdlg; 349 return fdlg;
350 } 350 }
351 351