"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/interface/Mainfrm.cpp" between
FileZilla_3.48.0_src.tar.bz2 and FileZilla_3.48.1_src.tar.bz2

About: FileZilla is a fast and feature-rich cross-platform FTP, FTPS and SFTP client with an intuitive graphical user interface.

Mainfrm.cpp  (FileZilla_3.48.0_src.tar.bz2):Mainfrm.cpp  (FileZilla_3.48.1_src.tar.bz2)
skipping to change at line 2227 skipping to change at line 2227
(*iter)->SetFocus(); (*iter)->SetFocus();
} }
void CMainFrame::RememberSplitterPositions() void CMainFrame::RememberSplitterPositions()
{ {
CContextControl::_context_controls* controls = m_pContextControl ? m_pCon textControl->GetCurrentControls() : 0; CContextControl::_context_controls* controls = m_pContextControl ? m_pCon textControl->GetCurrentControls() : 0;
if (!controls) { if (!controls) {
return; return;
} }
auto const positions = controls->GetSplitterPositions();
std::wstring const posString = fz::sprintf( std::wstring const posString = fz::sprintf(
L"%d %d %d %d %d %d", L"%d %d %d %d %d %d",
// top_pos // top_pos
m_pTopSplitter->GetSashPosition(), m_pTopSplitter->GetSashPosition(),
// bottom_height // bottom_height
m_pBottomSplitter->GetSashPosition(), m_pBottomSplitter->GetSashPosition(),
// view_pos // view_pos
// Note that we cannot use %f, it is locale-dependent // Note that we cannot use %f, it is locale-dependent
static_cast<int>(controls->pViewSplitter->GetRelativeSashPosition () * 1000000000), static_cast<int>(std::get<0>(positions) * 1000000000),
// local_pos // local_pos
controls->pLocalSplitter->GetSashPosition(), std::get<1>(positions),
// remote_pos // remote_pos
controls->pRemoteSplitter->GetSashPosition(), std::get<2>(positions),
// queuelog splitter // queuelog splitter
static_cast<int>(m_pQueueLogSplitter->GetRelativeSashPosition() * 1000000000) static_cast<int>(m_pQueueLogSplitter->GetRelativeSashPosition() * 1000000000)
); );
COptions::Get()->SetOption(OPTION_MAINWINDOW_SPLITTER_POSITION, posString ); COptions::Get()->SetOption(OPTION_MAINWINDOW_SPLITTER_POSITION, posString );
} }
bool CMainFrame::RestoreSplitterPositions() bool CMainFrame::RestoreSplitterPositions()
{ {
if (wxGetKeyState(WXK_SHIFT) && wxGetKeyState(WXK_ALT) && wxGetKeyState(W XK_CONTROL)) { if (wxGetKeyState(WXK_SHIFT) && wxGetKeyState(WXK_ALT) && wxGetKeyState(W XK_CONTROL)) {
return false; return false;
} }
// top_pos bottom_height view_pos view_height_width local_pos remote_pos // top_pos bottom_height view_pos view_height_width local_pos remote_pos
auto tokens = fz::strtok(COptions::Get()->GetOption(OPTION_MAINWINDOW_SPL std::wstring const positions = COptions::Get()->GetOption(OPTION_MAINWIND
ITTER_POSITION), L" "); OW_SPLITTER_POSITION);
auto tokens = fz::strtok_view(positions, L" ");
if (tokens.size() < 6) { if (tokens.size() < 6) {
return false; return false;
} }
int values[6]; int values[6];
for (size_t i = 0; i < 6; ++i) { for (size_t i = 0; i < 6; ++i) {
values[i] = fz::to_integral(tokens[i], std::numeric_limits<int>:: min()); values[i] = fz::to_integral(tokens[i], std::numeric_limits<int>:: min());
if (values[i] == std::numeric_limits<int>::min()) { if (values[i] == std::numeric_limits<int>::min()) {
return false; return false;
} }
} }
m_pTopSplitter->SetSashPosition(values[0]); if (m_pTopSplitter) {
m_pTopSplitter->SetSashPosition(values[0]);
m_pBottomSplitter->SetSashPosition(values[1]);
CContextControl::_context_controls* controls = m_pContextControl ? m_pCon
textControl->GetCurrentControls() : 0;
if (!controls) {
return false;
} }
if (m_pBottomSplitter) {
double pos = static_cast<double>(values[2]) / 1000000000; m_pBottomSplitter->SetSashPosition(values[1]);
if (pos >= 0 && pos <= 1) {
controls->pViewSplitter->SetRelativeSashPosition(pos);
} }
controls->pLocalSplitter->SetSashPosition(values[3]); if (m_pContextControl) {
controls->pRemoteSplitter->SetSashPosition(values[4]); double pos = static_cast<double>(values[2]) / 1000000000;
for (int i = 0; i < m_pContextControl->GetTabCount(); ++i) {
auto controls = m_pContextControl->GetControlsFromTabInde
x(i);
if (!controls) {
continue;
}
controls->SetSplitterPositions(std::make_tuple(pos, value
s[3], values[4]));
}
}
pos = static_cast<double>(values[5]) / 1000000000; double pos = static_cast<double>(values[5]) / 1000000000;
if (pos >= 0 && pos <= 1) { if (pos >= 0 && pos <= 1 && m_pQueueLogSplitter) {
m_pQueueLogSplitter->SetRelativeSashPosition(pos); m_pQueueLogSplitter->SetRelativeSashPosition(pos);
} }
return true; return true;
} }
void CMainFrame::SetDefaultSplitterPositions() void CMainFrame::SetDefaultSplitterPositions()
{ {
m_pTopSplitter->SetSashPosition(97); if (m_pTopSplitter) {
m_pTopSplitter->SetSashPosition(97);
}
wxSize size = m_pBottomSplitter->GetClientSize(); wxSize size = m_pBottomSplitter->GetClientSize();
int h = size.GetHeight() - 135; int h = size.GetHeight() - 135;
if (h < 50) { if (h < 50) {
h = 50; h = 50;
} }
m_pBottomSplitter->SetSashPosition(h); if (m_pBottomSplitter) {
m_pBottomSplitter->SetSashPosition(h);
}
m_pQueueLogSplitter->SetSashPosition(0); if (m_pQueueLogSplitter) {
m_pQueueLogSplitter->SetSashPosition(0);
}
CContextControl::_context_controls* controls = m_pContextControl ? m_pCon if (m_pContextControl) {
textControl->GetCurrentControls() : 0; for (int i = 0; i < m_pContextControl->GetTabCount(); ++i) {
if (controls) { CContextControl::_context_controls* controls = m_pContext
controls->pViewSplitter->SetSashPosition(0); Control->GetControlsFromTabIndex(i);
controls->pLocalSplitter->SetRelativeSashPosition(0.4); if (!controls) {
controls->pRemoteSplitter->SetRelativeSashPosition(0.4); continue;
}
if (controls->pViewSplitter) {
controls->pViewSplitter->SetRelativeSashPosition(
0.5);
}
if (controls->pLocalSplitter) {
controls->pLocalSplitter->SetRelativeSashPosition
(0.4);
}
if (controls->pRemoteSplitter) {
controls->pRemoteSplitter->SetRelativeSashPositio
n(0.4);
}
}
} }
} }
void CMainFrame::OnActivate(wxActivateEvent& event) void CMainFrame::OnActivate(wxActivateEvent& event)
{ {
// According to the wx docs we should do this // According to the wx docs we should do this
event.Skip(); event.Skip();
if (!event.GetActive()) { if (!event.GetActive()) {
return; return;
skipping to change at line 2482 skipping to change at line 2502
CState* pState = CContextManager::Get()->GetCurrentContext(); CState* pState = CContextManager::Get()->GetCurrentContext();
if (!pState) { if (!pState) {
return; return;
} }
int old_mode = COptions::Get()->GetOptionVal(OPTION_COMPARISONMODE); int old_mode = COptions::Get()->GetOptionVal(OPTION_COMPARISONMODE);
int new_mode = (event.GetId() == XRCID("ID_COMPARE_SIZE")) ? 0 : 1; int new_mode = (event.GetId() == XRCID("ID_COMPARE_SIZE")) ? 0 : 1;
COptions::Get()->SetOption(OPTION_COMPARISONMODE, new_mode); COptions::Get()->SetOption(OPTION_COMPARISONMODE, new_mode);
CComparisonManager* pComparisonManager = pState->GetComparisonManager(); CComparisonManager* pComparisonManager = pState->GetComparisonManager();
if (old_mode != new_mode && pComparisonManager && pComparisonManager->IsC omparing()) { if (old_mode != new_mode && pComparisonManager) {
pComparisonManager->SetComparisonMode(new_mode); pComparisonManager->SetComparisonMode(new_mode);
pComparisonManager->CompareListings(); if (pComparisonManager->IsComparing()) {
pComparisonManager->CompareListings();
}
} }
} }
void CMainFrame::OnDropdownComparisonHide(wxCommandEvent&) void CMainFrame::OnDropdownComparisonHide(wxCommandEvent&)
{ {
CState* pState = CContextManager::Get()->GetCurrentContext(); CState* pState = CContextManager::Get()->GetCurrentContext();
if (!pState) { if (!pState) {
return; return;
} }
bool old_mode = COptions::Get()->GetOptionVal(OPTION_COMPARE_HIDEIDENTICA L) != 0; bool old_mode = COptions::Get()->GetOptionVal(OPTION_COMPARE_HIDEIDENTICA L) != 0;
COptions::Get()->SetOption(OPTION_COMPARE_HIDEIDENTICAL, old_mode ? 0 : 1 ); COptions::Get()->SetOption(OPTION_COMPARE_HIDEIDENTICAL, old_mode ? 0 : 1 );
CComparisonManager* pComparisonManager = pState->GetComparisonManager(); CComparisonManager* pComparisonManager = pState->GetComparisonManager();
if (pComparisonManager && pComparisonManager->IsComparing()) { if (pComparisonManager) {
pComparisonManager->SetHideIdentical(old_mode ? 0 : 1); pComparisonManager->SetHideIdentical(old_mode ? 0 : 1);
pComparisonManager->CompareListings(); if (pComparisonManager->IsComparing()) {
pComparisonManager->CompareListings();
}
} }
} }
void CMainFrame::ProcessCommandLine() void CMainFrame::ProcessCommandLine()
{ {
CCommandLine const* pCommandLine = wxGetApp().GetCommandLine(); CCommandLine const* pCommandLine = wxGetApp().GetCommandLine();
if (!pCommandLine) { if (!pCommandLine) {
return; return;
} }
skipping to change at line 2770 skipping to change at line 2794
startupReconnect = false; startupReconnect = false;
} }
CCommandLine const* pCommandLine = wxGetApp().GetCommandLine(); CCommandLine const* pCommandLine = wxGetApp().GetCommandLine();
if (pCommandLine && pCommandLine->BlocksReconnectAtStartup()) { if (pCommandLine && pCommandLine->BlocksReconnectAtStartup()) {
startupReconnect = false; startupReconnect = false;
} }
if (m_pContextControl && startupReconnect) { if (m_pContextControl && startupReconnect) {
auto xml = COptions::Get()->GetOptionXml(OPTION_TAB_DATA); auto xml = COptions::Get()->GetOptionXml(OPTION_TAB_DATA);
pugi::xml_node tabs = xml ? xml->child("Tabs") : pugi::xml_node() ; pugi::xml_node tabs = xml.child("Tabs");
int i = 0; int i = 0;
for (auto tab = tabs.child("Tab"); tab; tab = tab.next_sibling("T ab")) { for (auto tab = tabs.child("Tab"); tab; tab = tab.next_sibling("T ab")) {
if (tab.attribute("connected").as_int()) { if (tab.attribute("connected").as_int()) {
auto controls = m_pContextControl->GetControlsFro mTabIndex(i); auto controls = m_pContextControl->GetControlsFro mTabIndex(i);
if (controls && controls->pState) { if (controls && controls->pState) {
CState* pState = controls->pState; CState* pState = controls->pState;
if (pState->IsRemoteConnected() || !pStat e->IsRemoteIdle()) { if (pState->IsRemoteConnected() || !pStat e->IsRemoteIdle()) {
continue; continue;
} }
 End of changes. 18 change blocks. 
35 lines changed or deleted 63 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)