Kaydet (Commit) cdb14b4f authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

tdf#100715 Slide transition sound: Remember remember last folder

Change-Id: I37bfb088a167464cdbd93a1f993a8161d12b379a
Reviewed-on: https://gerrit.libreoffice.org/26937Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 8a35cafb
......@@ -200,4 +200,9 @@
<value>$(work)</value>
</prop>
</node>
<node oor:name="Sound" oor:op="fuse" oor:mandatory="true">
<prop oor:name="Path">
<value>$(work)</value>
</prop>
</node>
</oor:component-data>
......@@ -1632,7 +1632,7 @@
</group>
<group oor:name="Pictures">
<info>
<desc>Contains configuration items form Impress Photo Album function.</desc>
<desc>Contains configuration items for Impress Photo Album function.</desc>
</info>
<prop oor:name="Path" oor:type="xs:string" oor:nillable="false">
<info>
......@@ -1644,5 +1644,19 @@
<value>$(work)</value>
</prop>
</group>
<group oor:name="Sound">
<info>
<desc>Contains configuration items for Sound related functions.</desc>
</info>
<prop oor:name="Path" oor:type="xs:string" oor:nillable="false">
<info>
<desc>
Access path, where sounds were loaded last time.
The default is work directory.
</desc>
</info>
<value>$(work)</value>
</prop>
</group>
</component>
</oor:component-schema>
......@@ -1496,16 +1496,13 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
OUString aFile( SvtPathOptions().GetWorkPath() );
aFileDialog.SetPath( aFile );
bool bValidSoundFile = false;
bool bQuitLoop = false;
long nPos = 0;
while( !bQuitLoop && (aFileDialog.Execute() == ERRCODE_NONE) )
{
aFile = aFileDialog.GetPath();
OUString aFile = aFileDialog.GetPath();
nPos = getSoundObject( aFile );
if( nPos < 0 ) // not in Soundliste
......
......@@ -735,12 +735,8 @@ void SlideTransitionPane::openSoundFileDialog()
SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
OUString aFile;
DBG_ASSERT( mpLB_SOUND->GetSelectedEntryPos() == 2,
"Dialog should only open when \"Other sound\" is selected" );
aFile = SvtPathOptions().GetWorkPath();
aFileDialog.SetPath( aFile );
bool bValidSoundFile( false );
bool bQuitLoop( false );
......@@ -748,7 +744,7 @@ void SlideTransitionPane::openSoundFileDialog()
while( ! bQuitLoop &&
aFileDialog.Execute() == ERRCODE_NONE )
{
aFile = aFileDialog.GetPath();
OUString aFile = aFileDialog.GetPath();
tSoundListType::size_type nPos = 0;
bValidSoundFile = lcl_findSoundInList( maSoundList, aFile, nPos );
......
......@@ -38,6 +38,7 @@
#include <sdresid.hxx>
#include <strings.hrc>
#include <vcl/graphicfilter.hxx>
#include <officecfg/Office/Impress.hxx>
// ----------- SdFileDialog_Imp ---------------------------
......@@ -235,6 +236,9 @@ SdOpenSoundFileDialog::SdOpenSoundFileDialog(weld::Window *pParent)
aDescr = SdResId(STR_MIDI_FILE);
mpImpl->AddFilter( aDescr, "*.mid" );
#endif
// Restore last selected path
mpImpl->SetDisplayDirectory(officecfg::Office::Impress::Sound::Path::get());
}
SdOpenSoundFileDialog::~SdOpenSoundFileDialog()
......@@ -248,6 +252,12 @@ ErrCode SdOpenSoundFileDialog::Execute()
OUString SdOpenSoundFileDialog::GetPath() const
{
// Save last selected path
std::shared_ptr<comphelper::ConfigurationChanges> batch(
comphelper::ConfigurationChanges::create());
officecfg::Office::Impress::Sound::Path::set(mpImpl->GetPath(), batch);
batch->commit();
return mpImpl->GetPath();
}
......
......@@ -411,10 +411,8 @@ void SdTPAction::OpenFileDialog()
{
SdOpenSoundFileDialog aFileDialog(GetFrameWeld());
if( aFile.isEmpty() )
aFile = SvtPathOptions().GetWorkPath();
aFileDialog.SetPath( aFile );
if( !aFile.isEmpty() )
aFileDialog.SetPath( aFile );
if( aFileDialog.Execute() == ERRCODE_NONE )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment