ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/src editcontacts.c,1.2,1.3 status.c,1.3,1.4


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src editcontacts.c,1.2,1.3 status.c,1.3,1.4
Date: Fri, 27 Dec 2002 12:25:36 -0500

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

Modified Files:
        editcontacts.c status.c 
Log Message:
        * src/editcontacts.c
          src/status.c
                Make accounts editing nicer (no more
                restart required)



Index: editcontacts.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/editcontacts.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- editcontacts.c      27 Dec 2002 16:46:52 -0000      1.2
+++ editcontacts.c      27 Dec 2002 17:25:32 -0000      1.3
@@ -234,6 +234,7 @@
        int id;
        gboolean had_accounts=(accounts != NULL);
        GList *pairs=NULL;
+       GList *existing_accounts = NULL, *new_accounts = NULL, *acc_walk = NULL;
        eb_local_account *ela=NULL;
 
        if (gtk_entry_get_text(GTK_ENTRY(username)) != NULL
@@ -266,6 +267,7 @@
                        fprintf(fp, "<ACCOUNT %s>\n", service);
                        value_pair_print_values(config, fp, 1); 
                        fprintf(fp, "</ACCOUNT>\n");
+                       existing_accounts = g_list_append(existing_accounts, 
ela);
                }
                else {
                        GList * config = NULL;  
@@ -279,7 +281,7 @@
                                // Is this an account for which a module is not 
loaded?
                                if(ela->service_id==-1)
                                        ela->service_id=id;
-                               accounts = g_list_append(accounts, ela);
+                               new_accounts = g_list_append(new_accounts, ela);
                                config = 
eb_services[id].sc->write_local_config(ela);
                                fprintf(fp, "<ACCOUNT %s>\n", service);
                                value_pair_print_values(config, fp, 1); 
@@ -290,8 +292,31 @@
                }
        }
 
+       
        fclose(fp);
 
+       acc_walk = accounts;
+       if (acc_walk) {
+               while(acc_walk != NULL) {
+                       if (g_list_find(existing_accounts, acc_walk->data) == 
NULL) {
+                               eb_local_account *removed = (eb_local_account 
*)(acc_walk->data);
+                               /* removed account */
+                               accounts = 
g_list_remove(accounts,acc_walk->data);
+                               if(removed->connected)
+                                       RUN_SERVICE(removed)->logout(removed);
+                       }
+                       acc_walk = acc_walk->next;
+               }
+       }
+       
+       acc_walk = new_accounts;
+       if (acc_walk) {
+               while(acc_walk != NULL) {
+                       accounts = g_list_append(accounts,acc_walk->data);
+                       acc_walk = acc_walk->next;
+               }               
+       }
+       
        gtk_widget_destroy(account_window);
 
        /* if this was an initial launch, start up EB */

Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- status.c    27 Dec 2002 16:46:52 -0000      1.3
+++ status.c    27 Dec 2002 17:25:32 -0000      1.4
@@ -1,4 +1,3 @@
-
 /*
  * Yattm 
  *
@@ -1730,7 +1729,7 @@
   { "/Tools/Add a _group...",  NULL, add_group_callback, 0, NULL },
   { "/Tools/---",              NULL,         NULL, 0, "<Separator>" },
   { "/Tools/_Preferences...",  NULL, build_prefs_callback, 0, NULL },
-  { "/Tools/_Edit accounts (require restart)",         
+  { "/Tools/_Edit accounts",           
                                NULL, eb_edit_accounts, 0, NULL },
   { "/_Help",                  NULL, NULL, 0, "<Branch>" },
   { "/_Help/_About",           NULL, show_about, 0, NULL }




reply via email to

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