vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx |   34 +++++++++++++++++++-----------
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx |    2 +
 2 files changed, 24 insertions(+), 12 deletions(-)

New commits:
commit 3c7cbaf19a5108e3870df6556c16ef25710011a2
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 6 10:12:57 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Oct 6 12:34:01 2022 +0200

    Related: tdf#150706 don't warn about missing LISTBOX_FILTER_LABEL
    
    which is not unexpected for gtk where we don't use that label
    
    Change-Id: Ieed1a6498cc9f40cbf6546f996f723ec9cd3aba9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141005
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
index ec4601913af3..829e4795ac19 100644
--- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
@@ -1136,6 +1136,10 @@ GtkWidget *SalGtkFilePicker::getWidget( sal_Int16 
nControlId, GType *pType )
         MAP_LIST_LABEL( TEMPLATE );
         MAP_LIST_LABEL( IMAGE_TEMPLATE );
         MAP_LIST_LABEL( IMAGE_ANCHOR );
+    case CommonFilePickerElementIds::LISTBOX_FILTER_LABEL:
+        // the filter list in gtk typically is not labeled, but has a build-in
+        // tooltip to indicate what it does
+        break;
     default:
         SAL_WARN( "vcl.gtk", "Handle unknown control " << nControlId);
         break;
@@ -1389,7 +1393,8 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 
nControlId, const OUString&
 
     if( !( pWidget = getWidget( nControlId, &tType ) ) )
     {
-        SAL_WARN( "vcl.gtk", "Set label '" << rLabel << "' on unknown control 
" << nControlId);
+        SAL_WARN_IF(nControlId != 
CommonFilePickerElementIds::LISTBOX_FILTER_LABEL,
+                    "vcl.gtk", "Set label '" << rLabel << "' on unknown 
control " << nControlId);
         return;
     }
 
commit 1da3406a8e97934615b5b644cbb81bf3108143ec
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 6 09:59:44 2022 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Oct 6 12:33:48 2022 +0200

    Related: tdf#150706 add OK and CANCEL to known controls
    
    which results that we can rename "Save" to "Export" in pdf export dialog
    
    Change-Id: I8186a9ea3d18bfb383b07ba54f2fd7a5cd71e7b9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141004
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
index 2c75546ff2b2..ec4601913af3 100644
--- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
@@ -1099,6 +1099,10 @@ GtkWidget *SalGtkFilePicker::getWidget( sal_Int16 
nControlId, GType *pType )
             pWidget = m_pToggles[elem]; tType = GTK_TYPE_CHECK_BUTTON; \
             break
 #define MAP_BUTTON( elem ) \
+        case CommonFilePickerElementIds::PUSHBUTTON_##elem: \
+            pWidget = m_pButtons[elem]; tType = GTK_TYPE_BUTTON; \
+            break
+#define MAP_EXT_BUTTON( elem ) \
         case ExtendedFilePickerElementIds::PUSHBUTTON_##elem: \
             pWidget = m_pButtons[elem]; tType = GTK_TYPE_BUTTON; \
             break
@@ -1121,7 +1125,9 @@ GtkWidget *SalGtkFilePicker::getWidget( sal_Int16 
nControlId, GType *pType )
         MAP_TOGGLE( LINK );
         MAP_TOGGLE( PREVIEW );
         MAP_TOGGLE( SELECTION );
-        MAP_BUTTON( PLAY );
+        MAP_BUTTON( OK );
+        MAP_BUTTON( CANCEL );
+        MAP_EXT_BUTTON( PLAY );
         MAP_LIST( VERSION );
         MAP_LIST( TEMPLATE );
         MAP_LIST( IMAGE_TEMPLATE );
@@ -1383,7 +1389,7 @@ void SAL_CALL SalGtkFilePicker::setLabel( sal_Int16 
nControlId, const OUString&
 
     if( !( pWidget = getWidget( nControlId, &tType ) ) )
     {
-        SAL_WARN( "vcl.gtk", "Set label on unknown control " << nControlId);
+        SAL_WARN( "vcl.gtk", "Set label '" << rLabel << "' on unknown control 
" << nControlId);
         return;
     }
 
@@ -1775,18 +1781,17 @@ void SalGtkFilePicker::impl_initialize(GtkWidget* 
pParentWidget, sal_Int16 templ
     }
 
     gtk_file_chooser_set_action( GTK_FILE_CHOOSER( m_pDialog ), eAction);
-    gtk_dialog_add_button(GTK_DIALOG( m_pDialog ),
-                          getCancelText().getStr(),
-                          GTK_RESPONSE_CANCEL);
-    for( int nTVIndex = 0; nTVIndex < BUTTON_LAST; nTVIndex++ )
+    m_pButtons[CANCEL] = gtk_dialog_add_button(GTK_DIALOG(m_pDialog), 
getCancelText().getStr(), GTK_RESPONSE_CANCEL);
+    mbButtonVisibility[CANCEL] = true;
+
+    if (mbButtonVisibility[PLAY])
     {
-        if( mbButtonVisibility[nTVIndex] )
-        {
-            OString aPlay = OUStringToOString( getResString( PUSHBUTTON_PLAY 
), RTL_TEXTENCODING_UTF8 );
-            m_pButtons[ nTVIndex ] = gtk_dialog_add_button( GTK_DIALOG( 
m_pDialog ), aPlay.getStr(), 1 );
-        }
+        OString aPlay = OUStringToOString(getResString(PUSHBUTTON_PLAY), 
RTL_TEXTENCODING_UTF8);
+        m_pButtons[PLAY] = gtk_dialog_add_button(GTK_DIALOG(m_pDialog), 
aPlay.getStr(), 1);
     }
-    gtk_dialog_add_button( GTK_DIALOG( m_pDialog ), first_button_text, 
GTK_RESPONSE_ACCEPT );
+
+    m_pButtons[OK] = gtk_dialog_add_button(GTK_DIALOG(m_pDialog), 
first_button_text, GTK_RESPONSE_ACCEPT);
+    mbButtonVisibility[OK] = true;
 
     gtk_dialog_set_default_response( GTK_DIALOG (m_pDialog), 
GTK_RESPONSE_ACCEPT );
 
diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx 
b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx
index c412478e8aab..fdc701a20384 100644
--- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx
+++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.hxx
@@ -170,6 +170,8 @@ class SalGtkFilePicker : public SalGtkPicker, public 
SalGtkFilePicker_Base
         bool mbToggleVisibility[TOGGLE_LAST];
 
         enum {
+            OK,
+            CANCEL,
             PLAY,
             BUTTON_LAST };
 

Reply via email to