"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/interface/context_control.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.

context_control.cpp  (FileZilla_3.48.0_src.tar.bz2):context_control.cpp  (FileZilla_3.48.1_src.tar.bz2)
skipping to change at line 145 skipping to change at line 145
std::wstring const homeDir = wxGetHomeDir().ToStdWstring( ); std::wstring const homeDir = wxGetHomeDir().ToStdWstring( );
if (!pState->SetLocalDir(homeDir)) { if (!pState->SetLocalDir(homeDir)) {
pState->SetLocalDir(L"/"); pState->SetLocalDir(L"/");
} }
#endif #endif
} }
CContextManager::Get()->SetCurrentContext(pState); CContextManager::Get()->SetCurrentContext(pState);
} }
if (!m_mainFrame.RestoreSplitterPositions()) {
m_mainFrame.SetDefaultSplitterPositions();
}
if (m_tabs) { if (m_tabs) {
m_tabs->SetSelection(m_tabs->GetPageCount() - 1); m_tabs->SetSelection(m_tabs->GetPageCount() - 1);
} }
return true; return true;
} }
void CContextControl::CreateContextControls(CState& state) void CContextControl::CreateContextControls(CState& state)
{ {
wxGetApp().AddStartupProfileRecord("CContextControl::CreateContextControl s"); wxGetApp().AddStartupProfileRecord("CContextControl::CreateContextControl s");
wxWindow* parent = this; wxWindow* parent = this;
#ifdef __WXGTK__ #ifdef __WXGTK__
// This prevents some ugly flickering on tab creation. // This prevents some ugly flickering on tab creation.
const wxPoint initial_position(1000000, 1000000); const wxPoint initial_position(1000000, 1000000);
#else #else
const wxPoint initial_position(wxDefaultPosition); const wxPoint initial_position(wxDefaultPosition);
#endif #endif
std::tuple<double, int, int> splitterPositions;
if (!m_context_controls.empty()) { if (!m_context_controls.empty()) {
splitterPositions = m_context_controls[m_current_context_controls
].GetSplitterPositions();
m_context_controls[m_current_context_controls].pLocalListView->Sa
veColumnSettings(OPTION_LOCALFILELIST_COLUMN_WIDTHS, OPTION_LOCALFILELIST_COLUMN
_SHOWN, OPTION_LOCALFILELIST_COLUMN_ORDER);
m_context_controls[m_current_context_controls].pRemoteListView->S
aveColumnSettings(OPTION_REMOTEFILELIST_COLUMN_WIDTHS, OPTION_REMOTEFILELIST_COL
UMN_SHOWN, OPTION_REMOTEFILELIST_COLUMN_ORDER);
if (!m_tabs) { if (!m_tabs) {
m_tabs = new wxAuiNotebookEx(); m_tabs = new wxAuiNotebookEx();
wxSize splitter_size = m_context_controls[m_current_conte xt_controls].pViewSplitter->GetSize(); wxSize splitter_size = m_context_controls[m_current_conte xt_controls].pViewSplitter->GetSize();
m_tabs->Create(this, wxID_ANY, initial_position, splitter _size, wxNO_BORDER | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON | wxAU I_NB_CLOSE_ON_ALL_TABS | wxAUI_NB_TAB_MOVE); m_tabs->Create(this, wxID_ANY, initial_position, splitter _size, wxNO_BORDER | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON | wxAU I_NB_CLOSE_ON_ALL_TABS | wxAUI_NB_TAB_MOVE);
m_tabs->SetExArtProvider(); m_tabs->SetExArtProvider();
m_tabs->SetSelectedFont(*wxNORMAL_FONT); m_tabs->SetSelectedFont(*wxNORMAL_FONT);
m_tabs->SetMeasuringFont(*wxNORMAL_FONT); m_tabs->SetMeasuringFont(*wxNORMAL_FONT);
m_context_controls[m_current_context_controls].pViewSplit ter->Reparent(m_tabs); m_context_controls[m_current_context_controls].pViewSplit ter->Reparent(m_tabs);
skipping to change at line 196 skipping to change at line 199
m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAu iNotebookEventHandler(CContextControl::OnTabBgDoubleclick), 0, this); m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAu iNotebookEventHandler(CContextControl::OnTabBgDoubleclick), 0, this);
m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebookEventHandler(CContextControl::OnTabClosing), 0, this); m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebookEventHandler(CContextControl::OnTabClosing), 0, this);
m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, w xAuiNotebookEventHandler(CContextControl::OnTabRightclick), 0, this); m_tabs->Connect(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, w xAuiNotebookEventHandler(CContextControl::OnTabRightclick), 0, this);
#ifdef __WXMAC__ #ifdef __WXMAC__
// We need to select the first page as the default select ion is -1. Not doing so prevents selecting other pages later on. // We need to select the first page as the default select ion is -1. Not doing so prevents selecting other pages later on.
m_tabs->SetSelection(0); m_tabs->SetSelection(0);
#endif #endif
} }
m_mainFrame.RememberSplitterPositions();
m_context_controls[m_current_context_controls].pLocalListView->Sa
veColumnSettings(OPTION_LOCALFILELIST_COLUMN_WIDTHS, OPTION_LOCALFILELIST_COLUMN
_SHOWN, OPTION_LOCALFILELIST_COLUMN_ORDER);
m_context_controls[m_current_context_controls].pRemoteListView->S
aveColumnSettings(OPTION_REMOTEFILELIST_COLUMN_WIDTHS, OPTION_REMOTEFILELIST_COL
UMN_SHOWN, OPTION_REMOTEFILELIST_COLUMN_ORDER);
parent = m_tabs; parent = m_tabs;
} }
CContextControl::_context_controls context_controls; CContextControl::_context_controls context_controls;
context_controls.pState = &state; context_controls.pState = &state;
context_controls.pViewSplitter = new CSplitterWindowEx(parent, -1, initia l_position, wxDefaultSize, wxSP_NOBORDER | wxSP_LIVE_UPDATE); context_controls.pViewSplitter = new CSplitterWindowEx(parent, -1, initia l_position, wxDefaultSize, wxSP_NOBORDER | wxSP_LIVE_UPDATE);
context_controls.pViewSplitter->SetMinimumPaneSize(50, 100); context_controls.pViewSplitter->SetMinimumPaneSize(50, 100);
context_controls.pViewSplitter->SetSashGravity(0.5); context_controls.pViewSplitter->SetSashGravity(0.5);
skipping to change at line 332 skipping to change at line 331
if (layout == 3) { if (layout == 3) {
if (!swap) { if (!swap) {
context_controls.pRemoteSplitter->SetSashGravity(1.0); context_controls.pRemoteSplitter->SetSashGravity(1.0);
} }
else { else {
context_controls.pLocalSplitter->SetSashGravity(1.0); context_controls.pLocalSplitter->SetSashGravity(1.0);
} }
} }
if (!m_context_controls.empty()) {
context_controls.SetSplitterPositions(splitterPositions);
}
else {
context_controls.pViewSplitter->SetRelativeSashPosition(0.5);
context_controls.pLocalSplitter->SetRelativeSashPosition(0.4);
context_controls.pLocalSplitter->SetRelativeSashPosition(0.4);
}
m_mainFrame.ConnectNavigationHandler(context_controls.pLocalListView); m_mainFrame.ConnectNavigationHandler(context_controls.pLocalListView);
m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteListView); m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteListView);
m_mainFrame.ConnectNavigationHandler(context_controls.pLocalTreeView); m_mainFrame.ConnectNavigationHandler(context_controls.pLocalTreeView);
m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteTreeView); m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteTreeView);
m_mainFrame.ConnectNavigationHandler(context_controls.pLocalViewHeader); m_mainFrame.ConnectNavigationHandler(context_controls.pLocalViewHeader);
m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteViewHeader); m_mainFrame.ConnectNavigationHandler(context_controls.pRemoteViewHeader);
if (context_controls.pLocalListView && context_controls.pRemoteListView) { if (context_controls.pLocalListView && context_controls.pRemoteListView) {
state.GetComparisonManager()->SetListings(context_controls.pLocal ListView, context_controls.pRemoteListView); state.GetComparisonManager()->SetListings(context_controls.pLocal ListView, context_controls.pRemoteListView);
} }
skipping to change at line 700 skipping to change at line 708
auto xml = COptions::Get()->GetOptionXml(OPTION_TAB_DATA); auto xml = COptions::Get()->GetOptionXml(OPTION_TAB_DATA);
bool selectedOnly = COptions::Get()->GetOptionVal(OPTION_STARTUP_ACTION) != 2; bool selectedOnly = COptions::Get()->GetOptionVal(OPTION_STARTUP_ACTION) != 2;
CCommandLine const* pCommandLine = wxGetApp().GetCommandLine(); CCommandLine const* pCommandLine = wxGetApp().GetCommandLine();
if (pCommandLine && pCommandLine->BlocksReconnectAtStartup()) { if (pCommandLine && pCommandLine->BlocksReconnectAtStartup()) {
selectedOnly = true; selectedOnly = true;
} }
pugi::xml_node tabs = xml ? xml->child("Tabs") : pugi::xml_node(); pugi::xml_node tabs = xml.child("Tabs");
if (tabs) { if (tabs) {
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("selected").as_int()) { if (tab.attribute("selected").as_int()) {
selected = m_context_controls.size(); selected = m_context_controls.size();
} }
else if (selectedOnly) { else if (selectedOnly) {
continue; continue;
} }
skipping to change at line 773 skipping to change at line 781
if (SwitchFocus(focus, p.first, p.second)) { if (SwitchFocus(focus, p.first, p.second)) {
return; return;
} }
if (SwitchFocus(focus, p.second, p.first)) { if (SwitchFocus(focus, p.second, p.first)) {
return; return;
} }
} }
focus = focus->GetParent(); focus = focus->GetParent();
} }
} }
std::tuple<double, int, int> CContextControl::_context_controls::GetSplitterPosi
tions()
{
std::tuple<double, int, int> ret;
std::get<0>(ret) = pViewSplitter ? pViewSplitter->GetRelativeSashPosition
() : 0.5f;
std::get<1>(ret) = pLocalSplitter ? pLocalSplitter->GetSashPosition() : 1
35;
std::get<2>(ret) = pRemoteSplitter ? pRemoteSplitter->GetSashPosition() :
135;
return ret;
}
void CContextControl::_context_controls::SetSplitterPositions(std::tuple<double,
int, int> const& positions)
{
if (pViewSplitter) {
double pos = std::get<0>(positions);
if (pos < 0 || pos > 1) {
pos = 0.5;
}
pViewSplitter->SetRelativeSashPosition(pos);
}
if (pLocalSplitter) {
pLocalSplitter->SetSashPosition(std::get<1>(positions));
}
if (pRemoteSplitter) {
pRemoteSplitter->SetSashPosition(std::get<2>(positions));
}
}
 End of changes. 7 change blocks. 
13 lines changed or deleted 22 lines changed or added

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