Skip to content

Commit

Permalink
Merge branch 'setupdlg' into pb
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Feb 22, 2024
2 parents dd26f31 + 92cb560 commit 7ab0f98
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Checkout last commit
uses: actions/checkout@v3
with:
submodules: true
submodules: recursive

- name: Configure build environment
run: |
Expand Down
26 changes: 26 additions & 0 deletions WeaselSetup/InstallOptionsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ LRESULT InstallOptionsDialog::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) {
remove_.EnableWindow(installed);
dir_.EnableWindow(user_dir.empty() ? FALSE : TRUE);

button_custom_dir_.Attach(GetDlgItem(IDC_BUTTON_CUSTOM_DIR));
button_custom_dir_.EnableWindow(user_dir.empty() ? FALSE : TRUE);

ok_.Attach(GetDlgItem(IDOK));
if (installed) {
CString str;
Expand Down Expand Up @@ -83,11 +86,34 @@ LRESULT InstallOptionsDialog::OnRemove(WORD, WORD code, HWND, BOOL&) {

LRESULT InstallOptionsDialog::OnUseDefaultDir(WORD, WORD code, HWND, BOOL&) {
dir_.EnableWindow(FALSE);
dir_.SetWindowTextW(L"");
button_custom_dir_.EnableWindow(FALSE);
return 0;
}

LRESULT InstallOptionsDialog::OnUseCustomDir(WORD, WORD code, HWND, BOOL&) {
CFolderDialog dlg;
CStringW text;
dir_.GetWindowTextW(text);
if(!text.IsEmpty())
dlg.SetInitialFolder(text, false);
if (dlg.DoModal() == IDOK)
dir_.SetWindowTextW(dlg.m_szFolderPath);
button_custom_dir_.EnableWindow(TRUE);
dir_.EnableWindow(TRUE);
dir_.SetFocus();
return 0;
}

LRESULT InstallOptionsDialog::OnBtnCustomDir(WORD, WORD code, HWND, BOOL&)
{
CFolderDialog dlg;
CStringW text;
dir_.GetWindowTextW(text);
if(!text.IsEmpty())
dlg.SetInitialFolder(text, false);
if (dlg.DoModal() == IDOK)
dir_.SetWindowTextW(dlg.m_szFolderPath);
ok_.SetFocus();
return 0;
}
5 changes: 3 additions & 2 deletions WeaselSetup/InstallOptionsDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class InstallOptionsDialog : public CDialogImpl<InstallOptionsDialog>
COMMAND_ID_HANDLER(IDC_REMOVE, OnRemove)
COMMAND_ID_HANDLER(IDC_RADIO_DEFAULT_DIR, OnUseDefaultDir)
COMMAND_ID_HANDLER(IDC_RADIO_CUSTOM_DIR, OnUseCustomDir)
COMMAND_ID_HANDLER(IDC_BUTTON_CUSTOM_DIR, OnBtnCustomDir)
END_MSG_MAP()

LRESULT OnInitDialog(UINT, WPARAM, LPARAM, BOOL&);
Expand All @@ -52,8 +53,7 @@ class InstallOptionsDialog : public CDialogImpl<InstallOptionsDialog>
LRESULT OnRemove(WORD, WORD code, HWND, BOOL&);
LRESULT OnUseDefaultDir(WORD, WORD code, HWND, BOOL&);
LRESULT OnUseCustomDir(WORD, WORD code, HWND, BOOL&);

void UpdateWidgets();
LRESULT OnBtnCustomDir(WORD, WORD code, HWND, BOOL&);

CButton cn_;
CButton tw_;
Expand All @@ -62,5 +62,6 @@ class InstallOptionsDialog : public CDialogImpl<InstallOptionsDialog>
CButton custom_dir_;
CButton ok_;
CButton ime_;
CButton button_custom_dir_;
CEdit dir_;
};
Binary file modified WeaselSetup/WeaselSetup.rc
Binary file not shown.
3 changes: 2 additions & 1 deletion WeaselSetup/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
#define IDC_REMOVE 1005
#define IDC_CHECK1 1006
#define IDC_CHECK_INSTIME 1006
#define IDC_BUTTON_CUSTOM_DIR 1007

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 205
#define _APS_NEXT_COMMAND_VALUE 32775
#define _APS_NEXT_CONTROL_VALUE 1007
#define _APS_NEXT_CONTROL_VALUE 1008
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

0 comments on commit 7ab0f98

Please sign in to comment.