[NEW_FEATURE] Add "Setting on Cloud - OneDrive" GUI part.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1251 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-06-22 23:23:39 +00:00
parent 8c5b4df673
commit 3f8474ffc8
5 changed files with 46 additions and 20 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB