Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GREPの「カレントフォルダーが初期値」に対応 #1852

Merged
merged 4 commits into from
Jun 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 7 additions & 9 deletions sakura_core/dlg/CDlgGrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@ BOOL CDlgGrep::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )
{
_SetHwnd( hwndDlg );

/* カレントフォルダーが初期値 */
if((m_szFolder[0] == L'\0' || m_pShareData->m_Common.m_sSearch.m_bGrepDefaultFolder) &&
m_szCurrentFilePath[0] != L'\0'
){
SplitPath_FolderAndFile( m_szCurrentFilePath, m_szFolder, nullptr );
}

/* ユーザーがコンボボックスのエディット コントロールに入力できるテキストの長さを制限する */
// Combo_LimitText( GetItemHwnd( IDC_COMBO_TEXT ), _MAX_PATH - 1 );
Combo_LimitText( GetItemHwnd( IDC_COMBO_FILE ), _countof2(m_szFile) - 1 );
Expand Down Expand Up @@ -599,15 +606,6 @@ void CDlgGrep::SetData( void )
/* 除外フォルダー */
::DlgItem_SetText( GetHwnd(), IDC_COMBO_EXCLUDE_FOLDER, m_szExcludeFolder);

if((m_szFolder[0] == L'\0' || m_pShareData->m_Common.m_sSearch.m_bGrepDefaultFolder) &&
m_szCurrentFilePath[0] != L'\0'
){
WCHAR szWorkFolder[MAX_PATH];
WCHAR szWorkFile[MAX_PATH];
SplitPath_FolderAndFile( m_szCurrentFilePath, szWorkFolder, szWorkFile );
SetGrepFolder( GetItemHwnd(IDC_COMBO_FOLDER), szWorkFolder );
sanomari marked this conversation as resolved.
Show resolved Hide resolved
berryzplus marked this conversation as resolved.
Show resolved Hide resolved
}

/* サブフォルダーからも検索する */
::CheckDlgButton( GetHwnd(), IDC_CHK_SUBFOLDER, m_bSubFolder );

Expand Down