diff --git a/0.74_My_PuTTY/be_all_s.c b/0.74_My_PuTTY/be_all_s.c index 204cb58..ded863b 100644 --- a/0.74_My_PuTTY/be_all_s.c +++ b/0.74_My_PuTTY/be_all_s.c @@ -14,7 +14,7 @@ * have tiny little source modules containing nothing but * declarations of appname, for as long as I can... */ -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) char *appname = "KiTTY"; #else const char *const appname = "PuTTY"; diff --git a/0.74_My_PuTTY/cmdline.c b/0.74_My_PuTTY/cmdline.c index 5544728..9f69fc6 100644 --- a/0.74_My_PuTTY/cmdline.c +++ b/0.74_My_PuTTY/cmdline.c @@ -30,6 +30,7 @@ #ifdef MOD_PERSO #include "kitty_crypt.h" +#include "kitty.h" int decode64(char *buffer) ; void SetAutoStoreSSHKey( void ) ; void load_open_settings_forced(char *filename, Conf *conf) ; @@ -470,9 +471,36 @@ int cmdline_process_param(const char *p, char *value, RETURN(2); /* This parameter must be processed immediately rather than being * saved. */ +#if MOD_PERSO + if( IniFileFlag == SAVEMODE_REG ) { + do_defaults(value, conf); + loaded_session = true; + cmdline_session_name = dupstr(value) ; + } else { + char *pst = strstr( value, "/" ) ; + if( pst==NULL ) { + do_defaults(value, conf); + loaded_session = true; + cmdline_session_name = dupstr(value) ; + } else { + char *name = (char*)malloc( strlen(value)+1 ) ; + strcpy(name,value) ; + pst = strstr( name, "/" ) ; + cmdline_session_name = dupstr(pst+1) ; + pst[0]='\0'; + conf_set_str(conf,CONF_folder,name) ; + SetSessPath( name ) ; + SetInitCurrentFolder( name ) ; + do_defaults(pst+1, conf); + loaded_session = true; + free(value) ; + } + } +#else do_defaults(value, conf); loaded_session = true; cmdline_session_name = dupstr(value); +#endif return 2; } if (!strcmp(p, "-ssh")) { diff --git a/0.74_My_PuTTY/config.c b/0.74_My_PuTTY/config.c index ac1b5d5..c3d1ac7 100644 --- a/0.74_My_PuTTY/config.c +++ b/0.74_My_PuTTY/config.c @@ -813,7 +813,7 @@ static void folder_handler(union control *ctrl, dlgparam *dlg, struct sessionsaver_data { #ifdef MOD_PERSO union control *editbox, *listbox, *clearbutton, *loadbutton, *savebutton, *delbutton, *createbutton, *delfolderbutton, *arrangebutton -#if (defined MOD_PERSO) && (!defined FDJ) && (defined MOD_STARTBUTTON) +#if (defined MOD_PERSO) && (!defined FLJ) && (defined MOD_STARTBUTTON) , *startbutton #endif ; @@ -1016,6 +1016,11 @@ void filter_session_portable(union control *ctrl, dlgparam *dlg, const int nb, c } } + // Removing session that starts with __ + for( i=0 ; isesslist.sessions[i], folder ) ; } + if( GetPuttyFlag() ) { // In PuTTY mode => all sessions dlg_listbox_add(ctrl, dlg, ssd->sesslist.sessions[i]); - } - + } + else if( (ssd->sesslist.sessions[i][0]=='_') && (ssd->sesslist.sessions[i][1]=='_') ) { } // Do nothing if session name starts with __ else if( !GetSessionFilterFlag() ) // In registry mode without filter => all sessions dlg_listbox_add(ctrl, dlg, ssd->sesslist.sessions[i]); else { // In registry mode with filter @@ -1083,8 +1089,7 @@ static void sessionsaver_handler(union control *ctrl, dlgparam *dlg, || ( filter_sessionname( "comment:", ssd->sesslist.sessions[i], folder, ssd->savedsession ) ) || ( filter_sessionname( "title:", ssd->sesslist.sessions[i], folder, ssd->savedsession ) ) || ( filter_sessionname( "class:", ssd->sesslist.sessions[i], folder, ssd->savedsession ) ) - //|| (stristr(host,ssd->savedsession)!=NULL) /* Filtre sur le nom du host */ - || (stristr(ssd->sesslist.sessions[i],ssd->savedsession)!=NULL) ) + || ( stristr(ssd->sesslist.sessions[i],ssd->savedsession)!=NULL) ) dlg_listbox_add(ctrl, dlg, ssd->sesslist.sessions[i]) ; } } @@ -1300,7 +1305,7 @@ static void sessionsaver_handler(union control *ctrl, dlgparam *dlg, dlg_end(dlg, 0); } #ifdef MOD_PERSO -#if (defined MOD_PERSO) && (!defined FDJ) && (defined MOD_STARTBUTTON) +#if (defined MOD_PERSO) && (!defined FLJ) && (defined MOD_STARTBUTTON) else if (ctrl == ssd->startbutton) { char sessionname[1024]; if( conf_launchable(conf) ) { @@ -2259,7 +2264,7 @@ void setup_config_box(struct controlbox *b, bool midsession, if( GetConfigBoxHeight() > 7 ) ssd->okbutton->generic.column = 0 ; else #endif ssd->okbutton->generic.column = 3; -#if (defined MOD_PERSO) && (!defined FDJ) && (defined MOD_STARTBUTTON) +#if (defined MOD_PERSO) && (!defined FLJ) && (defined MOD_STARTBUTTON) if( (!midsession)&&(!GetPuttyFlag()) ) { ssd->startbutton = ctrl_pushbutton(s, "Start", NO_SHORTCUT, HELPCTX(no_help), sessionsaver_handler, P(ssd)); if( GetConfigBoxHeight() > 7 ) ssd->startbutton->generic.column = 0 ; else ssd->startbutton->generic.column = 3; @@ -2450,7 +2455,7 @@ void setup_config_box(struct controlbox *b, bool midsession, ctrl_droplist(s, "Folder", NO_SHORTCUT, 80, HELPCTX(no_help), folder_handler, I(CONF_folder)) ; - } + } #else ssd->savebutton = ctrl_pushbutton(s, "Save", 'v', HELPCTX(session_saved), @@ -2920,7 +2925,7 @@ s = ctrl_getset(b, "Terminal/Bell", "overload", } #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( !GetPuttyFlag() && GetBackgroundImageFlag() ) { /* * The Window/Background panel. diff --git a/0.74_My_PuTTY/pscp.c b/0.74_My_PuTTY/pscp.c index cf4b799..b4dd59b 100644 --- a/0.74_My_PuTTY/pscp.c +++ b/0.74_My_PuTTY/pscp.c @@ -52,7 +52,7 @@ static void sink(const char *targ, const char *src); #ifdef MOD_PERSO void SetAutoStoreSSHKey( void ) ; -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) char *appname = "PSCP"; #else const char *const appname = "PSCP"; diff --git a/0.74_My_PuTTY/psftp.c b/0.74_My_PuTTY/psftp.c index ab08307..34b86c2 100644 --- a/0.74_My_PuTTY/psftp.c +++ b/0.74_My_PuTTY/psftp.c @@ -17,7 +17,7 @@ #ifdef MOD_PERSO void SetAutoStoreSSHKey( void ) ; -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) char *appname = "PSFTP"; #else const char *const appname = "PSFTP"; diff --git a/0.74_My_PuTTY/putty.h b/0.74_My_PuTTY/putty.h index 5c88b5c..8a86657 100644 --- a/0.74_My_PuTTY/putty.h +++ b/0.74_My_PuTTY/putty.h @@ -622,7 +622,7 @@ extern const int be_default_protocol; * Name of this particular application, for use in the config box * and other pieces of text. */ -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) extern char *appname; #else extern const char *const appname; @@ -1589,7 +1589,7 @@ NORETURN void cleanup_exit(int); X(STR, NONE, script_waitfor) \ X(STR, NONE, script_halton) \ /* #endif */ \ -/* #if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) */\ +/* #if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) */\ X(INT, NONE, bg_opacity) \ X(INT, NONE, bg_slideshow) \ X(INT, NONE, bg_type) /* 0=solid 1=wallpaper 2=bitmap */ \ diff --git a/0.74_My_PuTTY/settings.c b/0.74_My_PuTTY/settings.c index 6dcc85f..d97a8d9 100644 --- a/0.74_My_PuTTY/settings.c +++ b/0.74_My_PuTTY/settings.c @@ -839,7 +839,7 @@ void save_open_settings(settings_w *sesskey, Conf *conf) write_setting_i(sesskey, "WakeupReconnect", conf_get_int(conf,CONF_wakeup_reconnect) ); write_setting_i(sesskey, "FailureReconnect", conf_get_int(conf,CONF_failure_reconnect) ); #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() ) { write_setting_i(sesskey, "BgOpacity", conf_get_int(conf, CONF_bg_opacity) ); write_setting_i(sesskey, "BgSlideshow", conf_get_int(conf, CONF_bg_slideshow) ); @@ -953,14 +953,18 @@ bool load_settings(const char *section, Conf *conf) if( get_param("INIFILE") == SAVEMODE_DIR ) { char *name=NULL ; if( (section!=NULL) && (strlen(section)>0) && (strlen(conf_get_str( conf, CONF_folder))>0) ) { - name=(char*)malloc( strlen(section)+strlen(conf_get_str( conf, CONF_folder))+2); - sprintf(name,"%s/%s",conf_get_str( conf, CONF_folder),section); + if( !strcmp(conf_get_str( conf, CONF_folder),"Default") ) { + add_session_to_jumplist(section); + } else { + name=(char*)malloc( strlen(section)+strlen(conf_get_str( conf, CONF_folder))+5); + sprintf(name,"%s/%s",conf_get_str( conf, CONF_folder),section); + } } else if( (section!=NULL) && (strlen(section)>0) ) { name=(char*)malloc( strlen(section)+1); sprintf(name,"%s",section); } - add_session_to_jumplist(name); - if( name!=NULL ) free(name); + if( name!=NULL ) { add_session_to_jumplist(name); free(name) ; } + else { add_session_to_jumplist(section); } } else { add_session_to_jumplist(section); } @@ -1255,7 +1259,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf) gppb(sesskey, "TelnetRet", true, conf, CONF_telnet_newline); gppi(sesskey, "LocalEcho", AUTO, conf, CONF_localecho); gppi(sesskey, "LocalEdit", AUTO, conf, CONF_localedit); -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) gpps(sesskey, "Answerback", "KiTTY", conf, CONF_answerback); #else gpps(sesskey, "Answerback", "PuTTY", conf, CONF_answerback); @@ -1505,7 +1509,7 @@ void load_open_settings(settings_r *sesskey, Conf *conf) gppi(sesskey, "WakeupReconnect", 0, conf, CONF_wakeup_reconnect ); gppi(sesskey, "FailureReconnect", 0, conf, CONF_failure_reconnect ); #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) gppi(sesskey, "BgOpacity", 50, conf, CONF_bg_opacity ); gppi(sesskey, "BgSlideshow", 0, conf, CONF_bg_slideshow ); gppi(sesskey, "BgType", 0, conf, CONF_bg_type ); diff --git a/0.74_My_PuTTY/windows/MAKEFILE.MINGW b/0.74_My_PuTTY/windows/MAKEFILE.MINGW index 16cc0f3..ac5a3d3 100644 --- a/0.74_My_PuTTY/windows/MAKEFILE.MINGW +++ b/0.74_My_PuTTY/windows/MAKEFILE.MINGW @@ -133,21 +133,21 @@ CFLAGS += -DWINVER=0x0501 -D_WIN32_WINDOWS=0x0410 -D_WIN32_WINNT=0x0501 # -DMOD_PERSO -DMOD_BACKGROUNDIMAGE -DMOD_RECONNECT -DMOD_HYPERLINK -DMOD_ZMODEM -DMOD_STARTBUTTON -DMOD_LAUNCHER -DMOD_SAVEDUMP -DMOD_KEYMAPPING -DMOD_TUTTY -DMOD_PORTKNOCKING -DMOD_PUTTYX -DMOD_WTS -DMOD_PRINTCLIP -DMOD_RUTTY -DMOD_ADB \ -# Flag special FDJ -FDJFLAG = FDJ1 +# Flag special FLJ +FLJFLAG = FLJ1 # Ajouter -g -ggdb a CFLAGS pour avoir plus de debug !!! # Ajout du DEBUG # CFLAGS += -DDEBUG -RCFLAGS += -I ../../ -DMOD_PERSO -D$(FDJFLAG) +RCFLAGS += -I ../../ -DMOD_PERSO -D$(FLJFLAG) # Flag pour éviter les crashes sur processeurs AMD => Attention, fait planter la compilation 64bits # CFLAGS += -mms-bitfields -march=i386 CFLAGS += -DNO_SECUREZEROMEMORY -DCOVERITY -DNO_HTMLHELP -CFLAGS += -D$(FDJFLAG) +CFLAGS += -D$(FLJFLAG) CFLAGS += \ -DMOD_PERSO \ -DMOD_STARTBUTTON \ diff --git a/0.74_My_PuTTY/windows/version.rc2 b/0.74_My_PuTTY/windows/version.rc2 index a659a49..c1cf79d 100644 --- a/0.74_My_PuTTY/windows/version.rc2 +++ b/0.74_My_PuTTY/windows/version.rc2 @@ -62,7 +62,7 @@ BEGIN #else VALUE "FileVersion", TEXTVER #endif -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) VALUE "ProductVersion", TEXTVER " - Additional features on KiTTY That's all folks! by 9bis.com, 2005-2020" #else VALUE "ProductVersion", TEXTVER diff --git a/0.74_My_PuTTY/windows/win_res.h b/0.74_My_PuTTY/windows/win_res.h index 138f215..8fa7637 100644 --- a/0.74_My_PuTTY/windows/win_res.h +++ b/0.74_My_PuTTY/windows/win_res.h @@ -11,7 +11,7 @@ #ifdef MOD_PERSO -#ifdef FDJ +#ifdef FLJ #define NB_ICONES 4 #else #define NB_ICONES 50 diff --git a/0.74_My_PuTTY/windows/win_res.rc2 b/0.74_My_PuTTY/windows/win_res.rc2 index 36f2133..510ee51 100644 --- a/0.74_My_PuTTY/windows/win_res.rc2 +++ b/0.74_My_PuTTY/windows/win_res.rc2 @@ -24,7 +24,7 @@ IDI_PUTTY_LAUNCH ICON "../../res/putty_launcher.ico" IDI_BLACKBALL ICON "../../res/black.ico" IDI_NOCON ICON "../../res/nocon/kitty_nocon.ico" -#ifndef FDJ +#ifndef FLJ IDI_MAINICON_0 ICON "../../kitty.ico" IDI_MAINICON_1 ICON "putty.ico" #else @@ -36,7 +36,7 @@ IDI_MAINICON_2 ICON "../../res/puttyprd.ico" IDI_MAINICON_3 ICON "../../res/putty2.ico" IDI_MAINICON_4 ICON "../../res/putty3.ico" -#ifndef FDJ +#ifndef FLJ IDI_MAINICON_5 ICON "../../res/coyote.ico" IDI_MAINICON_6 ICON "../../res/daffy.ico" IDI_MAINICON_7 ICON "../../res/tweety.ico" @@ -108,16 +108,16 @@ BEGIN PUSHBUTTON "View &Licence", IDA_LICENCE, 6, 118, 70, 14 PUSHBUTTON "Visit &Web Site", IDA_WEB, 140, 118, 70, 14 EDITTEXT IDA_TEXT, 10, 6, 250, 110, ES_READONLY | ES_MULTILINE | ES_CENTER, WS_EX_STATICEDGE -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) CTEXT "KiTTY (http://kitty.9bis.com), by 9bis.com", IDA_TEXT2, 10, 26, 194, 16 #endif -#if (defined MOD_PERSO) && (defined FDJ) +#if (defined MOD_PERSO) && (defined FLJ) CTEXT "PuTTY", IDA_TEXT2, 10, 26, 194, 16 #endif END /* Accelerators used: aco */ -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) IDD_MAINBOX DIALOG DISCARDABLE 0, 0, 300, 610 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU /*| WS_SIZEBOX*/ #else @@ -198,7 +198,7 @@ END 120 DIALOG DISCARDABLE 0, 0, 350, 28 //STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE STYLE WS_DLGFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE -#ifdef FDJ +#ifdef FLJ CAPTION "PuTTY" #else CAPTION "KiTTY" diff --git a/0.74_My_PuTTY/windows/wincfg.c b/0.74_My_PuTTY/windows/wincfg.c index 13818ce..bafc546 100644 --- a/0.74_My_PuTTY/windows/wincfg.c +++ b/0.74_My_PuTTY/windows/wincfg.c @@ -14,7 +14,6 @@ static void about_handler(union control *ctrl, dlgparam *dlg, void *data, int event) { HWND *hwndp = (HWND *)ctrl->generic.context.p; - if (event == EVENT_ACTION) { modal_about_box(*hwndp); } @@ -44,7 +43,7 @@ static void variable_pitch_handler(union control *ctrl, dlgparam *dlg, #include "kitty.h" int get_param( const char * val ) ; char * get_param_str( const char * val ) ; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) void DisableBackgroundImage( void ) ; #endif void CheckVersionFromWebSite( HWND hwnd ) ; @@ -155,7 +154,7 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, bool has_help, if( GetConfigBoxHeight() > 7 ) c->generic.column = 0 ; else c->generic.column = 1; } -#ifndef FDJ +#ifndef FLJ if( !get_param("PUTTY") ) { c = ctrl_pushbutton(s, "Check Update", NO_SHORTCUT, HELPCTX(no_help), checkupdate_handler, P(hwndp)); @@ -616,7 +615,7 @@ void win_setup_config_box(struct controlbox *b, HWND *hwndp, bool has_help, conf_filesel_handler, I(CONF_url_browser)); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) /* Le patch Background image ne marche plus bien sur la version PuTTY 0.61 - il est en erreur lorsqu'on passe par la config box - il est ok lorsqu'on démarrer par -load ou par duplicate session diff --git a/0.74_My_PuTTY/windows/windlg.c b/0.74_My_PuTTY/windows/windlg.c index ab43795..6037a14 100644 --- a/0.74_My_PuTTY/windows/windlg.c +++ b/0.74_My_PuTTY/windows/windlg.c @@ -236,7 +236,7 @@ static INT_PTR CALLBACK LicenceProc(HWND hwnd, UINT msg, -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) //static const char MESSAGE[] = ""; static const char MESSAGE[] = " KiTTY software is developed by Cyd for 9bis.com, copyright \251 2005-2020, thanks to Leo for bcrypt and mini libraries, thanks to all contributors " ; @@ -261,7 +261,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg, case WM_INITDIALOG: { char buffer[1024] ; LOGFONT lf; -#ifdef FDJ +#ifdef FLJ /* Positionnement du ssh handler */ CreateSSHHandler() ; /* Creation des association de fichiers .ktx */ @@ -968,7 +968,7 @@ static INT_PTR CALLBACK GenericMainDlgProc(HWND hwnd, UINT msg, void modal_about_box(HWND hwnd) { EnableWindow(hwnd, 0); -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) if( get_param("PUTTY") ) DialogBox(hinst, MAKEINTRESOURCE(IDD_ABOUTBOX), hwnd, AboutProcOrig); else DialogBox(hinst, MAKEINTRESOURCE(IDD_KITTYABOUT), hwnd, AboutProc); #else @@ -1082,7 +1082,7 @@ bool do_reconfig(HWND hwnd, int protcfginfo) if (!ret) conf_copy_into(conf, backup_conf); -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (conf_get_int(conf,CONF_bg_slideshow)!=conf_get_int(backup_conf,CONF_bg_slideshow)) ) { KillTimer( hwnd, TIMER_SLIDEBG ) ; if((conf_get_int(conf,CONF_bg_type)!=0)&&(conf_get_int(conf,CONF_bg_slideshow)>0)) @@ -1149,7 +1149,7 @@ void showeventlog(HWND hwnd) SetActiveWindow(logbox); } -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) void showabout(HWND hwnd) { /* diff --git a/0.74_My_PuTTY/windows/window.c b/0.74_My_PuTTY/windows/window.c index 899a0a6..c69bf54 100644 --- a/0.74_My_PuTTY/windows/window.c +++ b/0.74_My_PuTTY/windows/window.c @@ -330,7 +330,7 @@ int WINAPI Agent_WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show typedef enum _WTS_VIRTUAL_CLASS { WTSVirtualClientData, WTSVirtualFileHandle } WTS_VIRTUAL_CLASS; // WTS_VIRTUAL_CLASS n'est pas défini dans le fichier wtsapi32.h !!! #include #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) #include "../../kitty_image.h" #endif #ifdef MOD_RECONNECT @@ -553,7 +553,18 @@ static void start_backend(void) if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) && is_backend_first_connected ) { lp_eventlog(default_logpolicy, msg) ; } else { - MessageBox(NULL, msg, str, MB_ICONERROR | MB_OK); + if( GetAutoreconnectFlag() && conf_get_int(conf,CONF_failure_reconnect) ) { + if( MessageBox(NULL, msg, str, MB_ICONERROR | MB_RETRYCANCEL | MB_DEFBUTTON2) == IDCANCEL ) { + sfree(str); + sfree(msg); + exit(0); + } else { + start_backend() ; + return ; + } + } else { + MessageBox(NULL, msg, str, MB_OK); + } } sfree(str); sfree(msg); @@ -565,7 +576,7 @@ static void start_backend(void) lp_eventlog(default_logpolicy, "Unable to connect, trying to reconnect...") ; SetTimer(hwnd, TIMER_RECONNECT, GetReconnectDelay()*1000, NULL) ; return ; - } + } else #else char *str = dupprintf("%s Error", appname); @@ -722,6 +733,12 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) // Initialisation specifique a KiTTY SethInstIcons( hinst ) ; InitWinMain(); + if( debug_flag ) { + char * buf = (char*)malloc( strlen(cmdline)+20 ) ; + sprintf( buf, "Command-line: %s", cmdline ) ; + lp_eventlog(default_logpolicy, buf) ; + free(buf); + } #endif #ifdef MOD_NOTRANSPARENCY SetTransparencyFlag(0); @@ -791,6 +808,18 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) p[i] = '\0'; #ifdef MOD_PERSO if( GetDirectoryBrowseFlag() ) { + char *pst = strstr( p+1, "/" ) ; + if( pst!=NULL ) { + pst[0]='\0'; + char *name = (char*)malloc( strlen(p)+1 ) ; + strcpy( name, p+1 ) ; + conf_set_str(conf,CONF_folder,name) ; + SetSessPath( name ) ; + SetInitCurrentFolder( name ) ; + free(name) ; + pst[0]='@' ; + p=pst; + } char * pfolder ; if( (pfolder=strstr(p+1," -folder \"")) ) { pfolder[0]='\0'; @@ -1017,7 +1046,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) if( conf_get_int( conf, CONF_xpos)<0) conf_set_int( conf, CONF_xpos,0); conf_set_bool( conf, CONF_save_windowpos, true ) ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) } else if( !strcmp(p, "-nobgimage") ) { SetBackgroundImageFlag(0) ; } else if( !strcmp(p, "-bgimage") ) { @@ -1043,7 +1072,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) SetRuttyFlag( 0 ) ; SetDefaultSettingsFlag(1); SetReadOnlyFlag(0); -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) SetBackgroundImageFlag(0) ; #endif #ifdef MOD_RECONNECT @@ -1064,7 +1093,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) CreateSSHHandler() ; return 0 ; } else if( !strcmp(p, "-fileassoc") ) { CreateFileAssoc() ; return 0 ; -#ifndef FDJ +#ifndef FLJ } else if( !strcmp(p, "-key") ) { GenerePrivateKey( "private.key.ppk" ) ; return 0 ; #endif @@ -1105,7 +1134,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } else if( !strcmp(p, "-title") ) { i++ ; conf_set_str( conf, CONF_wintitle, argv[i] ); -#ifndef FDJ +#ifndef FLJ } else if( !strcmp(p, "-classname") ) { i++ ; if( strlen( argv[i] ) > 0 ) { @@ -1229,7 +1258,7 @@ if( conf_get_int(conf,CONF_icone) == 0 ) { wndclass.hCursor = LoadCursor(NULL, IDC_IBEAM); wndclass.hbrBackground = NULL; wndclass.lpszMenuName = NULL; -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) wndclass.lpszClassName = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, KiTTYClassName); #else wndclass.lpszClassName = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, appname); @@ -1277,7 +1306,7 @@ TrayIcone.hWnd = hwnd ; if (guess_height > r.bottom - r.top) guess_height = r.bottom - r.top; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) const char* winname = appname; #endif { @@ -1301,7 +1330,7 @@ TrayIcone.hWnd = hwnd ; if (conf_get_bool(conf, CONF_sunken_edge)) exwinmode |= WS_EX_CLIENTEDGE; #ifdef MOD_PERSO -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) // TODO: This is the beginning of some work to have windows with fancy // no-client-edge borders. It's not ready yet. if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) @@ -1608,7 +1637,7 @@ TrayIcone.hWnd = hwnd ; } // Lancement des timer (changement image de fond, rafraichissement) -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( (!GetBackgroundImageFlag()) || GetPuttyFlag() ) conf_set_int(conf,CONF_bg_type,0); if( conf_get_int(conf,CONF_bg_type)!=0 ) { if(conf_get_int(conf,CONF_bg_slideshow)>0) @@ -3112,7 +3141,7 @@ static bool is_alt_pressed(void) return true; return false; } -#if (!defined MOD_BACKGROUNDIMAGE) || (defined FDJ) +#if (!defined MOD_BACKGROUNDIMAGE) || (defined FLJ) static bool resizing; #endif #ifdef MOD_PERSO @@ -3130,7 +3159,7 @@ struct ctrl_tab_info { static BOOL CALLBACK CtrlTabWindowProc(HWND hwnd, LPARAM lParam) { struct ctrl_tab_info* info = (struct ctrl_tab_info*) lParam; char lpszClassName[256]; -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) strcpy(lpszClassName,KiTTYClassName) ; #else strcpy(lpszClassName,appname) ; @@ -3399,7 +3428,7 @@ else if((UINT_PTR)wParam == TIMER_AUTOPASTE) { // AutoPaste } } } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) else if( GetBackgroundImageFlag() && ((UINT_PTR)wParam == TIMER_SLIDEBG) ) { // Changement automatique de l'image de fond NextBgImage( hwnd ) ; InvalidateRect( hwnd, NULL, true ) ; @@ -3478,7 +3507,7 @@ else if((UINT_PTR)wParam == TIMER_LOGROTATION) { // log rotation SetTransparency( hwnd, 255-conf_get_int(conf,CONF_transparencynumber) ) ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetIconeFlag() == -1 ) conf_set_int( conf, CONF_bg_type, 0 ) ; if( !GetBackgroundImageFlag() ) conf_set_int( conf, CONF_bg_type, 0 ); #endif @@ -3788,7 +3817,7 @@ free(cmd); break; } #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) { if(textdc) { DeleteObject(textbm); @@ -4360,11 +4389,27 @@ free(cmd); } #endif break ; - } + } + if( (message == WM_LBUTTONUP) && (wParam & MK_SHIFT) ) { // shift + bouton gauche => duplicate session dans la fenêtre d'édition + char * host= (char*)malloc(strlen(conf_get_str(conf,CONF_host))+1) ; + strcpy( host, conf_get_str(conf,CONF_host) ) ; + conf_set_str(conf,CONF_host,"") ; + save_settings("__STARTUP",conf) ; + RunSession( hwnd, "", "__STARTUP" ); + conf_set_str(conf,CONF_host,host) ; + free(host) ; + del_settings("__STARTUP"); + } else if (message == WM_LBUTTONUP && ((wParam & MK_CONTROL) ) ) {// ctrl+bouton gauche => nouvelle icone - if( GetIconeFlag() != -1 ) SetNewIcon( hwnd, conf_get_filename(conf,CONF_iconefile)->path, conf_get_int(conf,CONF_icone), SI_NEXT ) ; + if( !GetHyperlinkFlag() || !conf_get_int(conf,CONF_url_ctrl_click) ) { // si les hyperliens ou le ctrl sont désactivés + if( GetIconeFlag() != -1 ) SetNewIcon( hwnd, conf_get_filename(conf,CONF_iconefile)->path, conf_get_int(conf,CONF_icone), SI_NEXT ) ; + } else { + if( !urlhack_is_in_link_region(TO_CHR_X(cursor_pt.x), TO_CHR_Y(cursor_pt.y)) ) { // Si sou sla position de la souris il n'y a pas un hyperlien + if( GetIconeFlag() != -1 ) SetNewIcon( hwnd, conf_get_filename(conf,CONF_iconefile)->path, conf_get_int(conf,CONF_icone), SI_NEXT ) ; + } + } RefreshBackground( hwnd ) ; - //break ; + break ; } else if (message == WM_MBUTTONUP && ((wParam & MK_CONTROL) ) ) { // ctrl+bouton milieu => send to tray @@ -4611,7 +4656,7 @@ free(cmd); case WM_PAINT: { PAINTSTRUCT p; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) HDC hdccod=0, hdcScreen, hdcBack = 0; if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) { HideCaret(hwnd); @@ -4682,7 +4727,7 @@ free(cmd); */ //assert(!wintw_hdc); wintw_hdc = hdc; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) { term_paint(term, (p.rcPaint.left-offset_width)/font_width, @@ -4770,7 +4815,7 @@ free(cmd); SelectObject(hdc, GetStockObject(WHITE_PEN)); EndPaint(hwnd, &p); ShowCaret(hwnd); -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) } #endif } @@ -4816,7 +4861,7 @@ free(cmd); debug("WM_ENTERSIZEMOVE\n"); #endif EnableSizeTip(true); -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!PuttyFlag) ) GetClientRect(hwnd, &size_before); #endif resizing = true; @@ -4832,7 +4877,7 @@ free(cmd); term_size(term, conf_get_int(conf, CONF_height), conf_get_int(conf, CONF_width), conf_get_int(conf, CONF_savelines)); -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (conf_get_int(conf,CONF_bg_image_abs_fixed)==1) && (conf_get_int(conf,CONF_bg_type)!=0) ) RefreshBackground( hwnd ) ; #endif InvalidateRect(hwnd, NULL, true); @@ -4935,7 +4980,7 @@ free(cmd); fullscr_on_max = true; break; #ifdef MOD_PERSO -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) case WM_DISPLAYCHANGE: if( (!GetBackgroundImageFlag()) || GetPuttyFlag() ) return DefWindowProc(hwnd, message, wParam, lParam) ; case WM_MOVE: @@ -5285,7 +5330,7 @@ free(cmd); if( debug_flag ) addkeypressed( message, wParam, lParam, GetKeyState(VK_SHIFT)&0x8000, GetKeyState(VK_CONTROL)&0x8000, (GetKeyState(VK_MENU)&0x8000)||(GetKeyState(VK_LMENU)&0x8000),GetKeyState(VK_RMENU)&0x8000, (GetKeyState(VK_RWIN)&0x8000)||(GetKeyState(VK_LWIN)&0x8000 ) ); #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( (wParam==VK_SNAPSHOT)&&(GetKeyState(VK_CONTROL)&0x8000) ) { // CTRL + PrintScreen => Screenshot char screenShotFile[1024] ; sprintf( screenShotFile, "%s\\screenshot-%d-%ld.jpg", InitialDirectory, getpid(), time(0) ); @@ -5731,7 +5776,7 @@ static void do_text_internal( static size_t lpDx_len = 0; int *lpDx_maybe; int len2; /* for SURROGATE PAIR */ -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) int transBg = backgrounddc ? 1 : 0; UINT etoFlagOpaque = transBg ? 0 : ETO_OPAQUE; #endif @@ -5927,7 +5972,7 @@ static void do_text_internal( GetGValue(fg) * 2 / 3, GetBValue(fg) * 2 / 3); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) HDC hdc = wintw_hdc ; if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) { line_box.left = x; @@ -6114,7 +6159,7 @@ static void do_text_internal( } if (nlen <= 0) return; /* Eeek! */ -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) // ExtTextOutW(hdc, x, // y - font_height * (lattr == LATTR_BOT) + text_adjust, @@ -6147,7 +6192,7 @@ static void do_text_internal( sgrowarray(directbuf, directlen, len); for (size_t i = 0; i < len; i++) directbuf[i] = text[i] & 0xFF; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!GetPuttyFlag()) ) // ExtTextOut(hdc, x, // y - font_height * (lattr == LATTR_BOT) + text_adjust, @@ -6193,7 +6238,7 @@ static void do_text_internal( for (i = 0; i < len; i++) wbuf[i] = text[i]; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) /* print Glyphs as they are, without Windows' Shaping*/ if( GetBackgroundImageFlag() && (!PuttyFlag) ) // exact_textout(hdc, x, y - font_height * (lattr == LATTR_BOT) + text_adjust, @@ -6241,7 +6286,7 @@ static void do_text_internal( oldpen = SelectObject(wintw_hdc, oldpen); DeleteObject(oldpen); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (!PuttyFlag) ) if(textdc) { @@ -7291,7 +7336,7 @@ static void wintw_set_title(TermWin *tw, const char *title_in) { if( strstr(title, " (PROTECTED)")==(title+strlen(title)-12) ) { title[strlen(title)-12]='\0' ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) buffer = (char*) malloc( strlen( title ) + strlen( conf_get_str(conf,CONF_host)) + strlen( conf_get_filename(conf,CONF_bg_image_filename)->path ) + 40 ) ; if( GetBackgroundImageFlag() && GetImageViewerFlag() && (!PuttyFlag) ) { sprintf( buffer, "%s", conf_get_filename(conf,CONF_bg_image_filename)->path ) ; } else @@ -8440,7 +8485,7 @@ static void flip_full_screen() SendMessage(hwnd, WM_FULLSCR_ON_MAX, 0, 0); ShowWindow(hwnd, SW_MAXIMIZE); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag()&&(!PuttyFlag)&&(conf_get_int(conf,CONF_bg_image_abs_fixed)==1)&&(conf_get_int(conf,CONF_bg_type)!=0) ) RefreshBackground( hwnd ) ; #endif } diff --git a/0.74_My_PuTTY/windows/winstuff.h b/0.74_My_PuTTY/windows/winstuff.h index 16be821..33f1bb2 100644 --- a/0.74_My_PuTTY/windows/winstuff.h +++ b/0.74_My_PuTTY/windows/winstuff.h @@ -173,7 +173,7 @@ struct FontSpec *fontspec_new( #endif #ifdef MOD_PERSO -#ifdef FDJ +#ifdef FLJ #define PUTTY_REG_POS_SAVE "Software\\9bis.com\\PuTTY_save" #define PUTTY_REG_POS "Software\\SimonTatham\\PuTTY" #define PUTTY_REG_PARENT "Software\\SimonTatham" @@ -328,7 +328,7 @@ void write_aclip(int clipboard, char *, int, bool); #define FILTER_DYNLIB_FILES ("Dynamic Library Files (*.dll)\0*.dll\0" \ "All Files (*.*)\0*\0\0\0") -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) #define FILTER_IMAGE_FILES ("Image Files\0*.BMP;*.JPG;*.JPEG\0" \ "BMP Files (*.bmp)\0*.BMP\0" \ "JPEG Files (*.jpg)\0*.JPG;*.JPEG\0" \ diff --git a/kitty.c b/kitty.c index 3f04592..efd969c 100644 --- a/kitty.c +++ b/kitty.c @@ -94,7 +94,7 @@ static int PasteCommandFlag = 0 ; int GetPasteCommandFlag(void) { return PasteCommandFlag ; } // Flag de gestion de la fonction hyperlink -#ifdef FDJ +#ifdef FLJ int HyperlinkFlag = 1 ; #else #ifdef MOD_HYPERLINK @@ -112,7 +112,7 @@ int GetRuttyFlag(void) { return RuttyFlag ; } void SetRuttyFlag( const int flag ) { RuttyFlag = flag ; } // Flag de gestion de la Transparence -#ifdef FDJ +#ifdef FLJ static int TransparencyFlag = 1 ; #else static int TransparencyFlag = 1 ; @@ -140,7 +140,7 @@ void SetProtectFlag( const int flag ) { ProtectFlag = flag ; } #endif // Definition de la section du fichier de configuration -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) #ifndef INIT_SECTION #define INIT_SECTION "KiTTY" #endif @@ -184,7 +184,7 @@ int GetVisibleFlag(void) { return VisibleFlag ; } void SetVisibleFlag( const int flag ) { VisibleFlag = flag ; } // Flag pour inhiber les raccourcis clavier -#ifdef FDJ +#ifdef FLJ static int ShortcutsFlag = 0 ; #else static int ShortcutsFlag = 1 ; @@ -375,7 +375,7 @@ NOTIFYICONDATA TrayIcone ; #define TIMER_INIT 8701 #define TIMER_AUTOCOMMAND 8702 -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) #define TIMER_SLIDEBG 8703 #endif #define TIMER_REDRAW 8704 @@ -387,7 +387,7 @@ NOTIFYICONDATA TrayIcone ; /* #define TIMER_INIT 12341 #define TIMER_AUTOCOMMAND 12342 -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) #define TIMER_SLIDEBG 12343 #endif #define TIMER_REDRAW 12344 @@ -631,7 +631,7 @@ int get_param( const char * val ) { return 0 ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) /* Le patch Background image ne marche plus bien sur la version PuTTY 0.61 - il est en erreur lorsqu'on passe par la config box - il est ok lorsqu'on demarrer par -load ou par duplicate session @@ -1150,7 +1150,7 @@ void RegRenameTree( HWND hdlg, HKEY hMainKey, LPCTSTR lpSubKey, LPCTSTR lpDestKe // Permet de recuperer les sessions KiTTY dans PuTTY (PUTTY_REG_POS) void RepliqueToPuTTY( LPCTSTR Key ) { char buffer[1024] ; -#ifdef FDJ +#ifdef FLJ return ; #endif if( IniFileFlag == SAVEMODE_REG ) @@ -1270,7 +1270,7 @@ void CreateDefaultIniFile_old( void ) { writeINI( KittyIniFile, INIT_SECTION, "#antiidle=", " \\k08\\" ) ; writeINI( KittyIniFile, INIT_SECTION, "#antiidledelay", "60" ) ; writeINI( KittyIniFile, INIT_SECTION, "#autostoresshkey", "no" ) ; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) writeINI( KittyIniFile, INIT_SECTION, "backgroundimage", "no" ) ; #endif writeINI( KittyIniFile, INIT_SECTION, "#bcdelay", "0" ) ; @@ -1281,7 +1281,7 @@ void CreateDefaultIniFile_old( void ) { // writeINI( KittyIniFile, INIT_SECTION, "debug", "#no" ) ; writeINI( KittyIniFile, INIT_SECTION, "#downloaddir", "" ) ; #ifdef MOD_HYPERLINK -#ifdef FDJ +#ifdef FLJ writeINI( KittyIniFile, INIT_SECTION, "hyperlink", "yes" ) ; #else writeINI( KittyIniFile, INIT_SECTION, "hyperlink", "no" ) ; @@ -1303,7 +1303,7 @@ void CreateDefaultIniFile_old( void ) { writeINI( KittyIniFile, INIT_SECTION, "savemode", "registry" ) ; #endif writeINI( KittyIniFile, INIT_SECTION, "#scriptfilefilter", "All files (*.*)|*.*" ) ; -#ifdef FDJ +#ifdef FLJ writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "no" ) ; #else writeINI( KittyIniFile, INIT_SECTION, "shortcuts", "yes" ) ; @@ -1311,7 +1311,7 @@ void CreateDefaultIniFile_old( void ) { writeINI( KittyIniFile, INIT_SECTION, "size", "no" ) ; writeINI( KittyIniFile, INIT_SECTION, "#sshversion", "OpenSSH_5.5" ) ; #ifndef MOD_NOTRANSPARENCY -#ifdef FDJ +#ifdef FLJ writeINI( KittyIniFile, INIT_SECTION, "transparency", "yes" ) ; #else writeINI( KittyIniFile, INIT_SECTION, "transparency", "no" ) ; @@ -2687,21 +2687,21 @@ void ManageWinrol( HWND hwnd, int resize_action ) { InvalidateRect(hwnd, NULL, TRUE); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) BOOL load_bg_bmp() ; void clean_bg( void ) ; void RedrawBackground( HWND hwnd ) ; #endif void RefreshBackground( HWND hwnd ) { -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() ) RedrawBackground( hwnd ) ; else #endif InvalidateRect( hwnd, NULL, true ) ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) /* Changement du fond d'ecran */ int GetExt( const char * filename, char * ext) { int i; @@ -4008,7 +4008,7 @@ int SearchPSCP( void ) { } } } -#ifndef FDJ +#ifndef FLJ // kscp dans le meme repertoire sprintf( buffer, "%s\\%s", InitialDirectory, ki ) ; if( existfile( buffer ) ) { @@ -4050,7 +4050,7 @@ int SearchPlink( void ) { else { DelParameter( INIT_SECTION, "PlinkPath" ) ; } } -#ifndef FDJ +#ifndef FLJ // klink dans le meme repertoire sprintf( buffer, "%s\\%s", InitialDirectory, ki ) ; if( existfile( buffer ) ) { @@ -4620,7 +4620,7 @@ void ChangeSettings(HWND hwnd) { //ChangeFontSize(hwnd,-1); } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) // Gestion de l'image viewer int ManageViewer( HWND hwnd, WORD wParam ) { // Gestion du mode image if( wParam==VK_BACK ) @@ -4798,7 +4798,7 @@ void InitShortcuts( void ) { // } if( !readINI(KittyIniFile,"Shortcuts","inputm",buffer) || ( (shortcuts_tab.inputm=DefineShortcuts(buffer))<0 ) ) shortcuts_tab.inputm = SHIFTKEY+VK_F8 ; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( !readINI(KittyIniFile,"Shortcuts","viewer",buffer) || ( (shortcuts_tab.viewer=DefineShortcuts(buffer))<0 ) ) shortcuts_tab.viewer = SHIFTKEY+VK_F11 ; #endif @@ -4821,7 +4821,7 @@ void InitShortcuts( void ) { shortcuts_tab.input = CONTROLKEY+VK_F8 ; if( !readINI(KittyIniFile,"Shortcuts","protect",buffer) || ( (shortcuts_tab.protect=DefineShortcuts(buffer))<0 ) ) shortcuts_tab.protect = CONTROLKEY+VK_F9 ; -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( !readINI(KittyIniFile,"Shortcuts","imagechange",buffer) || ( (shortcuts_tab.imagechange=DefineShortcuts(buffer))<0 ) ) shortcuts_tab.imagechange = CONTROLKEY+VK_F11 ; #endif @@ -4920,7 +4920,7 @@ int ManageShortcuts( HWND hwnd, const int* clips_system, int key_num, int shift_ } } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && ImageViewerFlag ) { // Gestion du mode image if( ManageViewer( hwnd, key_num ) ) return 1 ; } @@ -4960,14 +4960,14 @@ int ManageShortcuts( HWND hwnd, const int* clips_system, int key_num, int shift_ SendMessage( hwnd, WM_COMMAND, IDM_PRINT, 0 ) ; return 1 ; } -#ifndef FDJ +#ifndef FLJ if( key == shortcuts_tab.inputm ) // Fenetre de controle { MainHwnd = hwnd ; _beginthread( routine_inputbox_multiline, 0, (void*)&hwnd ) ; return 1 ; } #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() && (key == shortcuts_tab.viewer) ) // Switcher le mode visualiseur d'image { ImageViewerFlag = abs(ImageViewerFlag-1) ; set_title(NULL, conf_get_str(conf,CONF_wintitle) ) ; return 1 ; } #endif @@ -5012,14 +5012,14 @@ int ManageShortcuts( HWND hwnd, const int* clips_system, int key_num, int shift_ else if( key == shortcuts_tab.keyexchange ) // Repeat key exchange { SendMessage( hwnd, WM_COMMAND, 1328, 0 ) ; return 1 ; } -#ifndef FDJ +#ifndef FLJ else if( key == shortcuts_tab.input ) // Fenetre de controle { MainHwnd = hwnd ; _beginthread( routine_inputbox, 0, (void*)&hwnd ) ; InvalidateRect( hwnd, NULL, TRUE ) ; return 1 ; } #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) else if( GetBackgroundImageFlag() && (key == shortcuts_tab.imagechange) ) // Changement d'image de fond { if( NextBgImage( hwnd ) ) InvalidateRect(hwnd, NULL, TRUE) ; return 1 ; } #endif @@ -5072,7 +5072,7 @@ void SetPasteCommand( void ) { } // Initialisation des parametres a partir du fichier kitty.ini -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) void SetShrinkBitmapEnable(int) ; #endif @@ -5094,7 +5094,7 @@ void LoadParameters( void ) { if( ReadParameter( INIT_SECTION, "antiidledelay", buffer ) ) { AntiIdleCountMax = (int)floor(atoi(buffer)/10.0) ; if( AntiIdleCountMax<=0 ) AntiIdleCountMax =1 ; } if( ReadParameter( INIT_SECTION, "autostoresshkey", buffer ) ) { if( !stricmp( buffer, "YES" ) ) SetAutoStoreSSHKeyFlag( 1 ) ; } -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( debug_flag ) if( ReadParameter( INIT_SECTION, "backgroundimage", buffer ) ) { if( !stricmp( buffer, "NO" ) ) SetBackgroundImageFlag( 0 ) ; @@ -5222,7 +5222,7 @@ void LoadParameters( void ) { } #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( ReadParameter( INIT_SECTION, "shrinkbitmap", buffer ) ) { if( !stricmp( buffer, "YES" ) ) SetShrinkBitmapEnable(1) ; else SetShrinkBitmapEnable(0) ; } #endif @@ -5366,7 +5366,7 @@ void InitWinMain( void ) { if( existfile("kitty.log") ) { unlink( "kitty.log" ) ; } -#ifdef FDJ +#ifdef FLJ CreateSSHHandler(); CreateFileAssoc() ; SetADBFlag(0) ; @@ -5395,7 +5395,7 @@ void InitWinMain( void ) { // Initialisation du nom de la classe strcpy( KiTTYClassName, appname ) ; -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) if( ReadParameter( INIT_SECTION, "KiClassName", buffer ) ) { if( (strlen(buffer)>0) && (strlen(buffer)<128) ) { buffer[127]='\0'; strcpy( KiTTYClassName, buffer ) ; } } appname = KiTTYClassName ; diff --git a/kitty.h b/kitty.h index e94fe20..d21ff8b 100644 --- a/kitty.h +++ b/kitty.h @@ -133,6 +133,9 @@ void SetRuttyFlag( const int flag ) ; // Flag pour le fonctionnement en mode "portable" (gestion par fichiers), defini dans kitty_commun.c extern int IniFileFlag ; +int GetIniFileFlag(void) ; +void SetIniFileFlag( const int flag ) ; +void SwitchIniFileFlag(void) ; // Flag permettant la gestion de l'arborscence (dossier=folder) dans le cas d'un savemode=dir, defini dans kitty_commun.c //extern int DirectoryBrowseFlag ; @@ -399,7 +402,7 @@ void InitLauncherRegistry( void ) ; int getpid(void) ; // Definition de la section du fichier de configuration -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) #ifndef INIT_SECTION #define INIT_SECTION "KiTTY" @@ -451,7 +454,7 @@ int getpid(void) ; #endif #ifndef TIMER_SLIDEBG -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) #define TIMER_SLIDEBG 8703 #endif #endif diff --git a/kitty_commun.c b/kitty_commun.c index c64407a..f1fe211 100644 --- a/kitty_commun.c +++ b/kitty_commun.c @@ -26,6 +26,9 @@ int IniFileFlag = SAVEMODE_DIR ; #else int IniFileFlag = SAVEMODE_REG ; #endif +int GetIniFileFlag(void) { return IniFileFlag ; } +void SetIniFileFlag( const int flag ) { IniFileFlag = flag ; } +void SwitchIniFileFlag(void) { if( IniFileFlag == SAVEMODE_REG ) { IniFileFlag = SAVEMODE_DIR ; } else if ( IniFileFlag == SAVEMODE_DIR ) { IniFileFlag; } } // Flag permettant la gestion de l'arborscence (dossier=folder) dans le cas d'un savemode=dir #ifdef MOD_PORTABLE @@ -75,7 +78,7 @@ void SetZModemFlag( const int flag ) { ZModemFlag = flag ; } #endif // Flag pour afficher l'image de fond -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) // Suite à PuTTY 0.61, le patch covidimus ne fonctionne plus tres bien // Il impose de demarrer les sessions avec -load meme depuis la config box (voir CONFIG.C) // Le patch est desactive par defaut @@ -156,7 +159,7 @@ int LoadParametersLight( void ) { int ret = 0 ; char buffer[4096] ; -#ifndef FDJ +#ifndef FLJ if( (getenv("KITTY_INI_FILE")!=NULL) && ((fp = fopen( getenv("KITTY_INI_FILE"), "r" )) != NULL) ) { fclose(fp ) ; IniFile = (char*)malloc(strlen(getenv("KITTY_INI_FILE"))+1) ; @@ -239,7 +242,7 @@ int LoadParametersLight( void ) { else DirectoryBrowseFlag = 0 ; } else { -#ifndef FDJ +#ifndef FLJ sprintf( buffer, "%s/KiTTY/kitty.ini", getenv("APPDATA") ); if( (fp = fopen( buffer, "r" )) != NULL ) { IniFile = (char*)malloc(strlen(buffer)+1) ; @@ -255,7 +258,7 @@ int LoadParametersLight( void ) { strcpy(INIT_SECTION,"PuTTY"); fclose(fp); } -#ifndef FDJ +#ifndef FLJ } #endif } diff --git a/kitty_commun.h b/kitty_commun.h index 2c369bf..48b1049 100644 --- a/kitty_commun.h +++ b/kitty_commun.h @@ -11,6 +11,11 @@ // Flag permettant d'activer l'acces a du code particulier permettant d'avoir plus d'info dans le kitty.dmp extern int debug_flag ; +// Flag pour le fonctionnement en mode "portable" (gestion par fichiers) +int GetIniFileFlag(void) ; +void SetIniFileFlag( const int flag ) ; +void SwitchIniFileFlag(void) ; + // Flag permettant de sauvegarder automatique les cles SSH des serveurs // extern int AutoStoreSSHKeyFlag ; int GetAutoStoreSSHKeyFlag(void) ; diff --git a/kitty_image.c b/kitty_image.c index 522dce2..25a0dc1 100644 --- a/kitty_image.c +++ b/kitty_image.c @@ -5,7 +5,7 @@ // Essai de compilation séparée -#ifdef FDJ +#ifdef FLJ #undef MOD_BACKGROUNDIMAGE #endif diff --git a/kitty_launcher.c b/kitty_launcher.c index 00f0c92..3d89499 100644 --- a/kitty_launcher.c +++ b/kitty_launcher.c @@ -518,7 +518,7 @@ LRESULT CALLBACK Launcher_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP TrayIcone.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE; // On lui indique les champs valables // On lui dit qu'il devra "écouter" son environement (clique de souris, etc) TrayIcone.uCallbackMessage = KLWM_NOTIFYICON; -#ifdef FDJ +#ifdef FLJ TrayIcone.szTip[1024] = (TCHAR*)"PuTTY\0" ; // Le tooltip par défaut, soit rien #else //TrayIcone.szTip[1024] = "KiTTY That\'s all folks!\0" ; // Le tooltip par défaut, soit rien @@ -527,7 +527,7 @@ LRESULT CALLBACK Launcher_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP TrayIcone.hWnd = hwnd ; ResShell = Shell_NotifyIcon(NIM_ADD, &TrayIcone); if( ResShell ) { -#ifdef FDJ +#ifdef FLJ strcpy( TrayIcone.szTip, "PuTTY\0" ) ; #else strcpy( TrayIcone.szTip, "KiTTY That\'s all folks!\0" ) ; @@ -851,7 +851,7 @@ int RunSession( HWND hwnd, const char * folder_in, char * session_in ) { } else if( IniFileFlag==SAVEMODE_DIR ) { if( DirectoryBrowseFlag ) { - if( strcmp(folder_in,"")&&strcmp(folder_in,"Default") ) { + if( (folder_in!=NULL)&&strcmp(folder_in,"")&&strcmp(folder_in,"Default") ) { strcat( shortname, " -folder \"" ) ; strcat( shortname, folder_in ) ; strcat( shortname, "\"" ) ; diff --git a/kitty_registry.c b/kitty_registry.c index 16dc0f3..bb52e40 100644 --- a/kitty_registry.c +++ b/kitty_registry.c @@ -411,7 +411,7 @@ BOOL RegCleanPuTTY( void ) { DWORD cbSecurityDescriptor; // size of security descriptor FILETIME ftLastWriteTime; // last write time char *buffer = NULL ; -#ifdef FDJ +#ifdef FLJ return 1 ; #endif if( (retCode = RegOpenKeyEx ( HKEY_CURRENT_USER, "Software\\SimonTatham\\PuTTY", 0, KEY_WRITE, &hSubKey)) == ERROR_SUCCESS ) { @@ -639,7 +639,7 @@ void TestRegKeyOrCopyFromPuTTY( HKEY hMainKey, char * KeyName ) { } else { RegCreateKey( hMainKey, TEXT(KeyName), &hKey ) ; RegCloseKey( hKey ) ; -#ifndef FDJ +#ifndef FLJ RegCopyTree( hMainKey, "Software\\SimonTatham\\PuTTY", TEXT(KeyName) ) ; #endif } diff --git a/kitty_savedump.c b/kitty_savedump.c index 7920133..6ff9fa1 100644 --- a/kitty_savedump.c +++ b/kitty_savedump.c @@ -551,7 +551,7 @@ void SaveDumpConfig( FILE *fp, Conf * conf ) { fprintf( fp, "ScriptWait=%s\n", conf_get_str(conf,CONF_script_waitfor) ) ; fprintf( fp, "ScriptHalt=%s\n", conf_get_str(conf,CONF_script_halton) ) ; #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) /* Image Options */ fprintf( fp, "bg_opacity=%d\n", conf_get_int(conf,CONF_bg_opacity) ) ; fprintf( fp, "bg_slideshow=%d\n", conf_get_int(conf,CONF_bg_slideshow) ) ; diff --git a/kitty_settings.c b/kitty_settings.c index 3023e59..fe7e96c 100644 --- a/kitty_settings.c +++ b/kitty_settings.c @@ -344,7 +344,7 @@ void save_open_settings_forced(char *filename, Conf *conf) { write_setting_i_forced(sesskey, "WakeupReconnect", conf_get_int(conf,CONF_wakeup_reconnect) ); write_setting_i_forced(sesskey, "FailureReconnect", conf_get_int(conf,CONF_failure_reconnect) ); #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) if( GetBackgroundImageFlag() ) { write_setting_i_forced(sesskey, "BgOpacity", conf_get_int(conf, CONF_bg_opacity) ); write_setting_i_forced(sesskey, "BgSlideshow", conf_get_int(conf, CONF_bg_slideshow) ); @@ -732,7 +732,7 @@ void load_open_settings_forced(char *filename, Conf *conf) { gppb_forced(sesskey, "TelnetRet", true, conf, CONF_telnet_newline); gppi_forced(sesskey, "LocalEcho", AUTO, conf, CONF_localecho); gppi_forced(sesskey, "LocalEdit", AUTO, conf, CONF_localedit); -#if (defined MOD_PERSO) && (!defined FDJ) +#if (defined MOD_PERSO) && (!defined FLJ) gpps_forced(sesskey, "Answerback", "KiTTY", conf, CONF_answerback); #else gpps_forced(sesskey, "Answerback", "PuTTY", conf, CONF_answerback); @@ -982,7 +982,7 @@ void load_open_settings_forced(char *filename, Conf *conf) { gppi_forced(sesskey, "WakeupReconnect", 0, conf, CONF_wakeup_reconnect ); gppi_forced(sesskey, "FailureReconnect", 0, conf, CONF_failure_reconnect ); #endif -#if (defined MOD_BACKGROUNDIMAGE) && (!defined FDJ) +#if (defined MOD_BACKGROUNDIMAGE) && (!defined FLJ) gppi_forced(sesskey, "BgOpacity", 50, conf, CONF_bg_opacity ); gppi_forced(sesskey, "BgSlideshow", 0, conf, CONF_bg_slideshow ); gppi_forced(sesskey, "BgType", 0, conf, CONF_bg_type );