[Ttssh2-commit] [5261] SSH接続時のアイコンを指定出来るようにした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2013年 5月 13日 (月) 14:37:00 JST


Revision: 5261
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5261
Author:   doda
Date:     2013-05-13 14:37:00 +0900 (Mon, 13 May 2013)
Log Message:
-----------
SSH接続時のアイコンを指定出来るようにした。

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/ttxssh.c
    trunk/ttssh2/ttxssh/ttxssh.h

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2013-05-13 05:33:49 UTC (rev 5260)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2013-05-13 05:37:00 UTC (rev 5261)
@@ -457,6 +457,17 @@
 	// \x83z\x83X\x83g\x8C\xAE\x82\xCC DNS \x82ł̃`\x83F\x83b\x83N (RFC 4255)
 	settings->VerifyHostKeyDNS = read_BOOL_option(fileName, "VerifyHostKeyDNS", TRUE);
 
+	// icon
+	GetPrivateProfileString("TTSSH", "SSHIcon", "", buf, sizeof(buf), fileName);
+	if ((_stricmp(buf, "old") == 0) ||
+	    (_stricmp(buf, "yellow") == 0) ||
+	    (_stricmp(buf, "securett_yellow") == 0)) {
+		settings->IconID = IDI_SECURETT_YELLOW;
+	}
+	else {
+		settings->IconID = IDI_SECURETT;
+	}
+
 	clear_local_settings(pvar);
 }
 
@@ -764,11 +775,11 @@
 	// LoadIcon \x82ł͂Ȃ\xAD LoadImage \x82\xF0\x8Eg\x82\xA4\x82悤\x82ɂ\xB5\x81A
 	// 16x16 \x82̃A\x83C\x83R\x83\x93\x82𖾎\xA6\x93I\x82Ɏ擾\x82\xB7\x82\xE9\x82悤\x82ɂ\xB5\x82\xBD (2006.8.9 maya)
 	if (SecureLargeIcon == NULL) {
-		SecureLargeIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_SECURETT),
+		SecureLargeIcon = LoadImage(hInst, MAKEINTRESOURCE(pvar->settings.IconID),
 		                            IMAGE_ICON, 0, 0, fuLoad);
 	}
 	if (SecureSmallIcon == NULL) {
-		SecureSmallIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_SECURETT),
+		SecureSmallIcon = LoadImage(hInst, MAKEINTRESOURCE(pvar->settings.IconID),
 		                            IMAGE_ICON, 16, 16, fuLoad);
 	}
 
@@ -1671,6 +1682,15 @@
 				pvar->settings.CompressionLevel = 6;
 			} else if (MATCH_STR(option + 4, "-c") == 0) {
 				pvar->settings.CompressionLevel = 0;
+			} else if (MATCH_STR_I(option + 4, "-icon=") == 0) {
+				if ((_stricmp(option+10, "old") == 0) ||
+				    (_stricmp(option+10, "yellow") == 0) ||
+				    (_stricmp(option+10, "securett_yellow") == 0)) {
+					pvar->settings.IconID = IDI_SECURETT_YELLOW;
+				}
+				else {
+					pvar->settings.IconID = IDI_SECURETT;
+				}
 
 			// /ssh1 \x82\xC6 /ssh2 \x83I\x83v\x83V\x83\x87\x83\x93\x82̐V\x8BK\x92lj\xC1 (2006.9.16 maya)
 			} else if (MATCH_STR(option + 4, "1") == 0) {
@@ -2466,7 +2486,7 @@
 				fuLoad = LR_VGACOLOR;
 			}
 
-			hicon = LoadImage(hInst, MAKEINTRESOURCE(IDI_SECURETT),
+			hicon = LoadImage(hInst, MAKEINTRESOURCE(pvar->settings.IconID),
 			                  IMAGE_ICON, 32, 32, fuLoad);
 			SendDlgItemMessage(dlg, IDC_TTSSH_ICON, STM_SETICON, (WPARAM)hicon, 0);
 		}

Modified: trunk/ttssh2/ttxssh/ttxssh.h
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.h	2013-05-13 05:33:49 UTC (rev 5260)
+++ trunk/ttssh2/ttxssh/ttxssh.h	2013-05-13 05:37:00 UTC (rev 5261)
@@ -147,6 +147,8 @@
 	char CompOrder[COMP_MAX+1];
 
 	BOOL VerifyHostKeyDNS;
+
+	int IconID;
 } TS_SSH;
 
 typedef struct _TInstVar {



Ttssh2-commit メーリングリストの案内
Back to archive index