ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/src prefs.c,1.31.2.1,1.31.2.2 prefs.h,1.6.2.


From: Andy Maloney <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src prefs.c,1.31.2.1,1.31.2.2 prefs.h,1.6.2.1,1.6.2.2 prefs_window.c,1.5.2.1,1.5.2.2
Date: Sun, 23 Mar 2003 06:41:59 -0500

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

Modified Files:
      Tag: new_prefs
        prefs.c prefs.h prefs_window.c 
Log Message:
Make accelerator key prefs work again

Index: prefs.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.c,v
retrieving revision 1.31.2.1
retrieving revision 1.31.2.2
diff -u -r1.31.2.1 -r1.31.2.2
--- prefs.c     23 Mar 2003 00:30:59 -0000      1.31.2.1
+++ prefs.c     23 Mar 2003 11:41:57 -0000      1.31.2.2
@@ -90,6 +90,9 @@
        iSetLocalPref( "do_spell_checking", 0 );
        cSetLocalPref( "spell_dictionary", "" );
        
+       iSetLocalPref( "length_contact_window", length_contact_window_default );
+       iSetLocalPref( "width_contact_window", width_contact_window_default );
+       
        /* logging */
        iSetLocalPref( "do_logging", 1 );
        iSetLocalPref( "do_strip_html", 0 );
@@ -116,8 +119,9 @@
        iSetLocalPref( "do_ignore_font", 1 );
        iSetLocalPref( "do_smiley", 1 );
        
-//     g_prefs.chat.accel_prev_tab = { GDK_Left, GDK_CONTROL_MASK };
-//     g_prefs.chat.accel_next_tab = { GDK_Right, GDK_CONTROL_MASK };
+       /* NOTE that the way these defaults are stored is GTK-specific */
+       cSetLocalPref( "accel_prev_tab", "<Control>Left" );
+       cSetLocalPref( "accel_next_tab", "<Control>Right" );
 
        /* modules */
        cSetLocalPref( "modules_path", MODULE_DIR );
@@ -161,9 +165,6 @@
        char            *param = buff;
        char            *val = buff;
        
-       /* Set some default values */
-       iSetLocalPref( "length_contact_window", length_contact_window_default );
-       iSetLocalPref( "width_contact_window", width_contact_window_default );
 
        snprintf( buff, bufferLen, "%sprefs",config_dir );
        
@@ -304,19 +305,21 @@
        fp = fopen(buff, "w");
        
        /* general */
-    fprintf( fp,"do_login_on_startup=%d\n", 
iGetLocalPref("do_login_on_startup") );
-    fprintf( fp,"do_ayttm_debug=%d\n", iGetLocalPref("do_ayttm_debug") );
-    fprintf( fp,"do_ayttm_debug_html=%d\n", 
iGetLocalPref("do_ayttm_debug_html") );
-    fprintf( fp,"do_plugin_debug=%d\n", iGetLocalPref("do_ayttm_debug") );
-    fprintf( fp,"length_contact_window=%d\n", 
iGetLocalPref("length_contact_window") );
-    fprintf( fp,"width_contact_window=%d\n", 
iGetLocalPref("width_contact_window") );
+    fprintf( fp, "do_login_on_startup=%d\n", 
iGetLocalPref("do_login_on_startup") );
+    fprintf( fp, "do_ayttm_debug=%d\n", iGetLocalPref("do_ayttm_debug") );
+    fprintf( fp, "do_ayttm_debug_html=%d\n", 
iGetLocalPref("do_ayttm_debug_html") );
+    fprintf( fp, "do_plugin_debug=%d\n", iGetLocalPref("do_ayttm_debug") );
+    fprintf( fp, "length_contact_window=%d\n", 
iGetLocalPref("length_contact_window") );
+    fprintf( fp, "width_contact_window=%d\n", 
iGetLocalPref("width_contact_window") );
+       fprintf( fp, "x_contact_window=%d\n", iGetLocalPref("x_contact_window") 
);
+       fprintf( fp, "y_contact_window=%d\n", iGetLocalPref("y_contact_window") 
);
 #ifdef HAVE_ISPELL
-    fprintf( fp,"do_spell_checking=%d\n", iGetLocalPref("do_spell_checking") );
-       fprintf( fp,"spell_dictionary=%s\n", cGetLocalPref("spell_dictionary") 
);
+    fprintf( fp, "do_spell_checking=%d\n", iGetLocalPref("do_spell_checking") 
);
+       fprintf( fp, "spell_dictionary=%s\n", cGetLocalPref("spell_dictionary") 
);
 #endif
-    fprintf( fp,"do_noautoresize=%d\n", iGetLocalPref("do_noautoresize") ) ;
-    fprintf( fp,"use_alternate_browser=%d\n", 
iGetLocalPref("use_alternate_browser") );
-       fprintf( fp,"alternate_browser=%s\n", 
cGetLocalPref("alternate_browser") );
+    fprintf( fp, "do_noautoresize=%d\n", iGetLocalPref("do_noautoresize") ) ;
+    fprintf( fp, "use_alternate_browser=%d\n", 
iGetLocalPref("use_alternate_browser") );
+       fprintf( fp, "alternate_browser=%s\n", 
cGetLocalPref("alternate_browser") );
 
        /* logging */
        fprintf( fp, "do_logging=%d\n", iGetLocalPref("do_logging") );
@@ -328,23 +331,23 @@
        fprintf( fp, "do_tabbed_chat_orient=%d\n", 
iGetLocalPref("do_tabbed_chat_orient") );
 
        /* chat */
-       fprintf( fp,"do_typing_notify=%d\n", iGetLocalPref("do_typing_notify") 
);
-       fprintf( fp,"do_send_typing_notify=%d\n", 
iGetLocalPref("do_send_typing_notify") );
-       fprintf( fp,"do_escape_close=%d\n", iGetLocalPref("do_escape_close") );
-       fprintf( fp,"do_convo_timestamp=%d\n", 
iGetLocalPref("do_convo_timestamp") );
-       fprintf( fp,"do_enter_send=%d\n", iGetLocalPref("do_enter_send") );
-       fprintf( fp,"do_ignore_unknown=%d\n", 
iGetLocalPref("do_ignore_unknown") );
-       fprintf( fp,"FontSize=%d\n", iGetLocalPref("FontSize") );
-       fprintf( fp,"do_multi_line=%d\n", iGetLocalPref("do_multi_line") );
-       fprintf( fp,"do_raise_window=%d\n", iGetLocalPref("do_raise_window") );
-       fprintf( fp,"do_send_idle_time=%d\n", 
iGetLocalPref("do_send_idle_time") );
-       fprintf( fp,"do_timestamp=%d\n", iGetLocalPref("do_timestamp") );
-       fprintf( fp,"do_ignore_fore=%d\n", iGetLocalPref("do_ignore_fore") );
-       fprintf( fp,"do_ignore_back=%d\n", iGetLocalPref("do_ignore_back") );
-       fprintf( fp,"do_ignore_font=%d\n", iGetLocalPref("do_ignore_font") );
-       fprintf( fp,"do_smiley=%d\n", iGetLocalPref("do_smiley" ) );
-//     fprintf( fp,"accel_next_tab=%s\n", ptr );
-//     fprintf( fp,"accel_prev_tab=%s\n", ptr );
+       fprintf( fp, "do_typing_notify=%d\n", iGetLocalPref("do_typing_notify") 
);
+       fprintf( fp, "do_send_typing_notify=%d\n", 
iGetLocalPref("do_send_typing_notify") );
+       fprintf( fp, "do_escape_close=%d\n", iGetLocalPref("do_escape_close") );
+       fprintf( fp, "do_convo_timestamp=%d\n", 
iGetLocalPref("do_convo_timestamp") );
+       fprintf( fp, "do_enter_send=%d\n", iGetLocalPref("do_enter_send") );
+       fprintf( fp, "do_ignore_unknown=%d\n", 
iGetLocalPref("do_ignore_unknown") );
+       fprintf( fp, "FontSize=%d\n", iGetLocalPref("FontSize") );
+       fprintf( fp, "do_multi_line=%d\n", iGetLocalPref("do_multi_line") );
+       fprintf( fp, "do_raise_window=%d\n", iGetLocalPref("do_raise_window") );
+       fprintf( fp, "do_send_idle_time=%d\n", 
iGetLocalPref("do_send_idle_time") );
+       fprintf( fp, "do_timestamp=%d\n", iGetLocalPref("do_timestamp") );
+       fprintf( fp, "do_ignore_fore=%d\n", iGetLocalPref("do_ignore_fore") );
+       fprintf( fp, "do_ignore_back=%d\n", iGetLocalPref("do_ignore_back") );
+       fprintf( fp, "do_ignore_font=%d\n", iGetLocalPref("do_ignore_font") );
+       fprintf( fp, "do_smiley=%d\n", iGetLocalPref("do_smiley" ) );
+       fprintf( fp, "accel_next_tab=%s\n", cGetLocalPref("accel_next_tab") );
+       fprintf( fp, "accel_prev_tab=%s\n", cGetLocalPref("accel_prev_tab") );
         
        /* modules */
        fprintf( fp, "modules_path=%s\n", cGetLocalPref("modules_path") );
@@ -414,9 +417,9 @@
        prefs.chat.do_ignore_fore        = iGetLocalPref("do_ignore_fore");
        prefs.chat.do_ignore_back        = iGetLocalPref("do_ignore_back");
        prefs.chat.do_ignore_font        = iGetLocalPref("do_ignore_font");
-
-//     gtk_accelerator_parse(cGetLocalPref("accel_next_tab"), 
&(accel_next_tab.keyval), &(accel_next_tab.modifiers));
-//     gtk_accelerator_parse(cGetLocalPref("accel_prev_tab"), 
&(accel_prev_tab.keyval), &(accel_prev_tab.modifiers));
+       
+       strncpy( prefs.chat.accel_next_tab, cGetLocalPref("accel_next_tab"), 
MAX_PREF_LEN );
+       strncpy( prefs.chat.accel_prev_tab, cGetLocalPref("accel_prev_tab"), 
MAX_PREF_LEN );
 
        /* modules */
        strncpy( prefs.module.modules_path, cGetLocalPref("modules_path"), 
MAX_PREF_LEN );
@@ -482,8 +485,8 @@
        iSetLocalPref( "do_ignore_back", inPrefs.chat.do_ignore_back );
        iSetLocalPref( "do_ignore_font", inPrefs.chat.do_ignore_font );
        
-//     g_prefs.chat.accel_prev_tab = { GDK_Left, GDK_CONTROL_MASK };
-//     g_prefs.chat.accel_next_tab = { GDK_Right, GDK_CONTROL_MASK };
+       cSetLocalPref( "accel_prev_tab", (char *)inPrefs.chat.accel_prev_tab );
+       cSetLocalPref( "accel_next_tab", (char *)inPrefs.chat.accel_next_tab );
 
        /* modules */
        cSetLocalPref( "modules_path", (char *)inPrefs.module.modules_path );

Index: prefs.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.h,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- prefs.h     23 Mar 2003 00:30:25 -0000      1.6.2.1
+++ prefs.h     23 Mar 2003 11:41:57 -0000      1.6.2.2
@@ -71,8 +71,8 @@
                int             do_ignore_fore;
                int             do_ignore_back;
                int             do_ignore_font;
-       //      GdkDeviceKey    accel_prev_tab;
-       //      GdkDeviceKey    accel_next_tab;
+               char    accel_prev_tab[MAX_PREF_LEN];
+               char    accel_next_tab[MAX_PREF_LEN];
        } chat;
        
        struct

Index: prefs_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs_window.c,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -r1.5.2.1 -r1.5.2.2
--- prefs_window.c      23 Mar 2003 00:30:25 -0000      1.5.2.1
+++ prefs_window.c      23 Mar 2003 11:41:57 -0000      1.5.2.2
@@ -455,6 +455,9 @@
 static GdkDeviceKey accel_prev_tab_old = { GDK_Left, GDK_CONTROL_MASK };
 static GdkDeviceKey accel_next_tab_old = { GDK_Right, GDK_CONTROL_MASK };
 */
+static GdkDeviceKey    local_accel_prev_tab;
+static GdkDeviceKey    local_accel_next_tab;
+
 static guint accel_change_handler_id = 0;
 
 
@@ -584,9 +587,12 @@
     gtk_widget_show(font_size_entry);
     gtk_widget_show(hbox);
     gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+               
+       gtk_accelerator_parse( s_prefs.chat.accel_next_tab, 
&(local_accel_next_tab.keyval), &(local_accel_next_tab.modifiers) );
+       gtk_accelerator_parse( s_prefs.chat.accel_next_tab, 
&(local_accel_prev_tab.keyval), &(local_accel_prev_tab.modifiers) );
 
-//      add_key_set(_("Hotkey to go to previous tab (requires a modifier)"), 
&accel_prev_tab, vbox);
-//      add_key_set(_("Hotkey to go to next tab (requires a modifier)"), 
&accel_next_tab, vbox);
+       add_key_set(_("Hotkey to go to previous tab (requires a modifier)"), 
&local_accel_prev_tab, vbox);
+       add_key_set(_("Hotkey to go to next tab (requires a modifier)"), 
&local_accel_next_tab, vbox);
 
      gtk_widget_show(vbox);
      gtk_notebook_append_page(GTK_NOTEBOOK(prefs_note), vbox, 
gtk_label_new(_("Chat")));
@@ -601,14 +607,14 @@
                ptr = gtk_entry_get_text(GTK_ENTRY(font_size_entry));
                s_prefs.chat.font_size = atoi(ptr);
        }
+
+       ptr = gtk_accelerator_name( local_accel_next_tab.keyval, 
local_accel_next_tab.modifiers );
+       strncpy( s_prefs.chat.accel_next_tab, ptr, MAX_PREF_LEN );
+       g_free(ptr);
         
-/*      ptr=gtk_accelerator_name(accel_next_tab.keyval, 
accel_next_tab.modifiers);
-        fprintf(fp,"accel_next_tab=%s\n", ptr);
-        g_free(ptr);
-        ptr=gtk_accelerator_name(accel_prev_tab.keyval, 
accel_prev_tab.modifiers);
-        fprintf(fp,"accel_prev_tab=%s\n", ptr);
-        g_free(ptr);
-*/
+       ptr = gtk_accelerator_name( local_accel_prev_tab.keyval, 
local_accel_prev_tab.modifiers );
+       strncpy( s_prefs.chat.accel_prev_tab, ptr, MAX_PREF_LEN );
+       g_free(ptr);
 }
 
 static void destroy_chat_prefs (void)





reply via email to

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