diff --git a/sakura/preBuild.bat b/sakura/preBuild.bat index fe3eb61359..2750361c8e 100644 --- a/sakura/preBuild.bat +++ b/sakura/preBuild.bat @@ -46,6 +46,12 @@ if "%GIT_ENABLED%" == "1" ( @echo SHORT_COMMITID: %SHORT_COMMITID% @echo COMMITID: %COMMITID% @echo GIT_URL: %GIT_URL% +@echo APPVEYOR_URL : %APPVEYOR_URL% +@echo APPVEYOR_REPO_NAME : %APPVEYOR_REPO_NAME% +@echo APPVEYOR_ACCOUNT_NAME : %APPVEYOR_ACCOUNT_NAME% +@echo APPVEYOR_PROJECT_SLUG : %APPVEYOR_PROJECT_SLUG% +@echo APPVEYOR_BUILD_VERSION: %APPVEYOR_BUILD_VERSION% +@echo APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER% : Output gitrev.h set GITREV_H=..\sakura_core\gitrev.h @@ -67,5 +73,42 @@ if "%GIT_URL%" == "" ( echo #define GIT_URL "%GIT_URL%" >> %GITREV_H% ) +if "%APPVEYOR_URL%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_URL "%APPVEYOR_URL%" >> %GITREV_H% +) + +if "%APPVEYOR_REPO_NAME%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_REPO_NAME "%APPVEYOR_REPO_NAME%" >> %GITREV_H% +) + +if "%APPVEYOR_ACCOUNT_NAME%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_ACCOUNT_NAME "%APPVEYOR_ACCOUNT_NAME%" >> %GITREV_H% +) + +if "%APPVEYOR_PROJECT_SLUG%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_PROJECT_SLUG "%APPVEYOR_PROJECT_SLUG%" >> %GITREV_H% +) + +if "%APPVEYOR_BUILD_VERSION%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_BUILD_VERSION "%APPVEYOR_BUILD_VERSION%" >> %GITREV_H% +) + +if "%APPVEYOR_BUILD_NUMBER%" == "" ( + type nul >> %GITREV_H% +) else ( + echo #define APPVEYOR_BUILD_NUMBER "%APPVEYOR_BUILD_NUMBER%" >> %GITREV_H% + echo #define APPVEYOR_BUILD_NUMBER_INT %APPVEYOR_BUILD_NUMBER% >> %GITREV_H% +) + ENDLOCAL rem exit 0 diff --git a/sakura_core/dlg/CDlgAbout.cpp b/sakura_core/dlg/CDlgAbout.cpp index 3aa0573765..40d572b13a 100644 --- a/sakura_core/dlg/CDlgAbout.cpp +++ b/sakura_core/dlg/CDlgAbout.cpp @@ -98,6 +98,20 @@ const DWORD p_helpids[] = { //12900 #define MY_WIN32_WINNT 0 #endif +#if defined(APPVEYOR_URL) && defined(APPVEYOR_ACCOUNT_NAME) && defined(APPVEYOR_PROJECT_SLUG) && defined(APPVEYOR_BUILD_VERSION) +#define APPVEYOR_BUILD_URL APPVEYOR_URL "/project/" APPVEYOR_ACCOUNT_NAME "/" APPVEYOR_PROJECT_SLUG "/build/" APPVEYOR_BUILD_VERSION +#endif +#if defined(APPVEYOR_BUILD_NUMBER) +#define APPVEYOR_BUILD_TEXT "Build " APPVEYOR_BUILD_NUMBER +#endif + +#if defined(APPVEYOR_BUILD_URL) +#pragma message("APPVEYOR_BUILD_URL: " APPVEYOR_BUILD_URL) +#endif +#if defined(APPVEYOR_BUILD_TEXT) +#pragma message("APPVEYOR_BUILD_TEXT: " APPVEYOR_BUILD_TEXT) +#endif + // From Here Nov. 7, 2000 genta /*! 標準以外のメッセージを捕捉する @@ -260,12 +274,19 @@ BOOL CDlgAbout::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam ) // URLウィンドウをサブクラス化する m_UrlUrWnd.SetSubclassWindow( GetDlgItem( GetHwnd(), IDC_STATIC_URL_UR ) ); m_UrlGitWnd.SetSubclassWindow(GetDlgItem( GetHwnd(), IDC_STATIC_URL_GIT)); + m_UrlBuildLinkWnd.SetSubclassWindow(GetDlgItem(GetHwnd(), IDC_STATIC_URL_APPVEYOR_BUILD)); #ifdef GIT_URL ::SetWindowText(::GetDlgItem(GetHwnd(), IDC_STATIC_URL_GIT), _T(GIT_URL)); #else ShowWindow(::GetDlgItem(GetHwnd(), IDC_STATIC_GIT_CAPTION), SW_HIDE); ShowWindow(::GetDlgItem(GetHwnd(), IDC_STATIC_URL_GIT), SW_HIDE); #endif +#if defined(APPVEYOR_BUILD_TEXT) + ::SetWindowText(::GetDlgItem(GetHwnd(), IDC_STATIC_URL_APPVEYOR_BUILD), _T(APPVEYOR_BUILD_TEXT)); +#else + ShowWindow(::GetDlgItem(GetHwnd(), IDC_STATIC_URL_APPVEYOR_CAPTION), SW_HIDE); + ShowWindow(::GetDlgItem(GetHwnd(), IDC_STATIC_URL_APPVEYOR_BUILD), SW_HIDE); +#endif // Oct. 22, 2005 genta 原作者ホームページが無くなったので削除 //m_UrlOrgWnd.SubclassWindow( GetDlgItem( GetHwnd(), IDC_STATIC_URL_ORG ) ); @@ -304,6 +325,15 @@ BOOL CDlgAbout::OnStnClicked( int wID ) ::ShellExecute( GetHwnd(), NULL, buf, NULL, NULL, SW_SHOWNORMAL ); return TRUE; } + case IDC_STATIC_URL_APPVEYOR_BUILD: + { +#if defined(APPVEYOR_BUILD_URL) + ::ShellExecute(GetHwnd(), NULL, _T(APPVEYOR_BUILD_URL), NULL, NULL, SW_SHOWNORMAL); +#elif defined(GIT_URL) + ::ShellExecute(GetHwnd(), NULL, _T(GIT_URL), NULL, NULL, SW_SHOWNORMAL); +#endif + return TRUE; + } } /* 基底クラスメンバ */ return CDialog::OnStnClicked( wID ); diff --git a/sakura_core/dlg/CDlgAbout.h b/sakura_core/dlg/CDlgAbout.h index 36c1d0d8c7..a493cd7c98 100644 --- a/sakura_core/dlg/CDlgAbout.h +++ b/sakura_core/dlg/CDlgAbout.h @@ -54,6 +54,7 @@ class CDlgAbout : public CDialog private: CUrlWnd m_UrlUrWnd; CUrlWnd m_UrlGitWnd; + CUrlWnd m_UrlBuildLinkWnd; CUrlWnd m_UrlOrgWnd; }; diff --git a/sakura_core/sakura_rc.h b/sakura_core/sakura_rc.h index e9e92b13b2..93e4d7d4c5 100644 --- a/sakura_core/sakura_rc.h +++ b/sakura_core/sakura_rc.h @@ -796,6 +796,8 @@ #define IDC_BUTTON_CLOSE 1726 #define IDC_STATIC_URL_GIT 1727 #define IDC_STATIC_GIT_CAPTION 1728 +#define IDC_STATIC_URL_APPVEYOR_CAPTION 1729 +#define IDC_STATIC_URL_APPVEYOR_BUILD 1730 #define IDS_AUTHOR_PAGE 4054 #define IDS_ABOUT_DESCRIPTION 4056 #define IDD_TYPELIST 5000 @@ -838,7 +840,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 230 #define _APS_NEXT_COMMAND_VALUE 4057 -#define _APS_NEXT_CONTROL_VALUE 1729 +#define _APS_NEXT_CONTROL_VALUE 1731 #define _APS_NEXT_SYMED_VALUE 104 #endif #endif diff --git a/sakura_core/sakura_rc.rc b/sakura_core/sakura_rc.rc index 929f892c1f..508e617875 100644 --- a/sakura_core/sakura_rc.rc +++ b/sakura_core/sakura_rc.rc @@ -104,13 +104,13 @@ BEGIN PUSHBUTTON "wv(&H)",IDC_BUTTON_HELP,221,73,58,14 END -IDD_ABOUT DIALOG DISCARDABLE 0, 0, 245, 203 +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 245, 213 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "o[W" FONT 9, "lr oSVbN" BEGIN - DEFPUSHBUTTON "&OK",IDOK,97,178,50,14 - PUSHBUTTON "Rs[(&C)",IDC_BUTTON_COPY,178,178,60,14 + DEFPUSHBUTTON "&OK",IDOK,97,188,50,14 + PUSHBUTTON "Rs[(&C)",IDC_BUTTON_COPY,178,188,60,14 ICON IDI_ICON_STD,IDC_STATIC_MYICON,5,5,20,20,SS_NOTIFY EDITTEXT IDC_EDIT_VER,33,6,204,51,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP @@ -126,7 +126,11 @@ BEGIN LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_GIT,101,98,120,8,SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP - EDITTEXT IDC_EDIT_ABOUT,5,111,233,63,ES_MULTILINE | ES_READONLY | + LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION,33,108,71,8,NOT WS_GROUP + LTEXT "Build No.", + IDC_STATIC_URL_APPVEYOR_BUILD, 101, 108,120,8,SS_NOTIFY | NOT WS_GROUP | + WS_TABSTOP + EDITTEXT IDC_EDIT_ABOUT,5,121,233,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP END diff --git a/sakura_lang_en_US/sakura_lang_rc.rc b/sakura_lang_en_US/sakura_lang_rc.rc index b37a7c9ec3..e0fa7702a0 100644 --- a/sakura_lang_en_US/sakura_lang_rc.rc +++ b/sakura_lang_en_US/sakura_lang_rc.rc @@ -106,13 +106,13 @@ BEGIN PUSHBUTTON "&Help",IDC_BUTTON_HELP,221,73,58,14 END -IDD_ABOUT DIALOG DISCARDABLE 0, 0, 245, 203 +IDD_ABOUT DIALOG DISCARDABLE 0, 0, 245, 213 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Version Information" FONT 9, "Tahoma" BEGIN - DEFPUSHBUTTON "&OK",IDOK,97,178,50,14 - PUSHBUTTON "&Copy to Clipboard",IDC_BUTTON_COPY,178,178,60,14 + DEFPUSHBUTTON "&OK",IDOK,97,188,50,14 + PUSHBUTTON "&Copy to Clipboard",IDC_BUTTON_COPY,178,188,60,14 ICON IDI_ICON_STD,IDC_STATIC_MYICON,5,5,20,20,SS_NOTIFY EDITTEXT IDC_EDIT_VER,33,6,204,51,ES_MULTILINE | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP @@ -128,7 +128,11 @@ BEGIN LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_GIT,101,98,120,8,SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP - EDITTEXT IDC_EDIT_ABOUT,5,111,233,63,ES_MULTILINE | ES_READONLY | + LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION,33,108,71,8,NOT WS_GROUP + LTEXT "Build No.", + IDC_STATIC_URL_APPVEYOR_BUILD, 101, 108,120,8,SS_NOTIFY | NOT WS_GROUP | + WS_TABSTOP + EDITTEXT IDC_EDIT_ABOUT,5,121,233,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP END