Enlightenment CVS committal

Author  : fletch3k
Project : misc
Module  : enotes

Dir     : misc/enotes/src


Modified Files:
        config.c controlcentre.c ipc.c ipc.h main.c note.c note.h 
        settings.c 


Log Message:
Azundris Requests - Closes if no CC and last note is closed - opens new note if enotes 
is run without CC for the first time and regardless if ran second, third, etc... times.

===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/config.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- config.c    15 Sep 2004 21:01:22 -0000      1.11
+++ config.c    24 Sep 2004 13:59:56 -0000      1.12
@@ -170,8 +170,7 @@
        snprintf(homedir_e_notes, PATH_MAX, "%s/.e/notes", getenv("HOME"));
        snprintf(homedir_e_notes_config, PATH_MAX,
                 "%s/.e/notes/config.xml", getenv("HOME"));
-       snprintf(global_config, PATH_MAX,
-                "%s/config.xml", PACKAGE_DATA_DIR);
+       snprintf(global_config, PATH_MAX, "%s/config.xml", PACKAGE_DATA_DIR);
 
        mkdir(homedir_e, 0700);
        mkdir(homedir_e_notes, 0700);
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/controlcentre.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- controlcentre.c     14 Sep 2004 21:03:04 -0000      1.15
+++ controlcentre.c     24 Sep 2004 13:59:56 -0000      1.16
@@ -227,6 +227,11 @@
        XmlWriteHandle *p;
        int             x, y, width, height;
 
+       if (controlcentre == NULL) {
+               free(locfn);
+               return;
+       }
+
        ecore_evas_geometry_get(controlcentre->win, &x, &y, &width, &height);
 
        snprintf(locfn, PATH_MAX, DEF_CC_CONFIG_LOC, getenv("HOME"));
@@ -324,8 +329,8 @@
 {
        /* FIXME: The line below should be removed when
         *          * ecore_evas is fixed. */
-        ecore_evas_iconified_set((Ecore_Evas*)data,0);
-               
+       ecore_evas_iconified_set((Ecore_Evas *) data, 0);
+
        ecore_evas_iconified_set((Ecore_Evas *) data, 1);
        return;
 }
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/ipc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ipc.c       9 Sep 2004 11:57:30 -0000       1.8
+++ ipc.c       24 Sep 2004 13:59:56 -0000      1.9
@@ -139,6 +139,8 @@
                                        new_note_with_values(0, 0, 325, 0,
                                                             "An IPC command was 
recieved which\nwants to open the control centre, but the\ncontrol centre is already 
open!");
                                }
+                       } else if (p->cmd == DEFNOTE) {
+                               new_note();
                        }
                }
        }
@@ -204,6 +206,8 @@
        /* Set the command */
        if (!strcmp(one, "NOTE")) {
                p->cmd = NOTE;
+       } else if (!strcmp(one, "DEFNOTE")) {
+               p->cmd = DEFNOTE;
        } else if (!strcmp(one, "CLOSE")) {
                p->cmd = CLOSE;
        } else if (!strcmp(one, "CONTROLCENTREOPEN")) {
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/ipc.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ipc.h       26 Aug 2004 20:50:24 -0000      1.5
+++ ipc.h       24 Sep 2004 13:59:56 -0000      1.6
@@ -31,6 +31,7 @@
 
 typedef enum {                 /* More to come. :-) */
        NOTE,
+       DEFNOTE,
        CLOSE,
        CONTROLCENTREOPEN,
        CONTROLCENTRECLOSE
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- main.c      15 Sep 2004 21:01:22 -0000      1.15
+++ main.c      24 Sep 2004 13:59:56 -0000      1.16
@@ -74,8 +74,7 @@
                        dml("Control Centre Setup", 1);
                } else {
                        dml("No Control Centre - Displaying Notice", 1);
-                       msgbox("E-Notes is Running",
-                              "Since the Control Centre is turned off,\nthis message 
is being displayed to say:\n\nE-Notes is running.");
+                       new_note();
                }
 
                /* Autoloading */
@@ -97,9 +96,8 @@
                set_cc_pos();
 
                /* Autosaving */
-               if (main_config->autosave == 1) {
+               if (main_config->autosave == 1)
                        autosave();
-               }
 
                /* Shutdown the E-Libs */
                edje_shutdown();
@@ -107,6 +105,9 @@
                ecore_x_shutdown();
                ecore_shutdown();
                dml("Efl Shutdown", 1);
+       } else {
+               /* Open a note */
+               send_to_server("DEFNOTE");
        }
 
        /* End IPC */
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/note.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- note.c      20 Sep 2004 21:52:28 -0000      1.36
+++ note.c      24 Sep 2004 13:59:56 -0000      1.37
@@ -108,6 +108,11 @@
                                     p->saveload_row);
        }
 
+       /*  Check if it was the last note  */
+       if (evas_list_next(note) == NULL && evas_list_prev(note) == NULL &&
+           controlcentre == NULL)
+               ecore_main_loop_quit();
+
        return;
 }
 
@@ -257,47 +262,77 @@
        p->pane = ewl_scrollpane_new();
        ewl_container_child_append((Ewl_Container *) p->emb, p->pane);
 
-       if(edje_object_data_get(p->edje,EDJE_INFO_SCROLLBARS)!=NULL){
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/button_increment/file",edjefn);
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/button_decrement/file",edjefn);
-               ewl_theme_data_str_set(p->pane,"/vscrollbar/vseeker/file",edjefn);
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/vseeker/button/file",edjefn);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/button_increment/file",edjefn);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/button_decrement/file",edjefn);
-               ewl_theme_data_str_set(p->pane,"/hscrollbar/hseeker/file",edjefn);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/hseeker/button/file",edjefn);
-
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/button_increment/group",EDJE_VSCROLLBAR_BTN_INCR);
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/button_decrement/group",EDJE_VSCROLLBAR_BTN_DECR);
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/vseeker/group",EDJE_VSCROLLBAR_SEEKER);
-               
ewl_theme_data_str_set(p->pane,"/vscrollbar/vseeker/button/group",EDJE_SCROLLBAR_BUTTON);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/button_increment/group",EDJE_HSCROLLBAR_BTN_INCR);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/button_decrement/group",EDJE_HSCROLLBAR_BTN_DECR);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/hseeker/group",EDJE_HSCROLLBAR_SEEKER);
-               
ewl_theme_data_str_set(p->pane,"/hscrollbar/hseeker/button/group",EDJE_SCROLLBAR_BUTTON);
+       if (edje_object_data_get(p->edje, EDJE_INFO_SCROLLBARS) != NULL) {
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/button_increment/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/button_decrement/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane, "/vscrollbar/vseeker/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/vseeker/button/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/button_increment/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/button_decrement/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane, "/hscrollbar/hseeker/file",
+                                      edjefn);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/hseeker/button/file",
+                                      edjefn);
+
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/button_increment/group",
+                                      EDJE_VSCROLLBAR_BTN_INCR);
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/button_decrement/group",
+                                      EDJE_VSCROLLBAR_BTN_DECR);
+               ewl_theme_data_str_set(p->pane, "/vscrollbar/vseeker/group",
+                                      EDJE_VSCROLLBAR_SEEKER);
+               ewl_theme_data_str_set(p->pane,
+                                      "/vscrollbar/vseeker/button/group",
+                                      EDJE_SCROLLBAR_BUTTON);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/button_increment/group",
+                                      EDJE_HSCROLLBAR_BTN_INCR);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/button_decrement/group",
+                                      EDJE_HSCROLLBAR_BTN_DECR);
+               ewl_theme_data_str_set(p->pane, "/hscrollbar/hseeker/group",
+                                      EDJE_HSCROLLBAR_SEEKER);
+               ewl_theme_data_str_set(p->pane,
+                                      "/hscrollbar/hseeker/button/group",
+                                      EDJE_SCROLLBAR_BUTTON);
 
        }
-       
+
        ewl_widget_show(p->pane);
 
        p->content = ewl_entry_multiline_new("");
        ewl_container_child_append((Ewl_Container *) p->pane, p->content);
+       ewl_entry_multiline_set((Ewl_Entry *) p->content, 1);
+
+       ewl_theme_data_str_set(p->content, "/entry/group", "none");
 
-       ewl_theme_data_str_set(p->content,"/entry/group","none");
+       prop = (char *) edje_object_data_get(p->edje, EDJE_INFO_FONTNAME);
+       if (prop != NULL)
+               ewl_theme_data_str_set(p->content, "/entry/text/font", prop);
 
-       prop=(char*)edje_object_data_get(p->edje,EDJE_INFO_FONTNAME);
-       if(prop!=NULL)
-               ewl_theme_data_str_set(p->content,"/entry/text/font",prop);
-
-       prop=(char*)edje_object_data_get(p->edje,EDJE_INFO_FONTSTYLE);
-       if(prop!=NULL)
-               ewl_theme_data_str_set(p->content,"/entry/text/style",prop);
-       
-       prop=(char*)edje_object_data_get(p->edje,EDJE_INFO_FONTSIZE);
-       if(prop!=NULL)
-               ewl_theme_data_int_set(p->content,"/entry/text/font_size",atoi(prop));
+       prop = (char *) edje_object_data_get(p->edje, EDJE_INFO_FONTSTYLE);
+       if (prop != NULL)
+               ewl_theme_data_str_set(p->content, "/entry/text/style", prop);
 
-       ewl_entry_text_set ((Ewl_Entry*)p->content,fcontent);
+       prop = (char *) edje_object_data_get(p->edje, EDJE_INFO_FONTSIZE);
+       if (prop != NULL)
+               ewl_theme_data_int_set(p->content, "/entry/text/font_size",
+                                      atoi(prop));
+
+       ewl_entry_text_set((Ewl_Entry *) p->content, fcontent);
        ewl_widget_show(p->content);
 
        ewl_callback_append(p->emb, EWL_CALLBACK_CONFIGURE, note_move_embed,
@@ -425,8 +460,8 @@
 
        /* FIXME: The line below should be removed when
         * ecore_evas is fixed. */
-       ecore_evas_iconified_set(p->win,0);
-       
+       ecore_evas_iconified_set(p->win, 0);
+
        ecore_evas_iconified_set(p->win, 1);
 
        return;
@@ -499,8 +534,8 @@
                p->txt_title = get_title_by_note_struct(p);
        }
 
-       update_enote_title (p->edje,p->txt_title);
-       
+       update_enote_title(p->edje, p->txt_title);
+
        return (1);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/note.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- note.h      14 Sep 2004 21:03:04 -0000      1.15
+++ note.h      24 Sep 2004 13:59:56 -0000      1.16
@@ -22,6 +22,7 @@
 
 #include "debug.h"
 #include "config.h"
+#include "controlcentre.h"
 #include "saveload.h"
 #include "ipc.h"
 #include "../config.h"
===================================================================
RCS file: /cvsroot/enlightenment/misc/enotes/src/settings.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- settings.c  15 Sep 2004 21:01:23 -0000      1.15
+++ settings.c  24 Sep 2004 13:59:56 -0000      1.16
@@ -116,6 +116,7 @@
                setup_settings_opt_int(settings->tree,
                                       "Control Centre [0=No 1=Yes]:",
                                       main_config->controlcentre);
+
        settings->debug =
                setup_settings_opt_int(settings->tree, "Debugging Level [0-2]:",
                                       main_config->debug);
@@ -288,6 +289,7 @@
        xml_write_append_entry(p, "controlcentre",
                               ewl_entry_text_get((Ewl_Entry *) settings->
                                                  cc.entry));
+
        xml_write_append_entry(p, "debug",
                               ewl_entry_text_get((Ewl_Entry *) settings->debug.
                                                  entry));




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to