fpicker/source/office/RemoteFilesDialog.cxx |    6 ++----
 fpicker/uiconfig/ui/remotefilesdialog.ui    |   21 +++------------------
 2 files changed, 5 insertions(+), 22 deletions(-)

New commits:
commit f55d8f4891fc6cd6be8278369c555847abdeebd4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Oct 18 16:17:54 2021 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Oct 19 10:09:36 2021 +0200

    tdf#145169 have one button per response
    
    not two sharing the same response, so the other buttons response
    handler is not a candidate to be called on pressing return
    
    which is the circumstance which causes the dialog to return even
    after cancel was selected in its child dialog warning about overwrite
    
    Change-Id: I09eb0ea5e94c89ce0860be362e1c7632887e7a4e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123771
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx 
b/fpicker/source/office/RemoteFilesDialog.cxx
index ee031caf099d..dceb9da84eec 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -32,6 +32,7 @@ RemoteFilesDialog::RemoteFilesDialog( weld::Window* pParent, 
PickerFlags nBits )
     , m_xContext( comphelper::getProcessComponentContext() )
     , m_xMasterPasswd( PasswordContainer::create( m_xContext ) )
     , m_bIsInExecute( false )
+    , m_xOk_btn(m_xBuilder->weld_button("ok"))
     , m_xCancel_btn(m_xBuilder->weld_button("cancel"))
     , m_xManageServices(m_xBuilder->weld_menu_button("add_service_btn"))
     , m_xServices_lb(m_xBuilder->weld_combo_box("services_lb"))
@@ -61,13 +62,11 @@ RemoteFilesDialog::RemoteFilesDialog( weld::Window* 
pParent, PickerFlags nBits )
 
     if( m_eMode == REMOTEDLG_MODE_OPEN )
     {
-        m_xOk_btn = m_xBuilder->weld_button("open");
-
         m_xNewFolder->hide();
     }
     else
     {
-        m_xOk_btn = m_xBuilder->weld_button("save");
+        m_xOk_btn->set_label(FpsResId(STR_EXPLORERFILE_BUTTONSAVE));
         m_xNewFolder->connect_clicked( LINK( this, RemoteFilesDialog, 
NewFolderHdl ) );
     }
 
@@ -75,7 +74,6 @@ RemoteFilesDialog::RemoteFilesDialog( weld::Window* pParent, 
PickerFlags nBits )
     m_xIconView_btn->connect_clicked( LINK( this, RemoteFilesDialog, 
IconViewHdl ) );
     m_xListView_btn->connect_clicked( LINK( this, RemoteFilesDialog, 
ListViewHdl ) );
 
-    m_xOk_btn->show();
     m_xOk_btn->set_sensitive(false);
 
     m_xOk_btn->connect_clicked( LINK( this, RemoteFilesDialog, OkHdl ) );
diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui 
b/fpicker/uiconfig/ui/remotefilesdialog.ui
index 9f4034deefc7..be7e83f43e03 100644
--- a/fpicker/uiconfig/ui/remotefilesdialog.ui
+++ b/fpicker/uiconfig/ui/remotefilesdialog.ui
@@ -138,8 +138,9 @@
               </packing>
             </child>
             <child>
-              <object class="GtkButton" id="open">
+              <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" 
context="remotefilesdialog|open">_Open</property>
+                <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
@@ -152,21 +153,6 @@
                 <property name="position">2</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkButton" id="save">
-                <property name="label" translatable="yes" 
context="remotefilesdialog|save">_Save</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_underline">True</property>
-              </object>
-              <packing>
-                <property name="expand">True</property>
-                <property name="fill">True</property>
-                <property name="position">3</property>
-              </packing>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -565,8 +551,7 @@
     <action-widgets>
       <action-widget response="-11">help</action-widget>
       <action-widget response="-6">cancel</action-widget>
-      <action-widget response="-5">open</action-widget>
-      <action-widget response="-5">save</action-widget>
+      <action-widget response="-5">ok</action-widget>
     </action-widgets>
   </object>
 </interface>

Reply via email to