diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 760f7951..4bd21164 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -379,8 +379,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Settings on cloud",IDC_SETTINGSONCLOUD_GB_STATIC,89,44,268,89,BS_CENTER - CONTROL "Dropbox",IDD_SETTINGSONCLOUD_DROPBOX_CHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,60,160,10 - LTEXT "",IDC_SETTINGSONCLOUD_WARNING_STATIC,132,75,135,8 + CONTROL "No Cloud",IDC_NOCLOUD_RADIO,"Button",BS_AUTORADIOBUTTON,125,57,92,10 + CONTROL "Dropbox",IDC_DROPBOX_RADIO,"Button",BS_AUTORADIOBUTTON,125,72,92,10 + CONTROL "OneDrive",IDC_ONEDRIVE_RADIO,"Button",BS_AUTORADIOBUTTON,125,87,92,10 + LTEXT "",IDC_SETTINGSONCLOUD_WARNING_STATIC,131,106,135,8 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 0e0c46b4..74a2e000 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -2800,14 +2800,21 @@ BOOL CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARA case WM_INITDIALOG : { CloudChoice cloudChoice = nppGUI._cloudChoice; - initialCloudChoice = nppGUI._cloudChoice; + _initialCloudChoice = nppGUI._cloudChoice; /* COLORREF bgColor = getCtrlBgColor(_hSelf); SetTextColor(hdcStatic, RGB(255, 0, 0)); SetBkColor(hdcStatic, RGB(GetRValue(bgColor) - 30, GetGValue(bgColor) - 30, GetBValue(bgColor) - 30)); */ - ::SendDlgItemMessage(_hSelf, IDD_SETTINGSONCLOUD_DROPBOX_CHECK, BM_SETCHECK, cloudChoice == dropbox?BST_CHECKED:BST_UNCHECKED, 0); - ::EnableWindow(::GetDlgItem(_hSelf, IDD_SETTINGSONCLOUD_DROPBOX_CHECK), (nppGUI._availableClouds & DROPBOX_AVAILABLE) != 0); + ::SendDlgItemMessage(_hSelf, IDC_NOCLOUD_RADIO, BM_SETCHECK, cloudChoice == noCloud?BST_CHECKED:BST_UNCHECKED, 0); + + ::SendDlgItemMessage(_hSelf, IDC_DROPBOX_RADIO, BM_SETCHECK, cloudChoice == dropbox?BST_CHECKED:BST_UNCHECKED, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_DROPBOX_RADIO), (nppGUI._availableClouds & DROPBOX_AVAILABLE) != 0); + + ::SendDlgItemMessage(_hSelf, IDC_ONEDRIVE_RADIO, BM_SETCHECK, cloudChoice == oneDrive?BST_CHECKED:BST_UNCHECKED, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_ONEDRIVE_RADIO), (nppGUI._availableClouds & ONEDRIVE_AVAILABLE) != 0); + + } break; @@ -2815,24 +2822,39 @@ BOOL CALLBACK SettingsOnCloudDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARA { switch (wParam) { - case IDD_SETTINGSONCLOUD_DROPBOX_CHECK : + case IDC_NOCLOUD_RADIO : { - nppGUI._cloudChoice = isCheckedOrNot(IDD_SETTINGSONCLOUD_DROPBOX_CHECK)?dropbox:noCloud; - if (nppGUI._cloudChoice == dropbox) - { - setCloudChoice("dropbox"); - } - else - { - removeCloudChoice(); - } - generic_string message = initialCloudChoice != nppGUI._cloudChoice?TEXT("Please restart Notepad++ to take effect."):TEXT(""); + nppGUI._cloudChoice = noCloud; + removeCloudChoice(); + + generic_string message = _initialCloudChoice != nppGUI._cloudChoice?TEXT("Please restart Notepad++ to take effect."):TEXT(""); + ::SetDlgItemText(_hSelf, IDC_SETTINGSONCLOUD_WARNING_STATIC, message.c_str()); + } + break; + + case IDC_DROPBOX_RADIO : + { + nppGUI._cloudChoice = dropbox; + setCloudChoice("dropbox"); + + generic_string message = _initialCloudChoice != nppGUI._cloudChoice?TEXT("Please restart Notepad++ to take effect."):TEXT(""); + ::SetDlgItemText(_hSelf, IDC_SETTINGSONCLOUD_WARNING_STATIC, message.c_str()); + } + break; + + case IDC_ONEDRIVE_RADIO : + { + nppGUI._cloudChoice = oneDrive; + setCloudChoice("oneDrive"); + + generic_string message = _initialCloudChoice != nppGUI._cloudChoice?TEXT("Please restart Notepad++ to take effect."):TEXT(""); ::SetDlgItemText(_hSelf, IDC_SETTINGSONCLOUD_WARNING_STATIC, message.c_str()); } break; default : return FALSE; + } } break; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index 0c451842..ab79ef9d 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -216,10 +216,10 @@ private : class SettingsOnCloudDlg : public StaticDialog { public : - SettingsOnCloudDlg(): initialCloudChoice(noCloud) {}; + SettingsOnCloudDlg(): _initialCloudChoice(noCloud) {}; private : - CloudChoice initialCloudChoice; + CloudChoice _initialCloudChoice; BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); void setCloudChoice(const char *choice); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index c02d7e91..f1fa476d 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -126,7 +126,10 @@ #define IDD_PREFERENCE_SETTINGSONCLOUD_BOX 6260 //(IDD_PREFERENCE_BOX + 250) #define IDC_SETTINGSONCLOUD_WARNING_STATIC (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 1) #define IDC_SETTINGSONCLOUD_GB_STATIC (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 2) - #define IDD_SETTINGSONCLOUD_DROPBOX_CHECK (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 3) + #define IDC_NOCLOUD_RADIO (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 3) + #define IDC_DROPBOX_RADIO (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 4) + #define IDC_ONEDRIVE_RADIO (IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 5) + #define IDD_PREFERENCE_SETTING_BOX 6300 //(IDD_PREFERENCE_BOX + 300) #define IDC_TABSETTING_GB_STATIC (IDD_PREFERENCE_SETTING_BOX + 1) diff --git a/PowerEditor/src/icons/chameleon.ico b/PowerEditor/src/icons/chameleon.ico index 9351f3d6..636c56c5 100644 Binary files a/PowerEditor/src/icons/chameleon.ico and b/PowerEditor/src/icons/chameleon.ico differ