diff options
Diffstat (limited to 'protocols/Tox/src')
| -rw-r--r-- | protocols/Tox/src/tox_options.cpp | 10 | ||||
| -rw-r--r-- | protocols/Tox/src/tox_services.cpp | 10 | 
2 files changed, 5 insertions, 15 deletions
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 71cbb5fd7e..0023c60141 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -38,12 +38,6 @@ void CToxOptionsMain::OnInitDialog()  		ShowWindow(m_profileExport.GetHwnd(), TRUE);
  	}
 -	if (m_proto->IsOnline())
 -	{
 -		EnableWindow(m_nickname.GetHwnd(), TRUE);
 -		EnableWindow(m_password.GetHwnd(), TRUE);
 -	}
 -
  	SendMessage(m_toxAddress.GetHwnd(), EM_LIMITTEXT, TOX_ADDRESS_SIZE * 2, 0);
  	SendMessage(m_nickname.GetHwnd(), EM_LIMITTEXT, TOX_MAX_NAME_LENGTH, 0);
  	SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 32, 0);
 @@ -164,15 +158,11 @@ void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)  	ofn.lpstrInitialDir = _T("%HOMEPATH%");
  	if (!GetSaveFileName(&ofn))
 -	{
  		return;
 -	}
  	std::tstring defaultProfilePath = m_proto->GetToxProfilePath();
  	if (mir_tstrcmpi(profilePath, defaultProfilePath.c_str()) != 0)
 -	{
  		CopyFile(defaultProfilePath.c_str(), profilePath, FALSE);
 -	}
  }
  void CToxOptionsMain::OnApply()
 diff --git a/protocols/Tox/src/tox_services.cpp b/protocols/Tox/src/tox_services.cpp index f42a3d35c0..c9fc238f34 100644 --- a/protocols/Tox/src/tox_services.cpp +++ b/protocols/Tox/src/tox_services.cpp @@ -5,12 +5,12 @@ INT_PTR CToxProto::SetMyNickname(WPARAM wParam, LPARAM lParam)  	ptrT nickname((wParam & SMNN_UNICODE) ? mir_u2t((TCHAR*)lParam) : mir_a2t((char*)lParam));
  	setTString("Nick", nickname);
 -	T2Utf szNick8(nickname);
 -	TOX_ERR_SET_INFO error;
 -	if (!tox_self_set_name(tox, szNick8, mir_strlen(szNick8), &error))
 +	if (IsOnline())
  	{
 -		debugLogA(__FUNCTION__": failed to set nick name");
 -		return 1;
 +		T2Utf szNick8(nickname);
 +		TOX_ERR_SET_INFO error;
 +		if (!tox_self_set_name(tox, szNick8, mir_strlen(szNick8), &error))
 +			debugLogA(__FUNCTION__": failed to set nick name");
  	}
  	return 0;
  | 
