Skip to content

Commit

Permalink
Merge tag 'v0.76.1.7' into cnKiTTY
Browse files Browse the repository at this point in the history
# Conflicts:
#	0.76b_My_PuTTY/windows/window.c
#	kitty.c
  • Loading branch information
dZ8Lx9OwX authored and dZ8Lx9OwX committed May 4, 2023
2 parents f953d70 + cb54bec commit 176496b
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 44 deletions.
2 changes: 1 addition & 1 deletion 0.76b_My_PuTTY/version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define RELEASE 0.76
#define TEXTVER "Release 0.76"
#define SSHVER "-Release-0.76"
#define BINARY_VERSION 0,76,1,6
#define BINARY_VERSION 0,76,1,7
#define SOURCE_COMMIT "unavailable"
3 changes: 1 addition & 2 deletions 0.76b_My_PuTTY/windows/MAKEFILE.MINGW
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ CFLAGS += \
-DMOD_ZMODEM \
-DMOD_PROXY \
-DMOD_FAR2L \
-I.././ -I../../ \
-I.././ -I../../ \
-I../charset/ -I../windows/ -I../unix/ -I../mac/ \
-I../macosx \
-I../../base64 \
Expand All @@ -174,7 +174,6 @@ CFLAGS += \

# -DMOD_TUTTYCOLOR


# Autre flag a gérer
# Ajouter -DMOD_NOPASSWORD \ pour compiler une version sans possibilité de sauvegarder le mot de passe
# Ajouter -DMOD_NOTRANSPARENCY \ pour compiler une version desactivant la transparence
Expand Down
2 changes: 1 addition & 1 deletion 0.76b_My_PuTTY/windows/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ static INT_PTR CALLBACK AboutProc(HWND hwnd, UINT msg,
sprintf( buffer, "KiTTY - %s", BuildVersionTime ) ;
SetDlgItemText(hwnd,IDA_VERSION,buffer);

str = dupprintf("关于%s_v0.76.1.6.1 - 这是一个KiTTY中文版本!", appname);
str = dupprintf("关于%s_v0.76.1.7.1 - 这是一个KiTTY中文版本!", appname);
SetWindowText(hwnd, str);
sfree(str);

Expand Down
2 changes: 1 addition & 1 deletion 0.76b_My_PuTTY/windows/version.rc2
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ BEGIN
BEGIN
#ifdef MOD_PERSO
VALUE "CompanyName", "9bis.com" /* required :/ */
VALUE "ProductName", "cnKiTTY_v0.76.1.6.1"
VALUE "ProductName", "cnKiTTY_v0.76.1.7.1"
VALUE "FileDescription", APPDESC
VALUE "InternalName", APPNAME
VALUE "OriginalFilename", "KiTTY"
Expand Down
2 changes: 1 addition & 1 deletion 0.76b_My_PuTTY/windows/version_minor.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6
7
26 changes: 13 additions & 13 deletions 0.76b_My_PuTTY/windows/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -4555,8 +4555,8 @@ free(cmd);
else return DefWindowProc(hwnd, message, wParam, lParam);
break;

case WM_COPYDATA: { // Reception d'un de donnees dans un message
#ifdef MOD_RUTTY
case WM_COPYDATA: { // Receive data in message
#ifdef MOD_RUTTY1
COPYDATASTRUCT *cds;
cds = (COPYDATASTRUCT *) lParam;
if (cds->dwData == ruttyAHK_send)
Expand All @@ -4578,15 +4578,15 @@ free(cmd);
return 0; /* not our message */
}
#else
PCOPYDATASTRUCT pMyCDS = (PCOPYDATASTRUCT) lParam;
switch( pMyCDS->dwData ) {
case 1: // Reception d'une chaine de caracteres a envoyer dans le terminal
if( pMyCDS->cbData > 0 ) {
SendKeyboardPlus( hwnd, (char*)pMyCDS->lpData ) ;
}
break ;
}
PCOPYDATASTRUCT pMyCDS = (PCOPYDATASTRUCT) lParam;
switch( pMyCDS->dwData ) {
case 1: // Reception of data string to send in terminal
if( pMyCDS->cbData > 0 ) {
SendKeyboardPlus( hwnd, (char*)pMyCDS->lpData ) ;
}
break ;
}
}
#endif
break ;

Expand Down Expand Up @@ -7813,13 +7813,13 @@ static void wintw_set_title(TermWin *tw, const char *title_in) {
if( title_in==NULL ) { return ; }

title = (char*)malloc( strlen(title_in)+1 ) ; strcpy( title, title_in ) ;

if( (title[0]=='_')&&(title[1]=='_') ) { // Mode commande a distance
if( (title[0]=='_')&&(title[1]=='_') ) { // Remote command
if( ManageLocalCmd( MainHwnd, title+2 ) ) { free( title ) ; return ; }
}

if( !GetTitleBarFlag() ) { set_title_internal( tw, title ) ; free( title ) ; return ; }

if( strstr( title, " (PROTECTED)")==( title+strlen(title)-12 ) ) {
title[strlen(title)-12]='\0' ;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.76.1.6
0.76.1.7
62 changes: 38 additions & 24 deletions kitty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,28 +1767,31 @@ void SendAutoCommand( HWND hwnd, const char * cmd ) {
}
}

// Command sender (envoi d'une meme commande a toutes les fenetres)
// Command sender (send a command to all windows)
BOOL CALLBACK SendCommandProc( HWND hwnd, LPARAM lParam ) {
char buffer[256] ;
GetClassName( hwnd, buffer, 256 ) ;
if( !strcmp( buffer, KiTTYClassName ) )
if( hwnd != MainHwnd ) {
COPYDATASTRUCT data;
data.dwData = 1 ;
data.cbData = strlen( (char*)lParam ) + 1 ;
data.lpData = (char*)lParam ;
SendMessage( hwnd, WM_COPYDATA, (WPARAM)(HWND)MainHwnd, (LPARAM) (LPVOID)&data ) ;
NbWindows++ ;
if( !strcmp( buffer, KiTTYClassName ) ) {
if( hwnd != MainHwnd ) {
COPYDATASTRUCT data;
data.dwData = 1 ;
data.cbData = strlen( (char*)lParam ) + 1 ;
data.lpData = (char*)lParam ;
SendMessage( hwnd, WM_COPYDATA, (WPARAM)(HWND)MainHwnd, (LPARAM) (LPVOID)&data ) ;
NbWindows++ ;
}
return TRUE ;
}
return TRUE ;
}

int SendCommandAllWindows( HWND hwnd, char * cmd ) {
NbWindows=0 ;
if( cmd==NULL ) return 0 ;
if( strlen(cmd) > 0 ) EnumWindows( SendCommandProc, (LPARAM)cmd ) ;
return NbWindows ;
if( strlen(cmd) > 0 ) {
EnumWindows( SendCommandProc, (LPARAM)cmd ) ;
}
return NbWindows ;
}

// Gestion de la taille des fenetres de la meme classe
BOOL CALLBACK ResizeWinListProc( HWND hwnd, LPARAM lParam ) {
Expand All @@ -1808,10 +1811,10 @@ BOOL CALLBACK ResizeWinListProc( HWND hwnd, LPARAM lParam ) {
//SetWindowPos( hwnd, 0, 0, 0, rc->right-rc->left+1, rc->bottom-rc->top+1, SWP_NOZORDER|SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOACTIVATE ) ;
//SetWindowPos( hwnd, 0, 0, 0, 50,50, SWP_NOZORDER|SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOACTIVATE);
NbWindows++ ;
}
}

return TRUE ;
}
}

int ResizeWinList( HWND hwnd, int width, int height ) {
NbWindows=0 ;
Expand All @@ -1822,7 +1825,7 @@ int ResizeWinList( HWND hwnd, int width, int height ) {
EnumWindows( ResizeWinListProc, (LPARAM)&rc ) ;
SetForegroundWindow( hwnd ) ;
return NbWindows ;
}
}

void set_title( TermWin *tw, const char *title ) { return win_set_title(tw,title) ; } // Disparue avec la version 0.71
void ManageProtect( HWND hwnd, TermWin *tw, char * title ) {
Expand Down Expand Up @@ -2566,7 +2569,9 @@ ds() { printf "\033]0;__ds:`pwd`\007" ; }
# Duplique une session sur le meme user, meme host, meme repertoire
dt() { printf "\033]0;__dt:"$(hostname)":"${USER}":"`pwd`"\007" ; }
*/
static int LocalCmdFlag = 1 ;
int ManageLocalCmd( HWND hwnd, const char * cmd ) {
//if( !LocalCmdFlag ) { return 0; }
char buffer[1024] = "", title[1024] = "" ;
if( debug_flag ) { debug_logevent( "Local command: %s", cmd ) ; }
if( cmd == NULL ) return 0 ;
Expand Down Expand Up @@ -3433,26 +3438,31 @@ BOOL CALLBACK EnumWindowsProc( HWND hwnd, LPARAM lParam ) {
char buffer[256] ;
GetClassName( hwnd, buffer, 256 ) ;

if( (!strcmp( buffer, appname )) || (!strcmp( buffer, "PuTTYConfigBox" )) ) NbWindows++ ;
if( (!strcmp( buffer, appname )) || (!strcmp( buffer, "PuTTYConfigBox" )) ) {
NbWindows++ ;
}

return TRUE ;
}
}

// Decompte le nombre de fenetre de la meme classe que KiTTY
int WindowsCount( HWND hwnd ) {
char buffer[256] ;
NbWindows = 0 ;

if( GetClassName( hwnd, buffer, 256 ) == 0 ) NbWindows = 1 ;
else {
if( !strcmp( buffer, "" ) ) NbWindows = 1 ;
if( GetClassName( hwnd, buffer, 256 ) == 0 ) {
NbWindows = 1 ;
} else {
if( !strcmp( buffer, "" ) ) {
NbWindows = 1 ;
}
}

EnumWindows( EnumWindowsProc, 0 ) ;
return NbWindows ;
}

}


// Gestion de la fenetre d'affichage des portforward
// Mettre la liste des port forward dans le presse-papier et l'afficher a l'ecran
// [C] en Listen dans le process courant, [X] en listen dans un autre process, [-] absent
Expand Down Expand Up @@ -5296,8 +5306,12 @@ void LoadParameters( void ) {
if( ReadParameter( INIT_SECTION, "KiPP", buffer ) != 0 ) {
if( decryptstring( GetCryptSaltFlag(), buffer, MASTER_PASSWORD ) ) ManagePassPhrase( buffer ) ;
}
if( ReadParameter( INIT_SECTION, "localcmd", buffer ) ) {
if( !stricmp( buffer, "NO" ) ) LocalCmdFlag = 0 ;
if( !stricmp( buffer, "YES" ) ) LocalCmdFlag = 1 ;
}
if( ReadParameter( INIT_SECTION, "maxblinkingtime", buffer ) ) { MaxBlinkingTime=2*atoi(buffer);if(MaxBlinkingTime<0) MaxBlinkingTime=0; }
if( ReadParameter( INIT_SECTION, "mouseshortcuts", buffer ) ) {
if( ReadParameter( INIT_SECTION, "mouseshortcuts", buffer ) ) {
if( !stricmp( buffer, "NO" ) ) MouseShortcutsFlag = 0 ;
if( !stricmp( buffer, "YES" ) ) MouseShortcutsFlag = 1 ;
}
Expand Down Expand Up @@ -5338,7 +5352,7 @@ void LoadParameters( void ) {
WinSCPPath = (char*) malloc( strlen(buffer) + 1 ) ; strcpy( WinSCPPath, buffer ) ;
}
}
if( ReadParameter( INIT_SECTION, "wintitle", buffer ) ) { if( !stricmp( buffer, "NO" ) ) TitleBarFlag = 0 ; }
if( ReadParameter( INIT_SECTION, "wintitle", buffer ) ) { if( !stricmp( buffer, "NO" ) ) TitleBarFlag = 0 ; }
#ifdef MOD_PROXY
if( ReadParameter( "ConfigBox", "proxyselection", buffer ) ) {
if( !stricmp( buffer, "YES" ) ) { SetProxySelectionFlag(1) ; }
Expand Down
3 changes: 3 additions & 0 deletions kitty_ini.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ icon=yes
; KiClassName: change the internal software name to be the same as PuTTY
;KiClassName=PuTTY

; localcmd: manage local commands (starting with __)
;localcmd=yes

; maxblinkingtime: maximum blinks (in system tray) where receiving bell signal
maxblinkingtime=5

Expand Down

0 comments on commit 176496b

Please sign in to comment.