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.24,1.24.2.1 prefs.h,1.6,1.6.2.1


From: Andy Maloney <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src main.c,1.24,1.24.2.1 prefs.h,1.6,1.6.2.1 prefs_window.c,1.5,1.5.2.1 prefs_window.h,1.1,1.1.2.1 status.c,1.67,1.67.2.1
Date: Sat, 22 Mar 2003 19:30:27 -0500

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

Modified Files:
      Tag: new_prefs
        main.c prefs.h prefs_window.c prefs_window.h status.c 
Log Message:
prefs.[ch] now handles all reading and writing of prefs


Index: main.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/main.c,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -r1.24 -r1.24.2.1
--- main.c      22 Mar 2003 11:48:25 -0000      1.24
+++ main.c      23 Mar 2003 00:30:25 -0000      1.24.2.1
@@ -60,7 +60,7 @@
 #include "smileys.h"
 #include "console_session.h"
 #include "crash.h"
-#include "prefs_window.h"
+#include "prefs.h"
 
 
 #define PACKAGE "ayttm"
@@ -309,7 +309,7 @@
        if (crash) {
                gtk_set_locale();
                gtk_init(&argc, &argv);
-               eb_read_prefs();
+               ayttm_prefs_read();
                crash_main(crash_param);
                return 0;
        }
@@ -423,8 +423,10 @@
 
        /* Initalize the menus that are available through the plugin_api */
        init_menus();
+       
+       ayttm_prefs_init();
 
-       eb_read_prefs();
+       ayttm_prefs_read();
 
        /* Load all the modules in the module_path preference, details can be 
found in the preferences module tab */
        load_modules();

Index: prefs.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.h,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- prefs.h     3 Feb 2003 11:11:26 -0000       1.6
+++ prefs.h     23 Mar 2003 00:30:25 -0000      1.6.2.1
@@ -35,22 +35,110 @@
 extern "C" {
 #endif
 
+struct prefs
+{
+       struct
+       {
+               int             do_login_on_startup;
+               int             do_ayttm_debug;
+               int             use_alternate_browser;
+               char    alternate_browser[MAX_PREF_LEN];
+
+               #ifdef HAVE_ISPELL
+                       int             do_spell_checking;
+                       char    spell_dictionary[MAX_PREF_LEN];
+               #endif
+       } general;
+       
+       struct
+       {
+               int             do_logging;
+               int             do_restore_last_conv;
+       } logging;
+       
+       struct
+       {
+               int             do_tabbed_chat;
+               int             do_tabbed_chat_orient;  /* Tab Orientation:  0 
=> bottom, 1 => top, 2=> left, 3 => right */
+       } layout;
+       
+       struct
+       {
+               int             do_ignore_unknown;
+               int             font_size;
+               int             do_raise_window;
+               int             do_send_idle_time;
+               int             do_ignore_fore;
+               int             do_ignore_back;
+               int             do_ignore_font;
+       //      GdkDeviceKey    accel_prev_tab;
+       //      GdkDeviceKey    accel_next_tab;
+       } chat;
+       
+       struct
+       {
+               char    modules_path[MAX_PREF_LEN];
+       } module;
+       
+       struct
+       {
+               int             do_no_sound_when_away;
+               int             do_no_sound_for_ignore;
+               int             do_online_sound;
+               int             do_play_send;
+               int             do_play_first;
+               int             do_play_receive;
+               
+               char    BuddyArriveFilename[MAX_PREF_LEN];
+               char    BuddyAwayFilename[MAX_PREF_LEN];
+               char    BuddyLeaveFilename[MAX_PREF_LEN];
+               char    SendFilename[MAX_PREF_LEN];
+               char    ReceiveFilename[MAX_PREF_LEN];
+               char    FirstMsgFilename[MAX_PREF_LEN];
+               
+               double  SoundVolume;
+       } sound;
+       
+       struct
+       {
+               int             proxy_type;
+               char    proxy_host[MAX_PREF_LEN];
+               int             proxy_port;
+               
+               int             do_proxy_auth;
+               char    proxy_user[MAX_PREF_LEN];
+               char    proxy_password[MAX_PREF_LEN];
+               
+               int             use_recoding;
+               char    local_encoding[MAX_PREF_LEN];
+               char    remote_encoding[MAX_PREF_LEN];
+       } advanced;
+};
+
+
+void   ayttm_prefs_init( void );
+void   ayttm_prefs_read( void );
+void   ayttm_prefs_write( void );
+
+void   ayttm_prefs_show_window( void );
+void   ayttm_prefs_set( const struct prefs inPrefs );
+
 #if defined(__MINGW32__) && defined(__IN_PLUGIN__)
-__declspec(dllimport) void *GetPref(char *key);
+__declspec(dllimport) void *GetPref(const char *key);
 #else
-void   *GetPref(char *key);
+void   *GetPref(const char *key);
 #endif
 
-void   *SetPref(char *key, void *data);
+void   *SetPref(const char *key, void *data);
 
-int            iGetLocalPref(char *key);
-void   iSetLocalPref(char *key, int data);
+void   iSetLocalPref(const char *key, int data);
+int            iGetLocalPref(const char *key);
 
-float  fGetLocalPref(char *key);
-void   fSetLocalPref(char *key, float data);
+void   fSetLocalPref(const char *key, float data);
+float  fGetLocalPref(const char *key);
 
-char   *cGetLocalPref(char *key);
-void   cSetLocalPref(char *key, char *data);
+void   cSetLocalPref(const char *key, char *data);
+char   *cGetLocalPref(const char *key);
 
 void   save_account_info(char *service, LList *pairs);
 void   reload_service_accounts(int service_id);

Index: prefs_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs_window.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- prefs_window.c      22 Mar 2003 12:39:29 -0000      1.5
+++ prefs_window.c      23 Mar 2003 00:30:25 -0000      1.5.2.1
@@ -52,8 +52,8 @@
 #define rindex(a,b) strrchr(a,b)
 #endif
 
-static int is_prefs_open = 0;
-
+static int                     s_is_prefs_open = 0;
+static struct prefs    s_prefs;
 
 /*
  * Preferences Dialog
@@ -71,21 +71,22 @@
[...1585 lines suppressed...]
-     /* reset current parent so error dialogs work correctly */
+
 #ifdef HAVE_ICONV_H
      destroy_encodings();
 #endif
         destroy_modules();
-     /* it'd be nice to check validity of recoding here 
-       and cancel change if not supported */
 
 #ifdef HAVE_ISPELL
-     if ((!do_spell_checking) && (gtkspell_running()))
+     if ((!s_prefs.general.do_spell_checking) && (gtkspell_running()))
             gtkspell_stop();
 #endif
+
      gtk_widget_destroy(current_parent_widget);
      current_parent_widget = NULL;
-
 }
+

Index: prefs_window.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs_window.h,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- prefs_window.h      3 Feb 2003 11:11:26 -0000       1.1
+++ prefs_window.h      23 Mar 2003 00:30:25 -0000      1.1.2.1
@@ -25,10 +25,11 @@
 #ifndef __PREFS_WINDOW_H__
 #define __PREFS_WINDOW_H__
 
+#include "prefs.h"
+
+
+void   prefs_window_create( struct prefs inPrefs );
 
-void write_prefs();
-void eb_read_prefs();
-void build_prefs();
 void rebuild_import_menu();
 void rebuild_profile_menu();
 

Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.67
retrieving revision 1.67.2.1
diff -u -r1.67 -r1.67.2.1
--- status.c    22 Mar 2003 10:22:40 -0000      1.67
+++ status.c    23 Mar 2003 00:30:25 -0000      1.67.2.1
@@ -48,7 +48,7 @@
 #include "contact_actions.h"
 #include "sound.h"
 #include "plugin.h"
-#include "prefs_window.h"
+#include "prefs.h"
 #include "offline_queue_mgmt.h"
 
 #include "gtk/gtkutils.h"
@@ -253,7 +253,7 @@
                return;
        iSetLocalPref("length_contact_window",h);
        iSetLocalPref("width_contact_window",w);
-       write_prefs();
+       ayttm_prefs_write();
 }
 
 static void get_info(GtkWidget * w, eb_account *ea )
@@ -587,7 +587,7 @@
 
 static void build_prefs_callback( GtkWidget * widget, gpointer stats )
 {
-       build_prefs();
+       ayttm_prefs_show_window();
 }
 
 static void launch_group_chat( GtkWidget * widget, gpointer userdata )





reply via email to

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