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.4,1.31.2.5 prefs.h,1.6.2.


From: Andy Maloney <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src prefs.c,1.31.2.4,1.31.2.5 prefs.h,1.6.2.3,1.6.2.4 prefs_window.h,1.1.2.1,1.1.2.2
Date: Fri, 28 Mar 2003 07:41:00 -0500

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

Modified Files:
      Tag: new_prefs
        prefs.c prefs.h prefs_window.h 
Log Message:
First step for module prefs

Index: prefs.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.c,v
retrieving revision 1.31.2.4
retrieving revision 1.31.2.5
diff -u -r1.31.2.4 -r1.31.2.5
--- prefs.c     26 Mar 2003 18:47:31 -0000      1.31.2.4
+++ prefs.c     28 Mar 2003 12:40:57 -0000      1.31.2.5
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <assert.h>
 
 #include "service.h"
 #include "value_pair.h"
@@ -34,6 +35,7 @@
 #include "defaults.h"
 #include "libproxy/libproxy.h"
 #include "prefs_window.h"
+#include "plugin.h"
 
 #ifdef __MINGW32__
 #define        snprintf        _snprintf
@@ -105,6 +107,68 @@
        return( inStr );
 }
 
+static LList   *create_module_prefs_list( void )
+{
+       const LList             *plugins = GetPref( EB_PLUGIN_LIST );
+       LList                   *module_prefs_list = NULL;
+       
+       for ( ; plugins; plugins = plugins->next )
+       {
+               const eb_PLUGIN_INFO    *epi = plugins->data;
+               plugin_pref                             *pref_info = NULL;
+               
+               
+               if ( epi == NULL )
+                       continue;
+               
+               pref_info = calloc( 1, sizeof( plugin_pref ) );
+
+               pref_info->type = PLUGIN_TYPE_TXT[epi->pi.type-1];
+               pref_info->brief_desc = strdup( epi->pi.brief_desc );
+               pref_info->status = PLUGIN_STATUS_TXT[epi->status];
+               pref_info->version = strdup( epi->pi.version );
+               pref_info->date = strdup( epi->pi.date );
+               pref_info->name = strdup( epi->name );
+               pref_info->status_desc = strdup( epi->status_desc );
+               pref_info->service_name = strdup( epi->service );
+                       
+               module_prefs_list = l_list_append( module_prefs_list, 
pref_info);
+       }
+       
+       return( l_list_nth( module_prefs_list, 0 ) );
+}
+
+static void    destroy_module_prefs_list( LList *io_module_prefs_list )
+{
+       for ( ; io_module_prefs_list != NULL; io_module_prefs_list = 
io_module_prefs_list->next )
+       {
+               plugin_pref             *pref_info = io_module_prefs_list->data;
+               
+               
+               if ( pref_info == NULL )
+                       continue;
+                       
+               free( (void *)pref_info->brief_desc );
+               free( (void *)pref_info->version );
+               free( (void *)pref_info->date );
+               free( (void *)pref_info->name );
+               free( (void *)pref_info->status_desc );
+               free( (void *)pref_info->service_name );
+       }
+       
+       l_list_free( io_module_prefs_list );
+}
+
+static void    free_pref_struct( struct prefs *ioPrefs )
+{
+       if ( ioPrefs == NULL )
+               return;
+               
+       // clean up memory
+       destroy_module_prefs_list( ioPrefs->module.module_info );
+       free( ioPrefs );
+}
+
 
 void   ayttm_prefs_init( void )
 {
@@ -476,144 +540,152 @@
 
 void   ayttm_prefs_show_window( void )
 {
-       struct prefs    prefs;
+       struct prefs    *prefs = calloc( 1, sizeof( struct prefs ) );
 
        
        /* general prefs */
-       prefs.general.do_login_on_startup   = 
iGetLocalPref("do_login_on_startup");
-       prefs.general.do_ayttm_debug        = iGetLocalPref("do_ayttm_debug");
-       prefs.general.use_alternate_browser = 
iGetLocalPref("use_alternate_browser");
-       strncpy( prefs.general.alternate_browser, 
cGetLocalPref("alternate_browser"), MAX_PREF_LEN );
+       prefs->general.do_login_on_startup   = 
iGetLocalPref("do_login_on_startup");
+       prefs->general.do_ayttm_debug        = iGetLocalPref("do_ayttm_debug");
+       prefs->general.use_alternate_browser = 
iGetLocalPref("use_alternate_browser");
+       strncpy( prefs->general.alternate_browser, 
cGetLocalPref("alternate_browser"), MAX_PREF_LEN );
 
-       prefs.general.do_spell_checking     = 
iGetLocalPref("do_spell_checking");
-       strncpy( prefs.general.spell_dictionary, 
cGetLocalPref("spell_dictionary"), MAX_PREF_LEN );
+       prefs->general.do_spell_checking     = 
iGetLocalPref("do_spell_checking");
+       strncpy( prefs->general.spell_dictionary, 
cGetLocalPref("spell_dictionary"), MAX_PREF_LEN );
 
        /* logging prefs */
-       prefs.logging.do_logging            = iGetLocalPref("do_logging");
-       prefs.logging.do_restore_last_conv  = 
iGetLocalPref("do_restore_last_conv");
+       prefs->logging.do_logging            = iGetLocalPref("do_logging");
+       prefs->logging.do_restore_last_conv  = 
iGetLocalPref("do_restore_last_conv");
 
        /* layout prefs */
-       prefs.layout.do_tabbed_chat        = iGetLocalPref("do_tabbed_chat");
-       prefs.layout.do_tabbed_chat_orient = 
iGetLocalPref("do_tabbed_chat_orient");
+       prefs->layout.do_tabbed_chat        = iGetLocalPref("do_tabbed_chat");
+       prefs->layout.do_tabbed_chat_orient = 
iGetLocalPref("do_tabbed_chat_orient");
 
        /* chat prefs */
-       prefs.chat.do_ignore_unknown     = iGetLocalPref("do_ignore_unknown");
-       prefs.chat.font_size             = iGetLocalPref("FontSize");
-       prefs.chat.do_raise_window       = iGetLocalPref("do_raise_window");    
-       prefs.chat.do_send_idle_time     = iGetLocalPref("do_send_idle_time");
-       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");
+       prefs->chat.do_ignore_unknown     = iGetLocalPref("do_ignore_unknown");
+       prefs->chat.font_size             = iGetLocalPref("FontSize");
+       prefs->chat.do_raise_window       = iGetLocalPref("do_raise_window");   
+       prefs->chat.do_send_idle_time     = iGetLocalPref("do_send_idle_time");
+       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");
        
-       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 );
+       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 );
+       prefs->module.module_info = create_module_prefs_list();
        
        /* sound prefs */
-       prefs.sound.do_no_sound_when_away = 
iGetLocalPref("do_no_sound_when_away");
-       prefs.sound.do_no_sound_for_ignore= 
iGetLocalPref("do_no_sound_for_ignore");
-       prefs.sound.do_online_sound       = iGetLocalPref("do_online_sound");
-       prefs.sound.do_play_send          = iGetLocalPref("do_play_send");
-       prefs.sound.do_play_first         = iGetLocalPref("do_play_first");
-       prefs.sound.do_play_receive       = iGetLocalPref("do_play_receive");
-       
-       strncpy( prefs.sound.BuddyArriveFilename, 
cGetLocalPref("BuddyArriveFilename"), MAX_PREF_LEN );
-       strncpy( prefs.sound.BuddyAwayFilename, 
cGetLocalPref("BuddyAwayFilename"), MAX_PREF_LEN );
-       strncpy( prefs.sound.BuddyLeaveFilename, 
cGetLocalPref("BuddyLeaveFilename"), MAX_PREF_LEN );
-       strncpy( prefs.sound.SendFilename, cGetLocalPref("SendFilename"), 
MAX_PREF_LEN );
-       strncpy( prefs.sound.ReceiveFilename, cGetLocalPref("ReceiveFilename"), 
MAX_PREF_LEN );
-       strncpy( prefs.sound.FirstMsgFilename, 
cGetLocalPref("FirstMsgFilename"), MAX_PREF_LEN );
+       prefs->sound.do_no_sound_when_away = 
iGetLocalPref("do_no_sound_when_away");
+       prefs->sound.do_no_sound_for_ignore= 
iGetLocalPref("do_no_sound_for_ignore");
+       prefs->sound.do_online_sound       = iGetLocalPref("do_online_sound");
+       prefs->sound.do_play_send          = iGetLocalPref("do_play_send");
+       prefs->sound.do_play_first         = iGetLocalPref("do_play_first");
+       prefs->sound.do_play_receive       = iGetLocalPref("do_play_receive");
+       
+       strncpy( prefs->sound.BuddyArriveFilename, 
cGetLocalPref("BuddyArriveFilename"), MAX_PREF_LEN );
+       strncpy( prefs->sound.BuddyAwayFilename, 
cGetLocalPref("BuddyAwayFilename"), MAX_PREF_LEN );
+       strncpy( prefs->sound.BuddyLeaveFilename, 
cGetLocalPref("BuddyLeaveFilename"), MAX_PREF_LEN );
+       strncpy( prefs->sound.SendFilename, cGetLocalPref("SendFilename"), 
MAX_PREF_LEN );
+       strncpy( prefs->sound.ReceiveFilename, 
cGetLocalPref("ReceiveFilename"), MAX_PREF_LEN );
+       strncpy( prefs->sound.FirstMsgFilename, 
cGetLocalPref("FirstMsgFilename"), MAX_PREF_LEN );
 
-       prefs.sound.SoundVolume = fGetLocalPref("SoundVolume");
+       prefs->sound.SoundVolume        = fGetLocalPref("SoundVolume");
        
        /* advanced */
-       prefs.advanced.proxy_type = iGetLocalPref("proxy_type");
-       strncpy( prefs.advanced.proxy_host, cGetLocalPref("proxy_host"), 
MAX_PREF_LEN );
-       prefs.advanced.proxy_port = iGetLocalPref("proxy_port");
-       prefs.advanced.do_proxy_auth = iGetLocalPref("do_proxy_auth");
-       strncpy( prefs.advanced.proxy_user, cGetLocalPref("proxy_user"), 
MAX_PREF_LEN );
-       strncpy( prefs.advanced.proxy_password, 
cGetLocalPref("proxy_password"), MAX_PREF_LEN );
-       
-       prefs.advanced.use_recoding = iGetLocalPref("use_recoding");
-       strncpy( prefs.advanced.local_encoding, 
cGetLocalPref("local_encoding"), MAX_PREF_LEN );
-       strncpy( prefs.advanced.remote_encoding, 
cGetLocalPref("remote_encoding"), MAX_PREF_LEN );
+       prefs->advanced.proxy_type      = iGetLocalPref("proxy_type");
+       strncpy( prefs->advanced.proxy_host, cGetLocalPref("proxy_host"), 
MAX_PREF_LEN );
+       prefs->advanced.proxy_port      = iGetLocalPref("proxy_port");
+       prefs->advanced.do_proxy_auth   = iGetLocalPref("do_proxy_auth");
+       strncpy( prefs->advanced.proxy_user, cGetLocalPref("proxy_user"), 
MAX_PREF_LEN );
+       strncpy( prefs->advanced.proxy_password, 
cGetLocalPref("proxy_password"), MAX_PREF_LEN );
+       
+       prefs->advanced.use_recoding    = iGetLocalPref("use_recoding");
+       strncpy( prefs->advanced.local_encoding, 
cGetLocalPref("local_encoding"), MAX_PREF_LEN );
+       strncpy( prefs->advanced.remote_encoding, 
cGetLocalPref("remote_encoding"), MAX_PREF_LEN );
        
        prefs_window_create( prefs );
 }
 
-void   ayttm_prefs_set( const struct prefs inPrefs )
+void   ayttm_prefs_apply( struct prefs *inPrefs )
 {
+       assert( inPrefs != NULL );
+       
        /* general */
-       iSetLocalPref( "do_login_on_startup", 
inPrefs.general.do_login_on_startup );
-       iSetLocalPref( "do_ayttm_debug", inPrefs.general.do_ayttm_debug );
-       iSetLocalPref( "do_plugin_debug", inPrefs.general.do_ayttm_debug );
-       iSetLocalPref( "use_alternate_browser", 
inPrefs.general.use_alternate_browser );
-       cSetLocalPref( "alternate_browser", (char 
*)inPrefs.general.alternate_browser );
+       iSetLocalPref( "do_login_on_startup", 
inPrefs->general.do_login_on_startup );
+       iSetLocalPref( "do_ayttm_debug", inPrefs->general.do_ayttm_debug );
+       iSetLocalPref( "do_plugin_debug", inPrefs->general.do_ayttm_debug );
+       iSetLocalPref( "use_alternate_browser", 
inPrefs->general.use_alternate_browser );
+       cSetLocalPref( "alternate_browser", inPrefs->general.alternate_browser 
);
        
-       iSetLocalPref( "do_spell_checking", inPrefs.general.do_spell_checking );
-       cSetLocalPref( "spell_dictionary", (char 
*)inPrefs.general.spell_dictionary );
+       iSetLocalPref( "do_spell_checking", inPrefs->general.do_spell_checking 
);
+       cSetLocalPref( "spell_dictionary", inPrefs->general.spell_dictionary );
        
        /* logging */
-       iSetLocalPref( "do_logging", inPrefs.logging.do_logging );
-       iSetLocalPref( "do_restore_last_conv", 
inPrefs.logging.do_restore_last_conv );
+       iSetLocalPref( "do_logging", inPrefs->logging.do_logging );
+       iSetLocalPref( "do_restore_last_conv", 
inPrefs->logging.do_restore_last_conv );
        
        /* layout */
-       iSetLocalPref( "do_tabbed_chat", inPrefs.layout.do_tabbed_chat );
-       iSetLocalPref( "do_tabbed_chat_orient", 
inPrefs.layout.do_tabbed_chat_orient );
+       iSetLocalPref( "do_tabbed_chat", inPrefs->layout.do_tabbed_chat );
+       iSetLocalPref( "do_tabbed_chat_orient", 
inPrefs->layout.do_tabbed_chat_orient );
 
        /* chat */
-       iSetLocalPref( "do_ignore_unknown", inPrefs.chat.do_ignore_unknown );
-       iSetLocalPref( "FontSize", inPrefs.chat.font_size );
-       iSetLocalPref( "do_raise_window", inPrefs.chat.do_raise_window );
-       iSetLocalPref( "do_send_idle_time", inPrefs.chat.do_send_idle_time );
-       iSetLocalPref( "do_ignore_fore", inPrefs.chat.do_ignore_fore );
-       iSetLocalPref( "do_ignore_back", inPrefs.chat.do_ignore_back );
-       iSetLocalPref( "do_ignore_font", inPrefs.chat.do_ignore_font );
+       iSetLocalPref( "do_ignore_unknown", inPrefs->chat.do_ignore_unknown );
+       iSetLocalPref( "FontSize", inPrefs->chat.font_size );
+       iSetLocalPref( "do_raise_window", inPrefs->chat.do_raise_window );
+       iSetLocalPref( "do_send_idle_time", inPrefs->chat.do_send_idle_time );
+       iSetLocalPref( "do_ignore_fore", inPrefs->chat.do_ignore_fore );
+       iSetLocalPref( "do_ignore_back", inPrefs->chat.do_ignore_back );
+       iSetLocalPref( "do_ignore_font", inPrefs->chat.do_ignore_font );
        
-       cSetLocalPref( "accel_prev_tab", (char *)inPrefs.chat.accel_prev_tab );
-       cSetLocalPref( "accel_next_tab", (char *)inPrefs.chat.accel_next_tab );
+       cSetLocalPref( "accel_prev_tab", inPrefs->chat.accel_prev_tab );
+       cSetLocalPref( "accel_next_tab", inPrefs->chat.accel_next_tab );
 
        /* modules */
-       cSetLocalPref( "modules_path", (char *)inPrefs.module.modules_path );
        
        /* sound */
-       iSetLocalPref( "do_no_sound_when_away", 
inPrefs.sound.do_no_sound_when_away );
-       iSetLocalPref( "do_no_sound_for_ignore", 
inPrefs.sound.do_no_sound_for_ignore );
-       iSetLocalPref( "do_online_sound", inPrefs.sound.do_online_sound );
-       iSetLocalPref( "do_play_send", inPrefs.sound.do_play_send );
-       iSetLocalPref( "do_play_first", inPrefs.sound.do_play_first );
-       iSetLocalPref( "do_play_receive", inPrefs.sound.do_play_receive );
-       
-       cSetLocalPref( "BuddyArriveFilename", (char 
*)inPrefs.sound.BuddyArriveFilename );
-       cSetLocalPref( "BuddyAwayFilename", (char 
*)inPrefs.sound.BuddyAwayFilename );
-       cSetLocalPref( "BuddyLeaveFilename", (char 
*)inPrefs.sound.BuddyLeaveFilename );
-       cSetLocalPref( "SendFilename", (char *)inPrefs.sound.SendFilename );
-       cSetLocalPref( "ReceiveFilename", (char *)inPrefs.sound.ReceiveFilename 
);
-       cSetLocalPref( "FirstMsgFilename", (char 
*)inPrefs.sound.FirstMsgFilename );
+       iSetLocalPref( "do_no_sound_when_away", 
inPrefs->sound.do_no_sound_when_away );
+       iSetLocalPref( "do_no_sound_for_ignore", 
inPrefs->sound.do_no_sound_for_ignore );
+       iSetLocalPref( "do_online_sound", inPrefs->sound.do_online_sound );
+       iSetLocalPref( "do_play_send", inPrefs->sound.do_play_send );
+       iSetLocalPref( "do_play_first", inPrefs->sound.do_play_first );
+       iSetLocalPref( "do_play_receive", inPrefs->sound.do_play_receive );
+       
+       cSetLocalPref( "BuddyArriveFilename", 
inPrefs->sound.BuddyArriveFilename );
+       cSetLocalPref( "BuddyAwayFilename", inPrefs->sound.BuddyAwayFilename );
+       cSetLocalPref( "BuddyLeaveFilename", inPrefs->sound.BuddyLeaveFilename 
);
+       cSetLocalPref( "SendFilename", inPrefs->sound.SendFilename );
+       cSetLocalPref( "ReceiveFilename", inPrefs->sound.ReceiveFilename );
+       cSetLocalPref( "FirstMsgFilename", inPrefs->sound.FirstMsgFilename );
                
-       fSetLocalPref( "SoundVolume", inPrefs.sound.SoundVolume );
+       fSetLocalPref( "SoundVolume", inPrefs->sound.SoundVolume );
 
        /* advanced */
-       iSetLocalPref( "proxy_type", inPrefs.advanced.proxy_type );
-       cSetLocalPref( "proxy_host", (char *)inPrefs.advanced.proxy_host );
-       iSetLocalPref( "proxy_port", inPrefs.advanced.proxy_port );
-       iSetLocalPref( "do_proxy_auth", inPrefs.advanced.do_proxy_auth );
-       cSetLocalPref( "proxy_user", (char *)inPrefs.advanced.proxy_user );
-       cSetLocalPref( "proxy_password", (char 
*)inPrefs.advanced.proxy_password );
-       
-       iSetLocalPref( "use_recoding", inPrefs.advanced.use_recoding );
-       cSetLocalPref( "local_encoding", (char 
*)inPrefs.advanced.local_encoding );
-       cSetLocalPref( "remote_encoding", (char 
*)inPrefs.advanced.remote_encoding );
+       iSetLocalPref( "proxy_type", inPrefs->advanced.proxy_type );
+       cSetLocalPref( "proxy_host", inPrefs->advanced.proxy_host );
+       iSetLocalPref( "proxy_port", inPrefs->advanced.proxy_port );
+       iSetLocalPref( "do_proxy_auth", inPrefs->advanced.do_proxy_auth );
+       cSetLocalPref( "proxy_user", inPrefs->advanced.proxy_user );
+       cSetLocalPref( "proxy_password", inPrefs->advanced.proxy_password );
+       
+       iSetLocalPref( "use_recoding", inPrefs->advanced.use_recoding );
+       cSetLocalPref( "local_encoding", inPrefs->advanced.local_encoding );
+       cSetLocalPref( "remote_encoding", inPrefs->advanced.remote_encoding );
        
        ayttm_prefs_write();
        
-       if ( inPrefs.advanced.proxy_type != 0 )
+       if ( inPrefs->advanced.proxy_type != 0 )
        {
                proxy_set_proxy( iGetLocalPref("proxy_type"), 
cGetLocalPref("proxy_host"), iGetLocalPref("proxy_port") );
                proxy_set_auth( iGetLocalPref("do_proxy_auth"), 
cGetLocalPref("proxy_user"), cGetLocalPref("proxy_password") );
        }
+       
+       free_pref_struct( inPrefs );
+}
+
+void   ayttm_prefs_cancel( struct prefs *inPrefs )
+{
+       free_pref_struct( inPrefs );
 }
 
 /* Find old pref data, and replace with new, returning old data */

Index: prefs.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs.h,v
retrieving revision 1.6.2.3
retrieving revision 1.6.2.4
diff -u -r1.6.2.3 -r1.6.2.4
--- prefs.h     24 Mar 2003 09:00:18 -0000      1.6.2.3
+++ prefs.h     28 Mar 2003 12:40:58 -0000      1.6.2.4
@@ -35,6 +35,19 @@
 extern "C" {
 #endif
 
+
+typedef struct
+{
+       const char              *type;
+       const char              *brief_desc;
+       const char              *status;
+       const char              *version;
+       const char              *date;
+       const char              *name;                  /* File Name */
+       const char              *status_desc;   /* Error description */
+       const char              *service_name;  /* NULL if not service */
+} plugin_pref;
+
 struct prefs
 {
        struct
@@ -77,7 +90,7 @@
        
        struct
        {
-               char    modules_path[MAX_PREF_LEN];
+               LList   *module_info;
        } module;
        
        struct
@@ -121,7 +134,8 @@
 void   ayttm_prefs_write( void );
 
 void   ayttm_prefs_show_window( void );
-void   ayttm_prefs_set( const struct prefs inPrefs );
+void   ayttm_prefs_apply( struct prefs *inPrefs );
+void   ayttm_prefs_cancel( struct prefs *inPrefs );
 
 #if defined(__MINGW32__) && defined(__IN_PLUGIN__)
 __declspec(dllimport) void *GetPref(const char *key);

Index: prefs_window.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/prefs_window.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- prefs_window.h      23 Mar 2003 00:30:25 -0000      1.1.2.1
+++ prefs_window.h      28 Mar 2003 12:40:58 -0000      1.1.2.2
@@ -28,7 +28,7 @@
 #include "prefs.h"
 
 
-void   prefs_window_create( struct prefs inPrefs );
+void   prefs_window_create( struct prefs *inPrefs );
 
 void rebuild_import_menu();
 void rebuild_profile_menu();





reply via email to

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