Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h Makefile.am actions.c backgrounds.c desktops.c dialog.c 
        dialog.h ecompmgr.c focus.c fx.c groups.c iconify.c menus.c 
        mod-misc.c mod-trans.c pager.c session.c settings.c snaps.c 
        sound.c tooltips.c 
Added Files:
        settings.h 


Log Message:
Refactor dialog creation functions.

===================================================================
RCS file: /cvs/e/e16/e/src/E.h,v
retrieving revision 1.558
retrieving revision 1.559
diff -u -3 -r1.558 -r1.559
--- E.h 11 Jul 2006 23:17:19 -0000      1.558
+++ E.h 21 Jul 2006 03:17:17 -0000      1.559
@@ -795,13 +795,6 @@
 /* regex.c */
 int                 matchregexp(const char *rx, const char *s);
 
-/* settings.c */
-void                SettingsMoveResize(void);
-void                SettingsPlacement(void);
-void                SettingsAutoRaise(void);
-void                SettingsMiscellaneous(void);
-void                SettingsComposite(void);
-
 /* setup.c */
 void                MapUnmap(int start);
 void                SetupX(const char *dstr);
===================================================================
RCS file: /cvs/e/e16/e/src/Makefile.am,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- Makefile.am 13 Jul 2006 02:35:13 -0000      1.73
+++ Makefile.am 21 Jul 2006 03:17:17 -0000      1.74
@@ -100,6 +100,7 @@
        session.c               \
        session.h               \
        settings.c              \
+       settings.h              \
        setup.c                 \
        size.c                  \
        slideout.c              \
===================================================================
RCS file: /cvs/e/e16/e/src/actions.c,v
retrieving revision 1.200
retrieving revision 1.201
diff -u -3 -r1.200 -r1.201
--- actions.c   26 Apr 2006 23:43:07 -0000      1.200
+++ actions.c   21 Jul 2006 03:17:17 -0000      1.201
@@ -278,25 +278,15 @@
    return did_end;
 }
 
-void
-About(void)
+static void
+_DlgFillAbout(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
+   DItem              *di;
    char                buf[1024];
 
-   d = DialogFind("ABOUT_ENLIGHTENMENT");
-   if (d)
-     {
-       DialogShow(d);
-       return;
-     }
-
-   d = DialogCreate("ABOUT_ENLIGHTENMENT");
    Esnprintf(buf, sizeof(buf), _("About Enlightenment %s"), e_wm_version);
    DialogSetTitle(d, buf);
 
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    di = DialogAddItem(table, DITEM_IMAGE);
@@ -320,7 +310,20 @@
    DialogItemSetText(di, buf);
 
    DialogAddButton(d, _("OK"), NULL, 1, DLG_BUTTON_OK);
-   DialogShow(d);
+}
+
+static const DialogDef DlgAbout = {
+   "ABOUT_ENLIGHTENMENT",
+   NULL,
+   NULL,
+   NULL,
+   _DlgFillAbout
+};
+
+void
+About(void)
+{
+   DialogShowSimple(&DlgAbout, NULL);
 }
 
 #if 0                          /* FIXME - Fix */
===================================================================
RCS file: /cvs/e/e16/e/src/backgrounds.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- backgrounds.c       28 May 2006 11:51:41 -0000      1.77
+++ backgrounds.c       21 Jul 2006 03:17:17 -0000      1.78
@@ -1801,7 +1801,7 @@
 }
 
 static void
-CB_BGAreaEvent(int val __UNUSED__, void *data)
+CB_BGAreaEvent(DItem * di __UNUSED__, int val __UNUSED__, void *data)
 {
    int                 x, num, w, h;
    Background         *bg;
@@ -1993,23 +1993,22 @@
 }
 
 static void
-SettingsBackground(Background * bg)
+CB_DesktopMiniDisplayAreaRedraw(DItem * di, int val __UNUSED__,
+                               void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *table2, *area, *slider, *slider2, *label;
+   CB_DesktopMiniDisplayRedraw(DialogItemGetDialog(di), 1, di);
+   BGSettingsGoTo(tmp_bg);
+}
+
+static void
+_DlgFillBackground(Dialog * d, DItem * table, void *data)
+{
+   Background         *bg = data;
+   DItem              *di, *table2, *area, *slider, *slider2, *label;
    DItem              *w1, *w2, *w3, *w4, *w5, *w6;
    int                 num;
    char                s[1024];
 
-   d = DialogFind("CONFIGURE_BG");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_BG");
-
    if (!bg)
       bg = BackgroundFind("NONE");
    tmp_bg = bg;
@@ -2021,10 +2020,8 @@
    tmp_root_hint = Conf.hints.set_xroot_info_on_root_window;
    tmp_bg_timeout = Conf.backgrounds.timeout;
 
-   d = bg_sel_dialog = DialogCreate("CONFIGURE_BG");
-   DialogSetTitle(d, _("Desktop Background Settings"));
+   bg_sel_dialog = d;
 
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 3, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -2140,6 +2137,7 @@
 
    di = bg_mini_disp = area = DialogAddItem(table2, DITEM_AREA);
    DialogItemAreaSetSize(di, 64, 48);
+   DialogItemAreaSetInitFunc(di, CB_DesktopMiniDisplayAreaRedraw);
 
    DialogItemSetCallback(w1, CB_DesktopMiniDisplayRedraw, 0, (void *)area);
    DialogItemSetCallback(w2, CB_DesktopMiniDisplayRedraw, 0, (void *)area);
@@ -2272,13 +2270,16 @@
    DialogItemCheckButtonSetPtr(di, &tmp_root_hint);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureBG);
-
-   DialogShow(d);
-
-   CB_DesktopMiniDisplayRedraw(NULL, 1, area);
-   BGSettingsGoTo(tmp_bg);
 }
 
+const DialogDef     DlgBackground = {
+   "CONFIGURE_BG",
+   N_("Background"),
+   N_("Desktop Background Settings"),
+   "SOUND_SETTINGS_BG",
+   _DlgFillBackground
+};
+
 /*
  * IPC functions
  */
@@ -2472,7 +2473,7 @@
      }
    else if (!strncmp(cmd, "cfg", 2))
      {
-       SettingsBackground(DeskBackgroundGet(DesksGetCurrent()));
+       DialogShowSimple(&DlgBackground, DeskBackgroundGet(DesksGetCurrent()));
      }
    else if (!strncmp(cmd, "del", 2))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/desktops.c,v
retrieving revision 1.245
retrieving revision 1.246
diff -u -3 -r1.245 -r1.246
--- desktops.c  28 May 2006 11:51:41 -0000      1.245
+++ desktops.c  21 Jul 2006 03:17:17 -0000      1.246
@@ -2221,11 +2221,10 @@
 }
 
 /*
- * Dialodgs
+ * Dialogs
  */
 static int          tmp_desktops;
 static DItem       *tmp_desk_text;
-static Dialog      *tmp_desk_dialog;
 static char         tmp_desktop_slide;
 static int          tmp_desktop_slide_speed;
 static char         tmp_desktop_wraparound;
@@ -2258,7 +2257,7 @@
 }
 
 static void
-CB_DesktopDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
+CB_DesktopDisplayRedraw(Dialog * d, int val, void *data)
 {
    static char         called = 0;
    static int          prev_desktops = -1;
@@ -2343,24 +2342,21 @@
    else
       Esnprintf(s, sizeof(s), _("%i Desktop"), tmp_desktops);
    DialogItemSetText(tmp_desk_text, s);
-   DialogDrawItems(tmp_desk_dialog, tmp_desk_text, 0, 0, 99999, 99999);
+   DialogDrawItems(d, tmp_desk_text, 0, 0, 99999, 99999);
 }
 
 static void
-SettingsDesktops(void)
+CB_DesktopDisplayAreaRedraw(DItem * di, int val __UNUSED__,
+                           void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *area, *slider, *radio;
-   char                s[64];
+   CB_DesktopDisplayRedraw(DialogItemGetDialog(di), 1, di);
+}
 
-   d = DialogFind("CONFIGURE_DESKTOPS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_DESKTOPS");
+static void
+_DlgFillDesks(Dialog * d, DItem * table, void *data __UNUSED__)
+{
+   DItem              *di, *area, *slider, *radio;
+   char                s[64];
 
    tmp_desktops = Conf.desks.num;
    tmp_desktop_slide = Conf.desks.slidein;
@@ -2372,10 +2368,6 @@
       tmp_dragbar = 1;
    tmp_dragdir = Conf.desks.dragdir;
 
-   d = tmp_desk_dialog = DialogCreate("CONFIGURE_DESKTOPS");
-   DialogSetTitle(d, _("Multiple Desktop Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -2405,6 +2397,9 @@
    di = area = DialogAddItem(table, DITEM_AREA);
    DialogItemSetColSpan(di, 2);
    DialogItemAreaSetSize(di, 128, 96);
+   DialogItemAreaSetInitFunc(area, CB_DesktopDisplayAreaRedraw);
+
+   DialogItemSetCallback(slider, CB_DesktopDisplayRedraw, 0, area);
 
    di = DialogAddItem(table, DITEM_SEPARATOR);
    DialogItemSetColSpan(di, 2);
@@ -2473,19 +2468,21 @@
    DialogItemRadioButtonGroupSetValPtr(radio, &tmp_dragdir);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureDesktops);
-
-   DialogShow(d);
-
-   DialogItemSetCallback(slider, CB_DesktopDisplayRedraw, 0, (void *)area);
-   CB_DesktopDisplayRedraw(d, 1, area);
 }
 
+const DialogDef     DlgDesks = {
+   "CONFIGURE_DESKTOPS",
+   N_("Desks"),
+   N_("Multiple Desktop Settings"),
+   "SOUND_SETTINGS_DESKTOPS",
+   _DlgFillDesks
+};
+
 static int          tmp_area_x;
 static int          tmp_area_y;
 static int          tmp_edge_resist;
 static char         tmp_edge_flip;
 static DItem       *tmp_area_text;
-static Dialog      *tmp_area_dialog;
 static char         tmp_area_wraparound;
 
 static void
@@ -2564,24 +2561,20 @@
    else
       Esnprintf(s, sizeof(s), _("1\nScreen in size"));
    DialogItemSetText(tmp_area_text, s);
-   DialogDrawItems(tmp_area_dialog, tmp_area_text, 0, 0, 99999, 99999);
+   DialogDrawItems(d, tmp_area_text, 0, 0, 99999, 99999);
 }
 
 static void
-SettingsArea(void)
+CB_AreaDisplayAreaRedraw(DItem * di, int val __UNUSED__, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *area, *slider, *slider2, *table2;
-   char                s[64];
+   CB_AreaDisplayRedraw(DialogItemGetDialog(di), 1, di);
+}
 
-   d = DialogFind("CONFIGURE_AREA");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_AREA");
+static void
+_DlgFillAreas(Dialog * d, DItem * table, void *data __UNUSED__)
+{
+   DItem              *di, *area, *slider, *slider2, *table2;
+   char                s[64];
 
    tmp_area_wraparound = Conf.desks.areas_wraparound;
    tmp_edge_resist = Conf.edge_flip_resistance;
@@ -2592,10 +2585,6 @@
    DesksGetAreaSize(&tmp_area_x, &tmp_area_y);
    tmp_area_y = 9 - tmp_area_y;
 
-   d = tmp_area_dialog = DialogCreate("CONFIGURE_AREA");
-   DialogSetTitle(d, _("Virtual Desktop Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 1, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -2636,9 +2625,10 @@
 
    di = area = DialogAddItem(table2, DITEM_AREA);
    DialogItemAreaSetSize(di, 160, 120);
+   DialogItemAreaSetInitFunc(area, CB_AreaDisplayAreaRedraw);
 
-   DialogItemSetCallback(slider, CB_AreaDisplayRedraw, 0, (void *)area);
-   DialogItemSetCallback(slider2, CB_AreaDisplayRedraw, 0, (void *)area);
+   DialogItemSetCallback(slider, CB_AreaDisplayRedraw, 0, area);
+   DialogItemSetCallback(slider2, CB_AreaDisplayRedraw, 0, area);
 
    di = DialogAddItem(table, DITEM_SEPARATOR);
 
@@ -2661,12 +2651,16 @@
    DialogItemSliderSetValPtr(di, &tmp_edge_resist);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureAreas);
-
-   DialogShow(d);
-
-   CB_AreaDisplayRedraw(d, 1, area);
 }
 
+const DialogDef     DlgAreas = {
+   "CONFIGURE_AREA",
+   N_("Areas"),
+   N_("Virtual Desktop Settings"),
+   "SOUND_SETTINGS_AREA",
+   _DlgFillAreas
+};
+
 /*
  * IPC functions
  */
@@ -2731,7 +2725,7 @@
      }
    else if (!strncmp(cmd, "cfg", 3))
      {
-       SettingsDesktops();
+       DialogShowSimple(&DlgDesks, NULL);
      }
    else if (!strncmp(cmd, "set", 3))
      {
@@ -2825,7 +2819,7 @@
      }
    else if (!strncmp(cmd, "cfg", 3))
      {
-       SettingsArea();
+       DialogShowSimple(&DlgAreas, NULL);
      }
    else if (!strncmp(cmd, "set", 3))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -3 -r1.160 -r1.161
--- dialog.c    3 Jun 2006 14:11:33 -0000       1.160
+++ dialog.c    21 Jul 2006 03:17:17 -0000      1.161
@@ -75,6 +75,7 @@
 {
    Win                 area_win;
    int                 w, h;
+   DialogItemCallbackFunc *init_func;
    DialogItemCallbackFunc *event_func;
 } DItemArea;
 
@@ -691,6 +692,36 @@
    EwinHide(d->ewin);
 }
 
+void
+DialogShowSimple(const DialogDef * dd, void *data)
+{
+   Dialog             *d;
+   DItem              *table;
+
+   d = DialogFind(dd->name);
+   if (d)
+     {
+       SoundPlay("SOUND_SETTINGS_ACTIVE");
+       DialogShow(d);
+       return;
+     }
+   SoundPlay(dd->sound);
+
+   d = DialogCreate(dd->name);
+   if (!d)
+      return;
+
+   DialogSetTitle(d, _(dd->title));
+
+   table = DialogInitItem(d);
+   if (!table)
+      return;
+
+   dd->fill(d, table, data);
+
+   DialogShow(d);
+}
+
 static DItem       *
 DialogItemCreate(int type)
 {
@@ -749,10 +780,8 @@
      default:
        break;
      case DITEM_AREA:
-       di->item.area.area_win = 0;
        di->item.area.w = 32;
        di->item.area.h = 32;
-       di->item.area.event_func = NULL;
        break;
      case DITEM_CHECKBUTTON:
        di->item.check_button.check_win = 0;
@@ -888,6 +917,12 @@
    DialogSetExitFunction(d, cb, 2);
 }
 
+Dialog             *
+DialogItemGetDialog(DItem * di)
+{
+   return di->dlg;
+}
+
 void
 DialogItemSetCallback(DItem * di, DialogCallbackFunc * func, int val,
                      void *data)
@@ -1673,8 +1708,12 @@
        break;
 
      case DITEM_AREA:
+       if (!d->redraw)
+          break;
        ImageclassApply(di->iclass, di->win, di->w, di->h, 0, 0,
                        STATE_NORMAL, ST_DIALOG);
+       if (di->item.area.init_func)
+          di->item.area.init_func(di, 0, NULL);
        break;
 
      case DITEM_CHECKBUTTON:
@@ -1981,6 +2020,12 @@
 }
 
 void
+DialogItemAreaSetInitFunc(DItem * di, DialogItemCallbackFunc * func)
+{
+   di->item.area.init_func = func;
+}
+
+void
 DialogItemAreaSetEventFunc(DItem * di, DialogItemCallbackFunc * func)
 {
    di->item.area.event_func = func;
@@ -2133,7 +2178,7 @@
      {
      case DITEM_AREA:
        if (di->item.area.event_func)
-          di->item.area.event_func(0, ev);
+          di->item.area.event_func(di, 0, ev);
        break;
 
      case DITEM_SLIDER:
@@ -2193,7 +2238,7 @@
      {
      case DITEM_AREA:
        if (di->item.area.event_func)
-          di->item.area.event_func(0, ev);
+          di->item.area.event_func(di, 0, ev);
        break;
 
      case DITEM_SLIDER:
@@ -2299,7 +2344,7 @@
      {
      case DITEM_AREA:
        if (di->item.area.event_func)
-          di->item.area.event_func(0, ev);
+          di->item.area.event_func(di, 0, ev);
        break;
 
      case DITEM_CHECKBUTTON:
@@ -2341,12 +2386,12 @@
      {
      case DITEM_AREA:
        if (di->item.area.event_func)
-          di->item.area.event_func(0, ev);
+          di->item.area.event_func(di, 0, ev);
        break;
 
      case DITEM_RADIOBUTTON:
        if (di->item.radio_button.event_func)
-          di->item.radio_button.event_func(di->item.radio_button.val, ev);
+          di->item.radio_button.event_func(di, di->item.radio_button.val, ev);
        break;
      }
 
@@ -2362,12 +2407,13 @@
      {
      case DITEM_AREA:
        if (di->item.area.event_func)
-          di->item.area.event_func(0, ev);
+          di->item.area.event_func(di, 0, ev);
        break;
 
      case DITEM_RADIOBUTTON:
        if (di->item.radio_button.event_func)
-          di->item.radio_button.event_func(di->item.radio_button.val, NULL);
+          di->item.radio_button.event_func(di, di->item.radio_button.val,
+                                           NULL);
        break;
      }
 
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- dialog.h    29 Apr 2006 19:39:20 -0000      1.9
+++ dialog.h    21 Jul 2006 03:17:17 -0000      1.10
@@ -51,7 +51,16 @@
 typedef struct _ditem DItem;
 
 typedef void        (DialogCallbackFunc) (Dialog * d, int val, void *data);
-typedef void        (DialogItemCallbackFunc) (int val, void *data);
+typedef void        (DialogItemCallbackFunc) (DItem * di, int val, void *data);
+
+typedef struct
+{
+   const char         *name;
+   const char         *label;
+   const char         *title;
+   const char         *sound;
+   void                (*fill) (Dialog * d, DItem * table, void *data);
+} DialogDef;
 
 /* dialog.c */
 Dialog             *DialogCreate(const char *name);
@@ -67,6 +76,7 @@
 
 void                DialogShow(Dialog * d);
 void                DialogShowCentered(Dialog * d);
+void                DialogShowSimple(const DialogDef * dd, void *data);
 void                DialogRedraw(Dialog * d);
 
 void                DialogAddButton(Dialog * d, const char *text,
@@ -78,6 +88,7 @@
                                    DialogCallbackFunc * cb);
 DItem              *DialogInitItem(Dialog * d);
 DItem              *DialogAddItem(DItem * dii, int type);
+Dialog             *DialogItemGetDialog(DItem * di);
 void                DialogItemSetCallback(DItem * di, DialogCallbackFunc * 
func,
                                          int val, void *data);
 void                DialogItemSetClass(DItem * di, ImageClass * ic,
@@ -122,6 +133,8 @@
 void                DialogItemAreaSetSize(DItem * di, int w, int h);
 void                DialogItemAreaGetSize(DItem * di, int *w, int *h);
 Win                 DialogItemAreaGetWindow(DItem * di);
+void                DialogItemAreaSetInitFunc(DItem * di,
+                                             DialogItemCallbackFunc * func);
 void                DialogItemAreaSetEventFunc(DItem * di,
                                               DialogItemCallbackFunc * func);
 
===================================================================
RCS file: /cvs/e/e16/e/src/ecompmgr.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -3 -r1.120 -r1.121
--- ecompmgr.c  5 Jun 2006 20:57:07 -0000       1.120
+++ ecompmgr.c  21 Jul 2006 03:17:17 -0000      1.121
@@ -33,6 +33,7 @@
 #include "ecompmgr.h"
 #include "emodule.h"
 #include "eobj.h"
+#include "settings.h"
 #include "timers.h"
 #include "xwin.h"
 
===================================================================
RCS file: /cvs/e/e16/e/src/focus.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -3 -r1.151 -r1.152
--- focus.c     2 Jun 2006 22:53:23 -0000       1.151
+++ focus.c     21 Jul 2006 03:17:17 -0000      1.152
@@ -678,19 +678,9 @@
 }
 
 static void
-SettingsFocus(void)
+_DlgFillFocus(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *radio, *radio2;
-
-   d = DialogFind("CONFIGURE_FOCUS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_FOCUS");
+   DItem              *di, *radio, *radio2;
 
    tmp_focus = Conf.focus.mode;
    tmp_new_focus = Conf.focus.all_new_windows_get_focus;
@@ -711,10 +701,6 @@
 
    tmp_clickalways = Conf.focus.clickraises;
 
-   d = DialogCreate("CONFIGURE_FOCUS");
-   DialogSetTitle(d, _("Focus Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -852,10 +838,16 @@
    DialogItemRadioButtonGroupSetValPtr(radio2, &tmp_warp_icon_mode);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureFocus);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgFocus = {
+   "CONFIGURE_FOCUS",
+   N_("Focus"),
+   N_("Focus Settings"),
+   "SOUND_SETTINGS_FOCUS",
+   _DlgFillFocus
+};
+
 /*
  * Focus Module
  */
@@ -920,7 +912,7 @@
      }
    else if (!strcmp(cmd, "cfg"))
      {
-       SettingsFocus();
+       DialogShowSimple(&DlgFocus, NULL);
      }
    else if (!strncmp(cmd, "mode", 2))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/fx.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- fx.c        7 May 2006 16:21:37 -0000       1.69
+++ fx.c        21 Jul 2006 03:17:17 -0000      1.70
@@ -971,28 +971,14 @@
 }
 
 static void
-FxSettings(void)
+_DlgFillFx(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_FX");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_FX");
+   DItem              *di;
 
    tmp_effect_raindrops = FX_IsOn("raindrops");
    tmp_effect_ripples = FX_IsOn("ripples");
    tmp_effect_waves = FX_IsOn("waves");
 
-   d = DialogCreate("CONFIGURE_FX");
-   DialogSetTitle(d, _("Special FX Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 1, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -1016,10 +1002,16 @@
    DialogItemCheckButtonSetPtr(di, &tmp_effect_waves);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureFX);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgFx = {
+   "CONFIGURE_FX",
+   N_("FX"),
+   N_("Special FX Settings"),
+   "SOUND_SETTINGS_FX",
+   _DlgFillFx
+};
+
 static void
 FxIpc(const char *params, Client * c __UNUSED__)
 {
@@ -1051,7 +1043,7 @@
      }
    else if (!strncmp(word1, "cfg", 2))
      {
-       FxSettings();
+       DialogShowSimple(&DlgFx, NULL);
      }
 }
 
===================================================================
RCS file: /cvs/e/e16/e/src/groups.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -3 -r1.81 -r1.82
--- groups.c    26 Apr 2006 23:43:07 -0000      1.81
+++ groups.c    21 Jul 2006 03:17:17 -0000      1.82
@@ -787,40 +787,14 @@
 }
 
 static void
-SettingsGroups(EWin * ewin)
+_DlgFillGroups(Dialog * d, DItem * table, void *data)
 {
-   Dialog             *d;
-   DItem              *table, *radio, *di;
+   EWin               *ewin = data;
+   DItem              *radio, *di;
    int                 i;
    char              **group_member_strings;
    EwinGroupDlgData   *dd;
 
-   if (!ewin)
-      return;
-
-   if (ewin->num_groups == 0)
-     {
-       DialogOK(_("Window Group Error"),
-                _
-                ("\n  This window currently does not belong to any groups.  
\n\n"));
-       return;
-     }
-
-   d = DialogFind("CONFIGURE_GROUP");
-   if (d)
-     {
-       SoundPlay("GROUP_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-
-   SoundPlay("SOUND_SETTINGS_GROUP");
-
-   d = DialogCreate("CONFIGURE_GROUP");
-   if (!d)
-      return;
-   DialogSetTitle(d, _("Window Group Settings"));
-
    dd = Ecalloc(1, sizeof(EwinGroupDlgData));
    if (!dd)
       return;
@@ -836,7 +810,6 @@
 
    ShowHideWinGroups(ewin, 0, SET_ON);
 
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -921,8 +894,31 @@
    DialogItemCheckButtonSetPtr(di, &(dd->cfg.mirror));
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureGroup);
+}
+
+static const DialogDef DlgGroups = {
+   "CONFIGURE_GROUP",
+   NULL,
+   N_("Window Group Settings"),
+   "SOUND_SETTINGS_GROUP",
+   _DlgFillGroups
+};
 
-   DialogShow(d);
+static void
+SettingsGroups(EWin * ewin)
+{
+   if (!ewin)
+      return;
+
+   if (ewin->num_groups == 0)
+     {
+       DialogOK(_("Window Group Error"),
+                _
+                ("\n  This window currently does not belong to any groups.  
\n\n"));
+       return;
+     }
+
+   DialogShowSimple(&DlgGroups, ewin);
 }
 
 static GroupConfig  tmp_group_cfg;
@@ -940,27 +936,13 @@
 }
 
 static void
-SettingsDefaultGroupControl(void)
+_DlgFillGroupDefaults(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_DEFAULT_GROUP_CONTROL");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_GROUP");
+   DItem              *di;
 
    CopyGroupConfig(&(Conf_groups.dflt), &tmp_group_cfg);
    tmp_group_swap = Conf_groups.swapmove;
 
-   d = DialogCreate("CONFIGURE_DEFAULT_GROUP_CONTROL");
-   DialogSetTitle(d, _("Default Group Control Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -1030,10 +1012,16 @@
    DialogItemCheckButtonSetPtr(di, &(tmp_group_swap));
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureDefaultGroupSettings);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgGroupDefaults = {
+   "CONFIGURE_DEFAULT_GROUP_CONTROL",
+   N_("Groups"),
+   N_("Default Group Control Settings"),
+   "SOUND_SETTINGS_GROUP",
+   _DlgFillGroupDefaults
+};
+
 /*
  * Groups module
  */
@@ -1060,7 +1048,7 @@
      }
    else if (!s[0] || !strcmp(s, "group_defaults"))
      {
-       SettingsDefaultGroupControl();
+       DialogShowSimple(&DlgGroupDefaults, NULL);
      }
    else if (!strcmp(s, "group_membership"))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/iconify.c,v
retrieving revision 1.212
retrieving revision 1.213
diff -u -3 -r1.212 -r1.213
--- iconify.c   3 Jun 2006 14:11:33 -0000       1.212
+++ iconify.c   21 Jul 2006 03:17:17 -0000      1.213
@@ -2135,25 +2135,16 @@
 }
 
 static void
-IconboxConfigure(Iconbox * ib)
+_DlgFillIconbox(Dialog * d, DItem * table, void *data)
 {
-   Dialog             *d;
-   DItem              *di, *table, *table2;
+   Iconbox            *ib = data;
+   DItem              *di, *table2;
    DItem              *radio1, *radio2, *radio3, *radio4, *label;
    char                s[256];
 
    if (!ib)
       return;
 
-   d = DialogFind("CONFIGURE_ICONBOX");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_ICONBOX");
-
    tmp_ib_nobg = ib->nobg;
    tmp_ib_shownames = ib->shownames;
    tmp_ib_vert = ib->orientation;
@@ -2171,13 +2162,11 @@
       Efree(tmp_ib_name);
    tmp_ib_name = Estrdup(ib->name);
 
-   d = DialogCreate("CONFIGURE_ICONBOX");
    if (ib->type == IB_TYPE_ICONBOX)
       DialogSetTitle(d, _("Iconbox Settings"));
    else
       DialogSetTitle(d, _("Systray Settings"));
 
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 1, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -2347,10 +2336,16 @@
    DialogItemRadioButtonGroupSetValPtr(radio3, &tmp_ib_arrows);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureIconbox);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgIconbox = {
+   "CONFIGURE_ICONBOX",
+   NULL,
+   NULL,
+   "SOUND_SETTINGS_ICONBOX",
+   _DlgFillIconbox
+};
+
 /*
  * Configuration load/save
  */
@@ -2557,7 +2552,7 @@
 
    ib = IconboxFind(params);
    if (ib)
-      IconboxConfigure(ib);
+      DialogShowSimple(&DlgIconbox, ib);
 }
 
 /*
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.250
retrieving revision 1.251
diff -u -3 -r1.250 -r1.251
--- menus.c     22 Jun 2006 02:39:03 -0000      1.250
+++ menus.c     21 Jul 2006 03:17:17 -0000      1.251
@@ -2031,28 +2031,14 @@
 }
 
 static void
-MenusSettings(void)
+_DlgFillMenus(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_MENUS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_MENUS");
+   DItem              *di;
 
    tmp_warpmenus = Conf.menus.warp;
    tmp_animated_menus = Conf.menus.animate;
    tmp_menusonscreen = Conf.menus.onscreen;
 
-   d = DialogCreate("CONFIGURE_MENUS");
-   DialogSetTitle(d, _("Menu Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 3, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -2075,10 +2061,16 @@
    DialogItemCheckButtonSetPtr(di, &tmp_warpmenus);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureMenus);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgMenus = {
+   "CONFIGURE_MENUS",
+   N_("Menus"),
+   N_("Menu Settings"),
+   "SOUND_SETTINGS_MENUS",
+   _DlgFillMenus
+};
+
 static void
 MenusIpc(const char *params, Client * c __UNUSED__)
 {
@@ -2102,7 +2094,7 @@
      }
    else if (!strncmp(cmd, "cfg", 2))
      {
-       MenusSettings();
+       DialogShowSimple(&DlgMenus, NULL);
      }
    else if (!strncmp(cmd, "list", 2))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/mod-misc.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- mod-misc.c  3 Jun 2006 14:11:34 -0000       1.36
+++ mod-misc.c  21 Jul 2006 03:17:18 -0000      1.37
@@ -21,8 +21,10 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
+#include "dialog.h"
 #include "emodule.h"
 #include "session.h"
+#include "settings.h"
 #include "snaps.h"
 
 /***********************************************************************
@@ -199,17 +201,17 @@
    else if (!strncmp(cmd, "cfg", 3))
      {
        if (!strncmp(prm, "autoraise", 2))
-          SettingsAutoRaise();
+          DialogShowSimple(&DlgAutoraise, NULL);
        else if (!strncmp(prm, "misc", 2))
-          SettingsMiscellaneous();
+          DialogShowSimple(&DlgMisc, NULL);
        else if (!strncmp(prm, "moveresize", 2))
-          SettingsMoveResize();
+          DialogShowSimple(&DlgMoveResize, NULL);
        else if (!strncmp(prm, "placement", 2))
-          SettingsPlacement();
+          DialogShowSimple(&DlgPlacement, NULL);
        else if (!strncmp(prm, "remember", 2))
-          SettingsRemember();
+          DialogShowSimple(&DlgRemember, NULL);
        else if (!strncmp(prm, "session", 2))
-          SettingsSession();
+          DialogShowSimple(&DlgSession, NULL);
      }
    else if (!strncmp(cmd, "arrange", 3))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/mod-trans.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- mod-trans.c 26 Apr 2006 23:43:07 -0000      1.19
+++ mod-trans.c 21 Jul 2006 03:17:18 -0000      1.20
@@ -107,23 +107,13 @@
 }
 
 static void
-SettingsTransparency(void)
+_DlgFillThemeTrans(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *label;
+   DItem              *di, *label;
    DItem              *radio_border, *radio_widget, *radio_menu,
       *radio_dialog, *radio_tooltip, *radio_hilight;
    char                s[256];
 
-   d = DialogFind("CONFIGURE_TRANS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_TRANS");
-
    tmp_st_border = Conf.trans.border;
    tmp_st_widget = Conf.trans.widget;
    tmp_st_dialog = Conf.trans.dialog;
@@ -133,10 +123,6 @@
 
    tmp_theme_transparency = Conf.trans.alpha;
 
-   d = DialogCreate("CONFIGURE_TRANS");
-   DialogSetTitle(d, _("Selective Transparency Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 7, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -282,10 +268,16 @@
    DialogItemSetCallback(di, CB_ThemeTransparency, 0, (void *)label);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureTrans);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgThemeTrans = {
+   "CONFIGURE_TRANS",
+   N_("Transparency"),
+   N_("Selective Transparency Settings"),
+   "SOUND_SETTINGS_TRANS",
+   _DlgFillThemeTrans
+};
+
 static void
 TransparencySighan(int sig, void *prm __UNUSED__)
 {
@@ -302,7 +294,7 @@
 {
    if (params && !strncmp(params, "cfg", 3))
      {
-       SettingsTransparency();
+       DialogShowSimple(&DlgThemeTrans, NULL);
      }
 }
 
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -3 -r1.218 -r1.219
--- pager.c     3 Jun 2006 14:11:34 -0000       1.218
+++ pager.c     21 Jul 2006 03:17:18 -0000      1.219
@@ -1684,7 +1684,6 @@
 static int          tmp_pager_win_button;
 static int          tmp_pager_menu_button;
 static DItem       *pager_scan_speed_label = NULL;
-static Dialog      *pager_settings_dialog = NULL;
 
 static void
 CB_ConfigurePager(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
@@ -1716,34 +1715,22 @@
 }
 
 static void
-CB_PagerScanSlide(Dialog * d __UNUSED__, int val __UNUSED__,
-                 void *data __UNUSED__)
+CB_PagerScanSlide(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
 {
    char                s[256];
 
    Esnprintf(s, sizeof(s), "%s %03i %s", _("Pager scanning speed:"),
             tmp_pager_scan_speed, _("lines per second"));
    DialogItemSetText(pager_scan_speed_label, s);
-   DialogDrawItems(pager_settings_dialog, pager_scan_speed_label, 0, 0, 99999,
-                  99999);
+   DialogDrawItems(d, pager_scan_speed_label, 0, 0, 99999, 99999);
 }
 
 static void
-SettingsPager(void)
+_DlgFillPagers(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *radio;
+   DItem              *di, *radio;
    char                s[256];
 
-   d = DialogFind("CONFIGURE_PAGER");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_PAGER");
-
    tmp_show_pagers = Conf_pagers.enable;
    tmp_pager_hiq = Conf_pagers.hiq;
    tmp_pager_snap = Conf_pagers.snap;
@@ -1758,10 +1745,6 @@
       tmp_pager_do_scan = 1;
    tmp_pager_scan_speed = Conf_pagers.scanspeed;
 
-   d = pager_settings_dialog = DialogCreate("CONFIGURE_PAGER");
-   DialogSetTitle(d, _("Pager Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -1892,10 +1875,16 @@
    DialogItemRadioButtonGroupSetValPtr(radio, &tmp_pager_menu_button);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigurePager);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgPagers = {
+   "CONFIGURE_PAGER",
+   N_("Pagers"),
+   N_("Pager Settings"),
+   "SOUND_SETTINGS_PAGER",
+   _DlgFillPagers
+};
+
 /*
  * Pagers Module
  */
@@ -1977,7 +1966,7 @@
 
    if (!strncmp(prm1, "cfg", 3))
      {
-       SettingsPager();
+       DialogShowSimple(&DlgPagers, NULL);
      }
    else if (!strcmp(prm1, "on"))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/session.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -3 -r1.128 -r1.129
--- session.c   11 Jul 2006 23:17:19 -0000      1.128
+++ session.c   21 Jul 2006 03:17:18 -0000      1.129
@@ -769,29 +769,15 @@
    autosave();
 }
 
-void
-SettingsSession(void)
+static void
+_DlgFillSession(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_SESSION");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_SESSION");
+   DItem              *di;
 
    tmp_session_script = Conf.session.enable_script;
    tmp_logout_dialog = Conf.session.enable_logout_dialog;
    tmp_reboot_halt = Conf.session.enable_reboot_halt;
 
-   d = DialogCreate("CONFIGURE_SESSION");
-   DialogSetTitle(d, _("Session Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -814,6 +800,12 @@
    DialogItemCheckButtonSetPtr(di, &tmp_reboot_halt);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureSession);
-
-   DialogShow(d);
 }
+
+const DialogDef     DlgSession = {
+   "CONFIGURE_SESSION",
+   N_("Session"),
+   N_("Session Settings"),
+   "SOUND_SETTINGS_SESSION",
+   _DlgFillSession
+};
===================================================================
RCS file: /cvs/e/e16/e/src/settings.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -3 -r1.152 -r1.153
--- settings.c  26 Apr 2006 23:43:07 -0000      1.152
+++ settings.c  21 Jul 2006 03:17:18 -0000      1.153
@@ -23,6 +23,7 @@
  */
 #include "E.h"
 #include "dialog.h"
+#include "settings.h"
 
 static int          tmp_move;
 static int          tmp_resize;
@@ -42,30 +43,16 @@
    autosave();
 }
 
-void
-SettingsMoveResize(void)
+static void
+_DlgFillMoveResize(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *radio1, *radio2, *radio3;
-
-   d = DialogFind("CONFIGURE_MOVERESIZE");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_MOVERESIZE");
+   DItem              *di, *radio1, *radio2, *radio3;
 
    tmp_move = Conf.movres.mode_move;
    tmp_resize = Conf.movres.mode_resize;
    tmp_geominfo = Conf.movres.mode_info;
    tmp_update_while_moving = Conf.movres.update_while_moving;
 
-   d = DialogCreate("CONFIGURE_MOVERESIZE");
-   DialogSetTitle(d, _("Move & Resize Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -179,10 +166,16 @@
    DialogItemCheckButtonSetPtr(di, &tmp_update_while_moving);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureMoveResize);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgMoveResize = {
+   "CONFIGURE_MOVERESIZE",
+   N_("Move/Resize"),
+   N_("Move & Resize Settings"),
+   "SOUND_SETTINGS_MOVERESIZE",
+   _DlgFillMoveResize
+};
+
 static char         tmp_with_leader;
 static char         tmp_switch_popup;
 static char         tmp_manual_placement;
@@ -231,20 +224,10 @@
    autosave();
 }
 
-void
-SettingsPlacement(void)
+static void
+_DlgFillPlacement(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di, *radio;
-
-   d = DialogFind("CONFIGURE_PLACEMENT");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_PLACEMENT");
+   DItem              *di, *radio;
 
    tmp_with_leader = Conf.focus.transientsfollowleader;
    tmp_switch_popup = Conf.focus.switchfortransientmap;
@@ -268,10 +251,6 @@
    tmp_extra_head = Conf.extra_head;
 #endif
 
-   d = DialogCreate("CONFIGURE_PLACEMENT");
-   DialogSetTitle(d, _("Window Placement Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 1, 0);
 
    if (Conf.dialogs.headers)
@@ -409,10 +388,16 @@
 #endif
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigurePlacement);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgPlacement = {
+   "CONFIGURE_PLACEMENT",
+   N_("Placement"),
+   N_("Window Placement Settings"),
+   "SOUND_SETTINGS_PLACEMENT",
+   _DlgFillPlacement
+};
+
 static char         tmp_autoraise;
 static int          tmp_autoraisetime;
 
@@ -427,28 +412,14 @@
    autosave();
 }
 
-void
-SettingsAutoRaise(void)
+static void
+_DlgFillAutoraise(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_AUTORAISE");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_AUTORAISE");
+   DItem              *di;
 
    tmp_autoraise = Conf.autoraise.enable;
    tmp_autoraisetime = Conf.autoraise.delay / 10;
 
-   d = DialogCreate("CONFIGURE_AUTORAISE");
-   DialogSetTitle(d, _("Autoraise Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -473,10 +444,16 @@
    DialogItemSliderSetValPtr(di, &tmp_autoraisetime);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureAutoraise);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgAutoraise = {
+   "CONFIGURE_AUTORAISE",
+   N_("Autoraise"),
+   N_("Autoraise Settings"),
+   "SOUND_SETTINGS_AUTORAISE",
+   _DlgFillAutoraise
+};
+
 static char         tmp_dialog_headers;
 static char         tmp_button_image;
 static char         tmp_animate_startup;
@@ -495,30 +472,16 @@
    autosave();
 }
 
-void
-SettingsMiscellaneous(void)
+static void
+_DlgFillMisc(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_MISCELLANEOUS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_MISCELLANEOUS");
+   DItem              *di;
 
    tmp_dialog_headers = Conf.dialogs.headers;
    tmp_button_image = Conf.dialogs.button_image;
    tmp_animate_startup = Conf.startup.animate;
    tmp_saveunders = Conf.save_under;
 
-   d = DialogCreate("CONFIGURE_MISCELLANEOUS");
-   DialogSetTitle(d, _("Miscellaneous Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -552,10 +515,16 @@
    DialogItemCheckButtonSetPtr(di, &tmp_saveunders);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureMiscellaneous);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgMisc = {
+   "CONFIGURE_MISCELLANEOUS",
+   N_("Miscellaneous"),
+   N_("Miscellaneous Settings"),
+   "SOUND_SETTINGS_MISCELLANEOUS",
+   _DlgFillMisc
+};
+
 #if USE_COMPOSITE
 #include "ecompmgr.h"
 
@@ -577,30 +546,19 @@
    ECompMgrConfigGet(cfg);
 }
 
-void
-SettingsComposite(void)
+static void
+_DlgFillComposite(Dialog * d, DItem * table, void *data __UNUSED__)
 {
    static cfg_composite Cfg_composite;
-   Dialog             *d;
-   DItem              *table, *di, *radio;
-
-   d = DialogFind("CONFIGURE_COMPOSITE");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_COMPOSITE");
+   DItem              *di, *radio;
 
-   d = DialogCreate("CONFIGURE_COMPOSITE");
    DialogSetTitle(d, _("Composite Settings"));
 
    /* Get current settings */
    ECompMgrConfigGet(&Cfg_composite);
    DialogSetData(d, &Cfg_composite);
 
-   table = DialogInitItem(d);
+   /* Layout */
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -660,7 +618,19 @@
    DialogItemSliderSetValPtr(di, &Cfg_composite.fade_speed);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureComposite);
+}
+
+const DialogDef     DlgComposite = {
+   "CONFIGURE_COMPOSITE",
+   N_("Composite"),
+   N_("Composite Settings"),
+   "SOUND_SETTINGS_COMPOSITE",
+   _DlgFillComposite
+};
 
-   DialogShow(d);
+void
+SettingsComposite(void)
+{
+   DialogShowSimple(&DlgComposite, NULL);
 }
 #endif
===================================================================
RCS file: /cvs/e/e16/e/src/snaps.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -3 -r1.118 -r1.119
--- snaps.c     26 Apr 2006 23:43:07 -0000      1.118
+++ snaps.c     21 Jul 2006 03:17:18 -0000      1.119
@@ -1003,30 +1003,15 @@
    SnapshotEwinDialog(sn->used);
 }
 
-void
-SettingsRemember(void)
+static void
+_DlgFillRemember(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
+   DItem              *di;
    Snapshot           *sn;
    int                 i, num;
    char                buf[128];
    const char         *s;
 
-   /* init remember window */
-   d = DialogFind("REMEMBER_WINDOW");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_REMEMBER");
-
-   d = DialogCreate("REMEMBER_WINDOW");
-   DialogSetTitle(d, _("Remembered Windows Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 3, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -1095,9 +1080,15 @@
      }
 
    DialogAddFooter(d, DLG_OC, CB_ApplyRemember);
-
-   DialogShow(d);
 }
+
+const DialogDef     DlgRemember = {
+   "CONFIGURE_PAGER",
+   NULL,
+   N_("Remembered Windows Settings"),
+   "SOUND_SETTINGS_PAGER",
+   _DlgFillRemember
+};
 
 /* ... combine writes, only save after a timeout */
 
===================================================================
RCS file: /cvs/e/e16/e/src/sound.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- sound.c     21 May 2006 18:44:16 -0000      1.44
+++ sound.c     21 Jul 2006 03:17:18 -0000      1.45
@@ -439,26 +439,12 @@
 }
 
 static void
-SettingsAudio(void)
+_DlgFillSound(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_AUDIO");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_AUDIO");
+   DItem              *di;
 
    tmp_audio = Conf_sound.enable;
 
-   d = DialogCreate("CONFIGURE_AUDIO");
-   DialogSetTitle(d, _("Audio Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -479,10 +465,16 @@
 #endif
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureAudio);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgSound = {
+   "CONFIGURE_AUDIO",
+   N_("Sound"),
+   N_("Audio Settings"),
+   "SOUND_SETTINGS_AUDIO",
+   _DlgFillSound
+};
+
 /*
  * IPC functions
  */
@@ -506,7 +498,7 @@
 
    if (!strncmp(cmd, "cfg", 3))
      {
-       SettingsAudio();
+       DialogShowSimple(&DlgSound, NULL);
      }
    else if (!strncmp(cmd, "del", 3))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/tooltips.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -3 -r1.104 -r1.105
--- tooltips.c  13 May 2006 13:25:30 -0000      1.104
+++ tooltips.c  21 Jul 2006 03:17:18 -0000      1.105
@@ -839,28 +839,14 @@
 }
 
 static void
-SettingsTooltips(void)
+_DlgFillTooltips(Dialog * d, DItem * table, void *data __UNUSED__)
 {
-   Dialog             *d;
-   DItem              *table, *di;
-
-   d = DialogFind("CONFIGURE_TOOLTIPS");
-   if (d)
-     {
-       SoundPlay("SOUND_SETTINGS_ACTIVE");
-       DialogShow(d);
-       return;
-     }
-   SoundPlay("SOUND_SETTINGS_TOOLTIPS");
+   DItem              *di;
 
    tmp_tooltips = Conf_tooltips.enable;
    tmp_tooltiptime = Conf_tooltips.delay / 10;
    tmp_roottip = Conf_tooltips.showroottooltip;
 
-   d = DialogCreate("CONFIGURE_TOOLTIPS");
-   DialogSetTitle(d, _("Tooltip Settings"));
-
-   table = DialogInitItem(d);
    DialogItemTableSetOptions(table, 2, 0, 0, 0);
 
    if (Conf.dialogs.headers)
@@ -888,16 +874,22 @@
    DialogItemSliderSetValPtr(di, &tmp_tooltiptime);
 
    DialogAddFooter(d, DLG_OAC, CB_ConfigureTooltips);
-
-   DialogShow(d);
 }
 
+const DialogDef     DlgTooltips = {
+   "CONFIGURE_TOOLTIPS",
+   N_("Tooltips"),
+   N_("Tooltip Settings"),
+   "SOUND_SETTINGS_TOOLTIPS",
+   _DlgFillTooltips
+};
+
 static void
 TooltipsIpc(const char *params, Client * c __UNUSED__)
 {
    if (params && !strncmp(params, "cfg", 3))
      {
-       SettingsTooltips();
+       DialogShowSimple(&DlgTooltips, NULL);
      }
 }
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to