[Libreoffice-commits] core.git: fpicker/source offapi/com sfx2/source vcl/unx

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Fri Jul 1 12:15:41 UTC 2016


 fpicker/source/aqua/ControlHelper.mm                    |    2 ++
 fpicker/source/aqua/SalAquaFilePicker.mm                |    3 +++
 fpicker/source/office/OfficeFilePicker.cxx              |    4 ++++
 fpicker/source/win32/filepicker/FilePicker.cxx          |    1 +
 fpicker/source/win32/filepicker/VistaFilePicker.cxx     |    8 ++++++++
 fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx |    1 +
 offapi/com/sun/star/ui/dialogs/TemplateDescription.idl  |   10 ++++++++++
 sfx2/source/dialog/filedlghelper.cxx                    |    6 ++++++
 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx                |    7 +++++++
 vcl/unx/kde/UnxFilePicker.cxx                           |    7 +++++++
 vcl/unx/kde4/KDE4FilePicker.cxx                         |    5 +++++
 11 files changed, 54 insertions(+)

New commits:
commit 5198c98337882319fae176135dcce1ad375ed2f6
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Fri Jul 1 11:49:02 2016 +0200

    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 at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/fpicker/source/aqua/ControlHelper.mm b/fpicker/source/aqua/ControlHelper.mm
index 0cecb40..092d049 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 eef8f42..5ef1b40 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 1a5496b..cdf83c2 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 40c258d..3644f3f 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 102117e..3297949 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 d60aff8..449519b 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 503d4f8..bbb670a 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 e82b4ec..d3ad69f 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 7207821..60f6741 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 bbee2f3..2fa7af6 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 2a35998..c8ed780 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 );


More information about the Libreoffice-commits mailing list