Skip to content

Commit

Permalink
Merge pull request sakura-editor#177 from m-tmatma/feature/add-appvey…
Browse files Browse the repository at this point in the history
…or-build-link

appveyor のビルドリンクをバージョン情報に追加
  • Loading branch information
kobake authored Jun 27, 2018
2 parents 57085b5 + d957606 commit e7346a1
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 9 deletions.
43 changes: 43 additions & 0 deletions sakura/preBuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
30 changes: 30 additions & 0 deletions sakura_core/dlg/CDlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*!
標準以外のメッセージを捕捉する
Expand Down Expand Up @@ -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 ) );
Expand Down Expand Up @@ -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 );
Expand Down
1 change: 1 addition & 0 deletions sakura_core/dlg/CDlgAbout.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class CDlgAbout : public CDialog
private:
CUrlWnd m_UrlUrWnd;
CUrlWnd m_UrlGitWnd;
CUrlWnd m_UrlBuildLinkWnd;
CUrlWnd m_UrlOrgWnd;
};

Expand Down
4 changes: 3 additions & 1 deletion sakura_core/sakura_rc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
12 changes: 8 additions & 4 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ BEGIN
PUSHBUTTON "�w���v(&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, "�l�r �o�S�V�b�N"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,97,178,50,14
PUSHBUTTON "�����R�s�[(&C)",IDC_BUTTON_COPY,178,178,60,14
DEFPUSHBUTTON "&OK",IDOK,97,188,50,14
PUSHBUTTON "�����R�s�[(&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
Expand All @@ -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

Expand Down
12 changes: 8 additions & 4 deletions sakura_lang_en_US/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit e7346a1

Please sign in to comment.