Ticket #1518: filezilla_3_rc1_save_position.patch
File filezilla_3_rc1_save_position.patch, 4.8 KB (added by , 17 years ago) |
---|
-
src/interface/Mainfrm.cpp
diff -Nur Filezilla3/src/interface/Mainfrm.cpp Filezilla3.patch/src/interface/Mainfrm.cpp
old new 29 29 #include "export.h" 30 30 #include "import.h" 31 31 #include "recursive_operation.h" 32 #include <wx/tokenzr.h> 32 33 33 34 #ifndef __WXMSW__ 34 35 #include "resources/filezilla.xpm" … … 189 190 190 191 m_pLocalSplitter = new wxSplitterWindow(m_pViewSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxSP_LIVE_UPDATE); 191 192 m_pLocalSplitter->SetMinimumPaneSize(20); 192 m_pLocalSplitter->SetSashGravity(0. 7);193 m_pLocalSplitter->SetSashGravity(0.0); 193 194 194 195 m_pRemoteSplitter = new wxSplitterWindow(m_pViewSplitter, -1, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxSP_LIVE_UPDATE); 195 196 m_pRemoteSplitter->SetMinimumPaneSize(20); 196 m_pRemoteSplitter->SetSashGravity(0. 7);197 m_pRemoteSplitter->SetSashGravity(0.0); 197 198 198 199 m_pStatusView = new CStatusView(m_pTopSplitter, -1); 199 200 m_pQueuePane = new CQueue(m_pBottomSplitter, this, m_pAsyncRequestQueue); … … 275 276 276 277 Layout(); 277 278 279 // is_maximized win_x win_y win_width win_height top_pos bottom_height view_pos view_height_width local_pos remote_pos 280 wxString posString = COptions::Get()->GetOption(OPTION_WINDOW_POSITION); 281 wxStringTokenizer tokens(posString, _T(" ")); 282 int count = tokens.CountTokens(); 283 if (count == 11) { 284 unsigned long * aPosValues = new unsigned long[count]; 285 for (int i = 0; i < count; i++) { 286 wxString token = tokens.GetNextToken(); 287 token.ToULong(aPosValues + i); 288 } 289 290 m_pTopSplitter->SetSashPosition(aPosValues[5]); 291 292 int x, y; 293 m_pBottomSplitter->GetClientSize(&x, &y); 294 y -= aPosValues[6]; 295 if (y < 100) y = 100; 296 m_pBottomSplitter->SetSashPosition(y); 297 298 m_ViewSplitterSashPos = (float)aPosValues[7]/aPosValues[8]; 299 m_pViewSplitter->SetSashPosition(aPosValues[7]); 300 301 if (aPosValues[0]) 302 Maximize(); 303 else { 304 Move(aPosValues[1], aPosValues[2]); 305 SetClientSize(aPosValues[3], aPosValues[4]); 306 } 307 308 m_pLocalSplitter->SetSashPosition(aPosValues[9]); 309 m_pRemoteSplitter->SetSashPosition(aPosValues[10]); 310 delete [] aPosValues; 311 } 312 278 313 wxString localDir = COptions::Get()->GetOption(OPTION_LASTLOCALDIR); 279 314 if (!m_pState->SetLocalDir(localDir)) 280 315 m_pState->SetLocalDir(_T("/")); … … 750 785 751 786 void CMainFrame::OnClose(wxCloseEvent &event) 752 787 { 788 wxString posString; 789 // is_maximized 790 posString += wxString::Format(_T("%d "), IsMaximized() ? 1 : 0); 791 int x, y; 792 // pos_x pos_y 793 GetPosition(&x, &y); 794 posString += wxString::Format(_T("%d %d "), x, y); 795 // pos_width pos_height 796 GetClientSize(&x, &y); 797 posString += wxString::Format(_T("%d %d "), x, y); 798 // top_pos 799 posString += wxString::Format(_T("%d "), m_pTopSplitter->GetSashPosition()); 800 // bottom_height 801 m_pBottomSplitter->GetClientSize(&x, &y); 802 posString += wxString::Format(_T("%d "), y - m_pBottomSplitter->GetSashPosition()); 803 // view_pos 804 posString += wxString::Format(_T("%d "), m_pViewSplitter->GetSashPosition()); 805 // view_height_width 806 m_pViewSplitter->GetClientSize(&x, &y); 807 if (COptions::Get()->GetOptionVal(OPTION_FILEPANE_LAYOUT) != 1) 808 posString += wxString::Format(_T("%d "), x); 809 else 810 posString += wxString::Format(_T("%d "), y); 811 // local_pos 812 posString += wxString::Format(_T("%d "), m_pLocalSplitter->GetSashPosition()); 813 // remote_pos 814 posString += wxString::Format(_T("%d "), m_pRemoteSplitter->GetSashPosition()); 815 COptions::Get()->SetOption(OPTION_WINDOW_POSITION, posString); 816 753 817 Show(false); 754 818 m_bQuit = true; 755 819 delete m_pSendLed; -
src/interface/Options.cpp
diff -Nur Filezilla3/src/interface/Options.cpp Filezilla3.patch/src/interface/Options.cpp
old new 81 81 { "Queue successful autoclear", number, _T("0") }, 82 82 { "Queue column widths", string, _T("") }, 83 83 { "Local filelist colwidths", string, _T("") }, 84 { "Remote filelist colwidths", string, _T("") } 84 { "Remote filelist colwidths", string, _T("") }, 85 { "Window position and size", string, _T("") } 85 86 }; 86 87 87 88 COptions::COptions() -
src/interface/Options.h
diff -Nur Filezilla3/src/interface/Options.h Filezilla3.patch/src/interface/Options.h
old new 35 35 OPTION_QUEUE_COLUMN_WIDTHS, 36 36 OPTION_LOCALFILELIST_COLUMN_WIDTHS, 37 37 OPTION_REMOTEFILELIST_COLUMN_WIDTHS, 38 OPTION_WINDOW_POSITION, 38 39 39 40 // Has to be last element 40 41 OPTIONS_NUM