Enlightenment CVS committal

Author  : essiene
Project : e17
Module  : proto

Dir     : e17/proto/entrance_edit_gui/src/widgets


Modified Files:
        ew.c ew.h ew_button.c ew_checkbox.c ew_group.c ew_messagebox.c 
        ew_radio_button.c ew_toggle_button.c 


Log Message:
- Fix bug occuring when trying to show any messagebox (trying to apply/ok with 
no user permissions, etc)
- Make sure that all Entrance_Widget based widgets properly deal with .title 
and if they ignore it, have a good reason to.
- Update TODO

===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ew.c        25 Sep 2006 19:08:56 -0000      1.5
+++ ew.c        29 Sep 2006 10:29:37 -0000      1.6
@@ -32,6 +32,7 @@
        Entrance_Widget ew = calloc(1, sizeof(*ew));
        if(ew) 
        {
+               ew->title = NULL;
                ew->owner = NULL;
                ew->box = NULL;
        }
@@ -39,6 +40,17 @@
        return ew;
 }
 
+void
+ew_title_set(Entrance_Widget ew, char *title)
+{
+       if(!title)
+               return;
+
+       if(ew->title)
+               free(ew->title);
+
+       ew->title = strdup(title);
+}
 
 
 /* privates */
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ew.h        29 Sep 2006 02:36:38 -0000      1.7
+++ ew.h        29 Sep 2006 10:29:37 -0000      1.8
@@ -38,5 +38,6 @@
 void ew_main_quit(void);
 
 Entrance_Widget ew_new(void);
+void ew_title_set(Entrance_Widget ew, char *title);
 
 #endif
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_button.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ew_button.c 15 Aug 2006 13:52:07 -0000      1.2
+++ ew_button.c 29 Sep 2006 10:29:37 -0000      1.3
@@ -11,7 +11,15 @@
                return NULL;
        }
 
-       ew->owner = etk_button_new_with_label(label);
+       ew_title_set(ew, label);
+
+       if(label)
+       {
+               ew->owner = etk_button_new_with_label(label);
+       }
+       else
+               ew->owner = etk_button_new();
+
        ew_button_onclick_set(ew, func, data);
 
        return ew;
@@ -26,6 +34,9 @@
 
 void
 ew_button_label_set(Entrance_Widget ew, char *label) {
+       if(!label)
+               return;
+       ew_title_set(ew, label);
        etk_button_label_set(ETK_BUTTON(ew->owner), label);
 }
 
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_checkbox.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ew_checkbox.c       16 Aug 2006 04:18:03 -0000      1.2
+++ ew_checkbox.c       29 Sep 2006 10:29:37 -0000      1.3
@@ -9,6 +9,7 @@
                return NULL;
 
        ew->owner = etk_check_button_new();
+       ew_title_set(ew, label);
        if(label)
                ew_button_label_set(ew, label);
 
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_group.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ew_group.c  29 Sep 2006 02:36:38 -0000      1.7
+++ ew_group.c  29 Sep 2006 10:29:37 -0000      1.8
@@ -10,10 +10,11 @@
                return NULL;
        }
 
-       ew->title = strdup(title);
-
+       ew_title_set(ew, title);
        if(title)
-         ew->owner = etk_frame_new(title);
+       {
+               ew->owner = etk_frame_new(title);
+       }
        else
          ew->owner = etk_vbox_new(ETK_FALSE, 0);
 
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_messagebox.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ew_messagebox.c     25 Sep 2006 19:08:56 -0000      1.10
+++ ew_messagebox.c     29 Sep 2006 10:29:37 -0000      1.11
@@ -45,6 +45,9 @@
 ew_messagebox_ok(const char *title, const char *message, const char *icon) 
 {
        Entrance_Dialog ew = _ew_messagebox_new(title, message, icon);
+       if(!ew)
+               return NULL;
+
        ew_notice_ok_button_add(ew, _ew_messagebox_cb_ok, ew);
        ew_notice_show(ew);
 
@@ -54,6 +57,8 @@
 Entrance_Dialog
 ew_messagebox_ok_cancel(const char *title, const char *message, const char 
*icon, void (*funct)(void *, int, void *)) {
        Entrance_Dialog ew = _ew_messagebox_new(title, message, icon);
+       if(!ew)
+               return NULL;
        ew_notice_ok_button_add(ew, funct, NULL);
        ew_notice_cancel_button_add(ew, NULL, NULL);
 
@@ -64,6 +69,8 @@
 Entrance_Dialog
 ew_messagebox_yes_no(const char *title, const char *message, const char *icon, 
void (*funct)(void *, int, void *)) {
        Entrance_Dialog ew = _ew_messagebox_new(title, message, icon);
+       if(!ew)
+               return NULL;
        ew_notice_yes_button_add(ew, funct, NULL);
        ew_notice_no_button_add(ew, NULL, NULL);
 
@@ -74,6 +81,8 @@
 Entrance_Dialog
 ew_messagebox_yes_no_cancel(const char *title, const char *message, const char 
*icon, void (*funct)(void *, int, void *)) {
        Entrance_Dialog ew = _ew_messagebox_new(title, message, icon);
+       if(!ew)
+               return NULL;
        ew_notice_yes_button_add(ew, funct, NULL);
        ew_notice_no_button_add(ew, NULL, NULL);
        ew_notice_cancel_button_add(ew, NULL, NULL);
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_radio_button.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ew_radio_button.c   15 Aug 2006 13:52:07 -0000      1.1
+++ ew_radio_button.c   29 Sep 2006 10:29:37 -0000      1.2
@@ -15,6 +15,8 @@
        else
                ew->owner = etk_radio_button_new(NULL);
 
+       ew_title_set(ew, label);
+
        if(label)
                ew_button_label_set(ew, label);
 
===================================================================
RCS file: /cvs/e/e17/proto/entrance_edit_gui/src/widgets/ew_toggle_button.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ew_toggle_button.c  15 Aug 2006 13:52:07 -0000      1.1
+++ ew_toggle_button.c  29 Sep 2006 10:29:37 -0000      1.2
@@ -8,6 +8,7 @@
                return NULL;
        
        ew->owner = etk_toggle_button_new();
+       ew_title_set(ew, label);
        if(label)
                ew_button_label_set(ew, label);
        



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