diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-08-24 12:51:21 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-08-29 12:33:17 +0200 |
commit | 6bf5bc98739c89537f7f3f1247f703943f907818 (patch) | |
tree | c0fc35fbcdde16eec24c8360d9547992e2a28e47 /fpicker | |
parent | 470d6ab5d35045902c2d07815314df9b03b6326e (diff) |
Remember window size
Change-Id: I4e9bd5e2516b66f47b560a388237b75059a7f142
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 38 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.hxx | 3 |
2 files changed, 38 insertions, 3 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index b00f0db252df..1b541ba9096e 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -6,7 +6,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - #include "RemoteFilesDialog.hxx" class FileViewContainer : public vcl::Window @@ -172,6 +171,8 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits ) : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" ) , m_xContext( comphelper::getProcessComponentContext() ) , m_xMasterPasswd( PasswordContainer::create( m_xContext ) ) + , m_nWidth( 0 ) + , m_nHeight( 0 ) , m_pCurrentAsyncAction( NULL ) , m_pFileNotifier( NULL ) , m_pSplitter( NULL ) @@ -297,9 +298,15 @@ void RemoteFilesDialog::dispose() { SvtViewOptions aDlgOpt( E_DIALOG, m_sIniKey ); aDlgOpt.SetWindowState( OStringToOUString( GetWindowState(), osl_getThreadTextEncoding() ) ); + + Size aSize( GetSizePixel() ); + + OUString sSize = OUString::number( aSize.Width() ) + "|"; + sSize = sSize + OUString::number( aSize.Height() ) + "|"; + OUString sUserData = m_pFileView->GetConfigString(); aDlgOpt.SetUserItem( OUString( "UserData" ), - makeAny( sUserData ) ); + makeAny( sSize + sUserData ) ); } // save services @@ -373,6 +380,17 @@ short RemoteFilesDialog::Execute() return nRet; } +void RemoteFilesDialog::Show() +{ + SvtFileDialog_Base::Show(); + + if( m_nWidth > 0 && m_nHeight > 0 ) + { + Size aSize( m_nWidth, m_nHeight ); + SetSizePixel( aSize ); + } +} + OUString lcl_GetServiceType( ServicePtr pService ) { INetProtocol aProtocol = pService->GetUrlObject().GetProtocol(); @@ -423,7 +441,21 @@ void RemoteFilesDialog::InitSize() Any aUserData = aDlgOpt.GetUserItem( OUString( "UserData" ) ); OUString sCfgStr; if( aUserData >>= sCfgStr ) - m_pFileView->SetConfigString( sCfgStr ); + { + int nPos = sCfgStr.indexOf( "|" ); + if( nPos != -1 ) + { + nPos = sCfgStr.indexOf( "|", nPos + 1 ); + if( nPos != -1 ) + { + sal_Int32 nIdx = 0; + m_nWidth = sCfgStr.getToken( 0, '|', nIdx ).toInt32(); + m_nHeight = sCfgStr.getToken( 0, '|', nIdx ).toInt32(); + + m_pFileView->SetConfigString( sCfgStr.copy( nPos + 1) ); + } + } + } } } diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index ad1323c2fea2..65ce6c22ef43 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -77,6 +77,7 @@ public: virtual void dispose() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE; virtual short Execute() SAL_OVERRIDE; + virtual void Show(); // SvtFileDialog_Base @@ -134,6 +135,8 @@ private: bool m_bServiceChanged; OUString m_sIniKey; + int m_nWidth; + int m_nHeight; OUString m_sPath; OUString m_sStdDir; |