Ejemplo n.º 1
0
bool CEzShortcutDlg::OnEditShortcutDlg(SHORTCUT_INFO& ShortcutInfo)
{
	EnableHotkeys(FALSE);

	CEditDlg dlg(ShortcutInfo, m_map_ShortcutInfo);
	int nRet = dlg.DoModal();

	EnableHotkeys(TRUE);

	if( nRet == IDCANCEL )
	{
		return false;
	}

	if( true == ShortcutInfo.m_strShortcutName.empty() )
	{
		AfxMessageBox(_T("This application must have shortcut-name. Please type shortcut-name."));
		return false;
	}

	if( true == ShortcutInfo.m_strProgramPath.empty() )
	{
		AfxMessageBox(_T("This application must have program-path. Please type program-path."));
		return false;
	}

	return true;
}
void HotkeysRegistry::SetHotkeysSettings(HotkeySettings settings)
{
    hotkeyIdToHotkeyMap[TranslateHotkeyId] = settings.GetTranslateHotkey();
    hotkeyIdToHotkeyMap[PlayTextHotkeyId] = settings.GetPlayTextHotkey();
    hotkeyIdToHotkeyMap[ZoomInHotkeyId] = settings.GetZoomInHotkey();
    hotkeyIdToHotkeyMap[ZoomOutHotkeyId] = settings.GetZoomOutHotkey();

    SuspendHotkeys();
    UpdateHotkeysInfo();
    EnableHotkeys();
}