Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        dialog.c dialog.h mod-misc.c settings.c settings.h 


Log Message:
Add combined configuration dialog.

===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -3 -r1.169 -r1.170
--- dialog.c    20 Aug 2006 18:40:41 -0000      1.169
+++ dialog.c    20 Aug 2006 19:30:55 -0000      1.170
@@ -249,6 +249,13 @@
       XKeysymToKeycode(disp, XStringToKeysym(key));
 }
 
+void
+DialogKeybindingsDestroy(Dialog * d)
+{
+   _EFREE(d->keybindings);
+   d->num_bindings = 0;
+}
+
 Dialog             *
 DialogCreate(const char *name)
 {
@@ -295,7 +302,7 @@
 }
 
 void
-DialogDestroyButtons(Dialog * d, int clean)
+DialogButtonsDestroy(Dialog * d, int clean)
 {
    int                 i;
 
@@ -318,15 +325,14 @@
       Efree(d->title);
    if (d->text)
       Efree(d->text);
-   DialogDestroyButtons(d, 0);
+   DialogButtonsDestroy(d, 0);
+   DialogKeybindingsDestroy(d);
    if (d->item)
       DialogItemDestroy(d->item, 0);
    if (d->iclass)
       ImageclassDecRefcount(d->iclass);
    if (d->tclass)
       TextclassDecRefcount(d->tclass);
-   if (d->keybindings)
-      Efree(d->keybindings);
 
    FreePmapMask(&(d->pmm_bg));
    EFreePixmap(d->pmap);
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- dialog.h    20 Aug 2006 17:39:32 -0000      1.16
+++ dialog.h    20 Aug 2006 19:30:55 -0000      1.17
@@ -85,7 +85,8 @@
 void                DialogClose(Dialog * d);
 
 void                DialogArrange(Dialog * d, int resize);
-void                DialogDestroyButtons(Dialog * d, int clean);
+void                DialogButtonsDestroy(Dialog * d, int clean);
+void                DialogKeybindingsDestroy(Dialog * d);
 void                DialogItemTableEmpty(DItem * di);
 
 void                DialogShowSimple(const DialogDef * dd, void *data);
===================================================================
RCS file: /cvs/e/e16/e/src/mod-misc.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- mod-misc.c  11 Aug 2006 16:09:39 -0000      1.39
+++ mod-misc.c  20 Aug 2006 19:30:55 -0000      1.40
@@ -211,6 +211,8 @@
           DialogShowSimple(&DlgRemember, NULL);
        else if (!strncmp(prm, "session", 2))
           DialogShowSimple(&DlgSession, NULL);
+       else if (prm[0] == '\0')
+          SettingsConfiguration();
      }
    else if (!strncmp(cmd, "arrange", 3))
      {
===================================================================
RCS file: /cvs/e/e16/e/src/settings.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -3 -r1.155 -r1.156
--- settings.c  8 Aug 2006 03:58:42 -0000       1.155
+++ settings.c  20 Aug 2006 19:30:55 -0000      1.156
@@ -616,3 +616,91 @@
    DialogShowSimple(&DlgComposite, NULL);
 }
 #endif
+
+/*
+ * Combined configuration dialog
+ */
+
+static const DialogDef *dialogs[] = {
+   &DlgFocus,
+   &DlgMoveResize,
+   &DlgPlacement,
+   &DlgDesks,
+   &DlgAreas,
+   &DlgPagers,
+   &DlgMenus,
+   &DlgAutoraise,
+   &DlgTooltips,
+   &DlgSound,
+   &DlgGroupDefaults,
+   &DlgRemember,
+   &DlgFx,
+   &DlgBackground,
+   &DlgThemeTrans,
+#if USE_COMPOSITE
+   &DlgComposite,
+#endif
+   &DlgSession,
+   &DlgMisc,
+};
+#define N_CFG_DLGS (sizeof(dialogs)/sizeof(DialogDef*))
+
+static void
+CB_DlgSelect(Dialog * d, int val, void *data)
+{
+   const DialogDef    *dd = dialogs[val];
+   DItem              *table = data;
+
+   if (!table)
+      return;
+   if (!dd->fill)
+      return;
+
+   DialogItemTableEmpty(table);
+   DialogButtonsDestroy(d, 1);
+   DialogKeybindingsDestroy(d);
+
+   DialogSetTitle(d, _(dd->title));
+   DialogFill(d, table, dd, NULL);
+
+   DialogArrange(d, 1);
+}
+
+static void
+_DlgFillConfiguration(Dialog * d, DItem * table, void *data __UNUSED__)
+{
+   DItem              *di, *buttons, *content;
+   unsigned int        i;
+
+   DialogItemTableSetOptions(table, 2, 0, 0, 0);
+
+   buttons = DialogAddItem(table, DITEM_TABLE);
+   content = DialogAddItem(table, DITEM_TABLE);
+
+   for (i = 0; i < N_CFG_DLGS; i++)
+     {
+       di = DialogAddItem(buttons, DITEM_BUTTON);
+       DialogItemSetPadding(di, 2, 2, 0, 0);
+       DialogItemSetText(di, dialogs[i]->label);
+       DialogItemSetCallback(di, CB_DlgSelect, i, content);
+     }
+
+   DialogFill(d, content, dialogs[0], NULL);
+}
+
+static const DialogDef DlgConfiguration = {
+   "CONFIGURE_ALL",
+   NULL,
+   N_("Enlightenment Settings"),
+   "SOUND_SETTINGS_ALL",
+   NULL,
+   NULL,
+   _DlgFillConfiguration,
+   0, NULL,
+};
+
+void
+SettingsConfiguration(void)
+{
+   DialogShowSimple(&DlgConfiguration, NULL);
+}
===================================================================
RCS file: /cvs/e/e16/e/src/settings.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- settings.h  21 Jul 2006 03:17:18 -0000      1.1
+++ settings.h  20 Aug 2006 19:30:55 -0000      1.2
@@ -1,16 +1,51 @@
+/*
+ * Copyright (C) 2006 Kim Woelders
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies of the Software, its documentation and marketing & publicity
+ * materials, and acknowledgment shall be given in the documentation, materials
+ * and software packages that this Software was used.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef _SETTINGS_H_
+#define _SETTINGS_H_
 
 /* settings.c */
+void                SettingsConfiguration(void);
 void                SettingsComposite(void);
 
 #ifdef _DIALOG_H_
+extern const DialogDef DlgAreas;
 extern const DialogDef DlgAutoraise;
+extern const DialogDef DlgBackground;
 extern const DialogDef DlgComposite;
+extern const DialogDef DlgDesks;
+extern const DialogDef DlgFocus;
+extern const DialogDef DlgFx;
 extern const DialogDef DlgGroupDefaults;
+extern const DialogDef DlgMenus;
 extern const DialogDef DlgMisc;
 extern const DialogDef DlgMoveResize;
+extern const DialogDef DlgPagers;
 extern const DialogDef DlgPlacement;
 extern const DialogDef DlgRemember;
 extern const DialogDef DlgSession;
 extern const DialogDef DlgSound;
+extern const DialogDef DlgThemeTrans;
 extern const DialogDef DlgTooltips;
 #endif
+
+#endif /* _SETTINGS_H_ */



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to