ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/src prefs_window.c,1.5,1.6 status.c,1.67,1.68


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src prefs_window.c,1.5,1.6 status.c,1.67,1.68
Date: Sat, 22 Mar 2003 18:52:41 -0500

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

Modified Files:
        prefs_window.c status.c 
Log Message:
Remember last status displayed (online|contacts|accounts)



Index: prefs_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs_window.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- prefs_window.c      22 Mar 2003 12:39:29 -0000      1.5
+++ prefs_window.c      22 Mar 2003 23:52:39 -0000      1.6
@@ -183,6 +183,7 @@
 #endif
 static const int       length_contact_window_default = 256;
 static const int       width_contact_window_default = 150;
+static const int       status_show_level_default = 2;
 
 static const int       font_size_def = 4;
 
@@ -389,6 +390,7 @@
     eb_debug (DBG_CORE, "length_contact_window=%d\n", 
iGetLocalPref("length_contact_window"));
     fprintf(fp,"length_contact_window=%d\n", 
iGetLocalPref("length_contact_window"));
     fprintf(fp,"width_contact_window=%d\n", 
iGetLocalPref("width_contact_window"));
+    fprintf(fp,"status_show_level=%d\n", iGetLocalPref("status_show_level"));
 #ifdef HAVE_ISPELL
     fprintf(fp,"do_spell_checking=%d\n", do_spell_checking) ;
     if (do_spell_checking) {
@@ -2171,6 +2173,7 @@
        /* Set some default values */
        iSetLocalPref("length_contact_window", length_contact_window_default);
        iSetLocalPref("width_contact_window", width_contact_window_default);
+       iSetLocalPref("status_show_level", status_show_level_default);
        cSetLocalPref("modules_path", MODULE_DIR);
        cSetLocalPref("BuddyArriveFilename", BuddyArriveDefault);
        cSetLocalPref("BuddyAwayFilename", BuddyLeaveDefault);

Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -r1.67 -r1.68
--- status.c    22 Mar 2003 10:22:40 -0000      1.67
+++ status.c    22 Mar 2003 23:52:39 -0000      1.68
@@ -92,7 +92,7 @@
    1 => show all contacts,
    2 => show online contacts
 */
-static int status_show = 2;
+static int status_show = -1;
 
 static time_t last_sound_played = 0;
 
@@ -253,6 +253,8 @@
                return;
        iSetLocalPref("length_contact_window",h);
        iSetLocalPref("width_contact_window",w);
+       iSetLocalPref("status_show_level",status_show);
+       printf("saving window size\n");
        write_prefs();
 }
 
@@ -298,7 +300,8 @@
 static void status_show_callback(GtkWidget *w, gpointer data)
 {
        status_show = (int)data;
-       update_contact_list();
+       update_contact_list(); 
+       eb_save_size(contact_window, NULL);
 }
 
 static GtkWidget *make_info_menu(struct contact *c, int *nb)
@@ -1812,6 +1815,7 @@
        GtkWidget *menu;
        GtkWidget *submenuitem;
        GtkWidget *hbox;
+       GtkWidget *radioonline, *radiocontact, *radioaccount;
        GtkAccelGroup *accel = NULL;
        char * userrc = NULL;
        int win_x, win_y, win_w, win_h;
@@ -1824,6 +1828,8 @@
        gtk_window_set_policy(GTK_WINDOW(statuswindow), TRUE, TRUE, FALSE);
        gtk_widget_realize(statuswindow);
 
+       status_show = iGetLocalPref("status_show_level");
+
        iconlogin_pm = gdk_pixmap_create_from_xpm_d(statuswindow->window, 
&iconlogin_bm,
                NULL, (gchar **) login_icon_xpm);
        iconblank_pm = gdk_pixmap_create_from_xpm_d(statuswindow->window, 
&iconblank_bm,
@@ -1890,32 +1896,29 @@
 
        label = gtk_radio_button_new_with_label (NULL, _("Online"));
        gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 1);
-       gtk_signal_connect(GTK_OBJECT(label), "clicked",
-                          GTK_SIGNAL_FUNC(status_show_callback),
-                          (gpointer) 2);
-       gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(label),TRUE);
+       gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(label),
+                       status_show==2);
        gtk_widget_show(label);
-
+       radioonline = label;
 
        label = gtk_radio_button_new_with_label
          (gtk_radio_button_group(GTK_RADIO_BUTTON(label)),
           _("Contacts"));
        gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 1);
-       gtk_signal_connect(GTK_OBJECT(label), "clicked",
-                          GTK_SIGNAL_FUNC(status_show_callback),
-                          (gpointer) 1);
+       gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(label),
+                       status_show==1);
        gtk_widget_show(label);
-
+       radiocontact = label;
 
        label = gtk_radio_button_new_with_label
          (gtk_radio_button_group(GTK_RADIO_BUTTON(label)),
           _("Accounts"));
        gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 1);
-       gtk_signal_connect(GTK_OBJECT(label), "clicked",
-                          GTK_SIGNAL_FUNC(status_show_callback),
-                          (gpointer) 0);
+       gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(label),
+                       status_show==0);
        gtk_widget_show(label);
-
+       radioaccount = label;
+       
        gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0);
        gtk_widget_show(hbox);
 
@@ -1956,9 +1959,19 @@
 
        gtk_widget_show( statuswindow);
 
+       update_contact_list ();
+
+       gtk_signal_connect(GTK_OBJECT(radioonline), "clicked",
+                          GTK_SIGNAL_FUNC(status_show_callback),
+                          (gpointer) 2);
+       gtk_signal_connect(GTK_OBJECT(radiocontact), "clicked",
+                          GTK_SIGNAL_FUNC(status_show_callback),
+                          (gpointer) 1);
+       gtk_signal_connect(GTK_OBJECT(radioaccount), "clicked",
+                          GTK_SIGNAL_FUNC(status_show_callback),
+                          (gpointer) 0);
        gtk_signal_connect(GTK_OBJECT(contact_window), "size_allocate",
                        eb_save_size,NULL);
-       update_contact_list ();
        
        set_menu_sensitivity();
                





reply via email to

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