Enlightenment CVS committal

Author  : essiene
Project : e17
Module  : proto

Dir     : e17/proto/entrance_edit_gui/src/gui


Modified Files:
        behavior.c layout.c main.c x_settings.c 


Log Message:
- Add temporary fix to ew_entry bug. I think MoOM is going to rewrite etk_entry 
sometime, that will be _the_ permanent fix :)
- make xsettings dialog work well with it. It now displays ok, but its not yet 
hooked up to libentrance_edit.
- Modified ew_checkbox to be fit for consumption. It was theoritically okay 
before, but actually using it felt clumsy. I feel happier now :) [moral lesson 
- never design and api and leave it be without actually using it. The taste of 
the eating is in the pudding... no wait! there's something wrong with that 
statement :P]
- Code up Behaviour dialog. Works poifectly!!!
- Added widgets stub to gui/layouts.c
- Rearranged main config ui order of items.
- TODO

===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/behavior.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- behavior.c  13 Aug 2006 02:48:19 -0000      1.2
+++ behavior.c  16 Aug 2006 04:18:03 -0000      1.3
@@ -1,7 +1,332 @@
+#include <limits.h>
 #include <Entrance_Widgets.h>
+#include <Entrance_Edit.h>
 #include <stdio.h>
 
+static void _cb_close(void*, void*);
+static void _cb_apply(void*, void*);
+static void _cb_ok(void*, void*);
+
+static void _close(void);
+static int _apply(void);
+static int _save_to_file(void);
+
+static Entrance_Dialog win;
+
+static Entrance_Widget group_login;
+static Entrance_Widget login_autologin_mode;
+static Entrance_Entry login_autologin_user;
+
+static int val_login_mode;
+static char* val_login_user;
+
+static void _build_group_login(void);
+static void _load_login(void);
+static void _save_login(void);
+
+static Entrance_Widget group_presel;
+static Entrance_Widget presel_mode;
+static Entrance_Entry presel_prevuser;
+
+static int val_presel_mode;
+static char* val_presel_prevuser;
+
+static void _build_group_presel(void);
+static void _load_presel(void);
+static void _save_presel(void);
+
+static Entrance_Widget group_remember;
+static Entrance_Widget remember_user_remember;
+static Entrance_Entry remember_remember_count;
+static Entrance_Entry remember_user_count;
+
+static int val_user_remember;
+static int val_user_remember_count;
+static int val_user_count;
+
+static void _build_group_remember(void);
+static void _load_remember(void);
+static void _save_remember(void);
+
+
+static Entrance_Widget group_others;
+static Entrance_Widget others_auth;
+static Entrance_Widget others_engine;
+static Entrance_Widget others_reboot;
+static Entrance_Widget others_halt;
+
+static int val_auth;
+static int val_engine;
+static int val_reboot;
+static int val_halt;
+
+static void _build_group_others(void);
+static void _load_others(void);
+static void _save_others(void);
+
 void
 egui_behavior_dialog_show() {
-       printf("Behavior clicked\n");
+       win = ew_dialog_new(_("Entrance Configuration - Behaviour"), EW_FALSE);
+
+       _build_group_login();
+       _build_group_presel();
+       _build_group_remember();
+       _build_group_others();
+
+       ew_dialog_close_button_add(win, _cb_close, NULL);
+       ew_dialog_apply_button_add(win, _cb_apply, NULL);
+       ew_dialog_ok_button_add(win, _cb_ok, NULL);
+
+       ew_dialog_show(win);
+
+       ew_entry_bugfix_makeshow(login_autologin_user);
+       ew_entry_bugfix_makeshow(presel_prevuser);
+       ew_entry_bugfix_makeshow(remember_user_count);
+       ew_entry_bugfix_makeshow(remember_remember_count);
+}
+
+static void
+_build_group_login(void)
+{
+       group_login = ew_dialog_group_add(win, _("AutoLogin"), 
EW_GROUP_VERTICAL);
+
+       val_login_user = NULL;
+
+       _load_login();
+
+       login_autologin_mode = ew_checkbox_new(_("Enable Autologin"));
+       if(val_login_mode)
+               ew_checkbox_toggle(login_autologin_mode);
+       ew_group_add(group_login, login_autologin_mode);
+
+       login_autologin_user = ew_entry_new(_("Autologin User"), 
val_login_user, EW_FALSE);
+       ew_group_add(group_login, login_autologin_user);
+}
+
+
+static void
+_build_group_presel(void)
+{
+       group_presel = ew_dialog_group_add(win, _("Preselect"), 
EW_GROUP_VERTICAL);
+
+       val_presel_prevuser = NULL;
+       _load_presel();
+
+       presel_mode = ew_checkbox_new(_("Enable Preselect Mode"));
+       if(val_presel_mode)
+               ew_checkbox_toggle(presel_mode);
+       ew_group_add(group_presel, presel_mode);
+
+       presel_prevuser = ew_entry_new(_("Previous Preselect User"), 
val_presel_prevuser, EW_FALSE);
+       ew_group_add(group_presel, presel_prevuser);
+}
+
+
+
+static void
+_build_group_others(void)
+{
+       group_others = ew_dialog_group_add(win, _("Others"), EW_GROUP_VERTICAL);
+
+       _load_others();
+
+       others_auth = ew_checkbox_new(_("Use Authentication"));
+       if(val_auth)
+               ew_checkbox_toggle(others_auth);
+       ew_group_add(group_others, others_auth);
+
+       others_engine = ew_checkbox_new(_("Use Engine"));
+       if(val_engine)
+               ew_checkbox_toggle(others_engine);
+       ew_group_add(group_others, others_engine);
+
+       others_reboot = ew_checkbox_new(_("Enable Reboot Button"));
+       if(val_reboot)
+               ew_checkbox_toggle(others_reboot);
+       ew_group_add(group_others, others_reboot);
+
+       others_halt = ew_checkbox_new(_("Enable Halt Button"));
+       if(val_halt)
+               ew_checkbox_toggle(others_halt);
+       ew_group_add(group_others, others_halt);
+}
+
+static void
+_build_group_remember(void)
+{
+       char str[PATH_MAX];
+       group_remember = ew_dialog_group_add(win, _("Remember"), 
EW_GROUP_VERTICAL);
+
+       _load_remember();
+
+       remember_user_remember = ew_checkbox_new(_("Enable User Remember"));
+       if(val_user_remember)
+               ew_checkbox_toggle(remember_user_remember);
+       ew_group_add(group_remember, remember_user_remember);
+
+
+       snprintf(str, PATH_MAX, "%d", val_user_remember_count);
+       remember_remember_count = ew_entry_new(_("User Remember Count"), str, 
EW_FALSE);
+       ew_group_add(group_remember, remember_remember_count);
+
+       snprintf(str, PATH_MAX, "%d", val_user_count);
+       remember_user_count     = ew_entry_new(_("User Count"), str,  EW_FALSE);
+       ew_group_add(group_remember, remember_user_count);
+}
+
+
+static void
+_load_login(void)
+{
+       val_login_mode = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT);
+       val_login_user = 
entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR);
+}
+
+static void
+_load_presel(void)
+{
+       val_presel_mode = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT);
+       val_presel_prevuser = 
entrance_edit_string_get(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR);
+}
+
+static void
+_load_others(void)
+{
+       val_auth = entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT);
+       val_engine = entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT);
+       val_reboot = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT);
+       val_halt = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT);
+}
+
+static void
+_load_remember(void)
+{
+       val_user_remember = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT);
+       val_user_remember_count  = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT);
+       val_user_count = 
entrance_edit_int_get(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT);
+}
+
+static void
+_save_login(void)
+{
+       if(ew_checkbox_is_active(login_autologin_mode))
+               val_login_mode = 1;
+       else
+               val_login_mode = 0;
+
+       val_login_user = ew_entry_get(login_autologin_user);
+
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_MODE_INT, 
val_login_mode);
+       entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_AUTOLOGIN_USER_STR, 
val_login_user);
+}
+
+static void
+_save_presel(void)
+{
+       if(ew_checkbox_is_active(presel_mode))
+               val_presel_mode = 1;
+       else
+               val_presel_mode = 0;
+
+       val_presel_prevuser = ew_entry_get(presel_prevuser);
+
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_MODE_INT, 
val_presel_mode);
+       entrance_edit_string_set(ENTRANCE_EDIT_KEY_CLIENT_PRESEL_PREVUSER_STR, 
val_presel_prevuser);
+}
+
+static void
+_save_remember(void)
+{
+       if(ew_checkbox_is_active(remember_user_remember))
+               val_user_remember = 1;
+       else
+               val_user_remember = 0;
+
+       val_user_remember_count = atoi(ew_entry_get(remember_remember_count));
+       val_user_count  = atoi(ew_entry_get(remember_user_count));
+
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_INT, 
val_user_remember);
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_REMEMBER_N_INT, 
val_user_remember_count);
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_USER_COUNT_INT, 
val_user_count);
+}
+
+
+static void
+_save_others(void)
+{
+       if(ew_checkbox_is_active(others_auth))
+               val_auth = 1;
+       else
+               val_auth = 0;
+
+       if(ew_checkbox_is_active(others_engine))
+               val_engine = 1;
+       else 
+               val_engine = 0;
+
+       if(ew_checkbox_is_active(others_reboot))
+               val_reboot = 1;
+       else
+               val_reboot = 0;
+
+       if(ew_checkbox_is_active(others_halt))
+               val_halt = 1;
+       else
+               val_halt = 0;
+
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_AUTH_INT, val_auth);
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_ENGINE_INT, val_engine);
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_REBOOT_INT, 
val_reboot);
+       entrance_edit_int_set(ENTRANCE_EDIT_KEY_CLIENT_SYSTEM_HALT_INT, 
val_halt);
+}
+
+static int
+_save_to_file(void)
+{
+       if(entrance_edit_save())
+               return 1;
+       else
+               return 0;
+}
+
+static void
+_cb_close(void* sender, void* data)
+{
+       _close();
+}
+
+static void
+_cb_apply(void* sender, void* data)
+{
+       _apply();
+}
+
+static void
+_cb_ok(void* sender, void* data)
+{
+       if(_apply()) 
+               _close();
+}
+
+
+static void
+_close(void)
+{
+       ew_dialog_destroy(win);
+}
+
+static int
+_apply(void)
+{
+       _save_login();
+       _save_presel();
+       _save_remember();
+       _save_others();
+
+       if(_save_to_file())
+               return 1;
+       else
+               ew_messagebox_ok("Entrance Configuration - Error", "Cannot save 
changes. Please Check You Permissions", EW_MESSAGEBOX_ICON_ERROR);
+
+       return 0;
 }
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/layout.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- layout.c    14 Aug 2006 17:08:55 -0000      1.4
+++ layout.c    16 Aug 2006 04:18:03 -0000      1.5
@@ -1,6 +1,12 @@
 #include <Entrance_Widgets.h>
 #include <stdio.h>
 
+static Entrance_Widget group_display;
+static Entrance_Entry display_greeting_before;
+static Entrance_Entry display_greeting_after;
+static Entrance_Entry display_date_format;
+static Entrance_Entry display_time_format;
+
 void
 egui_layout_dialog_show() {
        ew_messagebox_ok("notice", "This is a message", 
EW_MESSAGEBOX_ICON_MESSAGE);
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/main.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- main.c      15 Aug 2006 15:01:33 -0000      1.9
+++ main.c      16 Aug 2006 04:18:03 -0000      1.10
@@ -33,10 +33,10 @@
    Entrance_List tree = ew_edjelist_new("<b>Configuration</b>", 320, 240, 52, 
90);
    ew_edjelist_add(tree, _("Theme"), edjefile, "icons/main/theme", NULL, 0, 
egui_theme_dialog_show);
    ew_edjelist_add(tree, _("Background"), edjefile, "icons/main/background", 
NULL, 0, egui_background_dialog_show);
-   ew_edjelist_add(tree, _("Layout"), edjefile, "icons/main/layout", NULL, 0,  
egui_layout_dialog_show);
    ew_edjelist_add(tree, _("Behavior"), edjefile, "icons/main/behavior", NULL, 
0,  egui_behavior_dialog_show);
-   ew_edjelist_add(tree, _("Sessions"),edjefile, "icons/main/sessions", NULL, 
0,  egui_sessions_dialog_show);
    ew_edjelist_add(tree, _("X settings"), edjefile, 
"icons/main/xsettings",NULL, 0, egui_x_settings_dialog_show);
+   ew_edjelist_add(tree, _("Sessions"),edjefile, "icons/main/sessions", NULL, 
0,  egui_sessions_dialog_show);
+   ew_edjelist_add(tree, _("Layout"), edjefile, "icons/main/layout", NULL, 0,  
egui_layout_dialog_show);
    ew_edjelist_add(tree, _("Modules"), edjefile, "icons/main/modules",NULL, 0, 
NULL);
 
    Entrance_Widget group = ew_dialog_group_add(dialog, _("Configuration"), 
EW_GROUP_VERTICAL);
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/gui/x_settings.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- x_settings.c        15 Aug 2006 04:52:22 -0000      1.3
+++ x_settings.c        16 Aug 2006 04:18:03 -0000      1.4
@@ -55,6 +55,10 @@
        ew_dialog_ok_button_add(win, _xs_cb_ok, NULL);
 
        ew_dialog_show(win);
+
+       ew_entry_bugfix_makeshow(entry_attempts);
+       ew_entry_bugfix_makeshow(entry_xession);
+       ew_entry_bugfix_makeshow(entry_xserver);
 }
 
 



-------------------------------------------------------------------------
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