Beispiel #1
0
void AdvTrackerDialog::onReannounce(UINT, int, HWND)
{
	if (hal::bittorrent().torrentDetails().focused_torrent())
	{
		if (!hal::bittorrent().is_torrent_active(focused_torrent()->uuid()))
		{
			hal::bittorrent().resume_torrent(focused_torrent()->uuid());
		}
		else
		{
			hal::bittorrent().reannounce_torrent(focused_torrent()->uuid());
		}
	}
}
Beispiel #2
0
void AdvTrackerDialog::onLoginApply(UINT, int, HWND)
{
	DoDataExchange(true);

	HAL_DEV_MSG(hal::wform(L"Apply Tracker Login User: %1%, Pass: %2%") % username_ % password_ );

	if (hal::bit::torrent t = hal::bittorrent().get(focused_torrent()))
		t.set_tracker_login(username_, password_);
}
Beispiel #3
0
LRESULT HaliteDialog::OnHalEditChanged(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (hal::bit::torrent t = hal::bittorrent().get(focused_torrent()))
	{
		t.set_rate_limits(downloadRate_, uploadRate_);
		t.set_connection_limits(totalConnections_, uploadConnections_);
	}
	
	return 0;
}
Beispiel #4
0
LRESULT AdvTrackerDialog::OnEditKillFocus(UINT uCode, int nCtrlID, HWND hwndCtrl)
{
	DoDataExchange(true);
		
	setLoginUiState();

	if (hal::bit::torrent t = hal::bittorrent().get(focused_torrent()))
		t.set_tracker_login(username_, password_);
	
	return 0;
}
Beispiel #5
0
void AdvTrackerDialog::onReset(UINT, int, HWND)
{
	if (hal::bit::torrent t = hal::bittorrent().get(focused_torrent()))
	{
		t.reset_trackers();
		
		auto trackers = t.trackers();
		m_list.DeleteAllItems();
		
		BOOST_FOREACH (const hal::tracker_detail& tracker, trackers)
		{
			int itemPos = m_list.AddItem(0, 0, tracker.url.c_str(), 0);
			m_list.SetItemText(itemPos, 1, lexical_cast<wstring>(tracker.tier).c_str());
		}
Beispiel #6
0
void AdvTrackerDialog::onLoginCheck(UINT, int, HWND hWnd)
{
	LRESULT result = ::SendMessage(hWnd, BM_GETCHECK, 0, 0);
	
	if (result == BST_CHECKED)
	{
		::EnableWindow(GetDlgItem(HAL_TRACKER_USER), true);
		::EnableWindow(GetDlgItem(HAL_TRACKER_PASS), true);
	}
	else
	{
		::EnableWindow(GetDlgItem(HAL_TRACKER_USER), false);
		::EnableWindow(GetDlgItem(HAL_TRACKER_PASS), false);	

		username_.clear();	
		password_.clear();
		
		if (hal::bit::torrent t = hal::bittorrent().get(focused_torrent()))
			t.set_tracker_login(username_, password_);
		
		DoDataExchange(false);		
	}
}