ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src main.c,1.12,1.13 plugin_api.c,1.5,1.6 pre


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src main.c,1.12,1.13 plugin_api.c,1.5,1.6 prefs.c,1.18,1.19 status.c,1.22,1.23
Date: Fri, 17 Jan 2003 18:21:44 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv13979/src

Modified Files:
        main.c plugin_api.c prefs.c status.c 
Log Message:
- src/main.c
Reordered loading things so we can properly init
default prefs when they don't exist
- src/prefs.c
If prefs don't exist, write them
- src/plugin_api.c
Don't add twice the same thing in profile menu



Index: main.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- main.c      16 Jan 2003 20:03:16 -0000      1.12
+++ main.c      17 Jan 2003 23:21:42 -0000      1.13
@@ -429,14 +429,13 @@
                eb_input_add(sock, EB_INPUT_READ, console_session_init, NULL);
        }
 
-       //proxy_set_proxy( PROXY_NONE, "", 0 );
-       //proxy_set_proxy(PROXY_SOCKS5,"24.0.201.225",1080);
-
-       eb_read_prefs();
        /* Initalize the menus that are available through the plugin_api */
        init_menus();
+
        /* Load all the modules in the module_path preference, details can be 
found in the preferences module tab */
        load_modules();
+
+       eb_read_prefs();
 
        accounts_success = load_accounts();
        if(accounts_success)

Index: plugin_api.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/plugin_api.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- plugin_api.c        16 Jan 2003 13:11:01 -0000      1.5
+++ plugin_api.c        17 Jan 2003 23:21:42 -0000      1.6
@@ -66,17 +66,25 @@
 {
        menu_item_data *mid=NULL;
        menu_data *md=NULL;
-
+       GList *list;
+       
        eb_debug(DBG_CORE, ">Adding %s to menu %s\n", label, menu_name);
        md = GetPref(menu_name);
        if(!md)  {
-               eb_debug("Unknown menu requested: %s\n", menu_name);
+               eb_debug(DBG_CORE, "Unknown menu requested: %s\n", menu_name);
                return(NULL);
        }
        /* Make sure they're expecting the right kind of structure to be passed 
back */
        if(type!=md->type) {
-               eb_debug("Incorrect ebmType passed, not adding menu item: 
%s\n", label);
+               eb_debug(DBG_CORE, "Incorrect ebmType passed, not adding menu 
item: %s\n", label);
                return(NULL);
+       }
+       for(list = md->menu_items; list && list->data; list  = 
g_list_next(list) ){
+               menu_item_data *tmid = (menu_item_data *)list->data;
+               if( tmid->callback == callback && !strcmp(tmid->label,label)) {
+                       /* already in list */
+                       return ((void *)tmid);
+               }
        }
        mid=g_new0(menu_item_data, 1);
        mid->user_data=data;

Index: prefs.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- prefs.c     17 Jan 2003 20:02:59 -0000      1.18
+++ prefs.c     17 Jan 2003 23:21:42 -0000      1.19
@@ -2255,7 +2255,6 @@
 {
      gchar buff[1024], file[1024];
      FILE * fp;
-
      g_snprintf(buff, 1024, "%sprefs.tmp",config_dir);
      g_snprintf(file, 1024, "%sprefs",config_dir);
      fp = fopen(buff, "w");
@@ -2286,7 +2285,6 @@
        FILE * fp;
        gchar *param=buff;
        gchar *val=buff;
-
        /* Set some default values */
        iSetLocalPref("length_contact_window", length_contact_window_default);
        iSetLocalPref("width_contact_window", width_contact_window_default);
@@ -2303,12 +2301,8 @@
        fp = fopen(buff, "r");
        if(!fp)
        {
-               /* This would cause things to crash if there is no file, as 
services
-               * are not loaded yet.  It will be called when actual changes 
are made
-               * to preferences, until then, it doesn't need to be written.
-               */
-               printf("can't open %s\n",buff);
-//             write_prefs();
+               printf("Creating prefs\n");
+               write_prefs();
                return;
        }
        while(!feof(fp))

Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- status.c    16 Jan 2003 21:40:50 -0000      1.22
+++ status.c    17 Jan 2003 23:21:42 -0000      1.23
@@ -1583,14 +1583,12 @@
        label = gtk_tearoff_menu_item_new();
        gtk_menu_append(GTK_MENU(profile_menu), label);
        gtk_widget_show(label);
-
        eb_debug(DBG_CORE, ">\n");
     /* import_items is a list that is maintained as a pref, modified by calls 
to eb_add_menu_item */
        md = GetPref(EB_PROFILE_MENU);
        if(md) {
                for(list = md->menu_items; list; list  = g_list_next(list) ) {
                        mid=(menu_item_data *)list->data;
-                       eb_debug(DBG_CORE, "adding profile item: %s\n", 
mid->label);
                        label = gtk_menu_item_new_with_label(mid->label);
                        gtk_menu_append(GTK_MENU(profile_menu), label);
                        gtk_signal_connect(GTK_OBJECT(label), "activate",





reply via email to

[Prev in Thread] Current Thread [Next in Thread]