Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h mod-misc.c session.c settings.c 


Log Message:
Move session settings to separate dialog.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.511
retrieving revision 1.512
diff -u -3 -r1.511 -r1.512
--- E.h 9 Nov 2005 20:36:35 -0000       1.511
+++ E.h 10 Nov 2005 21:39:29 -0000      1.512
@@ -1148,6 +1148,7 @@
 void                SetSMID(const char *smid);
 void                MatchEwinToSM(EWin * ewin);
 void                autosave(void);
+void                SettingsSession(void);
 
 /* settings.c */
 void                SettingsMoveResize(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/mod-misc.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- mod-misc.c  9 Nov 2005 20:36:35 -0000       1.25
+++ mod-misc.c  10 Nov 2005 21:39:29 -0000      1.26
@@ -203,6 +203,8 @@
           SettingsPlacement();
        else if (!strncmp(prm, "remember", 2))
           SettingsRemember();
+       else if (!strncmp(prm, "session", 2))
+          SettingsSession();
      }
    else if (!strncmp(cmd, "arrange", 3))
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -3 -r1.111 -r1.112
--- session.c   9 Nov 2005 20:36:35 -0000       1.111
+++ session.c   10 Nov 2005 21:39:29 -0000      1.112
@@ -1063,3 +1063,71 @@
        break;
      }
 }
+
+/*
+ * Session dialog
+ */
+static char         tmp_session_script;
+static char         tmp_logout_dialog;
+static char         tmp_reboot_halt;
+
+static void
+CB_ConfigureSession(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
+{
+   if (val < 2)
+     {
+       Conf.session.enable_script = tmp_session_script;
+       Conf.session.enable_logout_dialog = tmp_logout_dialog;
+       Conf.session.enable_reboot_halt = tmp_reboot_halt;
+     }
+   autosave();
+}
+
+void
+SettingsSession(void)
+{
+   Dialog             *d;
+   DItem              *table, *di;
+
+   d = FindItem("CONFIGURE_SESSION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
+   if (d)
+     {
+       SoundPlay("SOUND_SETTINGS_ACTIVE");
+       ShowDialog(d);
+       return;
+     }
+   SoundPlay("SOUND_SETTINGS_SESSION");
+
+   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)
+      DialogAddHeader(d, "pix/miscellaneous.png",
+                     _("Enlightenment Session\n" "Settings Dialog\n"));
+
+   di = DialogAddItem(table, DITEM_CHECKBUTTON);
+   DialogItemSetColSpan(di, 2);
+   DialogItemSetText(di, _("Enable Session Script"));
+   DialogItemCheckButtonSetPtr(di, &tmp_session_script);
+
+   di = DialogAddItem(table, DITEM_CHECKBUTTON);
+   DialogItemSetColSpan(di, 2);
+   DialogItemSetText(di, _("Enable Logout Dialog"));
+   DialogItemCheckButtonSetPtr(di, &tmp_logout_dialog);
+
+   di = DialogAddItem(table, DITEM_CHECKBUTTON);
+   DialogItemSetColSpan(di, 2);
+   DialogItemSetText(di, _("Enable Reboot/Halt on Logout"));
+   DialogItemCheckButtonSetPtr(di, &tmp_reboot_halt);
+
+   DialogAddFooter(d, DLG_OAC, CB_ConfigureSession);
+
+   ShowDialog(d);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -3 -r1.147 -r1.148
--- settings.c  9 Nov 2005 20:36:35 -0000       1.147
+++ settings.c  10 Nov 2005 21:39:29 -0000      1.148
@@ -479,9 +479,6 @@
 
 static char         tmp_dialog_headers;
 static char         tmp_button_image;
-static char         tmp_session_script;
-static char         tmp_logout_dialog;
-static char         tmp_reboot_halt;
 static char         tmp_animate_startup;
 static char         tmp_saveunders;
 
@@ -492,9 +489,6 @@
      {
        Conf.dialogs.headers = tmp_dialog_headers;
        Conf.dialogs.button_image = tmp_button_image;
-       Conf.session.enable_script = tmp_session_script;
-       Conf.session.enable_logout_dialog = tmp_logout_dialog;
-       Conf.session.enable_reboot_halt = tmp_reboot_halt;
        Conf.startup.animate = tmp_animate_startup;
        Conf.save_under = tmp_saveunders;
      }
@@ -519,9 +513,6 @@
 
    tmp_dialog_headers = Conf.dialogs.headers;
    tmp_button_image = Conf.dialogs.button_image;
-   tmp_session_script = Conf.session.enable_script;
-   tmp_logout_dialog = Conf.session.enable_logout_dialog;
-   tmp_reboot_halt = Conf.session.enable_reboot_halt;
    tmp_animate_startup = Conf.startup.animate;
    tmp_saveunders = Conf.save_under;
 
@@ -550,24 +541,6 @@
 
    di = DialogAddItem(table, DITEM_CHECKBUTTON);
    DialogItemSetColSpan(di, 2);
-   DialogItemSetText(di, _("Enable Session Script"));
-   DialogItemCheckButtonSetPtr(di, &tmp_session_script);
-
-   di = DialogAddItem(table, DITEM_CHECKBUTTON);
-   DialogItemSetColSpan(di, 2);
-   DialogItemSetText(di, _("Enable Logout Dialog"));
-   DialogItemCheckButtonSetPtr(di, &tmp_logout_dialog);
-
-   di = DialogAddItem(table, DITEM_CHECKBUTTON);
-   DialogItemSetColSpan(di, 2);
-   DialogItemSetText(di, _("Enable Reboot/Halt on Logout"));
-   DialogItemCheckButtonSetPtr(di, &tmp_reboot_halt);
-
-   di = DialogAddItem(table, DITEM_SEPARATOR);
-   DialogItemSetColSpan(di, 2);
-
-   di = DialogAddItem(table, DITEM_CHECKBUTTON);
-   DialogItemSetColSpan(di, 2);
    DialogItemSetText(di, _("Enable sliding startup windows"));
    DialogItemCheckButtonSetPtr(di, &tmp_animate_startup);
 




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to