summaryrefslogtreecommitdiff
path: root/include/sfx2
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-07-08 05:50:25 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-07-12 14:31:20 +0200
commitd157c1bd70d630a58db33910d550bb8dee9fe62e (patch)
tree6a7d4a63cc524fcbbdcdfd8c4271fcbb7cd3c983 /include/sfx2
parentc62bb20032cef7479e9293e84a8d57a2c74399d0 (diff)
tdf#126665 Remember last used file picker directory
This introduces internal tracking of last used directories. Each caller of the file picker can pass a "context". The selected directory will then be saved & restored when opening the file picker with the same context again. After ffa636ba74b04b3258ec9a696bc4eac33581fa24 , the Windows file picker no longer tracks the last used directory itself. This is a replacement and an improvement at the same time, since there is not one global last used directory, but one per context. Change-Id: I10650cfb9359922690954fa65c89b4e47477e2c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118597 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'include/sfx2')
-rw-r--r--include/sfx2/filedlghelper.hxx64
1 files changed, 58 insertions, 6 deletions
diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index 4985b7bf045e..2c85c6b7b115 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -77,14 +77,64 @@ class FileDialogHelper_Impl;
class SFX2_DLLPUBLIC FileDialogHelper
{
public:
- enum Context // context where the FileDialogHelper is used
+ // context where the FileDialogHelper is used
+ enum Context
{
- UNKNOWN_CONTEXT, // unknown context
- SW_INSERT_GRAPHIC, // insert graphic in writer
- SD_EXPORT, // export in draw
- SI_EXPORT, // export in impress
- SW_EXPORT // export in writer
+ UnknownContext,
+ AcceleratorConfig,
+ AutoRedact,
+ BaseDataSource,
+ BaseSaveAs,
+ BasicExportPackage,
+ BasicInsertLib,
+ BulletsAddImage,
+ ExtensionManager,
+ CalcDataProvider,
+ CalcDataStream,
+ CalcExport,
+ CalcSaveAs,
+ CalcXMLSource,
+ DrawExport,
+ DrawImpressInsertFile,
+ DrawImpressOpenSound,
+ DrawSaveAs,
+ ExportImage,
+ FormsAddInstance,
+ FormsInsertImage,
+ IconImport,
+ ImpressClickAction,
+ ImpressExport,
+ ImpressPhotoDialog,
+ ImpressSaveAs,
+ LinkClientOLE,
+ LinkClientFile,
+ ImageMap,
+ InsertDoc,
+ InsertImage,
+ InsertMedia,
+ InsertOLE,
+ JavaClassPath,
+ ReportInsertImage,
+ ScreenshotAnnotation,
+ SignatureLine,
+ TemplateImport,
+ WriterCreateAddressList,
+ WriterInsertDoc,
+ WriterInsertImage,
+ WriterInsertScript,
+ WriterExport,
+ WriterImportAutotext,
+ WriterInsertHyperlink,
+ WriterLoadTemplate,
+ WriterMailMerge,
+ WriterMailMergeSaveAs,
+ WriterNewHTMLGlobalDoc,
+ WriterRegisterDataSource,
+ WriterSaveAs,
+ WriterSaveHTML,
+ XMLFilterSettings
};
+ static OUString contextToString(Context context);
private:
Link<FileDialogHelper*,void> m_aDialogClosedLink;
@@ -216,6 +266,8 @@ public:
void CreateMatcher( const OUString& rName );
/** sets the context of the dialog and trigger necessary actions e.g. loading config, setting help id
+ This will also store the last used directory for this context, so that the last directory
+ gets preselected on next filepicker launch (with the same context)
@param _eNewContext
New context for the dialog.
*/