Skip to content

Commit

Permalink
Merge pull request #569 from berryzplus/refactoring/straight_dlg_about
Browse files Browse the repository at this point in the history
バージョン情報ダイアログの整理
  • Loading branch information
berryzplus authored Oct 21, 2018
2 parents 25ce975 + f753d55 commit 87c4215
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 69 deletions.
42 changes: 22 additions & 20 deletions appveyor.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,28 @@

#### githash.h で生成するマクロ

生成するマクロ名 | 元にする環境変数 | 型 |
----|----|----
| GIT_COMMIT_HASH | COMMITID |文字列 |
| SHORT_COMMITID | SHORT_COMMITID |文字列 |
| GIT_URL | GIT_URL |文字列 |
| APPVEYOR_URL | APPVEYOR_URL |文字列 |
| APPVEYOR_REPO_NAME | APPVEYOR_REPO_NAME |文字列 |
| APPVEYOR_REPO_TAG_NAME | APPVEYOR_REPO_TAG_NAME |文字列 |
| APPVEYOR_ACCOUNT_NAME | APPVEYOR_ACCOUNT_NAME |文字列 |
| APPVEYOR_PROJECT_SLUG | APPVEYOR_PROJECT_SLUG |文字列 |
| APPVEYOR_BUILD_VERSION | APPVEYOR_BUILD_VERSION |文字列 |
| APPVEYOR_BUILD_NUMBER | APPVEYOR_BUILD_NUMBER |文字列 |
| APPVEYOR_BUILD_NUMBER_INT | APPVEYOR_BUILD_NUMBER |数値 |
| APPVEYOR_PULL_REQUEST_NUMBER |APPVEYOR_PULL_REQUEST_NUMBER |文字列 |
| APPVEYOR_PULL_REQUEST_NUMBER_INT |APPVEYOR_PULL_REQUEST_NUMBER |数値 |
| GITHUB_COMMIT_URL |GITHUB_COMMIT_URL |文字列 |
| GITHUB_COMMIT_URL_PR_HEAD |GITHUB_COMMIT_URL_PR_HEAD |文字列 |
| APPVEYOR_SHORTHASH |APPVEYOR_SHORTHASH |文字列 |
| APPVEYOR_SHORTHASH_PR_HEAD |APPVEYOR_SHORTHASH_PR_HEAD |文字列 |
| APPVEYOR_BUILD_URL |APPVEYOR_BUILD_URL |文字列 |
| 生成するマクロ名 | 元にする環境変数 ||
| ---- | ---- | ---- |
| GIT_COMMIT_HASH | COMMITID | 文字列 |
| SHORT_COMMITID | SHORT_COMMITID | 文字列 |
| GIT_URL | GIT_URL | 文字列 |
| APPVEYOR_URL | APPVEYOR_URL | 文字列 |
| APPVEYOR_REPO_NAME | APPVEYOR_REPO_NAME | 文字列 |
| APPVEYOR_REPO_TAG_NAME | APPVEYOR_REPO_TAG_NAME | 文字列 |
| APPVEYOR_ACCOUNT_NAME | APPVEYOR_ACCOUNT_NAME | 文字列 |
| APPVEYOR_PROJECT_SLUG | APPVEYOR_PROJECT_SLUG | 文字列 |
| APPVEYOR_BUILD_VERSION | APPVEYOR_BUILD_VERSION | 文字列 |
| APPVEYOR_BUILD_NUMBER | APPVEYOR_BUILD_NUMBER | 文字列 |
| APPVEYOR_BUILD_NUMBER_INT | APPVEYOR_BUILD_NUMBER | 数値 |
| APPVEYOR_BUILD_NUMBER_LABEL | APPVEYOR_BUILD_NUMBER | 数値 |
| APPVEYOR_PULL_REQUEST_NUMBER | APPVEYOR_PULL_REQUEST_NUMBER | 文字列 |
| APPVEYOR_PULL_REQUEST_NUMBER_INT| APPVEYOR_PULL_REQUEST_NUMBER | 数値 |
| APPVEYOR_PR_NUMBER_LABEL | APPVEYOR_PULL_REQUEST_NUMBER | 文字列 |
| GITHUB_COMMIT_URL | GITHUB_COMMIT_URL | 文字列 |
| GITHUB_COMMIT_URL_PR_HEAD | GITHUB_COMMIT_URL_PR_HEAD | 文字列 |
| APPVEYOR_SHORTHASH | APPVEYOR_SHORTHASH | 文字列 |
| APPVEYOR_SHORTHASH_PR_HEAD | APPVEYOR_SHORTHASH_PR_HEAD | 文字列 |
| APPVEYOR_BUILD_URL | APPVEYOR_BUILD_URL | 文字列 |


### postBuild.bat の構造
Expand Down
4 changes: 4 additions & 0 deletions sakura/githash.bat
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,21 @@ if "%APPVEYOR_BUILD_VERSION%" == "" (
if "%APPVEYOR_BUILD_NUMBER%" == "" (
echo // APPVEYOR_BUILD_NUMBER is not defined
echo // APPVEYOR_BUILD_NUMBER_INT is not defined
echo // APPVEYOR_BUILD_NUMBER_LABEL is not defined
) else (
echo #define APPVEYOR_BUILD_NUMBER "%APPVEYOR_BUILD_NUMBER%"
echo #define APPVEYOR_BUILD_NUMBER_INT %APPVEYOR_BUILD_NUMBER%
echo #define APPVEYOR_BUILD_NUMBER_LABEL "Build %APPVEYOR_BUILD_NUMBER%"
)

if "%APPVEYOR_PULL_REQUEST_NUMBER%" == "" (
echo // APPVEYOR_PULL_REQUEST_NUMBER is not defined
echo // APPVEYOR_PULL_REQUEST_NUMBER_INT is not defined
echo // APPVEYOR_PR_NUMBER_LABEL is not defined
) else (
echo #define APPVEYOR_PULL_REQUEST_NUMBER "%APPVEYOR_PULL_REQUEST_NUMBER%"
echo #define APPVEYOR_PULL_REQUEST_NUMBER_INT %APPVEYOR_PULL_REQUEST_NUMBER%
echo #define APPVEYOR_PR_NUMBER_LABEL "PR %APPVEYOR_PULL_REQUEST_NUMBER%"
)

if "%GITHUB_COMMIT_URL%" == "" (
Expand Down
50 changes: 9 additions & 41 deletions sakura_core/dlg/CDlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,11 @@ const DWORD p_helpids[] = { //12900
#define MY_WIN32_WINNT 0
#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)
#if defined(APPVEYOR_BUILD_NUMBER_LABEL)
#pragma message("APPVEYOR_BUILD_NUMBER_LABEL: " APPVEYOR_BUILD_NUMBER_LABEL)
#endif

// From Here Nov. 7, 2000 genta
Expand Down Expand Up @@ -263,45 +259,17 @@ BOOL CDlgAbout::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )

// URLウィンドウをサブクラス化する
m_UrlUrWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_UR ) );
m_UrlGitWnd.SetSubclassWindow(GetItemHwnd( IDC_STATIC_URL_GIT));
m_UrlBuildLinkWnd.SetSubclassWindow(GetItemHwnd(IDC_STATIC_URL_APPVEYOR_BUILD));
#if defined(GITHUB_COMMIT_URL) && defined(APPVEYOR_SHORTHASH)
m_UrlGitHubCommitWnd.SetSubclassWindow(GetItemHwnd(IDC_STATIC_URL_GITHUB_COMMIT));
#endif
#if defined(GITHUB_COMMIT_URL_PR_HEAD) && defined(APPVEYOR_PULL_REQUEST_NUMBER)
m_UrlGitHubPRWnd.SetSubclassWindow(GetItemHwnd(IDC_STATIC_URL_GITHUB_PR));
#endif

#ifdef GIT_URL
::SetWindowText(GetItemHwnd(IDC_STATIC_URL_GIT), _T(GIT_URL));
#else
ShowWindow(GetItemHwnd(IDC_STATIC_GIT_CAPTION), SW_HIDE);
ShowWindow(GetItemHwnd(IDC_STATIC_URL_GIT), SW_HIDE);
m_UrlGitWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_GIT ) );
#endif
#if defined(APPVEYOR_BUILD_TEXT)
::SetWindowText(GetItemHwnd(IDC_STATIC_URL_APPVEYOR_BUILD), _T(APPVEYOR_BUILD_TEXT));
#else
ShowWindow(GetItemHwnd(IDC_STATIC_URL_APPVEYOR_CAPTION), SW_HIDE);
ShowWindow(GetItemHwnd(IDC_STATIC_URL_APPVEYOR_BUILD), SW_HIDE);
#ifdef APPVEYOR_BUILD_NUMBER_LABEL
m_UrlBuildLinkWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_APPVEYOR_BUILD ) );
#endif

// GitHub の Commit のリンク
#if defined(GITHUB_COMMIT_URL) && defined(APPVEYOR_SHORTHASH)
::SetWindowText(GetItemHwnd(IDC_STATIC_URL_GITHUB_COMMIT), _T(APPVEYOR_SHORTHASH));
#else
ShowWindow(GetItemHwnd(IDC_STATIC_URL_GITHUB_COMMIT), SW_HIDE);
#endif

// GitHub の PR のリンク
#if defined(GITHUB_COMMIT_URL_PR_HEAD) && defined(APPVEYOR_PULL_REQUEST_NUMBER)
::SetWindowText(GetItemHwnd(IDC_STATIC_URL_GITHUB_PR), _T("PR ") _T(APPVEYOR_PULL_REQUEST_NUMBER));
#else
ShowWindow(GetItemHwnd(IDC_STATIC_URL_GITHUB_PR), SW_HIDE);
#ifdef APPVEYOR_SHORTHASH
m_UrlGitHubCommitWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_GITHUB_COMMIT ) );
#endif

// GitHub のリンクのテキスト
#if !defined(GITHUB_COMMIT_URL) && !defined(GITHUB_COMMIT_URL_PR_HEAD)
ShowWindow(GetItemHwnd(IDC_STATIC_URL_GITHUB_CAPTION), SW_HIDE);
#ifdef APPVEYOR_PR_NUMBER_LABEL
m_UrlGitHubPRWnd.SetSubclassWindow( GetItemHwnd( IDC_STATIC_URL_GITHUB_PR ) );
#endif

// Oct. 22, 2005 genta 原作者ホームページが無くなったので削除
Expand Down
18 changes: 14 additions & 4 deletions sakura_core/sakura_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,23 @@ BEGIN
LTEXT S_COPYRIGHT, IDC_STATIC, 33, 75, 205, 8, NOT WS_GROUP | SS_NOPREFIX
LTEXT "Project Sakura-Editor:", IDC_STATIC_URL_CAPTION, 33, 103, 71, 8, NOT WS_GROUP
LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_UR, 101, 103, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#ifdef GIT_URL
LTEXT "Source URL:", IDC_STATIC_GIT_CAPTION, 33, 113, 71, 8, NOT WS_GROUP
LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_GIT, 101, 113, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT GIT_URL, IDC_STATIC_URL_GIT, 101, 113, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_BUILD_NUMBER_LABEL
LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION, 33, 123, 71, 8, NOT WS_GROUP
LTEXT "Build No.", IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT APPVEYOR_BUILD_NUMBER_LABEL, IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PR_NUMBER_LABEL )
LTEXT "GitHub URL:", IDC_STATIC_URL_GITHUB_CAPTION, 33, 133, 50, 8, NOT WS_GROUP
LTEXT "Commit", IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT "PR.", IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_SHORTHASH
LTEXT APPVEYOR_SHORTHASH, IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_PR_NUMBER_LABEL
LTEXT APPVEYOR_PR_NUMBER_LABEL, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
EDITTEXT IDC_EDIT_ABOUT, 5, 146, 233, 53, ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
DEFPUSHBUTTON "&OK", IDOK, 97, 203, 50, 14
PUSHBUTTON "情報をコピー(&C)", IDC_BUTTON_COPY, 178, 203, 60, 14
Expand Down
18 changes: 14 additions & 4 deletions sakura_lang_en_US/sakura_lang_rc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,23 @@ BEGIN
LTEXT S_COPYRIGHT_TRANSLATION,IDC_STATIC,74,90,164,8,SS_NOPREFIX | NOT WS_GROUP
LTEXT "Project Sakura-Editor:", IDC_STATIC_URL_CAPTION, 33, 103, 71, 8, NOT WS_GROUP
LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_UR, 101, 103, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#ifdef GIT_URL
LTEXT "Source URL:", IDC_STATIC_GIT_CAPTION, 33, 113, 71, 8, NOT WS_GROUP
LTEXT "https://sakura-editor.github.io/", IDC_STATIC_URL_GIT, 101, 113, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT GIT_URL, IDC_STATIC_URL_GIT, 101, 113, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_BUILD_NUMBER_LABEL
LTEXT "Build URL:", IDC_STATIC_URL_APPVEYOR_CAPTION, 33, 123, 71, 8, NOT WS_GROUP
LTEXT "Build No.", IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT APPVEYOR_BUILD_NUMBER_LABEL, IDC_STATIC_URL_APPVEYOR_BUILD, 101, 123, 120, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#if defined( APPVEYOR_SHORTHASH ) || defined( APPVEYOR_PR_NUMBER_LABEL )
LTEXT "GitHub URL:", IDC_STATIC_URL_GITHUB_CAPTION, 33, 133, 50, 8, NOT WS_GROUP
LTEXT "Commit", IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
LTEXT "PR.", IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_SHORTHASH
LTEXT APPVEYOR_SHORTHASH, IDC_STATIC_URL_GITHUB_COMMIT, 101, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
#ifdef APPVEYOR_PR_NUMBER_LABEL
LTEXT APPVEYOR_PR_NUMBER_LABEL, IDC_STATIC_URL_GITHUB_PR, 150, 133, 30, 8, SS_NOTIFY | NOT WS_GROUP | WS_TABSTOP
#endif
EDITTEXT IDC_EDIT_ABOUT, 5, 146, 233, 53, ES_MULTILINE | ES_READONLY | WS_VSCROLL | NOT WS_TABSTOP
DEFPUSHBUTTON "&OK", IDOK, 97, 203, 50, 14
PUSHBUTTON "&Copy to Clipboard", IDC_BUTTON_COPY, 178, 203, 60, 14
Expand Down

0 comments on commit 87c4215

Please sign in to comment.