diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-07-01 11:49:02 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-07-01 12:15:08 +0000 |
commit | 5198c98337882319fae176135dcce1ad375ed2f6 (patch) | |
tree | 30bdd43f51b6f8ec5d28bf1b555388d055937d88 | |
parent | 6373f9ec6d056ffaef4a209b20a6ec7bab51c7b3 (diff) |
Add new open dialog type: Play and link
This is needed e.g. for the "Slide transition sound" files
where we want to play files and also give the choice whether to link or not
Change-Id: I5aaef7152be8e5c0a0f88c4d7234926f233c5d92
Reviewed-on: https://gerrit.libreoffice.org/26846
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | fpicker/source/aqua/ControlHelper.mm | 2 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaFilePicker.mm | 3 | ||||
-rw-r--r-- | fpicker/source/office/OfficeFilePicker.cxx | 4 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/FilePicker.cxx | 1 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 8 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx | 1 | ||||
-rw-r--r-- | offapi/com/sun/star/ui/dialogs/TemplateDescription.idl | 10 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/kde/UnxFilePicker.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 5 |
11 files changed, 54 insertions, 0 deletions
diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm index 0cecb40b1cea..092d0494808b 100644 --- a/fpicker/source/aqua/ControlHelper.mm +++ b/fpicker/source/aqua/ControlHelper.mm @@ -219,6 +219,8 @@ void ControlHelper::initialize( sal_Int16 nTemplateId ) case FILEOPEN_PREVIEW: m_bToggleVisibility[PREVIEW] = true; break; + case FILEOPEN_LINK_PLAY: + m_bToggleVisibility[LINK] = true; } createControls(); diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm index eef8f425e91c..5ef1b40e0594 100644 --- a/fpicker/source/aqua/SalAquaFilePicker.mm +++ b/fpicker/source/aqua/SalAquaFilePicker.mm @@ -474,6 +474,9 @@ throw( uno::Exception, uno::RuntimeException ) case FILEOPEN_PLAY: m_nDialogType = NAVIGATIONSERVICES_OPEN; break; + case FILEOPEN_LINK_PLAY: + m_nDialogType = NAVIGATIONSERVICES_OPEN; + break; case FILEOPEN_READONLY_VERSION: m_nDialogType = NAVIGATIONSERVICES_OPEN; break; diff --git a/fpicker/source/office/OfficeFilePicker.cxx b/fpicker/source/office/OfficeFilePicker.cxx index 1a5496b439d8..cdf83c2cdc1a 100644 --- a/fpicker/source/office/OfficeFilePicker.cxx +++ b/fpicker/source/office/OfficeFilePicker.cxx @@ -269,6 +269,10 @@ PickerFlags SvtFilePicker::getPickerFlags() { nBits = PickerFlags::Open | PickerFlags::PlayButton; } + else if ( m_nServiceType == TemplateDescription::FILEOPEN_LINK_PLAY ) + { + nBits = PickerFlags::Open | PickerFlags::InsertAsLink | PickerFlags::PlayButton; + } else if ( m_nServiceType == TemplateDescription::FILEOPEN_READONLY_VERSION ) { nBits = PickerFlags::Open | PickerFlags::ReadOnly | PickerFlags::ShowVersions; diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 40c258d124f2..3644f3f6303f 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -554,6 +554,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) break; case FILEOPEN_PLAY: + case FILEOPEN_LINK_PLAY: //FIXME: FILEOPEN_LINK_PLAY needs an own template, no idea how to create one winResTemplateId = TMPL2000_PLAY_PUSHBUTTON; break; diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 102117eb46fd..3297949a6aaf 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -501,6 +501,14 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An } break; + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY : + { + bFileOpenDialog = sal_True; + nFeatures |= FEATURE_LINK; + nFeatures |= FEATURE_PLAY; + } + break; + case css::ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION : { bFileOpenDialog = sal_True; diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx index d60aff8b95f3..449519bc22cf 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx @@ -552,6 +552,7 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I break; case css::ui::dialogs::TemplateDescription::FILEOPEN_PLAY : + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY : aGUID = CLIENTID_FILEOPEN_PLAY; break; diff --git a/offapi/com/sun/star/ui/dialogs/TemplateDescription.idl b/offapi/com/sun/star/ui/dialogs/TemplateDescription.idl index 503d4f899745..bbb670a844fa 100644 --- a/offapi/com/sun/star/ui/dialogs/TemplateDescription.idl +++ b/offapi/com/sun/star/ui/dialogs/TemplateDescription.idl @@ -123,6 +123,16 @@ published constants TemplateDescription @since LibreOffice 5.3 */ const short FILEOPEN_PREVIEW = 11; + + /** A FileOpen dialog with additional controls. + <ul> + <li>A checkbox "Insert as link"</li> + <li>A push button "Play"</li> + </ul> + + @since LibreOffice 5.3 + */ + const short FILEOPEN_LINK_PLAY = 12; }; diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index e82b4ec0ca2e..d3ad69fd784b 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -433,6 +433,7 @@ bool FileDialogHelper_Impl::isInOpenMode() const case FILEOPEN_SIMPLE: case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE: case FILEOPEN_PLAY: + case FILEOPEN_LINK_PLAY: case FILEOPEN_READONLY_VERSION: case FILEOPEN_LINK_PREVIEW: case FILEOPEN_PREVIEW: @@ -827,6 +828,7 @@ static open_or_save_t lcl_OpenOrSave(sal_Int16 const nDialogType) case FILEOPEN_SIMPLE: case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE: case FILEOPEN_PLAY: + case FILEOPEN_LINK_PLAY: case FILEOPEN_READONLY_VERSION: case FILEOPEN_LINK_PREVIEW: case FILEOPEN_PREVIEW: @@ -998,6 +1000,10 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( nTemplateDescription = TemplateDescription::FILEOPEN_PLAY; break; + case FILEOPEN_LINK_PLAY: + nTemplateDescription = TemplateDescription::FILEOPEN_LINK_PLAY; + break; + case FILEOPEN_READONLY_VERSION: nTemplateDescription = TemplateDescription::FILEOPEN_READONLY_VERSION; mbHasVersions = true; diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 7207821c2878..60f674156ab1 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1662,6 +1662,13 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu mbButtonVisibility[PLAY] = true; // TODO break; + case FILEOPEN_LINK_PLAY: + eAction = GTK_FILE_CHOOSER_ACTION_OPEN; + first_button_text = GTK_STOCK_OPEN; + mbToggleVisibility[LINK] = true; + mbButtonVisibility[PLAY] = true; + // TODO + break; case FILEOPEN_READONLY_VERSION: eAction = GTK_FILE_CHOOSER_ACTION_OPEN; first_button_text = GTK_STOCK_OPEN; diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx index bbee2f31dd1a..2fa7af624688 100644 --- a/vcl/unx/kde/UnxFilePicker.cxx +++ b/vcl/unx/kde/UnxFilePicker.cxx @@ -704,6 +704,13 @@ void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArgumen sendAppendControlCommand( ExtendedFilePickerElementIds::PUSHBUTTON_PLAY ); break; + case FILEOPEN_LINK_PLAY: + sendCommand( aTypeOpen ); + + sendAppendControlCommand( ExtendedFilePickerElementIds::CHECKBOX_LINK ); + sendAppendControlCommand( ExtendedFilePickerElementIds::PUSHBUTTON_PLAY ); + break; + case FILEOPEN_READONLY_VERSION: sendCommand( aTypeOpen ); diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index 2a359986bbe4..c8ed78025a66 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -715,6 +715,11 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args ) addCustomControl( PUSHBUTTON_PLAY ); break; + case FILEOPEN_LINK_PLAY: + addCustomControl( CHECKBOX_LINK ); + addCustomControl( PUSHBUTTON_PLAY ); + break; + case FILEOPEN_READONLY_VERSION: addCustomControl( CHECKBOX_READONLY ); addCustomControl( LISTBOX_VERSION ); |